15 from .ConfigurationPageBase import ConfigurationPageBase |
15 from .ConfigurationPageBase import ConfigurationPageBase |
16 from .Ui_HelpInterfacePage import Ui_HelpInterfacePage |
16 from .Ui_HelpInterfacePage import Ui_HelpInterfacePage |
17 |
17 |
18 import Preferences |
18 import Preferences |
19 import Utilities |
19 import Utilities |
|
20 import UI.PixmapCache |
20 |
21 |
21 |
22 |
22 class HelpInterfacePage(ConfigurationPageBase, Ui_HelpInterfacePage): |
23 class HelpInterfacePage(ConfigurationPageBase, Ui_HelpInterfacePage): |
23 """ |
24 """ |
24 Class implementing the Interface configuration page (variant for web |
25 Class implementing the Interface configuration page (variant for web |
29 Constructor |
30 Constructor |
30 """ |
31 """ |
31 super(HelpInterfacePage, self).__init__() |
32 super(HelpInterfacePage, self).__init__() |
32 self.setupUi(self) |
33 self.setupUi(self) |
33 self.setObjectName("InterfacePage") |
34 self.setObjectName("InterfacePage") |
|
35 |
|
36 self.styleSheetButton.setIcon(UI.PixmapCache.getIcon("open.png")) |
34 |
37 |
35 self.styleSheetCompleter = E5FileCompleter(self.styleSheetEdit) |
38 self.styleSheetCompleter = E5FileCompleter(self.styleSheetEdit) |
36 |
39 |
37 # set initial values |
40 # set initial values |
38 self.__populateStyleCombo() |
41 self.__populateStyleCombo() |
54 """ |
57 """ |
55 Private method to populate the style combo box. |
58 Private method to populate the style combo box. |
56 """ |
59 """ |
57 curStyle = Preferences.getUI("Style") |
60 curStyle = Preferences.getUI("Style") |
58 styles = sorted(list(QStyleFactory.keys())) |
61 styles = sorted(list(QStyleFactory.keys())) |
59 self.styleComboBox.addItem(self.trUtf8('System'), "System") |
62 self.styleComboBox.addItem(self.tr('System'), "System") |
60 for style in styles: |
63 for style in styles: |
61 self.styleComboBox.addItem(style, style) |
64 self.styleComboBox.addItem(style, style) |
62 currentIndex = self.styleComboBox.findData(curStyle) |
65 currentIndex = self.styleComboBox.findData(curStyle) |
63 if currentIndex == -1: |
66 if currentIndex == -1: |
64 currentIndex = 0 |
67 currentIndex = 0 |
69 """ |
72 """ |
70 Private method to select the style sheet file via a dialog. |
73 Private method to select the style sheet file via a dialog. |
71 """ |
74 """ |
72 file = E5FileDialog.getOpenFileName( |
75 file = E5FileDialog.getOpenFileName( |
73 self, |
76 self, |
74 self.trUtf8("Select style sheet file"), |
77 self.tr("Select style sheet file"), |
75 self.styleSheetEdit.text(), |
78 self.styleSheetEdit.text(), |
76 self.trUtf8( |
79 self.tr( |
77 "Qt Style Sheets (*.qss);;Cascading Style Sheets (*.css);;" |
80 "Qt Style Sheets (*.qss);;Cascading Style Sheets (*.css);;" |
78 "All files (*)")) |
81 "All files (*)")) |
79 |
82 |
80 if file: |
83 if file: |
81 self.styleSheetEdit.setText(Utilities.toNativeSeparators(file)) |
84 self.styleSheetEdit.setText(Utilities.toNativeSeparators(file)) |