From 22f2cef12e3cd8691615548edc630b96f4238b60 Mon Sep 17 00:00:00 2001 From: Sebastian Heinlein Date: Wed, 1 Feb 2006 03:55:51 +0100 Subject: * Use gksu and not gksudo #30057 --- data/gnome-software-properties.desktop.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'data') diff --git a/data/gnome-software-properties.desktop.in b/data/gnome-software-properties.desktop.in index ef1547c4..c626869a 100644 --- a/data/gnome-software-properties.desktop.in +++ b/data/gnome-software-properties.desktop.in @@ -2,7 +2,7 @@ _Name=Software Properties _GenericName=Software Properties _Comment=Edit software sources and settings -Exec=gksudo /usr/bin/gnome-software-properties +Exec=gksu /usr/bin/gnome-software-properties Icon=update-manager.png Terminal=false MultipleArgs=false -- cgit v1.2.3 From c6d126a887c61610227717eae43c24f732580500 Mon Sep 17 00:00:00 2001 From: Sebastian Heinlein Date: Wed, 1 Feb 2006 05:27:46 +0100 Subject: * Move Internet updates to its own tab * Add option for autoclean (not working 100% :) * Add option for auto download (working) * Add option for unattended install (placeholder) --- SoftwareProperties/SoftwareProperties.py | 73 ++++++- data/SoftwareProperties.glade | 327 +++++++++++++++++++++---------- 2 files changed, 291 insertions(+), 109 deletions(-) (limited to 'data') diff --git a/SoftwareProperties/SoftwareProperties.py b/SoftwareProperties/SoftwareProperties.py index 8da70eee..21f42cf6 100644 --- a/SoftwareProperties/SoftwareProperties.py +++ b/SoftwareProperties/SoftwareProperties.py @@ -115,6 +115,43 @@ class SoftwareProperties(SimpleGladeApp): self.checkbutton_auto_update.set_active(False) self.combobox_update_interval.set_sensitive(False) + # Automatic removal of cached packages by age + self.combobox_delete_interval_mapping = { 0 : 7, + 1 : 14, + 2 : 31 } + + delete_days = apt_pkg.Config.FindI(CONF_MAP["max_age"]) + + 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(): + if delete_days > 0 and CONF_MAP["autoclean"] != 0: + self.combobox_delete_interval.append_text(_("After %s days" + % delete_days)) + self.combobox_delete_interval_mapping[3] = delete_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 delete_days >= 1 and CONF_MAP["autoclean"] != 0: + self.checkbutton_auto_delete.set_active(True) + self.combobox_delete_interval.set_sensitive(True) + else: + self.checkbutton_auto_delete.set_active(False) + self.combobox_delete_interval.set_sensitive(False) + + # Autodownload + if CONF_MAP["autodownload"] == 1: + self.checkbutton_auto_download.set_active(True) + else: + self.checkbutton_auto_download.set_active(False) + # apt-key stuff self.apt_key = apt_key() self.init_keyslist() @@ -175,7 +212,7 @@ class SoftwareProperties(SimpleGladeApp): apt_pkg.Config.Set(CONF_MAP["autoupdate"], str(value)) self.write_config() - def 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 @@ -190,6 +227,40 @@ class SoftwareProperties(SimpleGladeApp): apt_pkg.Config.Set(CONF_MAP["autoupdate"], str(value)) # FIXME: Write config options, apt_pkg should be able to do this. self.write_config() + + def on_opt_autodownload_toggled(self, widget): + if self.checkbutton_auto_download.get_active(): + apt_pkg.Config.Set(CONF_MAP["autodownload"], str(1)) + else: + apt_pkg.Config.Set(CONF_MAP["autodownload"], str(0)) + # FIXME: Write config options, apt_pkg should be able to do this. + self.write_config() + + 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() + + def 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 + 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)) + else: + self.combobox_delete_interval.set_sensitive(False) + value_clean = 0 + apt_pkg.Config.Set(CONF_MAP["autoclean"], str(value_clean)) + # FIXME: Write config options, apt_pkg should be able to do this. + self.write_config() def write_config(self): #print "write_config()" diff --git a/data/SoftwareProperties.glade b/data/SoftwareProperties.glade index 0a39a13f..9df03955 100644 --- a/data/SoftwareProperties.glade +++ b/data/SoftwareProperties.glade @@ -41,6 +41,224 @@ False False + + + 12 + True + 0 + 0.5 + GTK_SHADOW_NONE + + + + True + 0.5 + 0.5 + 1 + 1 + 6 + 0 + 12 + 0 + + + + True + False + 6 + + + + True + False + 6 + + + + True + True + _Check for updates automatically: + True + GTK_RELIEF_NORMAL + True + False + False + True + + + + 0 + False + True + + + + + + True + + False + True + + + + 0 + True + True + + + + + 0 + False + False + + + + + + True + True + _Download updates in the backgound, but do not install them + True + GTK_RELIEF_NORMAL + True + False + False + True + + + + 0 + False + False + + + + + + True + True + _Install new updates without confirmation + True + GTK_RELIEF_NORMAL + True + False + False + True + + + + 0 + False + False + + + + + + True + False + 6 + + + + True + True + D_elete downloaded software files: + True + GTK_RELIEF_NORMAL + True + False + False + True + + + + 0 + False + True + + + + + + True + + False + True + + + + 0 + True + True + + + + + 0 + False + True + + + + + + + + + + True + <b>Internet updates</b> + False + True + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + label_item + + + + + False + True + + + + + + True + Internet Updates + False + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + tab + + + 12 @@ -237,7 +455,7 @@ True - <b>Sources</b> + <b>Channels</b> False True GTK_JUSTIFY_LEFT @@ -263,113 +481,6 @@ True - - - - True - 0 - 0.5 - GTK_SHADOW_NONE - - - - True - 0.5 - 0.5 - 1 - 1 - 6 - 0 - 12 - 0 - - - - True - False - 6 - - - - True - False - 6 - - - - True - True - Automatically check for updates: - True - GTK_RELIEF_NORMAL - True - False - False - True - - - - 0 - False - True - - - - - - True - - False - True - - - - 0 - True - True - - - - - 0 - False - False - - - - - - - - - - True - <b>Internet updates</b> - False - True - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - label_item - - - - - 0 - False - True - - False -- cgit v1.2.3 From 99a65ab5e62498dc958c3f1e374dbd2bbf72e7c6 Mon Sep 17 00:00:00 2001 From: Sebastian Heinlein Date: Fri, 3 Feb 2006 22:37:00 +0100 Subject: * Do not allow to close the main window until actions are performed and the main window is insenstive * Remove missing synaptic icon in the glade file. it only produces an error message in the terminal --- UpdateManager/UpdateManager.py | 14 +++++++++----- data/UpdateManager.glade | 1 - 2 files changed, 9 insertions(+), 6 deletions(-) (limited to 'data') diff --git a/UpdateManager/UpdateManager.py b/UpdateManager/UpdateManager.py index dd9204c3..3eac6395 100644 --- a/UpdateManager/UpdateManager.py +++ b/UpdateManager/UpdateManager.py @@ -238,7 +238,7 @@ class UpdateManager(SimpleGladeApp): self.expander_details.connect("notify::expanded", self.activate_details) # useful exit stuff - self.window_main.connect("delete_event", lambda w, ev: self.exit()) + self.window_main.connect("delete_event", self.close) self.button_cancel.connect("clicked", lambda w: self.exit()) # the treeview (move into it's own code!) @@ -291,6 +291,13 @@ class UpdateManager(SimpleGladeApp): self.restore_state() + def close(self, widget, data=None): + if self.window_main.get_property("sensitive") is False: + return True + else: + self.exit() + + def set_changes_buffer(self, changes_buffer, text, name, srcpkg): changes_buffer.set_text("") lines = text.split("\n") @@ -564,9 +571,6 @@ class UpdateManager(SimpleGladeApp): win.set_property("skip-pager-hint", True) win.resize(400,200) win.set_resizable(False) - # prevent the window from closing with the delete button (there is - # a cancel button in the window) - win.connect("delete_event", lambda e,w: True); # create the socket socket = gtk.Socket() @@ -586,7 +590,7 @@ class UpdateManager(SimpleGladeApp): while gtk.events_pending(): gtk.main_iteration() self.fillstore() - self.window_main.set_sensitive(True) + self.window_main.set_sensitive(True) def toggled(self, renderer, path_string): """ a toggle button in the listview was toggled """ diff --git a/data/UpdateManager.glade b/data/UpdateManager.glade index 2258e394..c39b94b0 100644 --- a/data/UpdateManager.glade +++ b/data/UpdateManager.glade @@ -1053,7 +1053,6 @@ Need to get the changes from the central server False False False - synaptic.xpm True True True -- cgit v1.2.3