20 try: |
20 try: |
21 MonospacedFontsOption = QFontDialog.MonospacedFonts |
21 MonospacedFontsOption = QFontDialog.MonospacedFonts |
22 except AttributeError: |
22 except AttributeError: |
23 MonospacedFontsOption = QFontDialog.FontDialogOptions(0x10) |
23 MonospacedFontsOption = QFontDialog.FontDialogOptions(0x10) |
24 |
24 |
|
25 from QScintilla.Shell import ShellHistoryStyle |
|
26 |
25 |
27 |
26 class ShellPage(ConfigurationPageBase, Ui_ShellPage): |
28 class ShellPage(ConfigurationPageBase, Ui_ShellPage): |
27 """ |
29 """ |
28 Class implementing the Shell configuration page. |
30 Class implementing the Shell configuration page. |
29 """ |
31 """ |
32 Constructor |
34 Constructor |
33 """ |
35 """ |
34 super(ShellPage, self).__init__() |
36 super(ShellPage, self).__init__() |
35 self.setupUi(self) |
37 self.setupUi(self) |
36 self.setObjectName("ShellPage") |
38 self.setObjectName("ShellPage") |
|
39 |
|
40 self.shellHistoryStyleComboBox.addItem( |
|
41 self.tr("Disabled"), ShellHistoryStyle.Disabled) |
|
42 self.shellHistoryStyleComboBox.addItem( |
|
43 self.tr("Linux Style"), ShellHistoryStyle.LinuxStyle) |
|
44 self.shellHistoryStyleComboBox.addItem( |
|
45 self.tr("Windows Style"), ShellHistoryStyle.WindowsStyle) |
37 |
46 |
38 # set initial values |
47 # set initial values |
39 self.shellLinenoCheckBox.setChecked( |
48 self.shellLinenoCheckBox.setChecked( |
40 Preferences.getShell("LinenoMargin")) |
49 Preferences.getShell("LinenoMargin")) |
41 self.shellWordWrapCheckBox.setChecked( |
50 self.shellWordWrapCheckBox.setChecked( |
46 Preferences.getShell("CallTipsEnabled")) |
55 Preferences.getShell("CallTipsEnabled")) |
47 self.shellSyntaxHighlightingCheckBox.setChecked( |
56 self.shellSyntaxHighlightingCheckBox.setChecked( |
48 Preferences.getShell("SyntaxHighlightingEnabled")) |
57 Preferences.getShell("SyntaxHighlightingEnabled")) |
49 self.shellHistorySpinBox.setValue( |
58 self.shellHistorySpinBox.setValue( |
50 Preferences.getShell("MaxHistoryEntries")) |
59 Preferences.getShell("MaxHistoryEntries")) |
|
60 index = self.shellHistoryStyleComboBox.findData( |
|
61 Preferences.getShell("HistoryStyle")) |
|
62 self.shellHistoryStyleComboBox.setCurrentIndex(index) |
51 self.stdOutErrCheckBox.setChecked( |
63 self.stdOutErrCheckBox.setChecked( |
52 Preferences.getShell("ShowStdOutErr")) |
64 Preferences.getShell("ShowStdOutErr")) |
53 |
65 |
54 self.monospacedFont = Preferences.getShell("MonospacedFont") |
66 self.monospacedFont = Preferences.getShell("MonospacedFont") |
55 self.monospacedFontSample.setFont(self.monospacedFont) |
67 self.monospacedFontSample.setFont(self.monospacedFont) |
78 "SyntaxHighlightingEnabled", |
90 "SyntaxHighlightingEnabled", |
79 self.shellSyntaxHighlightingCheckBox.isChecked()) |
91 self.shellSyntaxHighlightingCheckBox.isChecked()) |
80 Preferences.setShell( |
92 Preferences.setShell( |
81 "MaxHistoryEntries", |
93 "MaxHistoryEntries", |
82 self.shellHistorySpinBox.value()) |
94 self.shellHistorySpinBox.value()) |
|
95 Preferences.setShell( |
|
96 "HistoryStyle", |
|
97 self.shellHistoryStyleComboBox.currentData()) |
83 Preferences.setShell( |
98 Preferences.setShell( |
84 "ShowStdOutErr", |
99 "ShowStdOutErr", |
85 self.stdOutErrCheckBox.isChecked()) |
100 self.stdOutErrCheckBox.isChecked()) |
86 |
101 |
87 Preferences.setShell("MonospacedFont", self.monospacedFont) |
102 Preferences.setShell("MonospacedFont", self.monospacedFont) |