diff options
Diffstat (limited to 'SoftwareProperties')
| -rw-r--r-- | SoftwareProperties/SoftwareProperties.py | 25 |
1 files changed, 20 insertions, 5 deletions
diff --git a/SoftwareProperties/SoftwareProperties.py b/SoftwareProperties/SoftwareProperties.py index 6b992df7..edcd407d 100644 --- a/SoftwareProperties/SoftwareProperties.py +++ b/SoftwareProperties/SoftwareProperties.py @@ -86,14 +86,27 @@ class SoftwareProperties(SimpleGladeApp): self.combobox_interval_mapping = { 0 : 1, 1 : 2, 2 : 7, - 3 : 14, - 4 : -1} + 3 : 14 } self.combobox_update_interval.set_active(0) + update_days = apt_pkg.Config.FindI(CONF_MAP["autoupdate"]) + + self.combobox_update_interval.append_text("Daily") + self.combobox_update_interval.append_text("Every Two Days") + self.combobox_update_interval.append_text("Weekly") + self.combobox_update_interval.append_text("Every Two Weeks") + + # If a custom period is defined add an corresponding entry + if not update_days in self.combobox_interval_mapping.values(): + self.combobox_update_interval.append_text(_("Every %s Days" + % update_days)) + self.combobox_interval_mapping[4] = update_days + for key in self.combobox_interval_mapping: if self.combobox_interval_mapping[key] == update_days: self.combobox_update_interval.set_active(key) break + if update_days >= 1: self.checkbutton_auto_update.set_active(True) self.combobox_update_interval.set_sensitive(True) @@ -156,8 +169,10 @@ class SoftwareProperties(SimpleGladeApp): def on_combobox_update_interval_changed(self, widget): i = self.combobox_update_interval.get_active() value = self.combobox_interval_mapping[i] - apt_pkg.Config.Set(CONF_MAP["autoupdate"], str(value)) - self.write_config() + # Only wirte the key if it has changed + if not value == apt_pkg.Config.FindI(CONF_MAP["autoupdate"]): + apt_pkg.Config.Set(CONF_MAP["autoupdate"], str(value)) + self.write_config() def opt_autoupdate_toggled(self, widget): if self.checkbutton_auto_update.get_active(): @@ -234,7 +249,7 @@ class SoftwareProperties(SimpleGladeApp): self.modified = True def add_key_clicked(self, widget): - chooser = gtk.FileChooserDialog(title=_("Choose a key-file"), + chooser = gtk.FileChooserDialog(title=_("Import key"), parent=self.window_main, buttons=(gtk.STOCK_CANCEL, gtk.RESPONSE_REJECT, |
