Preferences/ConfigurationPages/TemplatesPage.py

changeset 3492
ae74a7201759
parent 3160
209a07d7e401
child 3515
1b8381afe38f
equal deleted inserted replaced
3490:b3d64a5d3100 3492:ae74a7201759
4 # 4 #
5 5
6 """ 6 """
7 Module implementing the Templates configuration page. 7 Module implementing the Templates configuration page.
8 """ 8 """
9
10 from PyQt4.QtCore import pyqtSlot
9 11
10 from .ConfigurationPageBase import ConfigurationPageBase 12 from .ConfigurationPageBase import ConfigurationPageBase
11 from .Ui_TemplatesPage import Ui_TemplatesPage 13 from .Ui_TemplatesPage import Ui_TemplatesPage
12 14
13 import Preferences 15 import Preferences
34 self.templatesSingleDialogButton.setChecked(True) 36 self.templatesSingleDialogButton.setChecked(True)
35 else: 37 else:
36 self.templatesMultiDialogButton.setChecked(True) 38 self.templatesMultiDialogButton.setChecked(True)
37 self.templatesToolTipCheckBox.setChecked( 39 self.templatesToolTipCheckBox.setChecked(
38 Preferences.getTemplates("ShowTooltip")) 40 Preferences.getTemplates("ShowTooltip"))
41 self.editorFont = Preferences.getTemplates("EditorFont")
42 self.editorFontSample.setFont(self.editorFont)
39 43
40 def save(self): 44 def save(self):
41 """ 45 """
42 Public slot to save the Templates configuration. 46 Public slot to save the Templates configuration.
43 """ 47 """
51 "SingleDialog", 55 "SingleDialog",
52 self.templatesSingleDialogButton.isChecked()) 56 self.templatesSingleDialogButton.isChecked())
53 Preferences.setTemplates( 57 Preferences.setTemplates(
54 "ShowTooltip", 58 "ShowTooltip",
55 self.templatesToolTipCheckBox.isChecked()) 59 self.templatesToolTipCheckBox.isChecked())
60 Preferences.setTemplates("EditorFont", self.editorFont)
61
62 @pyqtSlot()
63 def on_editorFontButton_clicked(self):
64 """
65 Private method used to select the font to be used by the code editor.
66 """
67 self.editorFont = self.selectFont(
68 self.editorFontSample, self.editorFont)
56 69
57 70
58 def create(dlg): 71 def create(dlg):
59 """ 72 """
60 Module function to create the configuration page. 73 Module function to create the configuration page.

eric ide

mercurial