summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Vogt <michael.vogt@ubuntu.com>2006-08-24 12:33:48 +0200
committerMichael Vogt <michael.vogt@ubuntu.com>2006-08-24 12:33:48 +0200
commit7f6bff5a191c2bb563198f20d1c2803f5054464b (patch)
tree1b0c5d802fa911502bbe68e0f160e039d74c2d9b
parenta9edef04412f95f3c2bc6da10388673c695a6ac3 (diff)
downloadpython-apt-7f6bff5a191c2bb563198f20d1c2803f5054464b.tar.gz
* merged with the latest upload
-rw-r--r--UpdateManager/UpdateManager.py33
-rw-r--r--debian/changelog7
2 files changed, 37 insertions, 3 deletions
diff --git a/UpdateManager/UpdateManager.py b/UpdateManager/UpdateManager.py
index a1eda861..38cffc39 100644
--- a/UpdateManager/UpdateManager.py
+++ b/UpdateManager/UpdateManager.py
@@ -712,6 +712,9 @@ class UpdateManager(SimpleGladeApp):
# don't display apt-listchanges, we already showed the changelog
os.environ["APT_LISTCHANGES_FRONTEND"]="none"
+ # Do not suspend during the update process
+ (dev, cookie) = self.inhibit_sleep()
+
# set window to insensitive
self.window_main.set_sensitive(False)
self.window_main.window.set_cursor(gtk.gdk.Cursor(gtk.gdk.WATCH))
@@ -726,18 +729,44 @@ class UpdateManager(SimpleGladeApp):
while gtk.events_pending():
gtk.main_iteration()
self.fillstore()
+
+ # Allow suspend after synaptic is finished
+ if cookie != False:
+ self.allow_sleep(dev, cookie)
self.window_main.set_sensitive(True)
self.window_main.window.set_cursor(None)
+ def inhibit_sleep(self):
+ """Send a dbus signal to gnome-power-manager to not suspend
+ the system"""
+ try:
+ 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.Inhibit('UpdateManager', 'Updating system')
+ return (dev, cookie)
+ except Exception, e:
+ print "could not send the dbus Inhibit signal: %s" % e
+ return (False, False)
+
+ def allow_sleep(self, dev, cookie):
+ """Send a dbus signal to gnome-power-manager to allow a suspending
+ the system"""
+ dev.UnInhibit(cookie)
+
def toggled(self, renderer, path):
""" a toggle button in the listview was toggled """
iter = self.store.get_iter(path)
+ pkg = self.store.get_value(iter, LIST_PKG)
+ if pkg is None:
+ return
if self.store.get_value(iter, LIST_INSTALL):
self.store.set_value(iter, LIST_INSTALL, False)
- self.remove_update(self.store.get_value(iter, LIST_PKG))
+ self.remove_update(pkg)
else:
self.store.set_value(iter, LIST_INSTALL, True)
- self.add_update(self.store.get_value(iter, LIST_PKG))
+ self.add_update(pkg)
def on_treeview_update_row_activated(self, treeview, path, column, *args):
"""
diff --git a/debian/changelog b/debian/changelog
index 9de7e07a..f03a4583 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -2,8 +2,13 @@ update-manager (0.44.3) edgy; urgency=low
* help/C/update-manager-C.omf:
- fix url (thanks to daniel holbach, lp: #45548)
+ * show the units better
+ * don't jump around on row activation
+ (thanks to Sebastian Heinlein)
+ * send "inhibit sleep" to power-manager while applying
+ updates (lp #40697)
- --
+ -- Michael Vogt <michael.vogt@ubuntu.com> Tue, 15 Aug 2006 18:06:53 +0200
update-manager (0.44.2) edgy; urgency=low