Preferences/ConfigurationPages/TemplatesPage.py

branch
Py2 comp.
changeset 3515
1b8381afe38f
parent 3178
f25fc1364c88
parent 3492
ae74a7201759
child 3656
441956d8fce5
equal deleted inserted replaced
3506:d85fadb263a0 3515:1b8381afe38f
6 """ 6 """
7 Module implementing the Templates configuration page. 7 Module implementing the Templates configuration page.
8 """ 8 """
9 9
10 from __future__ import unicode_literals 10 from __future__ import unicode_literals
11
12 from PyQt4.QtCore import pyqtSlot
11 13
12 from .ConfigurationPageBase import ConfigurationPageBase 14 from .ConfigurationPageBase import ConfigurationPageBase
13 from .Ui_TemplatesPage import Ui_TemplatesPage 15 from .Ui_TemplatesPage import Ui_TemplatesPage
14 16
15 import Preferences 17 import Preferences
36 self.templatesSingleDialogButton.setChecked(True) 38 self.templatesSingleDialogButton.setChecked(True)
37 else: 39 else:
38 self.templatesMultiDialogButton.setChecked(True) 40 self.templatesMultiDialogButton.setChecked(True)
39 self.templatesToolTipCheckBox.setChecked( 41 self.templatesToolTipCheckBox.setChecked(
40 Preferences.getTemplates("ShowTooltip")) 42 Preferences.getTemplates("ShowTooltip"))
43 self.editorFont = Preferences.getTemplates("EditorFont")
44 self.editorFontSample.setFont(self.editorFont)
41 45
42 def save(self): 46 def save(self):
43 """ 47 """
44 Public slot to save the Templates configuration. 48 Public slot to save the Templates configuration.
45 """ 49 """
53 "SingleDialog", 57 "SingleDialog",
54 self.templatesSingleDialogButton.isChecked()) 58 self.templatesSingleDialogButton.isChecked())
55 Preferences.setTemplates( 59 Preferences.setTemplates(
56 "ShowTooltip", 60 "ShowTooltip",
57 self.templatesToolTipCheckBox.isChecked()) 61 self.templatesToolTipCheckBox.isChecked())
62 Preferences.setTemplates("EditorFont", self.editorFont)
63
64 @pyqtSlot()
65 def on_editorFontButton_clicked(self):
66 """
67 Private method used to select the font to be used by the code editor.
68 """
69 self.editorFont = self.selectFont(
70 self.editorFontSample, self.editorFont)
58 71
59 72
60 def create(dlg): 73 def create(dlg):
61 """ 74 """
62 Module function to create the configuration page. 75 Module function to create the configuration page.

eric ide

mercurial