6 """ |
6 """ |
7 Module implementing the Editor General configuration page. |
7 Module implementing the Editor General configuration page. |
8 """ |
8 """ |
9 |
9 |
10 from __future__ import unicode_literals # __IGNORE_WARNING__ |
10 from __future__ import unicode_literals # __IGNORE_WARNING__ |
|
11 |
|
12 from PyQt4.Qsci import QsciScintillaBase |
11 |
13 |
12 from .ConfigurationPageBase import ConfigurationPageBase |
14 from .ConfigurationPageBase import ConfigurationPageBase |
13 from .Ui_EditorGeneralPage import Ui_EditorGeneralPage |
15 from .Ui_EditorGeneralPage import Ui_EditorGeneralPage |
14 |
16 |
15 import Preferences |
17 import Preferences |
43 self.autoindentCheckBox.setChecked( |
45 self.autoindentCheckBox.setChecked( |
44 Preferences.getEditor("AutoIndentation")) |
46 Preferences.getEditor("AutoIndentation")) |
45 self.comment0CheckBox.setChecked( |
47 self.comment0CheckBox.setChecked( |
46 Preferences.getEditor("CommentColumn0")) |
48 Preferences.getEditor("CommentColumn0")) |
47 |
49 |
|
50 virtualSpaceOptions = Preferences.getEditor("VirtualSpaceOptions") |
|
51 self.vsSelectionCheckBox.setChecked( |
|
52 virtualSpaceOptions & QsciScintillaBase.SCVS_RECTANGULARSELECTION) |
|
53 self.vsUserCheckBox.setChecked( |
|
54 virtualSpaceOptions & QsciScintillaBase.SCVS_USERACCESSIBLE) |
|
55 |
48 def save(self): |
56 def save(self): |
49 """ |
57 """ |
50 Public slot to save the Editor General configuration. |
58 Public slot to save the Editor General configuration. |
51 """ |
59 """ |
52 Preferences.setEditor("TabWidth", |
60 Preferences.setEditor("TabWidth", |
64 Preferences.setEditor("AutoIndentation", |
72 Preferences.setEditor("AutoIndentation", |
65 self.autoindentCheckBox.isChecked()) |
73 self.autoindentCheckBox.isChecked()) |
66 Preferences.setEditor("CommentColumn0", |
74 Preferences.setEditor("CommentColumn0", |
67 self.comment0CheckBox.isChecked()) |
75 self.comment0CheckBox.isChecked()) |
68 |
76 |
|
77 virtualSpaceOptions = QsciScintillaBase.SCVS_NONE |
|
78 if self.vsSelectionCheckBox.isChecked(): |
|
79 virtualSpaceOptions |= QsciScintillaBase.SCVS_RECTANGULARSELECTION |
|
80 if self.vsUserCheckBox.isChecked(): |
|
81 virtualSpaceOptions |= QsciScintillaBase.SCVS_USERACCESSIBLE |
|
82 Preferences.setEditor("VirtualSpaceOptions", virtualSpaceOptions) |
|
83 |
69 def on_tabforindentationCheckBox_toggled(self, checked): |
84 def on_tabforindentationCheckBox_toggled(self, checked): |
70 """ |
85 """ |
71 Private slot used to set the tab conversion check box. |
86 Private slot used to set the tab conversion check box. |
72 |
87 |
73 @param checked flag received from the signal (boolean) |
88 @param checked flag received from the signal (boolean) |