Preferences/ConfigurationPages/InterfacePage.py

changeset 2230
2b1b9265156c
parent 2129
eac9cf4ca314
child 2302
f29e9405c851
equal deleted inserted replaced
2229:78539385a8df 2230:2b1b9265156c
36 super().__init__() 36 super().__init__()
37 self.setupUi(self) 37 self.setupUi(self)
38 self.setObjectName("InterfacePage") 38 self.setObjectName("InterfacePage")
39 39
40 self.styleSheetCompleter = E5FileCompleter(self.styleSheetEdit) 40 self.styleSheetCompleter = E5FileCompleter(self.styleSheetEdit)
41
42 self.uiColours = {}
43 41
44 # set initial values 42 # set initial values
45 self.__populateStyleCombo() 43 self.__populateStyleCombo()
46 self.__populateLanguageCombo() 44 self.__populateLanguageCombo()
47 45
103 101
104 self.tabsGroupBox.setEnabled(True) 102 self.tabsGroupBox.setEnabled(True)
105 self.tabsCloseButtonCheckBox.setChecked( 103 self.tabsCloseButtonCheckBox.setChecked(
106 Preferences.getUI("SingleCloseButton")) 104 Preferences.getUI("SingleCloseButton"))
107 105
108 self.uiColours["LogStdErrColour"] = \ 106 self.initColour("LogStdErrColour", self.stderrTextColourButton,
109 self.initColour("LogStdErrColour", self.stderrTextColourButton, 107 Preferences.getUI)
110 Preferences.getUI)
111 108
112 def save(self): 109 def save(self):
113 """ 110 """
114 Public slot to save the Interface configuration. 111 Public slot to save the Interface configuration.
115 """ 112 """
179 Preferences.setUILayout(layout) 176 Preferences.setUILayout(layout)
180 177
181 Preferences.setUI("SingleCloseButton", 178 Preferences.setUI("SingleCloseButton",
182 self.tabsCloseButtonCheckBox.isChecked()) 179 self.tabsCloseButtonCheckBox.isChecked())
183 180
184 for key in list(self.uiColours.keys()): 181 self.saveColours(Preferences.setUI)
185 Preferences.setUI(key, self.uiColours[key])
186 182
187 def __populateStyleCombo(self): 183 def __populateStyleCombo(self):
188 """ 184 """
189 Private method to populate the style combo box. 185 Private method to populate the style combo box.
190 """ 186 """
256 def on_resetLayoutButton_clicked(self): 252 def on_resetLayoutButton_clicked(self):
257 """ 253 """
258 Private method to reset layout to factory defaults 254 Private method to reset layout to factory defaults
259 """ 255 """
260 Preferences.resetLayout() 256 Preferences.resetLayout()
261
262 @pyqtSlot()
263 def on_stderrTextColourButton_clicked(self):
264 """
265 Private slot to set the foreground colour of the caret.
266 """
267 self.uiColours["LogStdErrColour"] = \
268 self.selectColour(self.stderrTextColourButton,
269 self.uiColours["LogStdErrColour"])
270 257
271 258
272 def create(dlg): 259 def create(dlg):
273 """ 260 """
274 Module function to create the configuration page. 261 Module function to create the configuration page.

eric ide

mercurial