Tue, 18 Oct 2022 16:06:21 +0200
Changed the eric7 import statements to include the package name (i.e. eric7) in order to not fiddle with sys.path.
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1 | # -*- coding: utf-8 -*- |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
2 | |
8881
54e42bc2437a
Updated copyright for 2022.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8864
diff
changeset
|
3 | # Copyright (c) 2006 - 2022 Detlev Offenbach <detlev@die-offenbachs.de> |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
4 | # |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
5 | |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
6 | """ |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
7 | Module implementing the Interface configuration page. |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
8 | """ |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
9 | |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
10 | import glob |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
11 | import os |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
12 | |
8318
962bce857696
Replaced all imports of PyQt5 to PyQt6 and started to replace code using obsoleted methods and adapt to the PyQt6 enum usage.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8314
diff
changeset
|
13 | from PyQt6.QtCore import pyqtSlot, QTranslator |
8583
aac629a05f8b
Modernized the look of the side bars.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8358
diff
changeset
|
14 | from PyQt6.QtWidgets import QStyleFactory, QDialog, QColorDialog |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
15 | |
9413
80c06d472826
Changed the eric7 import statements to include the package name (i.e. eric7) in order to not fiddle with sys.path.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9221
diff
changeset
|
16 | from eric7.EricWidgets.EricPathPicker import EricPathPickerModes |
80c06d472826
Changed the eric7 import statements to include the package name (i.e. eric7) in order to not fiddle with sys.path.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9221
diff
changeset
|
17 | from eric7.EricWidgets.EricIconBar import EricIconBar |
80c06d472826
Changed the eric7 import statements to include the package name (i.e. eric7) in order to not fiddle with sys.path.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9221
diff
changeset
|
18 | from eric7.EricWidgets.EricApplication import ericApp |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
19 | |
12
1d8dd9706f46
First commit after changing to Python 3.1.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7
diff
changeset
|
20 | from .ConfigurationPageBase import ConfigurationPageBase |
1d8dd9706f46
First commit after changing to Python 3.1.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7
diff
changeset
|
21 | from .Ui_InterfacePage import Ui_InterfacePage |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
22 | |
9413
80c06d472826
Changed the eric7 import statements to include the package name (i.e. eric7) in order to not fiddle with sys.path.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9221
diff
changeset
|
23 | from eric7 import Preferences, Utilities |
80c06d472826
Changed the eric7 import statements to include the package name (i.e. eric7) in order to not fiddle with sys.path.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9221
diff
changeset
|
24 | from eric7.EricGui import EricPixmapCache |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
25 | |
8314
e3642a6a1e71
Finished renaming eric6 to eric7.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8312
diff
changeset
|
26 | from eric7config import getConfig |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
27 | |
945
8cd4d08fa9f6
Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
910
diff
changeset
|
28 | |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
29 | class InterfacePage(ConfigurationPageBase, Ui_InterfacePage): |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
30 | """ |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
31 | Class implementing the Interface configuration page. |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
32 | """ |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
33 | |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
34 | def __init__(self): |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
35 | """ |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
36 | Constructor |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
37 | """ |
8218
7c09585bd960
Applied some more code simplifications suggested by the new Simplify checker (super(Foo, self) => super()).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8109
diff
changeset
|
38 | super().__init__() |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
39 | self.setupUi(self) |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
40 | self.setObjectName("InterfacePage") |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
41 | |
8356
68ec9c3d4de5
Renamed the modules and classes of the E5Gui package to have the prefix 'Eric' instead of 'E5'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8327
diff
changeset
|
42 | self.styleSheetPicker.setMode(EricPathPickerModes.OPEN_FILE_MODE) |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
43 | self.styleSheetPicker.setFilters( |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
44 | self.tr( |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
45 | "Qt Style Sheets (*.qss);;Cascading Style Sheets (*.css);;" |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
46 | "All files (*)" |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
47 | ) |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
48 | ) |
5976
549918576245
Added a dark style (*.qss and Python lexers) provided by Giuseppe Corbelli.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5389
diff
changeset
|
49 | self.styleSheetPicker.setDefaultDirectory(getConfig("ericStylesDir")) |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
50 | |
8864
4a0f7105dbd8
Added configuration capability for the path containing the style icon sub-directories.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8761
diff
changeset
|
51 | styleIconsPath = ericApp().getStyleIconsPath() |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
52 | self.styleIconsPathPicker.setMode(EricPathPickerModes.DIRECTORY_SHOW_FILES_MODE) |
8864
4a0f7105dbd8
Added configuration capability for the path containing the style icon sub-directories.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8761
diff
changeset
|
53 | self.styleIconsPathPicker.setDefaultDirectory(styleIconsPath) |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
54 | |
8587
78971b458d25
Made the height/width of the icons bar configurable.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8583
diff
changeset
|
55 | for iconBarSize in EricIconBar.BarSizes: |
78971b458d25
Made the height/width of the icons bar configurable.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8583
diff
changeset
|
56 | self.iconSizeComboBox.addItem( |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
57 | EricIconBar.BarSizes[iconBarSize][2], iconBarSize |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
58 | ) |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
59 | |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
60 | # set initial values |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
61 | self.__populateStyleCombo() |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
62 | self.__populateLanguageCombo() |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
63 | |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
64 | self.uiBrowsersListFoldersFirstCheckBox.setChecked( |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
65 | Preferences.getUI("BrowsersListFoldersFirst") |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
66 | ) |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
67 | self.uiBrowsersHideNonPublicCheckBox.setChecked( |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
68 | Preferences.getUI("BrowsersHideNonPublic") |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
69 | ) |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
70 | self.uiBrowsersSortByOccurrenceCheckBox.setChecked( |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
71 | Preferences.getUI("BrowsersListContentsByOccurrence") |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
72 | ) |
7757
1f9f35f9be6d
File Browser, Project Source Browser, Editor Outline: added option to suppress the source code encoding line.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7360
diff
changeset
|
73 | self.browserShowCodingCheckBox.setChecked( |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
74 | Preferences.getUI("BrowserShowCoding") |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
75 | ) |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
76 | self.fileFiltersEdit.setText(Preferences.getUI("BrowsersFileFilters")) |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
77 | |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
78 | self.uiCaptionShowsFilenameGroupBox.setChecked( |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
79 | Preferences.getUI("CaptionShowsFilename") |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
80 | ) |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
81 | self.filenameLengthSpinBox.setValue(Preferences.getUI("CaptionFilenameLength")) |
4577
e79a139aacc4
Changed more configuration pages to use the path picker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4095
diff
changeset
|
82 | self.styleSheetPicker.setText(Preferences.getUI("StyleSheet")) |
8864
4a0f7105dbd8
Added configuration capability for the path containing the style icon sub-directories.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8761
diff
changeset
|
83 | self.styleIconsPathPicker.setText(Preferences.getUI("StyleIconsPath")) |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
84 | |
6416
a915f8dd1ca6
File-Browser, Shell: changed code so file-browser and shell are always a standalone windows.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6048
diff
changeset
|
85 | layoutType = Preferences.getUI("LayoutType") |
a915f8dd1ca6
File-Browser, Shell: changed code so file-browser and shell are always a standalone windows.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6048
diff
changeset
|
86 | if layoutType == "Sidebars": |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
87 | index = 0 |
6416
a915f8dd1ca6
File-Browser, Shell: changed code so file-browser and shell are always a standalone windows.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6048
diff
changeset
|
88 | elif layoutType == "Toolboxes": |
1852
12d37ab1baf3
Removed the user interface layout types "Floating Windows" and "Dock Windows".
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
1509
diff
changeset
|
89 | index = 1 |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
90 | else: |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
91 | index = 0 # default for bad values |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
92 | self.layoutComboBox.setCurrentIndex(index) |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
93 | |
6424
5e74c4e22e9a
Preferences, InterfacePage: introduced configuration options to make the activation of the Template-Viewer, File-Browser, Symbols widget and Numbers widget optional.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6420
diff
changeset
|
94 | # integrated tools activation |
5e74c4e22e9a
Preferences, InterfacePage: introduced configuration options to make the activation of the Template-Viewer, File-Browser, Symbols widget and Numbers widget optional.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6420
diff
changeset
|
95 | # left side |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
96 | self.findReplaceCheckBox.setChecked(Preferences.getUI("ShowFindFileWidget")) |
9038
90bcfdd63d47
Added capability to configure use of an external "Find/Replace In Files" dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8881
diff
changeset
|
97 | self.findLocationCheckBox.setChecked( |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
98 | Preferences.getUI("ShowFindLocationWidget") |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
99 | ) |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
100 | self.templateViewerCheckBox.setChecked(Preferences.getUI("ShowTemplateViewer")) |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
101 | self.fileBrowserCheckBox.setChecked(Preferences.getUI("ShowFileBrowser")) |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
102 | self.symbolsCheckBox.setChecked(Preferences.getUI("ShowSymbolsViewer")) |
6424
5e74c4e22e9a
Preferences, InterfacePage: introduced configuration options to make the activation of the Template-Viewer, File-Browser, Symbols widget and Numbers widget optional.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6420
diff
changeset
|
103 | # right side |
6420
4dd44f42a24f
Preferences, InterfacePage: introduced configuration options to make the activation of the code documentation viewer, the cooperation widget and the IRC widget optional.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6416
diff
changeset
|
104 | self.codeDocumentationViewerCheckBox.setChecked( |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
105 | Preferences.getUI("ShowCodeDocumentationViewer") |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
106 | ) |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
107 | self.helpViewerCheckBox.setChecked(Preferences.getUI("ShowInternalHelpViewer")) |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
108 | self.condaCheckBox.setChecked(Preferences.getUI("ShowCondaPackageManager")) |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
109 | self.pypiCheckBox.setChecked(Preferences.getUI("ShowPyPIPackageManager")) |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
110 | self.cooperationCheckBox.setChecked(Preferences.getUI("ShowCooperation")) |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
111 | self.ircCheckBox.setChecked(Preferences.getUI("ShowIrc")) |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
112 | self.microPythonCheckBox.setChecked(Preferences.getUI("ShowMicroPython")) |
6424
5e74c4e22e9a
Preferences, InterfacePage: introduced configuration options to make the activation of the Template-Viewer, File-Browser, Symbols widget and Numbers widget optional.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6420
diff
changeset
|
113 | # bottom side |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
114 | self.numbersCheckBox.setChecked(Preferences.getUI("ShowNumbersViewer")) |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
115 | |
8587
78971b458d25
Made the height/width of the icons bar configurable.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8583
diff
changeset
|
116 | self.iconSizeComboBox.setCurrentIndex( |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
117 | self.iconSizeComboBox.findData(Preferences.getUI("IconBarSize")) |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
118 | ) |
8583
aac629a05f8b
Modernized the look of the side bars.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8358
diff
changeset
|
119 | self.__iconBarColor = Preferences.getUI("IconBarColor") |
8587
78971b458d25
Made the height/width of the icons bar configurable.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8583
diff
changeset
|
120 | self.__setIconBarSamples() |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
121 | |
8727
e2f8a0fbf738
Added an interface option that shows all integrated tools in the left sidebar. The right one is not used. This is recommended for screens less FHD.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8714
diff
changeset
|
122 | self.combinedLeftRightSidebarCheckBox.setChecked( |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
123 | Preferences.getUI("CombinedLeftRightSidebar") |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
124 | ) |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
125 | |
8587
78971b458d25
Made the height/width of the icons bar configurable.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8583
diff
changeset
|
126 | # connect the icon size combo box after initialization is complete |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
127 | self.iconSizeComboBox.currentIndexChanged.connect(self.__setIconBarSamples) |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
128 | |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
129 | def save(self): |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
130 | """ |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
131 | Public slot to save the Interface configuration. |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
132 | """ |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
133 | # save the style settings |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
134 | styleIndex = self.styleComboBox.currentIndex() |
7
c679fb30c8f3
Change code dealing with QVariant (and QSettings) to use the PyQt4 QVariant v2 API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
0
diff
changeset
|
135 | style = self.styleComboBox.itemData(styleIndex) |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
136 | Preferences.setUI("Style", style) |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
137 | |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
138 | # save the other UI related settings |
3025
67064c71df21
Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3010
diff
changeset
|
139 | Preferences.setUI( |
67064c71df21
Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3010
diff
changeset
|
140 | "BrowsersListFoldersFirst", |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
141 | self.uiBrowsersListFoldersFirstCheckBox.isChecked(), |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
142 | ) |
3025
67064c71df21
Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3010
diff
changeset
|
143 | Preferences.setUI( |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
144 | "BrowsersHideNonPublic", self.uiBrowsersHideNonPublicCheckBox.isChecked() |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
145 | ) |
3025
67064c71df21
Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3010
diff
changeset
|
146 | Preferences.setUI( |
67064c71df21
Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3010
diff
changeset
|
147 | "BrowsersListContentsByOccurrence", |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
148 | self.uiBrowsersSortByOccurrenceCheckBox.isChecked(), |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
149 | ) |
3025
67064c71df21
Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3010
diff
changeset
|
150 | Preferences.setUI( |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
151 | "BrowserShowCoding", self.browserShowCodingCheckBox.isChecked() |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
152 | ) |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
153 | Preferences.setUI("BrowsersFileFilters", self.fileFiltersEdit.text()) |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
154 | |
3025
67064c71df21
Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3010
diff
changeset
|
155 | Preferences.setUI( |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
156 | "CaptionShowsFilename", self.uiCaptionShowsFilenameGroupBox.isChecked() |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
157 | ) |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
158 | Preferences.setUI("CaptionFilenameLength", self.filenameLengthSpinBox.value()) |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
159 | Preferences.setUI("StyleSheet", self.styleSheetPicker.text()) |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
160 | Preferences.setUI("StyleIconsPath", self.styleIconsPathPicker.text()) |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
161 | |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
162 | # save the language settings |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
163 | uiLanguageIndex = self.languageComboBox.currentIndex() |
8259
2bbec88047dd
Applied some more code simplifications suggested by the new Simplify checker (Y108: use ternary operator).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8218
diff
changeset
|
164 | uiLanguage = ( |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
165 | self.languageComboBox.itemData(uiLanguageIndex) if uiLanguageIndex else None |
8259
2bbec88047dd
Applied some more code simplifications suggested by the new Simplify checker (Y108: use ternary operator).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8218
diff
changeset
|
166 | ) |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
167 | Preferences.setUILanguage(uiLanguage) |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
168 | |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
169 | # save the interface layout settings |
6416
a915f8dd1ca6
File-Browser, Shell: changed code so file-browser and shell are always a standalone windows.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6048
diff
changeset
|
170 | if self.layoutComboBox.currentIndex() == 0: |
a915f8dd1ca6
File-Browser, Shell: changed code so file-browser and shell are always a standalone windows.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6048
diff
changeset
|
171 | layoutType = "Sidebars" |
a915f8dd1ca6
File-Browser, Shell: changed code so file-browser and shell are always a standalone windows.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6048
diff
changeset
|
172 | elif self.layoutComboBox.currentIndex() == 1: |
a915f8dd1ca6
File-Browser, Shell: changed code so file-browser and shell are always a standalone windows.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6048
diff
changeset
|
173 | layoutType = "Toolboxes" |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
174 | else: |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
175 | layoutType = "Sidebars" # just in case |
6416
a915f8dd1ca6
File-Browser, Shell: changed code so file-browser and shell are always a standalone windows.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6048
diff
changeset
|
176 | Preferences.setUI("LayoutType", layoutType) |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
177 | |
6424
5e74c4e22e9a
Preferences, InterfacePage: introduced configuration options to make the activation of the Template-Viewer, File-Browser, Symbols widget and Numbers widget optional.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6420
diff
changeset
|
178 | # save the integrated tools activation |
5e74c4e22e9a
Preferences, InterfacePage: introduced configuration options to make the activation of the Template-Viewer, File-Browser, Symbols widget and Numbers widget optional.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6420
diff
changeset
|
179 | # left side |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
180 | Preferences.setUI("ShowFindFileWidget", self.findReplaceCheckBox.isChecked()) |
9038
90bcfdd63d47
Added capability to configure use of an external "Find/Replace In Files" dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8881
diff
changeset
|
181 | Preferences.setUI( |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
182 | "ShowFindLocationWidget", self.findLocationCheckBox.isChecked() |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
183 | ) |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
184 | Preferences.setUI("ShowTemplateViewer", self.templateViewerCheckBox.isChecked()) |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
185 | Preferences.setUI("ShowFileBrowser", self.fileBrowserCheckBox.isChecked()) |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
186 | Preferences.setUI("ShowSymbolsViewer", self.symbolsCheckBox.isChecked()) |
6424
5e74c4e22e9a
Preferences, InterfacePage: introduced configuration options to make the activation of the Template-Viewer, File-Browser, Symbols widget and Numbers widget optional.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6420
diff
changeset
|
187 | # right side |
3025
67064c71df21
Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3010
diff
changeset
|
188 | Preferences.setUI( |
6420
4dd44f42a24f
Preferences, InterfacePage: introduced configuration options to make the activation of the code documentation viewer, the cooperation widget and the IRC widget optional.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6416
diff
changeset
|
189 | "ShowCodeDocumentationViewer", |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
190 | self.codeDocumentationViewerCheckBox.isChecked(), |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
191 | ) |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
192 | Preferences.setUI("ShowInternalHelpViewer", self.helpViewerCheckBox.isChecked()) |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
193 | Preferences.setUI("ShowCondaPackageManager", self.condaCheckBox.isChecked()) |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
194 | Preferences.setUI("ShowPyPIPackageManager", self.pypiCheckBox.isChecked()) |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
195 | Preferences.setUI("ShowCooperation", self.cooperationCheckBox.isChecked()) |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
196 | Preferences.setUI("ShowIrc", self.ircCheckBox.isChecked()) |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
197 | Preferences.setUI("ShowMicroPython", self.microPythonCheckBox.isChecked()) |
6424
5e74c4e22e9a
Preferences, InterfacePage: introduced configuration options to make the activation of the Template-Viewer, File-Browser, Symbols widget and Numbers widget optional.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6420
diff
changeset
|
198 | # bottom side |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
199 | Preferences.setUI("ShowNumbersViewer", self.numbersCheckBox.isChecked()) |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
200 | |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
201 | Preferences.setUI("IconBarSize", self.iconSizeComboBox.currentData()) |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
202 | Preferences.setUI("IconBarColor", self.__iconBarColor) |
8727
e2f8a0fbf738
Added an interface option that shows all integrated tools in the left sidebar. The right one is not used. This is recommended for screens less FHD.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8714
diff
changeset
|
203 | Preferences.setUI( |
e2f8a0fbf738
Added an interface option that shows all integrated tools in the left sidebar. The right one is not used. This is recommended for screens less FHD.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8714
diff
changeset
|
204 | "CombinedLeftRightSidebar", |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
205 | self.combinedLeftRightSidebarCheckBox.isChecked(), |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
206 | ) |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
207 | |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
208 | def __populateStyleCombo(self): |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
209 | """ |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
210 | Private method to populate the style combo box. |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
211 | """ |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
212 | curStyle = Preferences.getUI("Style") |
8761
f05818ae6431
Corrected some code style issues detected by the enhanced comprehensions check.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8727
diff
changeset
|
213 | styles = sorted(QStyleFactory.keys()) |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
214 | self.styleComboBox.addItem(self.tr("System"), "System") |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
215 | for style in styles: |
7
c679fb30c8f3
Change code dealing with QVariant (and QSettings) to use the PyQt4 QVariant v2 API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
0
diff
changeset
|
216 | self.styleComboBox.addItem(style, style) |
c679fb30c8f3
Change code dealing with QVariant (and QSettings) to use the PyQt4 QVariant v2 API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
0
diff
changeset
|
217 | currentIndex = self.styleComboBox.findData(curStyle) |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
218 | if currentIndex == -1: |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
219 | currentIndex = 0 |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
220 | self.styleComboBox.setCurrentIndex(currentIndex) |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
221 | |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
222 | def __populateLanguageCombo(self): |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
223 | """ |
6998
a63ca2373f44
Shell: added capability to place the Shell window in the left or right side container.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6987
diff
changeset
|
224 | Private method to initialize the language combo box. |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
225 | """ |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
226 | self.languageComboBox.clear() |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
227 | |
7263
c1af2e327675
Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7229
diff
changeset
|
228 | fnlist = ( |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
229 | glob.glob("eric7_*.qm") |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
230 | + glob.glob(os.path.join(getConfig("ericTranslationsDir"), "eric7_*.qm")) |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
231 | + glob.glob(os.path.join(Utilities.getConfigDir(), "eric7_*.qm")) |
7263
c1af2e327675
Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7229
diff
changeset
|
232 | ) |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
233 | locales = {} |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
234 | for fn in fnlist: |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
235 | locale = os.path.basename(fn)[6:-3] |
12
1d8dd9706f46
First commit after changing to Python 3.1.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7
diff
changeset
|
236 | if locale not in locales: |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
237 | translator = QTranslator() |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
238 | translator.load(fn) |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
239 | locales[locale] = translator.translate( |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
240 | "InterfacePage", "English", "Translate this with your language" |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
241 | ) + " ({0})".format(locale) |
8761
f05818ae6431
Corrected some code style issues detected by the enhanced comprehensions check.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8727
diff
changeset
|
242 | localeList = sorted(locales.keys()) |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
243 | try: |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
244 | uiLanguage = Preferences.getUILanguage() |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
245 | if uiLanguage == "None" or uiLanguage is None: |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
246 | currentIndex = 0 |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
247 | elif uiLanguage == "System": |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
248 | currentIndex = 1 |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
249 | else: |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
250 | currentIndex = localeList.index(uiLanguage) + 2 |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
251 | except ValueError: |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
252 | currentIndex = 0 |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
253 | self.languageComboBox.clear() |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
254 | |
7
c679fb30c8f3
Change code dealing with QVariant (and QSettings) to use the PyQt4 QVariant v2 API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
0
diff
changeset
|
255 | self.languageComboBox.addItem("English (default)", "None") |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
256 | self.languageComboBox.addItem(self.tr("System"), "System") |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
257 | for locale in localeList: |
7
c679fb30c8f3
Change code dealing with QVariant (and QSettings) to use the PyQt4 QVariant v2 API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
0
diff
changeset
|
258 | self.languageComboBox.addItem(locales[locale], locale) |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
259 | self.languageComboBox.setCurrentIndex(currentIndex) |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
260 | |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
261 | @pyqtSlot() |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
262 | def on_resetLayoutButton_clicked(self): |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
263 | """ |
2964
84b65fb9e780
Continued correcting doc strings by using the new doc string checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
2624
diff
changeset
|
264 | Private method to reset layout to factory defaults. |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
265 | """ |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
266 | Preferences.resetLayout() |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
267 | |
8587
78971b458d25
Made the height/width of the icons bar configurable.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8583
diff
changeset
|
268 | @pyqtSlot() |
78971b458d25
Made the height/width of the icons bar configurable.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8583
diff
changeset
|
269 | def __setIconBarSamples(self): |
78971b458d25
Made the height/width of the icons bar configurable.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8583
diff
changeset
|
270 | """ |
78971b458d25
Made the height/width of the icons bar configurable.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8583
diff
changeset
|
271 | Private slot to set the colors of the icon bar color samples. |
8583
aac629a05f8b
Modernized the look of the side bars.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8358
diff
changeset
|
272 | """ |
8587
78971b458d25
Made the height/width of the icons bar configurable.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8583
diff
changeset
|
273 | iconBarSize = self.iconSizeComboBox.currentData() |
78971b458d25
Made the height/width of the icons bar configurable.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8583
diff
changeset
|
274 | iconSize, borderSize = EricIconBar.BarSizes[iconBarSize][:2] |
78971b458d25
Made the height/width of the icons bar configurable.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8583
diff
changeset
|
275 | size = iconSize + 2 * borderSize |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
276 | |
8587
78971b458d25
Made the height/width of the icons bar configurable.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8583
diff
changeset
|
277 | self.sampleLabel.setFixedSize(size, size) |
8583
aac629a05f8b
Modernized the look of the side bars.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8358
diff
changeset
|
278 | self.sampleLabel.setStyleSheet( |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
279 | EricIconBar.LabelStyleSheetTemplate.format(self.__iconBarColor.name()) |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
280 | ) |
8587
78971b458d25
Made the height/width of the icons bar configurable.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8583
diff
changeset
|
281 | self.sampleLabel.setPixmap( |
9413
80c06d472826
Changed the eric7 import statements to include the package name (i.e. eric7) in order to not fiddle with sys.path.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9221
diff
changeset
|
282 | EricPixmapCache.getIcon("sbDebugViewer96").pixmap(iconSize, iconSize) |
8587
78971b458d25
Made the height/width of the icons bar configurable.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8583
diff
changeset
|
283 | ) |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
284 | |
8587
78971b458d25
Made the height/width of the icons bar configurable.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8583
diff
changeset
|
285 | self.highlightedSampleLabel.setFixedSize(size, size) |
8583
aac629a05f8b
Modernized the look of the side bars.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8358
diff
changeset
|
286 | self.highlightedSampleLabel.setStyleSheet( |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
287 | EricIconBar.LabelStyleSheetTemplate.format( |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
288 | self.__iconBarColor.darker().name() |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
289 | ) |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
290 | ) |
8587
78971b458d25
Made the height/width of the icons bar configurable.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8583
diff
changeset
|
291 | self.highlightedSampleLabel.setPixmap( |
9413
80c06d472826
Changed the eric7 import statements to include the package name (i.e. eric7) in order to not fiddle with sys.path.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9221
diff
changeset
|
292 | EricPixmapCache.getIcon("sbDebugViewer96").pixmap(iconSize, iconSize) |
8587
78971b458d25
Made the height/width of the icons bar configurable.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8583
diff
changeset
|
293 | ) |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
294 | |
8583
aac629a05f8b
Modernized the look of the side bars.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8358
diff
changeset
|
295 | @pyqtSlot() |
aac629a05f8b
Modernized the look of the side bars.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8358
diff
changeset
|
296 | def on_iconBarButton_clicked(self): |
aac629a05f8b
Modernized the look of the side bars.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8358
diff
changeset
|
297 | """ |
aac629a05f8b
Modernized the look of the side bars.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8358
diff
changeset
|
298 | Private slot to select the icon bar color. |
aac629a05f8b
Modernized the look of the side bars.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8358
diff
changeset
|
299 | """ |
aac629a05f8b
Modernized the look of the side bars.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8358
diff
changeset
|
300 | colDlg = QColorDialog(self) |
aac629a05f8b
Modernized the look of the side bars.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8358
diff
changeset
|
301 | # Set current colour last to avoid conflicts with alpha channel |
aac629a05f8b
Modernized the look of the side bars.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8358
diff
changeset
|
302 | colDlg.setCurrentColor(self.__iconBarColor) |
aac629a05f8b
Modernized the look of the side bars.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8358
diff
changeset
|
303 | if colDlg.exec() == QDialog.DialogCode.Accepted: |
aac629a05f8b
Modernized the look of the side bars.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8358
diff
changeset
|
304 | self.__iconBarColor = colDlg.selectedColor() |
8587
78971b458d25
Made the height/width of the icons bar configurable.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8583
diff
changeset
|
305 | self.__setIconBarSamples() |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
306 | |
8727
e2f8a0fbf738
Added an interface option that shows all integrated tools in the left sidebar. The right one is not used. This is recommended for screens less FHD.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8714
diff
changeset
|
307 | @pyqtSlot(bool) |
e2f8a0fbf738
Added an interface option that shows all integrated tools in the left sidebar. The right one is not used. This is recommended for screens less FHD.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8714
diff
changeset
|
308 | def on_combinedLeftRightSidebarCheckBox_toggled(self, checked): |
e2f8a0fbf738
Added an interface option that shows all integrated tools in the left sidebar. The right one is not used. This is recommended for screens less FHD.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8714
diff
changeset
|
309 | """ |
e2f8a0fbf738
Added an interface option that shows all integrated tools in the left sidebar. The right one is not used. This is recommended for screens less FHD.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8714
diff
changeset
|
310 | Private slot handling a change of the combined sidebars checkbox. |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
311 | |
8727
e2f8a0fbf738
Added an interface option that shows all integrated tools in the left sidebar. The right one is not used. This is recommended for screens less FHD.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8714
diff
changeset
|
312 | @param checked state of the checkbox |
e2f8a0fbf738
Added an interface option that shows all integrated tools in the left sidebar. The right one is not used. This is recommended for screens less FHD.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8714
diff
changeset
|
313 | @type bool |
e2f8a0fbf738
Added an interface option that shows all integrated tools in the left sidebar. The right one is not used. This is recommended for screens less FHD.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8714
diff
changeset
|
314 | """ |
e2f8a0fbf738
Added an interface option that shows all integrated tools in the left sidebar. The right one is not used. This is recommended for screens less FHD.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8714
diff
changeset
|
315 | self.leftRightGroupBox.setTitle( |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
316 | self.tr("Combined Left Side") if checked else self.tr("Right Side") |
8727
e2f8a0fbf738
Added an interface option that shows all integrated tools in the left sidebar. The right one is not used. This is recommended for screens less FHD.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8714
diff
changeset
|
317 | ) |
8583
aac629a05f8b
Modernized the look of the side bars.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8358
diff
changeset
|
318 | |
945
8cd4d08fa9f6
Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
910
diff
changeset
|
319 | |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
320 | def create(dlg): |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
321 | """ |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
322 | Module function to create the configuration page. |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
323 | |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
324 | @param dlg reference to the configuration dialog |
2964
84b65fb9e780
Continued correcting doc strings by using the new doc string checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
2624
diff
changeset
|
325 | @return reference to the instantiated page (ConfigurationPageBase) |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
326 | """ |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
327 | page = InterfacePage() |
880
52ed20236a1c
Added the option to not use the native file dialog to prevent crashes on Linux.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
791
diff
changeset
|
328 | return page |