Mon, 26 Dec 2011 19:32:02 +0100
Updated copyright for 2012.
701
fc587a1c2f8b
Added an option to configure the icon of the tray starter application.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1 | # -*- coding: utf-8 -*- |
fc587a1c2f8b
Added an option to configure the icon of the tray starter application.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
2 | |
1510
e75ecf2bd9dd
Updated copyright for 2012.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
791
diff
changeset
|
3 | # Copyright (c) 2010 - 2012 Detlev Offenbach <detlev@die-offenbachs.de> |
701
fc587a1c2f8b
Added an option to configure the icon of the tray starter application.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
4 | # |
fc587a1c2f8b
Added an option to configure the icon of the tray starter application.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
5 | |
fc587a1c2f8b
Added an option to configure the icon of the tray starter application.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
6 | """ |
fc587a1c2f8b
Added an option to configure the icon of the tray starter application.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
7 | Module implementing the tray starter configuration page. |
fc587a1c2f8b
Added an option to configure the icon of the tray starter application.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
8 | """ |
fc587a1c2f8b
Added an option to configure the icon of the tray starter application.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
9 | |
fc587a1c2f8b
Added an option to configure the icon of the tray starter application.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
10 | from .ConfigurationPageBase import ConfigurationPageBase |
fc587a1c2f8b
Added an option to configure the icon of the tray starter application.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
11 | from .Ui_TrayStarterPage import Ui_TrayStarterPage |
fc587a1c2f8b
Added an option to configure the icon of the tray starter application.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
12 | |
fc587a1c2f8b
Added an option to configure the icon of the tray starter application.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
13 | import Preferences |
fc587a1c2f8b
Added an option to configure the icon of the tray starter application.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
14 | import UI.PixmapCache |
fc587a1c2f8b
Added an option to configure the icon of the tray starter application.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
15 | |
fc587a1c2f8b
Added an option to configure the icon of the tray starter application.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
16 | class TrayStarterPage(ConfigurationPageBase, Ui_TrayStarterPage): |
fc587a1c2f8b
Added an option to configure the icon of the tray starter application.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
17 | """ |
fc587a1c2f8b
Added an option to configure the icon of the tray starter application.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
18 | Class implementing the tray starter configuration page. |
fc587a1c2f8b
Added an option to configure the icon of the tray starter application.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
19 | """ |
fc587a1c2f8b
Added an option to configure the icon of the tray starter application.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
20 | def __init__(self, parent = None): |
fc587a1c2f8b
Added an option to configure the icon of the tray starter application.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
21 | """ |
fc587a1c2f8b
Added an option to configure the icon of the tray starter application.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
22 | Constructor |
fc587a1c2f8b
Added an option to configure the icon of the tray starter application.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
23 | |
fc587a1c2f8b
Added an option to configure the icon of the tray starter application.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
24 | @param parent reference to the parent widget (QWidget) |
fc587a1c2f8b
Added an option to configure the icon of the tray starter application.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
25 | """ |
fc587a1c2f8b
Added an option to configure the icon of the tray starter application.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
26 | ConfigurationPageBase.__init__(self) |
fc587a1c2f8b
Added an option to configure the icon of the tray starter application.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
27 | self.setupUi(self) |
fc587a1c2f8b
Added an option to configure the icon of the tray starter application.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
28 | self.setObjectName("Py3FlakesPage") |
fc587a1c2f8b
Added an option to configure the icon of the tray starter application.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
29 | |
fc587a1c2f8b
Added an option to configure the icon of the tray starter application.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
30 | self.standardButton.setIcon(UI.PixmapCache.getIcon("erict.png")) |
fc587a1c2f8b
Added an option to configure the icon of the tray starter application.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
31 | self.highContrastButton.setIcon(UI.PixmapCache.getIcon("erict-hc.png")) |
fc587a1c2f8b
Added an option to configure the icon of the tray starter application.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
32 | self.blackWhiteButton.setIcon(UI.PixmapCache.getIcon("erict-bw.png")) |
fc587a1c2f8b
Added an option to configure the icon of the tray starter application.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
33 | self.blackWhiteInverseButton.setIcon(UI.PixmapCache.getIcon("erict-bwi.png")) |
fc587a1c2f8b
Added an option to configure the icon of the tray starter application.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
34 | |
fc587a1c2f8b
Added an option to configure the icon of the tray starter application.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
35 | # set initial values |
fc587a1c2f8b
Added an option to configure the icon of the tray starter application.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
36 | iconName = Preferences.getTrayStarter("TrayStarterIcon") |
fc587a1c2f8b
Added an option to configure the icon of the tray starter application.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
37 | if iconName == "erict.png": |
fc587a1c2f8b
Added an option to configure the icon of the tray starter application.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
38 | self.standardButton.setChecked(True) |
fc587a1c2f8b
Added an option to configure the icon of the tray starter application.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
39 | elif iconName == "erict-hc.png": |
fc587a1c2f8b
Added an option to configure the icon of the tray starter application.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
40 | self.highContrastButton.setChecked(True) |
fc587a1c2f8b
Added an option to configure the icon of the tray starter application.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
41 | elif iconName == "erict-bw.png": |
fc587a1c2f8b
Added an option to configure the icon of the tray starter application.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
42 | self.blackWhiteButton.setChecked(True) |
fc587a1c2f8b
Added an option to configure the icon of the tray starter application.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
43 | elif iconName == "erict-bwi.png": |
fc587a1c2f8b
Added an option to configure the icon of the tray starter application.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
44 | self.blackWhiteInverseButton.setChecked(True) |
fc587a1c2f8b
Added an option to configure the icon of the tray starter application.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
45 | |
fc587a1c2f8b
Added an option to configure the icon of the tray starter application.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
46 | def save(self): |
fc587a1c2f8b
Added an option to configure the icon of the tray starter application.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
47 | """ |
fc587a1c2f8b
Added an option to configure the icon of the tray starter application.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
48 | Public slot to save the Python configuration. |
fc587a1c2f8b
Added an option to configure the icon of the tray starter application.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
49 | """ |
fc587a1c2f8b
Added an option to configure the icon of the tray starter application.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
50 | if self.standardButton.isChecked(): |
fc587a1c2f8b
Added an option to configure the icon of the tray starter application.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
51 | iconName = "erict.png" |
fc587a1c2f8b
Added an option to configure the icon of the tray starter application.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
52 | elif self.highContrastButton.isChecked(): |
fc587a1c2f8b
Added an option to configure the icon of the tray starter application.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
53 | iconName = "erict-hc.png" |
fc587a1c2f8b
Added an option to configure the icon of the tray starter application.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
54 | elif self.blackWhiteButton.isChecked(): |
fc587a1c2f8b
Added an option to configure the icon of the tray starter application.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
55 | iconName = "erict-bw.png" |
fc587a1c2f8b
Added an option to configure the icon of the tray starter application.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
56 | elif self.blackWhiteInverseButton.isChecked(): |
fc587a1c2f8b
Added an option to configure the icon of the tray starter application.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
57 | iconName = "erict-bwi.png" |
fc587a1c2f8b
Added an option to configure the icon of the tray starter application.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
58 | Preferences.setTrayStarter("TrayStarterIcon", iconName) |
fc587a1c2f8b
Added an option to configure the icon of the tray starter application.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
59 | |
fc587a1c2f8b
Added an option to configure the icon of the tray starter application.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
60 | def create(dlg): |
fc587a1c2f8b
Added an option to configure the icon of the tray starter application.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
61 | """ |
fc587a1c2f8b
Added an option to configure the icon of the tray starter application.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
62 | Module function to create the configuration page. |
fc587a1c2f8b
Added an option to configure the icon of the tray starter application.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
63 | |
fc587a1c2f8b
Added an option to configure the icon of the tray starter application.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
64 | @param dlg reference to the configuration dialog |
fc587a1c2f8b
Added an option to configure the icon of the tray starter application.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
65 | """ |
fc587a1c2f8b
Added an option to configure the icon of the tray starter application.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
66 | page = TrayStarterPage() |
fc587a1c2f8b
Added an option to configure the icon of the tray starter application.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
67 | return page |