Preferences/ConfigurationPages/GraphicsPage.py

changeset 0
de9c2efb9d02
child 12
1d8dd9706f46
equal deleted inserted replaced
-1:000000000000 0:de9c2efb9d02
1 # -*- coding: utf-8 -*-
2
3 # Copyright (c) 2006 - 2009 Detlev Offenbach <detlev@die-offenbachs.de>
4 #
5
6 """
7 Module implementing the Printer configuration page.
8 """
9
10 from PyQt4.QtCore import pyqtSlot
11
12 from ConfigurationPageBase import ConfigurationPageBase
13 from Ui_GraphicsPage import Ui_GraphicsPage
14
15 import Preferences
16
17 class GraphicsPage(ConfigurationPageBase, Ui_GraphicsPage):
18 """
19 Class implementing the Printer configuration page.
20 """
21 def __init__(self):
22 """
23 Constructor
24 """
25 ConfigurationPageBase.__init__(self)
26 self.setupUi(self)
27 self.setObjectName("GraphicsPage")
28
29 # set initial values
30 self.graphicsFont = Preferences.getGraphics("Font")
31 self.graphicsFontSample.setFont(self.graphicsFont)
32
33 def save(self):
34 """
35 Public slot to save the Printer configuration.
36 """
37 Preferences.setGraphics("Font", self.graphicsFont)
38
39 @pyqtSlot()
40 def on_graphicsFontButton_clicked(self):
41 """
42 Private method used to select the font for the graphics items.
43 """
44 self.graphicsFont = self.selectFont(self.graphicsFontSample, self.graphicsFont)
45
46 def polishPage(self):
47 """
48 Public slot to perform some polishing actions.
49 """
50 self.graphicsFontSample.setFont(self.graphicsFont)
51
52 def create(dlg):
53 """
54 Module function to create the configuration page.
55
56 @param dlg reference to the configuration dialog
57 """
58 page = GraphicsPage()
59 return page

eric ide

mercurial