Preferences/ConfigurationPages/EditorGeneralPage.py

changeset 945
8cd4d08fa9f6
parent 791
9ec2ac20e54e
child 1131
7781e396c903
equal deleted inserted replaced
944:1b59c4ba121e 945:8cd4d08fa9f6
9 9
10 from .ConfigurationPageBase import ConfigurationPageBase 10 from .ConfigurationPageBase import ConfigurationPageBase
11 from .Ui_EditorGeneralPage import Ui_EditorGeneralPage 11 from .Ui_EditorGeneralPage import Ui_EditorGeneralPage
12 12
13 import Preferences 13 import Preferences
14
14 15
15 class EditorGeneralPage(ConfigurationPageBase, Ui_EditorGeneralPage): 16 class EditorGeneralPage(ConfigurationPageBase, Ui_EditorGeneralPage):
16 """ 17 """
17 Class implementing the Editor General configuration page. 18 Class implementing the Editor General configuration page.
18 """ 19 """
44 45
45 def save(self): 46 def save(self):
46 """ 47 """
47 Public slot to save the Editor General configuration. 48 Public slot to save the Editor General configuration.
48 """ 49 """
49 Preferences.setEditor("TabWidth", 50 Preferences.setEditor("TabWidth",
50 self.tabwidthSlider.value()) 51 self.tabwidthSlider.value())
51 Preferences.setEditor("IndentWidth", 52 Preferences.setEditor("IndentWidth",
52 self.indentwidthSlider.value()) 53 self.indentwidthSlider.value())
53 Preferences.setEditor("IndentationGuides", 54 Preferences.setEditor("IndentationGuides",
54 self.indentguidesCheckBox.isChecked()) 55 self.indentguidesCheckBox.isChecked())
55 Preferences.setEditor("TabForIndentation", 56 Preferences.setEditor("TabForIndentation",
56 self.tabforindentationCheckBox.isChecked()) 57 self.tabforindentationCheckBox.isChecked())
57 Preferences.setEditor("TabIndents", 58 Preferences.setEditor("TabIndents",
58 self.tabindentsCheckBox.isChecked()) 59 self.tabindentsCheckBox.isChecked())
59 Preferences.setEditor("ConvertTabsOnLoad", 60 Preferences.setEditor("ConvertTabsOnLoad",
60 self.converttabsCheckBox.isChecked()) 61 self.converttabsCheckBox.isChecked())
61 Preferences.setEditor("AutoIndentation", 62 Preferences.setEditor("AutoIndentation",
62 self.autoindentCheckBox.isChecked()) 63 self.autoindentCheckBox.isChecked())
63 Preferences.setEditor("CommentColumn0", 64 Preferences.setEditor("CommentColumn0",
64 self.comment0CheckBox.isChecked()) 65 self.comment0CheckBox.isChecked())
65 66
66 def on_tabforindentationCheckBox_toggled(self, checked): 67 def on_tabforindentationCheckBox_toggled(self, checked):
67 """ 68 """
68 Private slot used to set the tab conversion check box. 69 Private slot used to set the tab conversion check box.
71 """ 72 """
72 if checked and self.converttabsCheckBox.isChecked(): 73 if checked and self.converttabsCheckBox.isChecked():
73 self.converttabsCheckBox.setChecked(not checked) 74 self.converttabsCheckBox.setChecked(not checked)
74 self.converttabsCheckBox.setEnabled(not checked) 75 self.converttabsCheckBox.setEnabled(not checked)
75 76
77
76 def create(dlg): 78 def create(dlg):
77 """ 79 """
78 Module function to create the configuration page. 80 Module function to create the configuration page.
79 81
80 @param dlg reference to the configuration dialog 82 @param dlg reference to the configuration dialog

eric ide

mercurial