From 8200e5372634e26fd41cb5d2e128ff4687db5247 Mon Sep 17 00:00:00 2001 From: Sebastian Heinlein Date: Thu, 26 Jan 2006 20:17:15 +0100 Subject: 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 --- SoftwareProperties/SoftwareProperties.py | 11 ++++++++--- 1 file 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) -- cgit v1.2.3