Preferences/ConfigurationPages/EditorGeneralPage.py

changeset 2659
7f46c5a7ed73
parent 2302
f29e9405c851
child 2677
3d4277929fb3
child 2964
84b65fb9e780
equal deleted inserted replaced
2658:ec17f5d559e9 2659:7f46c5a7ed73
4 # 4 #
5 5
6 """ 6 """
7 Module implementing the Editor General configuration page. 7 Module implementing the Editor General configuration page.
8 """ 8 """
9
10 from PyQt4.Qsci import QsciScintillaBase
9 11
10 from .ConfigurationPageBase import ConfigurationPageBase 12 from .ConfigurationPageBase import ConfigurationPageBase
11 from .Ui_EditorGeneralPage import Ui_EditorGeneralPage 13 from .Ui_EditorGeneralPage import Ui_EditorGeneralPage
12 14
13 import Preferences 15 import Preferences
41 self.autoindentCheckBox.setChecked( 43 self.autoindentCheckBox.setChecked(
42 Preferences.getEditor("AutoIndentation")) 44 Preferences.getEditor("AutoIndentation"))
43 self.comment0CheckBox.setChecked( 45 self.comment0CheckBox.setChecked(
44 Preferences.getEditor("CommentColumn0")) 46 Preferences.getEditor("CommentColumn0"))
45 47
48 virtualSpaceOptions = Preferences.getEditor("VirtualSpaceOptions")
49 self.vsSelectionCheckBox.setChecked(
50 virtualSpaceOptions & QsciScintillaBase.SCVS_RECTANGULARSELECTION)
51 self.vsUserCheckBox.setChecked(
52 virtualSpaceOptions & QsciScintillaBase.SCVS_USERACCESSIBLE)
53
46 def save(self): 54 def save(self):
47 """ 55 """
48 Public slot to save the Editor General configuration. 56 Public slot to save the Editor General configuration.
49 """ 57 """
50 Preferences.setEditor("TabWidth", 58 Preferences.setEditor("TabWidth",
62 Preferences.setEditor("AutoIndentation", 70 Preferences.setEditor("AutoIndentation",
63 self.autoindentCheckBox.isChecked()) 71 self.autoindentCheckBox.isChecked())
64 Preferences.setEditor("CommentColumn0", 72 Preferences.setEditor("CommentColumn0",
65 self.comment0CheckBox.isChecked()) 73 self.comment0CheckBox.isChecked())
66 74
75 virtualSpaceOptions = QsciScintillaBase.SCVS_NONE
76 if self.vsSelectionCheckBox.isChecked():
77 virtualSpaceOptions |= QsciScintillaBase.SCVS_RECTANGULARSELECTION
78 if self.vsUserCheckBox.isChecked():
79 virtualSpaceOptions |= QsciScintillaBase.SCVS_USERACCESSIBLE
80 Preferences.setEditor("VirtualSpaceOptions", virtualSpaceOptions)
81
67 def on_tabforindentationCheckBox_toggled(self, checked): 82 def on_tabforindentationCheckBox_toggled(self, checked):
68 """ 83 """
69 Private slot used to set the tab conversion check box. 84 Private slot used to set the tab conversion check box.
70 85
71 @param checked flag received from the signal (boolean) 86 @param checked flag received from the signal (boolean)

eric ide

mercurial