eric7/Preferences/ConfigurationPages/InterfacePage.py

branch
eric7
changeset 8727
e2f8a0fbf738
parent 8714
85deb98a0a6c
child 8761
f05818ae6431
equal deleted inserted replaced
8726:12c25acee031 8727:e2f8a0fbf738
49 EricIconBar.BarSizes[iconBarSize][2], iconBarSize) 49 EricIconBar.BarSizes[iconBarSize][2], iconBarSize)
50 50
51 # set initial values 51 # set initial values
52 self.__populateStyleCombo() 52 self.__populateStyleCombo()
53 self.__populateLanguageCombo() 53 self.__populateLanguageCombo()
54 self.__populateShellPositionCombo()
55 54
56 self.uiBrowsersListFoldersFirstCheckBox.setChecked( 55 self.uiBrowsersListFoldersFirstCheckBox.setChecked(
57 Preferences.getUI("BrowsersListFoldersFirst")) 56 Preferences.getUI("BrowsersListFoldersFirst"))
58 self.uiBrowsersHideNonPublicCheckBox.setChecked( 57 self.uiBrowsersHideNonPublicCheckBox.setChecked(
59 Preferences.getUI("BrowsersHideNonPublic")) 58 Preferences.getUI("BrowsersHideNonPublic"))
109 self.iconSizeComboBox.setCurrentIndex( 108 self.iconSizeComboBox.setCurrentIndex(
110 self.iconSizeComboBox.findData(Preferences.getUI("IconBarSize"))) 109 self.iconSizeComboBox.findData(Preferences.getUI("IconBarSize")))
111 self.__iconBarColor = Preferences.getUI("IconBarColor") 110 self.__iconBarColor = Preferences.getUI("IconBarColor")
112 self.__setIconBarSamples() 111 self.__setIconBarSamples()
113 112
113 self.combinedLeftRightSidebarCheckBox.setChecked(
114 Preferences.getUI("CombinedLeftRightSidebar"))
115
114 # connect the icon size combo box after initialization is complete 116 # connect the icon size combo box after initialization is complete
115 self.iconSizeComboBox.currentIndexChanged.connect( 117 self.iconSizeComboBox.currentIndexChanged.connect(
116 self.__setIconBarSamples) 118 self.__setIconBarSamples)
117 119
118 def save(self): 120 def save(self):
167 layoutType = "Toolboxes" 169 layoutType = "Toolboxes"
168 else: 170 else:
169 layoutType = "Sidebars" # just in case 171 layoutType = "Sidebars" # just in case
170 Preferences.setUI("LayoutType", layoutType) 172 Preferences.setUI("LayoutType", layoutType)
171 173
172 # save the shell position setting
173 shellPositionIndex = self.shellPositionComboBox.currentIndex()
174 shellPosition = self.shellPositionComboBox.itemData(shellPositionIndex)
175 Preferences.setUI("ShellPosition", shellPosition)
176
177 # save the integrated tools activation 174 # save the integrated tools activation
178 # left side 175 # left side
179 Preferences.setUI( 176 Preferences.setUI(
180 "ShowTemplateViewer", 177 "ShowTemplateViewer",
181 self.templateViewerCheckBox.isChecked()) 178 self.templateViewerCheckBox.isChecked())
216 "IconBarSize", 213 "IconBarSize",
217 self.iconSizeComboBox.currentData()) 214 self.iconSizeComboBox.currentData())
218 Preferences.setUI( 215 Preferences.setUI(
219 "IconBarColor", 216 "IconBarColor",
220 self.__iconBarColor) 217 self.__iconBarColor)
218 Preferences.setUI(
219 "CombinedLeftRightSidebar",
220 self.combinedLeftRightSidebarCheckBox.isChecked())
221 221
222 def __populateStyleCombo(self): 222 def __populateStyleCombo(self):
223 """ 223 """
224 Private method to populate the style combo box. 224 Private method to populate the style combo box.
225 """ 225 """
274 self.languageComboBox.addItem(self.tr('System'), "System") 274 self.languageComboBox.addItem(self.tr('System'), "System")
275 for locale in localeList: 275 for locale in localeList:
276 self.languageComboBox.addItem(locales[locale], locale) 276 self.languageComboBox.addItem(locales[locale], locale)
277 self.languageComboBox.setCurrentIndex(currentIndex) 277 self.languageComboBox.setCurrentIndex(currentIndex)
278 278
279 def __populateShellPositionCombo(self):
280 """
281 Private method to initialize the shell position combo box.
282 """
283 self.shellPositionComboBox.addItem(self.tr("Left Side"), "left")
284 self.shellPositionComboBox.addItem(self.tr("Right Side"), "right")
285 self.shellPositionComboBox.addItem(self.tr("Bottom Side"), "bottom")
286
287 shellPosition = Preferences.getUI("ShellPosition")
288 if shellPosition not in ("left", "right", "bottom"):
289 shellPosition = "bottom"
290 index = self.shellPositionComboBox.findData(shellPosition)
291 self.shellPositionComboBox.setCurrentIndex(index)
292
293 @pyqtSlot() 279 @pyqtSlot()
294 def on_resetLayoutButton_clicked(self): 280 def on_resetLayoutButton_clicked(self):
295 """ 281 """
296 Private method to reset layout to factory defaults. 282 Private method to reset layout to factory defaults.
297 """ 283 """
333 # Set current colour last to avoid conflicts with alpha channel 319 # Set current colour last to avoid conflicts with alpha channel
334 colDlg.setCurrentColor(self.__iconBarColor) 320 colDlg.setCurrentColor(self.__iconBarColor)
335 if colDlg.exec() == QDialog.DialogCode.Accepted: 321 if colDlg.exec() == QDialog.DialogCode.Accepted:
336 self.__iconBarColor = colDlg.selectedColor() 322 self.__iconBarColor = colDlg.selectedColor()
337 self.__setIconBarSamples() 323 self.__setIconBarSamples()
324
325 @pyqtSlot(bool)
326 def on_combinedLeftRightSidebarCheckBox_toggled(self, checked):
327 """
328 Private slot handling a change of the combined sidebars checkbox.
329
330 @param checked state of the checkbox
331 @type bool
332 """
333 self.leftRightGroupBox.setTitle(
334 self.tr("Combined Left Side")
335 if checked else
336 self.tr("Right Side")
337 )
338 338
339 339
340 def create(dlg): 340 def create(dlg):
341 """ 341 """
342 Module function to create the configuration page. 342 Module function to create the configuration page.

eric ide

mercurial