eric6/Preferences/ConfigurationPages/InterfacePage.py

changeset 6998
a63ca2373f44
parent 6987
3371a03ed0a7
child 7054
fb84d8489bc1
equal deleted inserted replaced
6997:24eabcea4c59 6998:a63ca2373f44
45 self.styleSheetPicker.setDefaultDirectory(getConfig("ericStylesDir")) 45 self.styleSheetPicker.setDefaultDirectory(getConfig("ericStylesDir"))
46 46
47 # set initial values 47 # set initial values
48 self.__populateStyleCombo() 48 self.__populateStyleCombo()
49 self.__populateLanguageCombo() 49 self.__populateLanguageCombo()
50 self.__populateShellPositionCombo()
50 51
51 self.uiBrowsersListFoldersFirstCheckBox.setChecked( 52 self.uiBrowsersListFoldersFirstCheckBox.setChecked(
52 Preferences.getUI("BrowsersListFoldersFirst")) 53 Preferences.getUI("BrowsersListFoldersFirst"))
53 self.uiBrowsersHideNonPublicCheckBox.setChecked( 54 self.uiBrowsersHideNonPublicCheckBox.setChecked(
54 Preferences.getUI("BrowsersHideNonPublic")) 55 Preferences.getUI("BrowsersHideNonPublic"))
95 Preferences.getUI("ShowIrc")) 96 Preferences.getUI("ShowIrc"))
96 # bottom side 97 # bottom side
97 self.numbersCheckBox.setChecked( 98 self.numbersCheckBox.setChecked(
98 Preferences.getUI("ShowNumbersViewer")) 99 Preferences.getUI("ShowNumbersViewer"))
99 100
100 self.tabsGroupBox.setEnabled(True)
101 self.tabsCloseButtonCheckBox.setChecked(
102 Preferences.getUI("SingleCloseButton"))
103
104 self.delaySpinBox.setValue(Preferences.getUI("SidebarDelay")) 101 self.delaySpinBox.setValue(Preferences.getUI("SidebarDelay"))
105 102
106 def save(self): 103 def save(self):
107 """ 104 """
108 Public slot to save the Interface configuration. 105 Public slot to save the Interface configuration.
155 layoutType = "Toolboxes" 152 layoutType = "Toolboxes"
156 else: 153 else:
157 layoutType = "Sidebars" # just in case 154 layoutType = "Sidebars" # just in case
158 Preferences.setUI("LayoutType", layoutType) 155 Preferences.setUI("LayoutType", layoutType)
159 156
157 # save the shell position setting
158 shellPositionIndex = self.shellPositionComboBox.currentIndex()
159 shellPosition = self.shellPositionComboBox.itemData(shellPositionIndex)
160 Preferences.setUI("ShellPosition", shellPosition)
161
160 # save the integrated tools activation 162 # save the integrated tools activation
161 # left side 163 # left side
162 Preferences.setUI( 164 Preferences.setUI(
163 "ShowTemplateViewer", 165 "ShowTemplateViewer",
164 self.templateViewerCheckBox.isChecked()) 166 self.templateViewerCheckBox.isChecked())
186 self.ircCheckBox.isChecked()) 188 self.ircCheckBox.isChecked())
187 # bottom side 189 # bottom side
188 Preferences.setUI( 190 Preferences.setUI(
189 "ShowNumbersViewer", 191 "ShowNumbersViewer",
190 self.numbersCheckBox.isChecked()) 192 self.numbersCheckBox.isChecked())
191
192 Preferences.setUI(
193 "SingleCloseButton",
194 self.tabsCloseButtonCheckBox.isChecked())
195 193
196 Preferences.setUI("SidebarDelay", self.delaySpinBox.value()) 194 Preferences.setUI("SidebarDelay", self.delaySpinBox.value())
197 195
198 def __populateStyleCombo(self): 196 def __populateStyleCombo(self):
199 """ 197 """
209 currentIndex = 0 207 currentIndex = 0
210 self.styleComboBox.setCurrentIndex(currentIndex) 208 self.styleComboBox.setCurrentIndex(currentIndex)
211 209
212 def __populateLanguageCombo(self): 210 def __populateLanguageCombo(self):
213 """ 211 """
214 Private method to initialize the language combobox of the Interface 212 Private method to initialize the language combo box.
215 configuration page.
216 """ 213 """
217 self.languageComboBox.clear() 214 self.languageComboBox.clear()
218 215
219 fnlist = glob.glob("eric6_*.qm") + \ 216 fnlist = glob.glob("eric6_*.qm") + \
220 glob.glob(os.path.join( 217 glob.glob(os.path.join(
246 self.languageComboBox.addItem("English (default)", "None") 243 self.languageComboBox.addItem("English (default)", "None")
247 self.languageComboBox.addItem(self.tr('System'), "System") 244 self.languageComboBox.addItem(self.tr('System'), "System")
248 for locale in localeList: 245 for locale in localeList:
249 self.languageComboBox.addItem(locales[locale], locale) 246 self.languageComboBox.addItem(locales[locale], locale)
250 self.languageComboBox.setCurrentIndex(currentIndex) 247 self.languageComboBox.setCurrentIndex(currentIndex)
251 248
249 def __populateShellPositionCombo(self):
250 """
251 Private method to initialize the shell position combo box.
252 """
253 self.shellPositionComboBox.addItem(self.tr("Left Side"), "left")
254 self.shellPositionComboBox.addItem(self.tr("Right Side"), "right")
255 self.shellPositionComboBox.addItem(self.tr("Bottom Side"), "bottom")
256
257 shellPosition = Preferences.getUI("ShellPosition")
258 if shellPosition not in ("left", "right", "bottom"):
259 shellPosition = "bottom"
260 index = self.shellPositionComboBox.findData(shellPosition)
261 self.shellPositionComboBox.setCurrentIndex(index)
262
252 @pyqtSlot() 263 @pyqtSlot()
253 def on_resetLayoutButton_clicked(self): 264 def on_resetLayoutButton_clicked(self):
254 """ 265 """
255 Private method to reset layout to factory defaults. 266 Private method to reset layout to factory defaults.
256 """ 267 """

eric ide

mercurial