From 8abb01fb328c6e0c3da3263af149934b02949b8a Mon Sep 17 00:00:00 2001 From: Sebastian Heinlein Date: Sat, 18 Feb 2006 16:06:37 +0100 Subject: * Do not disable the update dialog during downloading of the changelog * Show step 5 "Restarting the system" in the ui, since users asked me, how and when they should reboot. this should provide a better picture of the upgrade process * Fixed the parent of the change media dialog * Converted the abort DistUpgrade dialog to a nice glade dialog * Disabled the abortion of the DistUpgrade. it is currently not supported. --- DistUpgrade/DistUpgrade.glade | 129 +++++++++++++++++++++++++++++++++++++- DistUpgrade/DistUpgradeViewGtk.py | 24 ++++--- UpdateManager/UpdateManager.py | 2 - 3 files changed, 142 insertions(+), 13 deletions(-) diff --git a/DistUpgrade/DistUpgrade.glade b/DistUpgrade/DistUpgrade.glade index 5b59fb4d..55b439c1 100644 --- a/DistUpgrade/DistUpgrade.glade +++ b/DistUpgrade/DistUpgrade.glade @@ -12,7 +12,6 @@ False False False - update-manager.png True False False @@ -293,6 +292,7 @@ 18 18 + True 0.5 0.5 0 @@ -309,7 +309,8 @@ - + True + Restarting the system False False GTK_JUSTIFY_LEFT @@ -1285,4 +1286,128 @@ This is you last chance to cancel the upgrade. + + 6 + + GTK_WINDOW_TOPLEVEL + GTK_WIN_POS_CENTER_ON_PARENT + False + False + False + True + True + True + GDK_WINDOW_TYPE_HINT_DIALOG + GDK_GRAVITY_NORTH_WEST + True + True + False + + + + True + False + 12 + + + + True + GTK_BUTTONBOX_END + + + + True + True + True + _Cancel Upgrade + True + GTK_RELIEF_NORMAL + True + -6 + + + + + + True + True + True + True + _Resume Upgrade + True + GTK_RELIEF_NORMAL + True + -5 + + + + + 0 + False + True + GTK_PACK_END + + + + + + 6 + True + False + 12 + + + + True + gtk-dialog-question + 6 + 0 + 0 + 0 + 0 + + + 0 + False + True + + + + + + True + <b><big>Cancel the running upgrade?</big></b> + +The system could be in an unusable state if you cancel the upgrade. You are strongly adviced to resume the upgrade. + False + True + GTK_JUSTIFY_LEFT + True + False + 0 + 0 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + False + False + + + + + 0 + True + True + + + + + + diff --git a/DistUpgrade/DistUpgradeViewGtk.py b/DistUpgrade/DistUpgradeViewGtk.py index 6013200b..c36d8dac 100644 --- a/DistUpgrade/DistUpgradeViewGtk.py +++ b/DistUpgrade/DistUpgradeViewGtk.py @@ -74,7 +74,7 @@ class GtkFetchProgressAdapter(apt.progress.FetchProgress): def mediaChange(self, medium, drive): #print "mediaChange %s %s" % (medium, drive) msg = _("Please insert '%s' into the drive '%s'" % (medium,drive)) - dialog = gtk.MessageDialog(parent=self.main, + dialog = gtk.MessageDialog(parent=self.window_main, flags=gtk.DIALOG_MODAL, type=gtk.MESSAGE_QUESTION, buttons=gtk.BUTTONS_OK_CANCEL) @@ -182,9 +182,13 @@ class DistUpgradeViewGtk(DistUpgradeView,SimpleGladeApp): # FIXME: i18n must be somewhere relative do this dir bindtextdomain("update-manager",os.path.join(os.getcwd(),"mo")) + icons = gtk.icon_theme_get_default() + gtk.window_set_default_icon(icons.load_icon("update-manager", 32, 0)) SimpleGladeApp.__init__(self, "DistUpgrade.glade", None, domain="update-manager") self.window_main.set_keep_above(True) + self.window_main.realize() + self.window_main.window.set_functions(gtk.gdk.FUNC_MOVE) self._opCacheProgress = GtkOpProgress(self.progressbar_cache) self._fetchProgress = GtkFetchProgressAdapter(self) self._installProgress = GtkInstallProgressAdapter(self) @@ -328,6 +332,8 @@ class DistUpgradeViewGtk(DistUpgradeView,SimpleGladeApp): def confirmRestart(self): self.dialog_restart.set_transient_for(self.window_main) + self.dialog_restart.realize() + self.dialog_restart.window.set_functions(gtk.gdk.FUNC_MOVE) res = self.dialog_restart.run() self.dialog_restart.hide() if res == gtk.RESPONSE_YES: @@ -335,14 +341,14 @@ class DistUpgradeViewGtk(DistUpgradeView,SimpleGladeApp): return False def on_window_main_delete_event(self, widget, event): - #print "on_window_main_delete_event()" - summary = _("Are you sure you want cancel?") - msg = _("Canceling during a upgrade can leave the system in a " - "unstable state. It is strongly adviced to continue " - "the operation. ") - if self.askYesNoQuestion(summary, msg): - self.exit(1) - return True + self.dialog_cancel.set_transient_for(self.window_main) + self.dialog_cancel.realize() + self.dialog_cancel.window.set_functions(gtk.gdk.FUNC_MOVE) + res = self.dialog_cancel.run() + self.dialog_cancel.hide() + if res == gtk.RESPONSE_CANCEL: + self.destroy() + return True if __name__ == "__main__": view = GtkDistUpgradeView() diff --git a/UpdateManager/UpdateManager.py b/UpdateManager/UpdateManager.py index f73f790a..8b757bd1 100644 --- a/UpdateManager/UpdateManager.py +++ b/UpdateManager/UpdateManager.py @@ -356,7 +356,6 @@ class UpdateManager(SimpleGladeApp): self.set_changes_buffer(changes_buffer, changes[0], name, changes[1]) else: if self.expander_details.get_expanded(): - self.hbox_footer.set_sensitive(False) lock = thread.allocate_lock() lock.acquire() t=thread.start_new_thread(self.cache.get_changelog,(name,lock)) @@ -373,7 +372,6 @@ class UpdateManager(SimpleGladeApp): # download finished (or canceld, or time-out) button.hide() button.disconnect(id); - self.hbox_footer.set_sensitive(True) if self.cache.all_changes.has_key(name): changes = self.cache.all_changes[name] -- cgit v1.2.3