eric6/Preferences/ConfigurationPages/QtPage.py

changeset 7911
4621c9082a43
parent 7907
7991ea245c20
child 7923
91e843545d9a
equal deleted inserted replaced
7910:2eeec6bc49e6 7911:4621c9082a43
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 UI.PixmapCache
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.
34 self.__virtualenvManager = e5App().getObject("VirtualEnvManager") 35 self.__virtualenvManager = e5App().getObject("VirtualEnvManager")
35 except KeyError: 36 except KeyError:
36 from VirtualEnv.VirtualenvManager import VirtualenvManager 37 from VirtualEnv.VirtualenvManager import VirtualenvManager
37 self.__virtualenvManager = VirtualenvManager() 38 self.__virtualenvManager = VirtualenvManager()
38 39
40 for button in (
41 self.pyqt5VenvDlgButton, self.pyqt6VenvDlgButton,
42 self.pyside2VenvDlgButton, self.pyside6VenvDlgButton,
43 ):
44 button.setIcon(UI.PixmapCache.getIcon("virtualenv"))
45
39 self.qtTransPicker.setMode(E5PathPickerModes.DirectoryMode) 46 self.qtTransPicker.setMode(E5PathPickerModes.DirectoryMode)
40 self.qtToolsDirPicker.setMode(E5PathPickerModes.DirectoryShowFilesMode) 47 for picker in (
41 self.pyqtToolsDirPicker.setMode( 48 self.qtToolsDirPicker,
42 E5PathPickerModes.DirectoryShowFilesMode) 49 self.pyqtToolsDirPicker,
43 self.pyqt6ToolsDirPicker.setMode( 50 self.pyqt6ToolsDirPicker,
44 E5PathPickerModes.DirectoryShowFilesMode) 51 self.pyside2ToolsDirPicker,
45 self.pyside2ToolsDirPicker.setMode( 52 self.pyside6ToolsDirPicker,
46 E5PathPickerModes.DirectoryShowFilesMode) 53 ):
54 picker.setMode(E5PathPickerModes.DirectoryShowFilesMode)
47 55
48 self.__populateAndSetVenvComboBoxes(True) 56 self.__populateAndSetVenvComboBoxes(True)
49 57
50 # set initial values 58 # set initial values
51 self.qtTransPicker.setText( 59 self.qtTransPicker.setText(
74 # PySide 2 82 # PySide 2
75 self.pyside2ToolsDirPicker.setText( 83 self.pyside2ToolsDirPicker.setText(
76 Preferences.getQt("PySide2ToolsDir")) 84 Preferences.getQt("PySide2ToolsDir"))
77 self.pyside2uicImportsCheckBox.setChecked( 85 self.pyside2uicImportsCheckBox.setChecked(
78 Preferences.getQt("PySide2FromImports")) 86 Preferences.getQt("PySide2FromImports"))
87
88 # PySide 6
89 self.pyside6ToolsDirPicker.setText(
90 Preferences.getQt("PySide6ToolsDir"))
91 self.pyside6uicImportsCheckBox.setChecked(
92 Preferences.getQt("PySide6FromImports"))
79 93
80 def save(self): 94 def save(self):
81 """ 95 """
82 Public slot to save the Qt configuration. 96 Public slot to save the Qt configuration.
83 """ 97 """
104 Preferences.setQt("PySide2VenvName", 118 Preferences.setQt("PySide2VenvName",
105 self.pyside2VenvComboBox.currentText()) 119 self.pyside2VenvComboBox.currentText())
106 Preferences.setQt("PySide2ToolsDir", self.pyside2ToolsDirPicker.text()) 120 Preferences.setQt("PySide2ToolsDir", self.pyside2ToolsDirPicker.text())
107 Preferences.setQt("PySide2FromImports", 121 Preferences.setQt("PySide2FromImports",
108 self.pyside2uicImportsCheckBox.isChecked()) 122 self.pyside2uicImportsCheckBox.isChecked())
123
124 Preferences.setQt("PySide6VenvName",
125 self.pyside6VenvComboBox.currentText())
126 Preferences.setQt("PySide6ToolsDir", self.pyside6ToolsDirPicker.text())
127 Preferences.setQt("PySide6FromImports",
128 self.pyside6uicImportsCheckBox.isChecked())
109 129
110 def __updateQtSample(self): 130 def __updateQtSample(self):
111 """ 131 """
112 Private slot to update the Qt tools sample label. 132 Private slot to update the Qt tools sample label.
113 """ 133 """
172 self.pyqt5VenvComboBox, "PyQtVenvName", initial) 192 self.pyqt5VenvComboBox, "PyQtVenvName", initial)
173 self.__populateAndSetVenvComboBox( 193 self.__populateAndSetVenvComboBox(
174 self.pyqt6VenvComboBox, "PyQt6VenvName", initial) 194 self.pyqt6VenvComboBox, "PyQt6VenvName", initial)
175 self.__populateAndSetVenvComboBox( 195 self.__populateAndSetVenvComboBox(
176 self.pyside2VenvComboBox, "PySide2VenvName", initial) 196 self.pyside2VenvComboBox, "PySide2VenvName", initial)
197 self.__populateAndSetVenvComboBox(
198 self.pyside6VenvComboBox, "PySide6VenvName", initial)
177 199
178 def __showVirtualEnvManager(self): 200 def __showVirtualEnvManager(self):
179 """ 201 """
180 Private method to show the virtual environment manager dialog. 202 Private method to show the virtual environment manager dialog.
181 """ 203 """
203 """ 225 """
204 Private slot to show the virtual environment manager dialog. 226 Private slot to show the virtual environment manager dialog.
205 """ 227 """
206 self.__showVirtualEnvManager() 228 self.__showVirtualEnvManager()
207 229
230 @pyqtSlot()
231 def on_pyside6VenvDlgButton_clicked(self):
232 """
233 Private slot to show the virtual environment manager dialog.
234 """
235 self.__showVirtualEnvManager()
236
208 237
209 def create(dlg): 238 def create(dlg):
210 """ 239 """
211 Module function to create the configuration page. 240 Module function to create the configuration page.
212 241

eric ide

mercurial