13 from PyQt6.QtCore import pyqtSlot, QTranslator |
13 from PyQt6.QtCore import pyqtSlot, QTranslator |
14 from PyQt6.QtWidgets import QStyleFactory, QDialog, QColorDialog |
14 from PyQt6.QtWidgets import QStyleFactory, QDialog, QColorDialog |
15 |
15 |
16 from EricWidgets.EricPathPicker import EricPathPickerModes |
16 from EricWidgets.EricPathPicker import EricPathPickerModes |
17 from EricWidgets.EricIconBar import EricIconBar |
17 from EricWidgets.EricIconBar import EricIconBar |
|
18 from EricWidgets.EricApplication import ericApp |
18 |
19 |
19 from .ConfigurationPageBase import ConfigurationPageBase |
20 from .ConfigurationPageBase import ConfigurationPageBase |
20 from .Ui_InterfacePage import Ui_InterfacePage |
21 from .Ui_InterfacePage import Ui_InterfacePage |
21 |
22 |
22 import Preferences |
23 import Preferences |
41 self.styleSheetPicker.setMode(EricPathPickerModes.OPEN_FILE_MODE) |
42 self.styleSheetPicker.setMode(EricPathPickerModes.OPEN_FILE_MODE) |
42 self.styleSheetPicker.setFilters(self.tr( |
43 self.styleSheetPicker.setFilters(self.tr( |
43 "Qt Style Sheets (*.qss);;Cascading Style Sheets (*.css);;" |
44 "Qt Style Sheets (*.qss);;Cascading Style Sheets (*.css);;" |
44 "All files (*)")) |
45 "All files (*)")) |
45 self.styleSheetPicker.setDefaultDirectory(getConfig("ericStylesDir")) |
46 self.styleSheetPicker.setDefaultDirectory(getConfig("ericStylesDir")) |
|
47 |
|
48 styleIconsPath = ericApp().getStyleIconsPath() |
|
49 self.styleIconsPathPicker.setMode( |
|
50 EricPathPickerModes.DIRECTORY_SHOW_FILES_MODE) |
|
51 self.styleIconsPathPicker.setDefaultDirectory(styleIconsPath) |
46 |
52 |
47 for iconBarSize in EricIconBar.BarSizes: |
53 for iconBarSize in EricIconBar.BarSizes: |
48 self.iconSizeComboBox.addItem( |
54 self.iconSizeComboBox.addItem( |
49 EricIconBar.BarSizes[iconBarSize][2], iconBarSize) |
55 EricIconBar.BarSizes[iconBarSize][2], iconBarSize) |
50 |
56 |
66 self.uiCaptionShowsFilenameGroupBox.setChecked( |
72 self.uiCaptionShowsFilenameGroupBox.setChecked( |
67 Preferences.getUI("CaptionShowsFilename")) |
73 Preferences.getUI("CaptionShowsFilename")) |
68 self.filenameLengthSpinBox.setValue( |
74 self.filenameLengthSpinBox.setValue( |
69 Preferences.getUI("CaptionFilenameLength")) |
75 Preferences.getUI("CaptionFilenameLength")) |
70 self.styleSheetPicker.setText(Preferences.getUI("StyleSheet")) |
76 self.styleSheetPicker.setText(Preferences.getUI("StyleSheet")) |
|
77 self.styleIconsPathPicker.setText(Preferences.getUI("StyleIconsPath")) |
71 |
78 |
72 layoutType = Preferences.getUI("LayoutType") |
79 layoutType = Preferences.getUI("LayoutType") |
73 if layoutType == "Sidebars": |
80 if layoutType == "Sidebars": |
74 index = 0 |
81 index = 0 |
75 elif layoutType == "Toolboxes": |
82 elif layoutType == "Toolboxes": |
150 "CaptionFilenameLength", |
157 "CaptionFilenameLength", |
151 self.filenameLengthSpinBox.value()) |
158 self.filenameLengthSpinBox.value()) |
152 Preferences.setUI( |
159 Preferences.setUI( |
153 "StyleSheet", |
160 "StyleSheet", |
154 self.styleSheetPicker.text()) |
161 self.styleSheetPicker.text()) |
|
162 Preferences.setUI( |
|
163 "StyleIconsPath", |
|
164 self.styleIconsPathPicker.text()) |
155 |
165 |
156 # save the language settings |
166 # save the language settings |
157 uiLanguageIndex = self.languageComboBox.currentIndex() |
167 uiLanguageIndex = self.languageComboBox.currentIndex() |
158 uiLanguage = ( |
168 uiLanguage = ( |
159 self.languageComboBox.itemData(uiLanguageIndex) |
169 self.languageComboBox.itemData(uiLanguageIndex) |