eric6/Project/UicCompilerOptionsDialog.py

Wed, 01 Jan 2020 11:57:23 +0100

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Wed, 01 Jan 2020 11:57:23 +0100
changeset 7360
9190402e4505
parent 7229
53054eb5b15a
child 7780
41420f82c0ac
permissions
-rw-r--r--

Updated copyright for 2020.

6597
dc668f774d3d Project Forms Browser: added support for the --resource-suffix= and --import-from= options of pyuic (the PyQt forms compiler).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1 # -*- coding: utf-8 -*-
dc668f774d3d Project Forms Browser: added support for the --resource-suffix= and --import-from= options of pyuic (the PyQt forms compiler).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2
7360
9190402e4505 Updated copyright for 2020.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
3 # Copyright (c) 2018 - 2020 Detlev Offenbach <detlev@die-offenbachs.de>
6597
dc668f774d3d Project Forms Browser: added support for the --resource-suffix= and --import-from= options of pyuic (the PyQt forms compiler).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
4 #
dc668f774d3d Project Forms Browser: added support for the --resource-suffix= and --import-from= options of pyuic (the PyQt forms compiler).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
5
dc668f774d3d Project Forms Browser: added support for the --resource-suffix= and --import-from= options of pyuic (the PyQt forms compiler).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
6 """
dc668f774d3d Project Forms Browser: added support for the --resource-suffix= and --import-from= options of pyuic (the PyQt forms compiler).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
7 Module implementing a dialog to enter some non-common uic compiler options.
dc668f774d3d Project Forms Browser: added support for the --resource-suffix= and --import-from= options of pyuic (the PyQt forms compiler).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
8 """
dc668f774d3d Project Forms Browser: added support for the --resource-suffix= and --import-from= options of pyuic (the PyQt forms compiler).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
9
dc668f774d3d Project Forms Browser: added support for the --resource-suffix= and --import-from= options of pyuic (the PyQt forms compiler).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
10
dc668f774d3d Project Forms Browser: added support for the --resource-suffix= and --import-from= options of pyuic (the PyQt forms compiler).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
11 from PyQt5.QtWidgets import QDialog
dc668f774d3d Project Forms Browser: added support for the --resource-suffix= and --import-from= options of pyuic (the PyQt forms compiler).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
12
dc668f774d3d Project Forms Browser: added support for the --resource-suffix= and --import-from= options of pyuic (the PyQt forms compiler).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
13 from .Ui_UicCompilerOptionsDialog import Ui_UicCompilerOptionsDialog
dc668f774d3d Project Forms Browser: added support for the --resource-suffix= and --import-from= options of pyuic (the PyQt forms compiler).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
14
dc668f774d3d Project Forms Browser: added support for the --resource-suffix= and --import-from= options of pyuic (the PyQt forms compiler).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
15
dc668f774d3d Project Forms Browser: added support for the --resource-suffix= and --import-from= options of pyuic (the PyQt forms compiler).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
16 class UicCompilerOptionsDialog(QDialog, Ui_UicCompilerOptionsDialog):
dc668f774d3d Project Forms Browser: added support for the --resource-suffix= and --import-from= options of pyuic (the PyQt forms compiler).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
17 """
dc668f774d3d Project Forms Browser: added support for the --resource-suffix= and --import-from= options of pyuic (the PyQt forms compiler).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
18 Class implementing a dialog to enter some non-common uic compiler options.
dc668f774d3d Project Forms Browser: added support for the --resource-suffix= and --import-from= options of pyuic (the PyQt forms compiler).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
19 """
dc668f774d3d Project Forms Browser: added support for the --resource-suffix= and --import-from= options of pyuic (the PyQt forms compiler).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
20 def __init__(self, compilerOptions, compiler, parent=None):
dc668f774d3d Project Forms Browser: added support for the --resource-suffix= and --import-from= options of pyuic (the PyQt forms compiler).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
21 """
dc668f774d3d Project Forms Browser: added support for the --resource-suffix= and --import-from= options of pyuic (the PyQt forms compiler).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
22 Constructor
dc668f774d3d Project Forms Browser: added support for the --resource-suffix= and --import-from= options of pyuic (the PyQt forms compiler).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
23
dc668f774d3d Project Forms Browser: added support for the --resource-suffix= and --import-from= options of pyuic (the PyQt forms compiler).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
24 @param compilerOptions dictionary containing the uic compiler options
dc668f774d3d Project Forms Browser: added support for the --resource-suffix= and --import-from= options of pyuic (the PyQt forms compiler).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
25 @type dict
dc668f774d3d Project Forms Browser: added support for the --resource-suffix= and --import-from= options of pyuic (the PyQt forms compiler).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
26 @param compiler name of the uic compiler executable
dc668f774d3d Project Forms Browser: added support for the --resource-suffix= and --import-from= options of pyuic (the PyQt forms compiler).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
27 @type str
dc668f774d3d Project Forms Browser: added support for the --resource-suffix= and --import-from= options of pyuic (the PyQt forms compiler).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
28 @param parent reference to the parent widget
dc668f774d3d Project Forms Browser: added support for the --resource-suffix= and --import-from= options of pyuic (the PyQt forms compiler).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
29 @type QWidget
dc668f774d3d Project Forms Browser: added support for the --resource-suffix= and --import-from= options of pyuic (the PyQt forms compiler).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
30 """
dc668f774d3d Project Forms Browser: added support for the --resource-suffix= and --import-from= options of pyuic (the PyQt forms compiler).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
31 super(UicCompilerOptionsDialog, self).__init__(parent)
dc668f774d3d Project Forms Browser: added support for the --resource-suffix= and --import-from= options of pyuic (the PyQt forms compiler).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
32 self.setupUi(self)
dc668f774d3d Project Forms Browser: added support for the --resource-suffix= and --import-from= options of pyuic (the PyQt forms compiler).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
33
dc668f774d3d Project Forms Browser: added support for the --resource-suffix= and --import-from= options of pyuic (the PyQt forms compiler).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
34 self.packageEdit.setText(compilerOptions["Package"])
7050
b66cac9a6560 Project: added an option to the UIC parameters to specify the packages root directory relative to the project directory.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6942
diff changeset
35 self.packageRootEdit.setText(compilerOptions["PackagesRoot"])
6597
dc668f774d3d Project Forms Browser: added support for the --resource-suffix= and --import-from= options of pyuic (the PyQt forms compiler).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
36 self.suffixEdit.setText(compilerOptions["RcSuffix"])
dc668f774d3d Project Forms Browser: added support for the --resource-suffix= and --import-from= options of pyuic (the PyQt forms compiler).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
37
7201
6b42677d7043 Modified sources to be in line with the minimum Qt/PyQt requirement (v 5.9.0).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7050
diff changeset
38 if 'uic5' not in compiler:
6597
dc668f774d3d Project Forms Browser: added support for the --resource-suffix= and --import-from= options of pyuic (the PyQt forms compiler).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
39 self.packageGroup.setEnabled(False)
dc668f774d3d Project Forms Browser: added support for the --resource-suffix= and --import-from= options of pyuic (the PyQt forms compiler).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
40
dc668f774d3d Project Forms Browser: added support for the --resource-suffix= and --import-from= options of pyuic (the PyQt forms compiler).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
41 msh = self.minimumSizeHint()
dc668f774d3d Project Forms Browser: added support for the --resource-suffix= and --import-from= options of pyuic (the PyQt forms compiler).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
42 self.resize(max(self.width(), msh.width()), msh.height())
dc668f774d3d Project Forms Browser: added support for the --resource-suffix= and --import-from= options of pyuic (the PyQt forms compiler).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
43
dc668f774d3d Project Forms Browser: added support for the --resource-suffix= and --import-from= options of pyuic (the PyQt forms compiler).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
44 def getData(self):
dc668f774d3d Project Forms Browser: added support for the --resource-suffix= and --import-from= options of pyuic (the PyQt forms compiler).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
45 """
dc668f774d3d Project Forms Browser: added support for the --resource-suffix= and --import-from= options of pyuic (the PyQt forms compiler).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
46 Public method to get the entered data.
dc668f774d3d Project Forms Browser: added support for the --resource-suffix= and --import-from= options of pyuic (the PyQt forms compiler).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
47
7050
b66cac9a6560 Project: added an option to the UIC parameters to specify the packages root directory relative to the project directory.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6942
diff changeset
48 @return tuple containing the package, the rc-file suffix and the
b66cac9a6560 Project: added an option to the UIC parameters to specify the packages root directory relative to the project directory.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6942
diff changeset
49 project relative root of the packages directory
b66cac9a6560 Project: added an option to the UIC parameters to specify the packages root directory relative to the project directory.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6942
diff changeset
50 @rtype tuple of (str, str, str)
6597
dc668f774d3d Project Forms Browser: added support for the --resource-suffix= and --import-from= options of pyuic (the PyQt forms compiler).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
51 """
dc668f774d3d Project Forms Browser: added support for the --resource-suffix= and --import-from= options of pyuic (the PyQt forms compiler).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
52 return (
dc668f774d3d Project Forms Browser: added support for the --resource-suffix= and --import-from= options of pyuic (the PyQt forms compiler).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
53 self.packageEdit.text().strip(),
dc668f774d3d Project Forms Browser: added support for the --resource-suffix= and --import-from= options of pyuic (the PyQt forms compiler).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
54 self.suffixEdit.text().strip(),
7050
b66cac9a6560 Project: added an option to the UIC parameters to specify the packages root directory relative to the project directory.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6942
diff changeset
55 self.packageRootEdit.text().strip(),
6597
dc668f774d3d Project Forms Browser: added support for the --resource-suffix= and --import-from= options of pyuic (the PyQt forms compiler).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
56 )

eric ide

mercurial