Preferences/ConfigurationPages/PluginManagerPage.py

branch
Py2 comp.
changeset 3142
55030c09e142
parent 3058
0a02c433f52d
parent 3113
2780e230f129
child 3145
a9de05d4a22f
--- a/Preferences/ConfigurationPages/PluginManagerPage.py	Fri Dec 13 22:45:47 2013 +0100
+++ b/Preferences/ConfigurationPages/PluginManagerPage.py	Fri Dec 13 23:39:14 2013 +0100
@@ -43,6 +43,22 @@
         self.downloadDirEdit.setText(
             Preferences.getPluginManager("DownloadPath"))
         
+        period = Preferences.getPluginManager("UpdatesCheckInterval")
+        if period == 0:
+            self.noCheckRadioButton.setChecked(True)
+        elif period == 1:
+            self.dailyCheckRadioButton.setChecked(True)
+        elif period == 2:
+            self.weeklyCheckRadioButton.setChecked(True)
+        elif period == 3:
+            self.monthlyCheckRadioButton.setChecked(True)
+        
+        self.downloadedOnlyCheckBox.setChecked(
+            Preferences.getPluginManager("CheckInstalledOnly"))
+        
+        self.__repositoryUrl = Preferences.getUI("PluginRepositoryUrl5")
+        self.repositoryUrlEdit.setText(self.__repositoryUrl)
+    
     def save(self):
         """
         Public slot to save the Viewmanager configuration.
@@ -53,6 +69,24 @@
         Preferences.setPluginManager(
             "DownloadPath",
             self.downloadDirEdit.text())
+        
+        if self.noCheckRadioButton.isChecked():
+            period = 0
+        elif self.dailyCheckRadioButton.isChecked():
+            period = 1
+        elif self.weeklyCheckRadioButton.isChecked():
+            period = 2
+        elif self.monthlyCheckRadioButton.isChecked():
+            period = 3
+        Preferences.setPluginManager("UpdatesCheckInterval", period)
+        
+        Preferences.setPluginManager(
+            "CheckInstalledOnly",
+            self.downloadedOnlyCheckBox.isChecked())
+        
+        if self.repositoryUrlEdit.text() != self.__repositoryUrl:
+            Preferences.setUI(
+                "PluginRepositoryUrl5", self.repositoryUrlEdit.text())
     
     @pyqtSlot()
     def on_downloadDirButton_clicked(self):
@@ -71,6 +105,16 @@
                 dn = dn[:-1]
             self.downloadDirEdit.setText(dn)
     
+    @pyqtSlot(bool)
+    def on_repositoryUrlEditButton_toggled(self, checked):
+        """
+        Private slot to set the read only status of the repository URL line
+        edit.
+        
+        @param checked state of the push button (boolean)
+        """
+        self.repositoryUrlEdit.setReadOnly(not checked)
+    
 
 def create(dlg):
     """

eric ide

mercurial