diff options
| author | Sebastian Heinlein <sebastian.heinlein@web.de> | 2006-01-26 20:17:15 +0100 |
|---|---|---|
| committer | Sebastian Heinlein <sebastian.heinlein@web.de> | 2006-01-26 20:17:15 +0100 |
| commit | 8200e5372634e26fd41cb5d2e128ff4687db5247 (patch) | |
| tree | fbf3a7c57f4ed29ffafaff94a1e75ce3e3494aab | |
| parent | 79bbe42e52af6ddd5d680d118ac09a50dafc9b78 (diff) | |
| download | python-apt-8200e5372634e26fd41cb5d2e128ff4687db5247.tar.gz | |
Polishing the SoftwareProperties:
* Add a sanity check: if no autoupdate was specifed do not add and show "Every 0 days" int the combo box. instead select no entry - it's insensitive anyway.
* If autoupdated is activated and no frequency was defined before use daily as default
| -rw-r--r-- | SoftwareProperties/SoftwareProperties.py | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/SoftwareProperties/SoftwareProperties.py b/SoftwareProperties/SoftwareProperties.py index 961c4fdd..52351db6 100644 --- a/SoftwareProperties/SoftwareProperties.py +++ b/SoftwareProperties/SoftwareProperties.py @@ -98,9 +98,10 @@ class SoftwareProperties(SimpleGladeApp): # 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 + if update_days > 0: + 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: @@ -178,6 +179,10 @@ class SoftwareProperties(SimpleGladeApp): if self.checkbutton_auto_update.get_active(): self.combobox_update_interval.set_sensitive(True) i = self.combobox_update_interval.get_active() + # if no frequency was specified use daily + if i == -1: + i = 0 + self.combobox_update_interval.set_active(i) value = self.combobox_interval_mapping[i] else: self.combobox_update_interval.set_sensitive(False) |
