eric6/Preferences/ConfigurationPages/QtPage.py

changeset 7451
f04328aef87a
parent 7446
67b21645ffec
child 7635
0cdead130a81
equal deleted inserted replaced
7450:c33c1dbd0ee5 7451:f04328aef87a
14 14
15 from .ConfigurationPageBase import ConfigurationPageBase 15 from .ConfigurationPageBase import ConfigurationPageBase
16 from .Ui_QtPage import Ui_QtPage 16 from .Ui_QtPage import Ui_QtPage
17 17
18 import Preferences 18 import Preferences
19 import Utilities
19 20
20 21
21 class QtPage(ConfigurationPageBase, Ui_QtPage): 22 class QtPage(ConfigurationPageBase, Ui_QtPage):
22 """ 23 """
23 Class implementing the Qt configuration page. 24 Class implementing the Qt configuration page.
42 Preferences.getQt("Qt5TranslationsDir")) 43 Preferences.getQt("Qt5TranslationsDir"))
43 self.qtToolsDirPicker.setText(Preferences.getQt("QtToolsDir")) 44 self.qtToolsDirPicker.setText(Preferences.getQt("QtToolsDir"))
44 self.qtPrefixEdit.setText(Preferences.getQt("QtToolsPrefix")) 45 self.qtPrefixEdit.setText(Preferences.getQt("QtToolsPrefix"))
45 self.qtPostfixEdit.setText(Preferences.getQt("QtToolsPostfix")) 46 self.qtPostfixEdit.setText(Preferences.getQt("QtToolsPostfix"))
46 self.__updateQtSample() 47 self.__updateQtSample()
48
47 self.pyqtToolsDirPicker.setText(Preferences.getQt("PyQtToolsDir")) 49 self.pyqtToolsDirPicker.setText(Preferences.getQt("PyQtToolsDir"))
48 self.pyside2ToolsDirPicker.setText(
49 Preferences.getQt("PySide2ToolsDir"))
50 self.pyuicIndentSpinBox.setValue(Preferences.getQt("PyuicIndent")) 50 self.pyuicIndentSpinBox.setValue(Preferences.getQt("PyuicIndent"))
51 self.pyuicImportsCheckBox.setChecked( 51 self.pyuicImportsCheckBox.setChecked(
52 Preferences.getQt("PyuicFromImports")) 52 Preferences.getQt("PyuicFromImports"))
53 self.pyuicExecuteCheckBox.setChecked(
54 Preferences.getQt("PyuicExecute"))
55
56 self.pyside2ToolsDirPicker.setText(
57 Preferences.getQt("PySide2ToolsDir"))
58 self.pyside2uicImportsCheckBox.setChecked(
59 Preferences.getQt("PySide2FromImports"))
60
61 self.pyside2Group.setEnabled(any(Utilities.checkPyside()))
53 62
54 def save(self): 63 def save(self):
55 """ 64 """
56 Public slot to save the Qt configuration. 65 Public slot to save the Qt configuration.
57 """ 66 """
58 Preferences.setQt("Qt5TranslationsDir", self.qtTransPicker.text()) 67 Preferences.setQt("Qt5TranslationsDir", self.qtTransPicker.text())
59 Preferences.setQt("QtToolsDir", self.qtToolsDirPicker.text()) 68 Preferences.setQt("QtToolsDir", self.qtToolsDirPicker.text())
60 Preferences.setQt("QtToolsPrefix", self.qtPrefixEdit.text()) 69 Preferences.setQt("QtToolsPrefix", self.qtPrefixEdit.text())
61 Preferences.setQt("QtToolsPostfix", self.qtPostfixEdit.text()) 70 Preferences.setQt("QtToolsPostfix", self.qtPostfixEdit.text())
71
62 Preferences.setQt("PyQtToolsDir", self.pyqtToolsDirPicker.text()) 72 Preferences.setQt("PyQtToolsDir", self.pyqtToolsDirPicker.text())
63 Preferences.setQt("PySide2ToolsDir", self.pyside2ToolsDirPicker.text())
64 Preferences.setQt("PyuicIndent", self.pyuicIndentSpinBox.value()) 73 Preferences.setQt("PyuicIndent", self.pyuicIndentSpinBox.value())
65 Preferences.setQt("PyuicFromImports", 74 Preferences.setQt("PyuicFromImports",
66 self.pyuicImportsCheckBox.isChecked()) 75 self.pyuicImportsCheckBox.isChecked())
76 Preferences.setQt("PyuicExecute",
77 self.pyuicExecuteCheckBox.isChecked())
78
79 Preferences.setQt("PySide2ToolsDir", self.pyside2ToolsDirPicker.text())
80 Preferences.setQt("PySide2FromImports",
81 self.pyside2uicImportsCheckBox.isChecked())
67 82
68 def __updateQtSample(self): 83 def __updateQtSample(self):
69 """ 84 """
70 Private slot to update the Qt tools sample label. 85 Private slot to update the Qt tools sample label.
71 """ 86 """

eric ide

mercurial