src/eric7/Preferences/ConfigurationPages/PluginManagerPage.py

branch
eric7
changeset 9221
bf71ee032bb4
parent 9209
b99e7fd55fd3
child 9413
80c06d472826
equal deleted inserted replaced
9220:e9e7eca7efee 9221:bf71ee032bb4
19 19
20 class PluginManagerPage(ConfigurationPageBase, Ui_PluginManagerPage): 20 class PluginManagerPage(ConfigurationPageBase, Ui_PluginManagerPage):
21 """ 21 """
22 Class implementing the Plugin Manager configuration page. 22 Class implementing the Plugin Manager configuration page.
23 """ 23 """
24
24 def __init__(self): 25 def __init__(self):
25 """ 26 """
26 Constructor 27 Constructor
27 """ 28 """
28 super().__init__() 29 super().__init__()
29 self.setupUi(self) 30 self.setupUi(self)
30 self.setObjectName("PluginManagerPage") 31 self.setObjectName("PluginManagerPage")
31 32
32 self.downloadDirPicker.setMode(EricPathPickerModes.DIRECTORY_MODE) 33 self.downloadDirPicker.setMode(EricPathPickerModes.DIRECTORY_MODE)
33 34
34 # set initial values 35 # set initial values
35 self.activateExternalPluginsCheckBox.setChecked( 36 self.activateExternalPluginsCheckBox.setChecked(
36 Preferences.getPluginManager("ActivateExternal")) 37 Preferences.getPluginManager("ActivateExternal")
37 self.downloadDirPicker.setText( 38 )
38 Preferences.getPluginManager("DownloadPath")) 39 self.downloadDirPicker.setText(Preferences.getPluginManager("DownloadPath"))
39 self.generationsSpinBox.setValue( 40 self.generationsSpinBox.setValue(
40 Preferences.getPluginManager("KeepGenerations")) 41 Preferences.getPluginManager("KeepGenerations")
41 self.keepHiddenCheckBox.setChecked( 42 )
42 Preferences.getPluginManager("KeepHidden")) 43 self.keepHiddenCheckBox.setChecked(Preferences.getPluginManager("KeepHidden"))
43 self.startupCleanupCheckBox.setChecked( 44 self.startupCleanupCheckBox.setChecked(
44 Preferences.getPluginManager("StartupCleanup")) 45 Preferences.getPluginManager("StartupCleanup")
45 46 )
47
46 period = Preferences.getPluginManager("UpdatesCheckInterval") 48 period = Preferences.getPluginManager("UpdatesCheckInterval")
47 if period == 0: 49 if period == 0:
48 self.noCheckRadioButton.setChecked(True) 50 self.noCheckRadioButton.setChecked(True)
49 elif period == 1: 51 elif period == 1:
50 self.dailyCheckRadioButton.setChecked(True) 52 self.dailyCheckRadioButton.setChecked(True)
55 elif period == 4: 57 elif period == 4:
56 self.alwaysCheckRadioButton.setChecked(True) 58 self.alwaysCheckRadioButton.setChecked(True)
57 else: 59 else:
58 # invalid value, default to daily 60 # invalid value, default to daily
59 self.dailyCheckRadioButton.setChecked(True) 61 self.dailyCheckRadioButton.setChecked(True)
60 62
61 self.downloadedOnlyCheckBox.setChecked( 63 self.downloadedOnlyCheckBox.setChecked(
62 Preferences.getPluginManager("CheckInstalledOnly")) 64 Preferences.getPluginManager("CheckInstalledOnly")
63 65 )
66
64 self.__repositoryUrl = Preferences.getUI("PluginRepositoryUrl7") 67 self.__repositoryUrl = Preferences.getUI("PluginRepositoryUrl7")
65 self.repositoryUrlEdit.setText(self.__repositoryUrl) 68 self.repositoryUrlEdit.setText(self.__repositoryUrl)
66 69
67 self.autoInstallCheckBox.setChecked( 70 self.autoInstallCheckBox.setChecked(
68 Preferences.getPluginManager("AutoInstallDependencies")) 71 Preferences.getPluginManager("AutoInstallDependencies")
69 72 )
73
70 def save(self): 74 def save(self):
71 """ 75 """
72 Public slot to save the Viewmanager configuration. 76 Public slot to save the Viewmanager configuration.
73 """ 77 """
74 Preferences.setPluginManager( 78 Preferences.setPluginManager(
75 "ActivateExternal", 79 "ActivateExternal", self.activateExternalPluginsCheckBox.isChecked()
76 self.activateExternalPluginsCheckBox.isChecked()) 80 )
81 Preferences.setPluginManager("DownloadPath", self.downloadDirPicker.text())
82 Preferences.setPluginManager("KeepGenerations", self.generationsSpinBox.value())
83 Preferences.setPluginManager("KeepHidden", self.keepHiddenCheckBox.isChecked())
77 Preferences.setPluginManager( 84 Preferences.setPluginManager(
78 "DownloadPath", 85 "StartupCleanup", self.startupCleanupCheckBox.isChecked()
79 self.downloadDirPicker.text()) 86 )
80 Preferences.setPluginManager( 87
81 "KeepGenerations",
82 self.generationsSpinBox.value())
83 Preferences.setPluginManager(
84 "KeepHidden",
85 self.keepHiddenCheckBox.isChecked())
86 Preferences.setPluginManager(
87 "StartupCleanup",
88 self.startupCleanupCheckBox.isChecked())
89
90 if self.noCheckRadioButton.isChecked(): 88 if self.noCheckRadioButton.isChecked():
91 period = 0 89 period = 0
92 elif self.dailyCheckRadioButton.isChecked(): 90 elif self.dailyCheckRadioButton.isChecked():
93 period = 1 91 period = 1
94 elif self.weeklyCheckRadioButton.isChecked(): 92 elif self.weeklyCheckRadioButton.isChecked():
96 elif self.monthlyCheckRadioButton.isChecked(): 94 elif self.monthlyCheckRadioButton.isChecked():
97 period = 3 95 period = 3
98 elif self.alwaysCheckRadioButton.isChecked(): 96 elif self.alwaysCheckRadioButton.isChecked():
99 period = 4 97 period = 4
100 Preferences.setPluginManager("UpdatesCheckInterval", period) 98 Preferences.setPluginManager("UpdatesCheckInterval", period)
101 99
102 Preferences.setPluginManager( 100 Preferences.setPluginManager(
103 "CheckInstalledOnly", 101 "CheckInstalledOnly", self.downloadedOnlyCheckBox.isChecked()
104 self.downloadedOnlyCheckBox.isChecked()) 102 )
105 103
106 if self.repositoryUrlEdit.text() != self.__repositoryUrl: 104 if self.repositoryUrlEdit.text() != self.__repositoryUrl:
107 Preferences.setUI( 105 Preferences.setUI("PluginRepositoryUrl7", self.repositoryUrlEdit.text())
108 "PluginRepositoryUrl7", self.repositoryUrlEdit.text()) 106
109
110 Preferences.setPluginManager( 107 Preferences.setPluginManager(
111 "AutoInstallDependencies", 108 "AutoInstallDependencies", self.autoInstallCheckBox.isChecked()
112 self.autoInstallCheckBox.isChecked()) 109 )
113 110
114 @pyqtSlot(bool) 111 @pyqtSlot(bool)
115 def on_repositoryUrlEditButton_toggled(self, checked): 112 def on_repositoryUrlEditButton_toggled(self, checked):
116 """ 113 """
117 Private slot to set the read only status of the repository URL line 114 Private slot to set the read only status of the repository URL line
118 edit. 115 edit.
119 116
120 @param checked state of the push button (boolean) 117 @param checked state of the push button (boolean)
121 """ 118 """
122 self.repositoryUrlEdit.setReadOnly(not checked) 119 self.repositoryUrlEdit.setReadOnly(not checked)
123 120
124 121
125 def create(dlg): 122 def create(dlg):
126 """ 123 """
127 Module function to create the configuration page. 124 Module function to create the configuration page.
128 125
129 @param dlg reference to the configuration dialog 126 @param dlg reference to the configuration dialog
130 @return reference to the instantiated page (ConfigurationPageBase) 127 @return reference to the instantiated page (ConfigurationPageBase)
131 """ 128 """
132 page = PluginManagerPage() 129 page = PluginManagerPage()
133 return page 130 return page

eric ide

mercurial