From 41a6ea707688e2e239ee75212888d01c219f39b1 Mon Sep 17 00:00:00 2001 From: Sebastian Heinlein Date: Wed, 25 Jan 2006 14:32:38 +0100 Subject: SoftwareProperties: * Allow a custom configuration for automatic internet udpates * Wording: "Choose a key-file" -> "Import key" (Import is the label on the button) * use the update-manager icon in the window list UpdateManager: * set window_main to unsensitive at the startup * Wording in the synaptic dialog: - "The updates are being applied." -> "Please wait, this can take some time." - "Upgrade is complete" -> "Update is complete" * set synapitc dialog to type-hint "dialog" and not "normal" * set the main_window to type-hint "dialog" and not "normal" * do not write a status message to treeview_updates during startup "Initializing and getting list of updates..." * Nicer wording in the dialog_manual_update: "You need to manually reload the latest information about updates" "Your system does not check for updates automatically. You can configure this behavior in "System" -> "Administration" -> "Software Properties" --- SoftwareProperties/SoftwareProperties.py | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) (limited to 'SoftwareProperties/SoftwareProperties.py') 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, -- cgit v1.2.3 From 79bbe42e52af6ddd5d680d118ac09a50dafc9b78 Mon Sep 17 00:00:00 2001 From: Sebastian Heinlein Date: Thu, 26 Jan 2006 19:54:10 +0100 Subject: * Do not use header capitalization in the combo box. The HIG says sentence capitalization * Add a ":" to the checkbox for automatic updates. the sentence does not include the combo box --- SoftwareProperties/SoftwareProperties.py | 6 +++--- data/SoftwareProperties.glade | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'SoftwareProperties/SoftwareProperties.py') diff --git a/SoftwareProperties/SoftwareProperties.py b/SoftwareProperties/SoftwareProperties.py index edcd407d..961c4fdd 100644 --- a/SoftwareProperties/SoftwareProperties.py +++ b/SoftwareProperties/SoftwareProperties.py @@ -92,13 +92,13 @@ class SoftwareProperties(SimpleGladeApp): 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("Every two days") self.combobox_update_interval.append_text("Weekly") - self.combobox_update_interval.append_text("Every Two Weeks") + 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" + self.combobox_update_interval.append_text(_("Every %s days" % update_days)) self.combobox_interval_mapping[4] = update_days diff --git a/data/SoftwareProperties.glade b/data/SoftwareProperties.glade index edd12320..0a39a13f 100644 --- a/data/SoftwareProperties.glade +++ b/data/SoftwareProperties.glade @@ -299,7 +299,7 @@ True True - Automatically check for updates + Automatically check for updates: True GTK_RELIEF_NORMAL True -- cgit v1.2.3 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(-) (limited to 'SoftwareProperties/SoftwareProperties.py') 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