From c30ae70b655e7ede7cd3ecade20eb9e6c1a7b8c4 Mon Sep 17 00:00:00 2001 From: Sebastian Heinlein Date: Tue, 7 Feb 2006 13:16:08 +0100 Subject: * Use the correct signal handler on_opt_... * Do not try to get the active entry of the combo box if none is selected * Remove unsupported "immediatley" autoclean * Fixed checks (CONF_MAP -> apt config) --- SoftwareProperties/SoftwareProperties.py | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/SoftwareProperties/SoftwareProperties.py b/SoftwareProperties/SoftwareProperties.py index 21f42cf6..5422ba55 100644 --- a/SoftwareProperties/SoftwareProperties.py +++ b/SoftwareProperties/SoftwareProperties.py @@ -125,7 +125,6 @@ class SoftwareProperties(SimpleGladeApp): self.combobox_delete_interval.append_text("After one week") self.combobox_delete_interval.append_text("After two weeks") self.combobox_delete_interval.append_text("After one month") - self.combobox_delete_interval.append_text("Immediatly") # If a custom period is defined add an corresponding entry if not delete_days in self.combobox_delete_interval_mapping.values(): @@ -139,7 +138,7 @@ class SoftwareProperties(SimpleGladeApp): self.combobox_update_interval.set_active(key) break - if delete_days >= 1 and CONF_MAP["autoclean"] != 0: + if delete_days >= 1 and apt_pkg.Config.FindI(CONF_MAP["autoclean"]) != 0: self.checkbutton_auto_delete.set_active(True) self.combobox_delete_interval.set_sensitive(True) else: @@ -147,7 +146,7 @@ class SoftwareProperties(SimpleGladeApp): self.combobox_delete_interval.set_sensitive(False) # Autodownload - if CONF_MAP["autodownload"] == 1: + if apt_pkg.Config.FindI(CONF_MAP["autodownload"]) == 1: self.checkbutton_auto_download.set_active(True) else: self.checkbutton_auto_download.set_active(False) @@ -206,13 +205,14 @@ class SoftwareProperties(SimpleGladeApp): def on_combobox_update_interval_changed(self, widget): i = self.combobox_update_interval.get_active() - value = self.combobox_interval_mapping[i] - # Only write 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() + if i != -1: + value = self.combobox_interval_mapping[i] + # Only write 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 on_opt_autoupdate_toggled(self, widget): + def on_opt_autoupdate_toggled(self, widget): if self.checkbutton_auto_update.get_active(): self.combobox_update_interval.set_sensitive(True) # if no frequency was specified use daily @@ -230,8 +230,10 @@ class SoftwareProperties(SimpleGladeApp): def on_opt_autodownload_toggled(self, widget): if self.checkbutton_auto_download.get_active(): + self.checkbutton_auto_download.set_active(True) apt_pkg.Config.Set(CONF_MAP["autodownload"], str(1)) else: + self.checkbutton_auto_download.set_active(False) apt_pkg.Config.Set(CONF_MAP["autodownload"], str(0)) # FIXME: Write config options, apt_pkg should be able to do this. self.write_config() @@ -244,7 +246,7 @@ class SoftwareProperties(SimpleGladeApp): apt_pkg.Config.Set(CONF_MAP["max_age"], str(value)) self.write_config() - def opt_autodelete_toggled(self, widget): + def on_opt_autodelete_toggled(self, widget): if self.checkbutton_auto_delete.get_active(): self.combobox_delete_interval.set_sensitive(True) # if no frequency was specified use daily -- cgit v1.2.3 From f5f4fc0812ec40a3701ff17692c4bd295d53daaa Mon Sep 17 00:00:00 2001 From: Sebastian Heinlein Date: Tue, 7 Feb 2006 13:42:11 +0100 Subject: * Fixed the grammatically atrocious primary text #30296 - thanks to Scott * Fixed a wrong signal handler --- data/SoftwareProperties.glade | 2 +- data/UpdateManager.glade | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/data/SoftwareProperties.glade b/data/SoftwareProperties.glade index 3d0e788f..7fc37c30 100644 --- a/data/SoftwareProperties.glade +++ b/data/SoftwareProperties.glade @@ -336,7 +336,7 @@ False False True - + 0 diff --git a/data/UpdateManager.glade b/data/UpdateManager.glade index c39b94b0..dfd54dc3 100644 --- a/data/UpdateManager.glade +++ b/data/UpdateManager.glade @@ -91,7 +91,7 @@ True - Software updates can fix possible security holes, fix possible errors, so called "bugs", or provide new features to you. + Software updates can correct errors, eliminate security vulnerabilities, and provide new features to you. False False GTK_JUSTIFY_LEFT @@ -1477,7 +1477,7 @@ Your system does not check for updates automatically. You can configure this beh True <big><b>Checking for available updates</b></big> -Software updates can fix possible security holes, fix possible errors, so called "bugs", or provide new features to you. +Software updates can correct errors, eliminate security vulnerabilities, and provide new features to you. False True GTK_JUSTIFY_LEFT -- cgit v1.2.3 From 5073b91679242238428c1c6b5c967ae67ff4643b Mon Sep 17 00:00:00 2001 From: Sebastian Heinlein Date: Tue, 7 Feb 2006 14:07:57 +0100 Subject: * Do not always set max_age to 1 if the check box is toggled * Sanity check for the max_age combo box --- SoftwareProperties/SoftwareProperties.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/SoftwareProperties/SoftwareProperties.py b/SoftwareProperties/SoftwareProperties.py index 16adae43..b1d557d4 100644 --- a/SoftwareProperties/SoftwareProperties.py +++ b/SoftwareProperties/SoftwareProperties.py @@ -240,23 +240,24 @@ class SoftwareProperties(SimpleGladeApp): def on_combobox_delete_interval_changed(self, widget): i = self.combobox_delete_interval.get_active() - value = self.combobox_delete_interval_mapping[i] - # Only write the key if it has changed - if not value == apt_pkg.Config.FindI(CONF_MAP["max_age"]): - apt_pkg.Config.Set(CONF_MAP["max_age"], str(value)) - self.write_config() + if i != -1: + value = self.combobox_delete_interval_mapping[i] + # Only write the key if it has changed + if not value == apt_pkg.Config.FindI(CONF_MAP["max_age"]): + apt_pkg.Config.Set(CONF_MAP["max_age"], str(value)) + self.write_config() def on_opt_autodelete_toggled(self, widget): if self.checkbutton_auto_delete.get_active(): self.combobox_delete_interval.set_sensitive(True) - # if no frequency was specified use daily + # if no frequency was specified use the first default value i = self.combobox_delete_interval.get_active() if i == -1: i = 0 self.combobox_delete_interval.set_active(i) value_maxage = self.combobox_delete_interval_mapping[i] value_clean = 1 - apt_pkg.Config.Set(CONF_MAP["max_age"], str(value_clean)) + apt_pkg.Config.Set(CONF_MAP["max_age"], str(value_maxage)) else: self.combobox_delete_interval.set_sensitive(False) value_clean = 0 -- cgit v1.2.3