|
1 # -*- coding: utf-8 -*- |
|
2 |
|
3 # Copyright (c) 2018 - 2021 Detlev Offenbach <detlev@die-offenbachs.de> |
|
4 # |
|
5 |
|
6 """ |
|
7 Module implementing a dialog to enter some non-common uic compiler options. |
|
8 """ |
|
9 |
|
10 from PyQt5.QtWidgets import QDialog |
|
11 |
|
12 from .Ui_UicCompilerOptionsDialog import Ui_UicCompilerOptionsDialog |
|
13 |
|
14 |
|
15 class UicCompilerOptionsDialog(QDialog, Ui_UicCompilerOptionsDialog): |
|
16 """ |
|
17 Class implementing a dialog to enter some non-common uic compiler options. |
|
18 """ |
|
19 def __init__(self, compilerOptions, compiler, parent=None): |
|
20 """ |
|
21 Constructor |
|
22 |
|
23 @param compilerOptions dictionary containing the uic compiler options |
|
24 @type dict |
|
25 @param compiler name of the uic compiler executable |
|
26 @type str |
|
27 @param parent reference to the parent widget |
|
28 @type QWidget |
|
29 """ |
|
30 super().__init__(parent) |
|
31 self.setupUi(self) |
|
32 |
|
33 self.packageEdit.setText(compilerOptions["Package"]) |
|
34 self.packageRootEdit.setText(compilerOptions["PackagesRoot"]) |
|
35 self.suffixEdit.setText(compilerOptions["RcSuffix"]) |
|
36 |
|
37 self.packageGroup.setEnabled('uic5' in compiler) |
|
38 self.suffixGroup.setEnabled('uic6' not in compiler) |
|
39 |
|
40 msh = self.minimumSizeHint() |
|
41 self.resize(max(self.width(), msh.width()), msh.height()) |
|
42 |
|
43 def getData(self): |
|
44 """ |
|
45 Public method to get the entered data. |
|
46 |
|
47 @return tuple containing the package, the rc-file suffix and the |
|
48 project relative root of the packages directory |
|
49 @rtype tuple of (str, str, str) |
|
50 """ |
|
51 return ( |
|
52 self.packageEdit.text().strip(), |
|
53 self.suffixEdit.text().strip(), |
|
54 self.packageRootEdit.text().strip(), |
|
55 ) |