eric7/Preferences/ConfigurationPages/InterfacePage.py

Sat, 15 May 2021 18:45:04 +0200

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Sat, 15 May 2021 18:45:04 +0200
branch
eric7
changeset 8312
800c432b34c8
parent 8259
eric6/Preferences/ConfigurationPages/InterfacePage.py@2bbec88047dd
child 8314
e3642a6a1e71
permissions
-rw-r--r--

Started to rename eric6 to eric7.

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
7923
91e843545d9a Updated copyright for 2021.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7780
diff changeset
3 # Copyright (c) 2006 - 2021 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
3656
441956d8fce5 Started porting eric5 to PyQt5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3484
diff changeset
13 from PyQt5.QtCore import pyqtSlot, QTranslator
441956d8fce5 Started porting eric5 to PyQt5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3484
diff changeset
14 from PyQt5.QtWidgets import QStyleFactory
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
15
4577
e79a139aacc4 Changed more configuration pages to use the path picker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4095
diff changeset
16 from E5Gui.E5PathPicker import E5PathPickerModes
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
17
12
1d8dd9706f46 First commit after changing to Python 3.1.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7
diff changeset
18 from .ConfigurationPageBase import ConfigurationPageBase
1d8dd9706f46 First commit after changing to Python 3.1.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7
diff changeset
19 from .Ui_InterfacePage import Ui_InterfacePage
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
20
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
21 import Preferences
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
22 import Utilities
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
23
3670
f0cb7579c0b4 Finished renaming eric5 for PyQt5 to eric6.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3656
diff changeset
24 from eric6config import getConfig
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
25
945
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 910
diff changeset
26
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
27 class InterfacePage(ConfigurationPageBase, Ui_InterfacePage):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
28 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
29 Class implementing the Interface configuration page.
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 def __init__(self):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
32 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
33 Constructor
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
34 """
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
35 super().__init__()
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
36 self.setupUi(self)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
37 self.setObjectName("InterfacePage")
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
38
4577
e79a139aacc4 Changed more configuration pages to use the path picker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4095
diff changeset
39 self.styleSheetPicker.setMode(E5PathPickerModes.OpenFileMode)
e79a139aacc4 Changed more configuration pages to use the path picker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4095
diff changeset
40 self.styleSheetPicker.setFilters(self.tr(
e79a139aacc4 Changed more configuration pages to use the path picker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4095
diff changeset
41 "Qt Style Sheets (*.qss);;Cascading Style Sheets (*.css);;"
e79a139aacc4 Changed more configuration pages to use the path picker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4095
diff changeset
42 "All files (*)"))
5976
549918576245 Added a dark style (*.qss and Python lexers) provided by Giuseppe Corbelli.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5389
diff changeset
43 self.styleSheetPicker.setDefaultDirectory(getConfig("ericStylesDir"))
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
44
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
45 # set initial values
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
46 self.__populateStyleCombo()
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
47 self.__populateLanguageCombo()
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
48 self.__populateShellPositionCombo()
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
49
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
50 self.uiBrowsersListFoldersFirstCheckBox.setChecked(
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
51 Preferences.getUI("BrowsersListFoldersFirst"))
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
52 self.uiBrowsersHideNonPublicCheckBox.setChecked(
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
53 Preferences.getUI("BrowsersHideNonPublic"))
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
54 self.uiBrowsersSortByOccurrenceCheckBox.setChecked(
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
55 Preferences.getUI("BrowsersListContentsByOccurrence"))
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
56 self.browserShowCodingCheckBox.setChecked(
7765
72ea8b7452a4 Fixed some code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7757
diff changeset
57 Preferences.getUI("BrowserShowCoding"))
910
dc2436a9e2a1 Added capability to filter out unwanted items in the file browsers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 882
diff changeset
58 self.fileFiltersEdit.setText(
dc2436a9e2a1 Added capability to filter out unwanted items in the file browsers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 882
diff changeset
59 Preferences.getUI("BrowsersFileFilters"))
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
60
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
61 self.uiCaptionShowsFilenameGroupBox.setChecked(
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
62 Preferences.getUI("CaptionShowsFilename"))
564
b3d966393ba9 Did some code cleanup.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 405
diff changeset
63 self.filenameLengthSpinBox.setValue(
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
64 Preferences.getUI("CaptionFilenameLength"))
4577
e79a139aacc4 Changed more configuration pages to use the path picker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4095
diff changeset
65 self.styleSheetPicker.setText(Preferences.getUI("StyleSheet"))
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
66
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
67 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
68 if layoutType == "Sidebars":
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
69 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
70 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
71 index = 1
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
72 else:
1852
12d37ab1baf3 Removed the user interface layout types "Floating Windows" and "Dock Windows".
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1509
diff changeset
73 index = 0 # default for bad values
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
74 self.layoutComboBox.setCurrentIndex(index)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
75
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
76 # 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
77 # left side
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
78 self.templateViewerCheckBox.setChecked(
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
79 Preferences.getUI("ShowTemplateViewer"))
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
80 self.fileBrowserCheckBox.setChecked(
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
81 Preferences.getUI("ShowFileBrowser"))
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
82 self.symbolsCheckBox.setChecked(
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
83 Preferences.getUI("ShowSymbolsViewer"))
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
84 # 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
85 self.codeDocumentationViewerCheckBox.setChecked(
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
86 Preferences.getUI("ShowCodeDocumentationViewer"))
7054
fb84d8489bc1 Started implementing the MicroPython support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6998
diff changeset
87 self.microPythonCheckBox.setChecked(
fb84d8489bc1 Started implementing the MicroPython support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6998
diff changeset
88 Preferences.getUI("ShowMicroPython"))
6803
4a6257252525 InterfacePage: added option to enable/disable the PyPI Package Manager widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
89 self.pypiCheckBox.setChecked(
4a6257252525 InterfacePage: added option to enable/disable the PyPI Package Manager widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
90 Preferences.getUI("ShowPyPIPackageManager"))
6761
0b69fe8314e3 UserInterface, Preferences, InterfacePage: added an option to configure the presence of the conda package manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6645
diff changeset
91 self.condaCheckBox.setChecked(
0b69fe8314e3 UserInterface, Preferences, InterfacePage: added an option to configure the presence of the conda package manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6645
diff changeset
92 Preferences.getUI("ShowCondaPackageManager"))
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
93 self.cooperationCheckBox.setChecked(
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
94 Preferences.getUI("ShowCooperation"))
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
95 self.ircCheckBox.setChecked(
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
96 Preferences.getUI("ShowIrc"))
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
97 # bottom side
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
98 self.numbersCheckBox.setChecked(
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
99 Preferences.getUI("ShowNumbersViewer"))
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
100
2624
e04b5d53281e Introduced a configurable delay timer to get smoother sidebars behavior.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2302
diff changeset
101 self.delaySpinBox.setValue(Preferences.getUI("SidebarDelay"))
e04b5d53281e Introduced a configurable delay timer to get smoother sidebars behavior.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2302
diff changeset
102
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
103 def save(self):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
104 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
105 Public slot to save the Interface configuration.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
106 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
107 # save the style settings
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
108 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
109 style = self.styleComboBox.itemData(styleIndex)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
110 Preferences.setUI("Style", style)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
111
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
112 # 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
113 Preferences.setUI(
67064c71df21 Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3010
diff changeset
114 "BrowsersListFoldersFirst",
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
115 self.uiBrowsersListFoldersFirstCheckBox.isChecked())
3025
67064c71df21 Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3010
diff changeset
116 Preferences.setUI(
67064c71df21 Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3010
diff changeset
117 "BrowsersHideNonPublic",
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
118 self.uiBrowsersHideNonPublicCheckBox.isChecked())
3025
67064c71df21 Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3010
diff changeset
119 Preferences.setUI(
67064c71df21 Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3010
diff changeset
120 "BrowsersListContentsByOccurrence",
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
121 self.uiBrowsersSortByOccurrenceCheckBox.isChecked())
3025
67064c71df21 Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3010
diff changeset
122 Preferences.setUI(
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
123 "BrowserShowCoding",
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
124 self.browserShowCodingCheckBox.isChecked())
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
125 Preferences.setUI(
3025
67064c71df21 Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3010
diff changeset
126 "BrowsersFileFilters",
910
dc2436a9e2a1 Added capability to filter out unwanted items in the file browsers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 882
diff changeset
127 self.fileFiltersEdit.text())
dc2436a9e2a1 Added capability to filter out unwanted items in the file browsers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 882
diff changeset
128
3025
67064c71df21 Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3010
diff changeset
129 Preferences.setUI(
67064c71df21 Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3010
diff changeset
130 "CaptionShowsFilename",
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
131 self.uiCaptionShowsFilenameGroupBox.isChecked())
3025
67064c71df21 Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3010
diff changeset
132 Preferences.setUI(
67064c71df21 Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3010
diff changeset
133 "CaptionFilenameLength",
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
134 self.filenameLengthSpinBox.value())
3025
67064c71df21 Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3010
diff changeset
135 Preferences.setUI(
67064c71df21 Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3010
diff changeset
136 "StyleSheet",
4577
e79a139aacc4 Changed more configuration pages to use the path picker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4095
diff changeset
137 self.styleSheetPicker.text())
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
138
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
139 # save the language settings
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
140 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
141 uiLanguage = (
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
142 self.languageComboBox.itemData(uiLanguageIndex)
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
143 if uiLanguageIndex else
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
144 None
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
145 )
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
146 Preferences.setUILanguage(uiLanguage)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
147
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
148 # 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
149 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
150 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
151 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
152 layoutType = "Toolboxes"
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
153 else:
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
154 layoutType = "Sidebars" # just in case
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
155 Preferences.setUI("LayoutType", layoutType)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
156
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
157 # save the shell position setting
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
158 shellPositionIndex = self.shellPositionComboBox.currentIndex()
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
159 shellPosition = self.shellPositionComboBox.itemData(shellPositionIndex)
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
160 Preferences.setUI("ShellPosition", shellPosition)
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
161
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
162 # 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
163 # left side
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
164 Preferences.setUI(
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
165 "ShowTemplateViewer",
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
166 self.templateViewerCheckBox.isChecked())
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
167 Preferences.setUI(
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
168 "ShowFileBrowser",
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
169 self.fileBrowserCheckBox.isChecked())
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
170 Preferences.setUI(
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
171 "ShowSymbolsViewer",
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
172 self.symbolsCheckBox.isChecked())
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
173 # right side
3025
67064c71df21 Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3010
diff changeset
174 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
175 "ShowCodeDocumentationViewer",
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
176 self.codeDocumentationViewerCheckBox.isChecked())
6803
4a6257252525 InterfacePage: added option to enable/disable the PyPI Package Manager widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
177 Preferences.setUI(
7054
fb84d8489bc1 Started implementing the MicroPython support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6998
diff changeset
178 "ShowMicroPython",
fb84d8489bc1 Started implementing the MicroPython support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6998
diff changeset
179 self.microPythonCheckBox.isChecked())
fb84d8489bc1 Started implementing the MicroPython support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6998
diff changeset
180 Preferences.setUI(
6803
4a6257252525 InterfacePage: added option to enable/disable the PyPI Package Manager widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
181 "ShowPyPIPackageManager",
4a6257252525 InterfacePage: added option to enable/disable the PyPI Package Manager widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
182 self.pypiCheckBox.isChecked())
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
183 Preferences.setUI(
6761
0b69fe8314e3 UserInterface, Preferences, InterfacePage: added an option to configure the presence of the conda package manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6645
diff changeset
184 "ShowCondaPackageManager",
0b69fe8314e3 UserInterface, Preferences, InterfacePage: added an option to configure the presence of the conda package manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6645
diff changeset
185 self.condaCheckBox.isChecked())
0b69fe8314e3 UserInterface, Preferences, InterfacePage: added an option to configure the presence of the conda package manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6645
diff changeset
186 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
187 "ShowCooperation",
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
188 self.cooperationCheckBox.isChecked())
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 Preferences.setUI(
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
190 "ShowIrc",
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
191 self.ircCheckBox.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
192 # bottom side
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
193 Preferences.setUI(
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
194 "ShowNumbersViewer",
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
195 self.numbersCheckBox.isChecked())
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
196
2624
e04b5d53281e Introduced a configurable delay timer to get smoother sidebars behavior.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2302
diff changeset
197 Preferences.setUI("SidebarDelay", self.delaySpinBox.value())
e04b5d53281e Introduced a configurable delay timer to get smoother sidebars behavior.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2302
diff changeset
198
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
199 def __populateStyleCombo(self):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
200 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
201 Private method to populate the style combo box.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
202 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
203 curStyle = Preferences.getUI("Style")
12
1d8dd9706f46 First commit after changing to Python 3.1.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7
diff changeset
204 styles = sorted(list(QStyleFactory.keys()))
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3186
diff changeset
205 self.styleComboBox.addItem(self.tr('System'), "System")
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
206 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
207 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
208 currentIndex = self.styleComboBox.findData(curStyle)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
209 if currentIndex == -1:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
210 currentIndex = 0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
211 self.styleComboBox.setCurrentIndex(currentIndex)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
212
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
213 def __populateLanguageCombo(self):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
214 """
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
215 Private method to initialize the language combo box.
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
216 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
217 self.languageComboBox.clear()
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
218
7263
c1af2e327675 Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
219 fnlist = (
c1af2e327675 Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
220 glob.glob("eric6_*.qm") +
3010
befeff46ec0f Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2964
diff changeset
221 glob.glob(os.path.join(
7263
c1af2e327675 Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
222 getConfig('ericTranslationsDir'), "eric6_*.qm")) +
3670
f0cb7579c0b4 Finished renaming eric5 for PyQt5 to eric6.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3656
diff changeset
223 glob.glob(os.path.join(Utilities.getConfigDir(), "eric6_*.qm"))
7263
c1af2e327675 Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
224 )
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
225 locales = {}
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
226 for fn in fnlist:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
227 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
228 if locale not in locales:
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
229 translator = QTranslator()
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
230 translator.load(fn)
7263
c1af2e327675 Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
231 locales[locale] = (
c1af2e327675 Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
232 translator.translate(
c1af2e327675 Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
233 "InterfacePage", "English",
c1af2e327675 Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
234 "Translate this with your language") +
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
235 " ({0})".format(locale)
7263
c1af2e327675 Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
236 )
12
1d8dd9706f46 First commit after changing to Python 3.1.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7
diff changeset
237 localeList = sorted(list(locales.keys()))
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
238 try:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
239 uiLanguage = Preferences.getUILanguage()
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
240 if uiLanguage == "None" or uiLanguage is None:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
241 currentIndex = 0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
242 elif uiLanguage == "System":
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
243 currentIndex = 1
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
244 else:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
245 currentIndex = localeList.index(uiLanguage) + 2
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
246 except ValueError:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
247 currentIndex = 0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
248 self.languageComboBox.clear()
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
249
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
250 self.languageComboBox.addItem("English (default)", "None")
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3186
diff changeset
251 self.languageComboBox.addItem(self.tr('System'), "System")
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
252 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
253 self.languageComboBox.addItem(locales[locale], locale)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
254 self.languageComboBox.setCurrentIndex(currentIndex)
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
255
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
256 def __populateShellPositionCombo(self):
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
257 """
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
258 Private method to initialize the shell position combo box.
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
259 """
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
260 self.shellPositionComboBox.addItem(self.tr("Left Side"), "left")
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
261 self.shellPositionComboBox.addItem(self.tr("Right Side"), "right")
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
262 self.shellPositionComboBox.addItem(self.tr("Bottom Side"), "bottom")
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
263
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
264 shellPosition = Preferences.getUI("ShellPosition")
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
265 if shellPosition not in ("left", "right", "bottom"):
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
266 shellPosition = "bottom"
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
267 index = self.shellPositionComboBox.findData(shellPosition)
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
268 self.shellPositionComboBox.setCurrentIndex(index)
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
269
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
270 @pyqtSlot()
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
271 def on_resetLayoutButton_clicked(self):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
272 """
2964
84b65fb9e780 Continued correcting doc strings by using the new doc string checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2624
diff changeset
273 Private method to reset layout to factory defaults.
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
274 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
275 Preferences.resetLayout()
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
276
945
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 910
diff changeset
277
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
278 def create(dlg):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
279 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
280 Module function to create the configuration page.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
281
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
282 @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
283 @return reference to the instantiated page (ConfigurationPageBase)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
284 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
285 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
286 return page

eric ide

mercurial