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