src/eric7/Preferences/ConfigurationPages/TrayStarterPage.py

branch
eric7
changeset 9221
bf71ee032bb4
parent 9209
b99e7fd55fd3
child 9413
80c06d472826
equal deleted inserted replaced
9220:e9e7eca7efee 9221:bf71ee032bb4
18 18
19 class TrayStarterPage(ConfigurationPageBase, Ui_TrayStarterPage): 19 class TrayStarterPage(ConfigurationPageBase, Ui_TrayStarterPage):
20 """ 20 """
21 Class implementing the tray starter configuration page. 21 Class implementing the tray starter configuration page.
22 """ 22 """
23
23 def __init__(self): 24 def __init__(self):
24 """ 25 """
25 Constructor 26 Constructor
26 """ 27 """
27 super().__init__() 28 super().__init__()
28 self.setupUi(self) 29 self.setupUi(self)
29 self.setObjectName("TrayStarterPage") 30 self.setObjectName("TrayStarterPage")
30 31
31 self.standardButton.setIcon(UI.PixmapCache.getIcon("erict")) 32 self.standardButton.setIcon(UI.PixmapCache.getIcon("erict"))
32 self.highContrastButton.setIcon(UI.PixmapCache.getIcon("erict-hc")) 33 self.highContrastButton.setIcon(UI.PixmapCache.getIcon("erict-hc"))
33 self.blackWhiteButton.setIcon(UI.PixmapCache.getIcon("erict-bw")) 34 self.blackWhiteButton.setIcon(UI.PixmapCache.getIcon("erict-bw"))
34 self.blackWhiteInverseButton.setIcon( 35 self.blackWhiteInverseButton.setIcon(UI.PixmapCache.getIcon("erict-bwi"))
35 UI.PixmapCache.getIcon("erict-bwi")) 36
36
37 # set initial values 37 # set initial values
38 iconName = os.path.splitext( 38 iconName = os.path.splitext(Preferences.getTrayStarter("TrayStarterIcon"))[0]
39 Preferences.getTrayStarter("TrayStarterIcon"))[0]
40 if iconName == "erict": 39 if iconName == "erict":
41 self.standardButton.setChecked(True) 40 self.standardButton.setChecked(True)
42 elif iconName == "erict-hc": 41 elif iconName == "erict-hc":
43 self.highContrastButton.setChecked(True) 42 self.highContrastButton.setChecked(True)
44 elif iconName == "erict-bw": 43 elif iconName == "erict-bw":
45 self.blackWhiteButton.setChecked(True) 44 self.blackWhiteButton.setChecked(True)
46 elif iconName == "erict-bwi": 45 elif iconName == "erict-bwi":
47 self.blackWhiteInverseButton.setChecked(True) 46 self.blackWhiteInverseButton.setChecked(True)
48 47
49 def save(self): 48 def save(self):
50 """ 49 """
51 Public slot to save the Python configuration. 50 Public slot to save the Python configuration.
52 """ 51 """
53 if self.standardButton.isChecked(): 52 if self.standardButton.isChecked():
57 elif self.blackWhiteButton.isChecked(): 56 elif self.blackWhiteButton.isChecked():
58 iconName = "erict-bw" 57 iconName = "erict-bw"
59 elif self.blackWhiteInverseButton.isChecked(): 58 elif self.blackWhiteInverseButton.isChecked():
60 iconName = "erict-bwi" 59 iconName = "erict-bwi"
61 Preferences.setTrayStarter("TrayStarterIcon", iconName) 60 Preferences.setTrayStarter("TrayStarterIcon", iconName)
62 61
63 62
64 def create(dlg): 63 def create(dlg):
65 """ 64 """
66 Module function to create the configuration page. 65 Module function to create the configuration page.
67 66
68 @param dlg reference to the configuration dialog 67 @param dlg reference to the configuration dialog
69 @return reference to the instantiated page (ConfigurationPageBase) 68 @return reference to the instantiated page (ConfigurationPageBase)
70 """ 69 """
71 page = TrayStarterPage() 70 page = TrayStarterPage()
72 return page 71 return page

eric ide

mercurial