From 96efe8c5c6e3c2d03026eec77634072a6c013c36 Mon Sep 17 00:00:00 2001 From: Sebastian Heinlein Date: Sun, 23 Apr 2006 17:13:17 +0200 Subject: * Do not allow to suspend the computer during updating thanks to Aaron Whitehouse - fixes bug #40697 (needs more testing, the connection to the session dbus failed on my local machine) --- UpdateManager/UpdateManager.py | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'UpdateManager/UpdateManager.py') diff --git a/UpdateManager/UpdateManager.py b/UpdateManager/UpdateManager.py index 6ac83197..59a19612 100644 --- a/UpdateManager/UpdateManager.py +++ b/UpdateManager/UpdateManager.py @@ -498,6 +498,8 @@ class UpdateManager(SimpleGladeApp): self.invoke_manager(INSTALL) def invoke_manager(self, action): + # Do not suspend during the update process + (dev, cookie) = self.inhibit_sleep() # check first if no other package manager is runing # don't display apt-listchanges, we already showed the changelog @@ -519,6 +521,30 @@ class UpdateManager(SimpleGladeApp): self.fillstore() self.window_main.set_sensitive(True) self.window_main.window.set_cursor(None) + # Allow suspend after synaptic is finished + if cookie != False: + self.allow_sleep(dev, cookie) + + def inhibit_sleep(self): + """Send a dbus signal to gnome-power-manager to not suspend + the system""" + try: + import dbus + bus = dbus.Bus(dbus.Bus.TYPE_SESSION) + devobj = bus.get_object('org.gnome.PowerManager', + '/org/gnome/PowerManager') + dev = dbus.Interface(devobj, "org.gnome.PowerManager") + cookie = dev.InhibitInactiveSleep('UpdateManager', + 'Updating system') + return (dev, cookie) + except: + print "could not send the dbus InhibitInactiveSleep signal" + return (False, False) + + def allow_sleep(self, dev, cookie): + """Send a dbus signal to gnome-power-manager to allow a suspending + the system""" + dev.AllowInactiveSleep(cookie) def toggled(self, renderer, path_string): """ a toggle button in the listview was toggled """ -- cgit v1.2.3 From c694583903af0139d3e73ddf2eee34eb5a506d80 Mon Sep 17 00:00:00 2001 From: Sebastian Heinlein Date: Sun, 23 Apr 2006 20:52:54 +0200 Subject: * Fix the use of gettext in UpdateManager : You can install X updates * Do not mention the need of the unanttended-updates package - the tooltip isn't even shown if the option is disabled * Fix the channel terminolgy in the add custom apt line dialog --- DistUpgrade/DistUpgradeViewGtk.py | 3 ++- UpdateManager/UpdateManager.py | 9 ++++++--- data/SoftwareProperties.glade | 2 +- data/SoftwarePropertiesDialogs.glade | 2 +- 4 files changed, 10 insertions(+), 6 deletions(-) (limited to 'UpdateManager/UpdateManager.py') diff --git a/DistUpgrade/DistUpgradeViewGtk.py b/DistUpgrade/DistUpgradeViewGtk.py index 3236ba14..dba8014f 100644 --- a/DistUpgrade/DistUpgradeViewGtk.py +++ b/DistUpgrade/DistUpgradeViewGtk.py @@ -299,7 +299,8 @@ class DistUpgradeViewGtk(DistUpgradeView,SimpleGladeApp): logging.error("not handled expection:\n%s" % "\n".join(lines)) self.error(_("A fatal error occured"), _("Please report this as a bug and include the " - "files ~/dist-upgrade.log and ~/dist-upgrade-apt.log " + "files '/var/log/dist-upgrade.log' and " + "'/var/log/dist-upgrade-apt.log' " "in your report. The upgrade aborts now. "), "\n".join(lines)) sys.exit(1) diff --git a/UpdateManager/UpdateManager.py b/UpdateManager/UpdateManager.py index 59a19612..b4090589 100644 --- a/UpdateManager/UpdateManager.py +++ b/UpdateManager/UpdateManager.py @@ -437,9 +437,12 @@ class UpdateManager(SimpleGladeApp): self.textview_changes.get_buffer().set_text("") self.textview_descr.get_buffer().set_text("") else: - text_header = ""+gettext.ngettext("You can install one update", "You can install %s updates" % len(self.store), len(self.store))+"" - - text_download = _("Download size: %s" % apt_pkg.SizeToStr(self.dl_size)) + text_header = "" + \ + gettext.ngettext("You can install %s update", + "You can install %s updates", + len(self.store)) % \ + len(self.store) + "" + text_download = _("Download size: %s") % apt_pkg.SizeToStr(self.dl_size) self.notebook_details.set_sensitive(True) self.treeview_update.set_sensitive(True) self.button_install.grab_default() diff --git a/data/SoftwareProperties.glade b/data/SoftwareProperties.glade index 58584826..a1f7f8f9 100644 --- a/data/SoftwareProperties.glade +++ b/data/SoftwareProperties.glade @@ -390,7 +390,7 @@ True - Only security updates from the official Ubuntu servers will be installed automatically. The software package "unattended-upgrades" needs to be installed therefor + Only security updates from the official Ubuntu servers will be installed automatically True _Install security updates without confirmation True diff --git a/data/SoftwarePropertiesDialogs.glade b/data/SoftwarePropertiesDialogs.glade index 549a9c7c..8c5b00c6 100644 --- a/data/SoftwarePropertiesDialogs.glade +++ b/data/SoftwarePropertiesDialogs.glade @@ -451,7 +451,7 @@ True <big><b>Enter the complete APT line of the channel that you want to add</b></big> -The APT line contains the type, location and sections of a channel, for example <i>"deb http://ftp.debian.org sarge main"</i>. +The APT line includes the type, location and components of a channel, for example <i>"deb http://ftp.debian.org sarge main"</i>. False True GTK_JUSTIFY_LEFT -- cgit v1.2.3 From 7d692f2512f73e7cf8f439350ff09e283746635e Mon Sep 17 00:00:00 2001 From: Sebastian Heinlein Date: Sun, 23 Apr 2006 21:06:07 +0200 Subject: * Remove the oboslete Preferences method in UpdateManager, since it only adds strings for the translators --- UpdateManager/UpdateManager.py | 45 ------------------------------------------ 1 file changed, 45 deletions(-) (limited to 'UpdateManager/UpdateManager.py') diff --git a/UpdateManager/UpdateManager.py b/UpdateManager/UpdateManager.py index b4090589..0958564f 100644 --- a/UpdateManager/UpdateManager.py +++ b/UpdateManager/UpdateManager.py @@ -581,51 +581,6 @@ class UpdateManager(SimpleGladeApp): if x > 0 and y > 0: self.window_main.resize(x,y) - def on_button_preferences_clicked(self, widget): - """ start gnome-software preferences """ - # args: "-n" means we take care of the reloading of the - # package list ourself - #apt_pkg.PkgSystemUnLock() - #args = ['/usr/bin/gnome-software-properties', '-n'] - #child = subprocess.Popen(args) - #self.window_main.set_sensitive(False) - #res = None - #while res == None: - # res = child.poll() - # time.sleep(0.05) - ## while gtk.events_pending(): - # gtk.main_iteration() - # repository information changed, call "reload" - #try: - # apt_pkg.PkgSystemLock() - #except SystemError: - # print "Error geting the cache" - # apt_pkg.PkgSystemLock() - # if res > 0: - # self.on_button_reload_clicked(None) - # self.window_main.set_sensitive(True) - self.window_main.set_sensitive(False) - from SoftwareProperties import SoftwareProperties - prop = SoftwareProperties.SoftwareProperties(self.datadir, None) - prop.window_main.set_transient_for(self.window_main) - prop.run() - prop.window_main.hide() - if prop.modified: - primary = "%s" % \ - _("Repositories changed") - secondary = _("You need to reload the package list from the servers " - "for your changes to take effect. Do you want to do " - "this now?") - dialog = gtk.MessageDialog(self.window_main, 0, - gtk.MESSAGE_INFO,gtk.BUTTONS_YES_NO,"") - dialog.set_markup(primary); - dialog.format_secondary_text(secondary); - res = dialog.run() - dialog.destroy() - if res == gtk.RESPONSE_YES: - self.on_button_reload_clicked(None) - self.window_main.set_sensitive(True) - def fillstore(self): # use the watch cursor self.window_main.window.set_cursor(gtk.gdk.Cursor(gtk.gdk.WATCH)) -- cgit v1.2.3 From 8095fdf900d8dbf2bef6d49eabdef7489141ed08 Mon Sep 17 00:00:00 2001 From: Sebastian Heinlein Date: Tue, 25 Apr 2006 15:39:27 +0200 Subject: * revert the inhibit sleep patch - it is only supported by the comming 2.15 branch of gnome-power-manager (the patch is attached to bug #40697) --- UpdateManager/UpdateManager.py | 26 -------------------------- 1 file changed, 26 deletions(-) (limited to 'UpdateManager/UpdateManager.py') diff --git a/UpdateManager/UpdateManager.py b/UpdateManager/UpdateManager.py index 0958564f..648d5f39 100644 --- a/UpdateManager/UpdateManager.py +++ b/UpdateManager/UpdateManager.py @@ -501,8 +501,6 @@ class UpdateManager(SimpleGladeApp): self.invoke_manager(INSTALL) def invoke_manager(self, action): - # Do not suspend during the update process - (dev, cookie) = self.inhibit_sleep() # check first if no other package manager is runing # don't display apt-listchanges, we already showed the changelog @@ -524,30 +522,6 @@ class UpdateManager(SimpleGladeApp): self.fillstore() self.window_main.set_sensitive(True) self.window_main.window.set_cursor(None) - # Allow suspend after synaptic is finished - if cookie != False: - self.allow_sleep(dev, cookie) - - def inhibit_sleep(self): - """Send a dbus signal to gnome-power-manager to not suspend - the system""" - try: - import dbus - bus = dbus.Bus(dbus.Bus.TYPE_SESSION) - devobj = bus.get_object('org.gnome.PowerManager', - '/org/gnome/PowerManager') - dev = dbus.Interface(devobj, "org.gnome.PowerManager") - cookie = dev.InhibitInactiveSleep('UpdateManager', - 'Updating system') - return (dev, cookie) - except: - print "could not send the dbus InhibitInactiveSleep signal" - return (False, False) - - def allow_sleep(self, dev, cookie): - """Send a dbus signal to gnome-power-manager to allow a suspending - the system""" - dev.AllowInactiveSleep(cookie) def toggled(self, renderer, path_string): """ a toggle button in the listview was toggled """ -- cgit v1.2.3