From a576717a3c84e635779bc63299a6372fd4ef20d0 Mon Sep 17 00:00:00 2001 From: Sebastian Heinlein Date: Wed, 25 Jan 2006 00:49:43 +0100 Subject: * Change the progress bar to pulse mode during caching, otherwise the progress bar restarts too often * Wording: - "Upgrading to Ubuntu 'Dapper' 6.04" in the header - Mention the download in the step 3 * Fixed new error dialog - nice test case: dpkg -i --force-all libnotify0_0.3.0-0ubuntu2_i386.deb * Set position of the main window to center always. the terminal is quite huge, so the window has to be moved anyway if you expand the terminal I am not sure about this behavior. So please take a look at it * Initial glade work on a new dialog_obsolete --- DistUpgrade/DistUpgrade.glade | 326 +++++++++++++++++++++++++++++++------- DistUpgrade/DistUpgradeViewGtk.py | 25 ++- 2 files changed, 288 insertions(+), 63 deletions(-) diff --git a/DistUpgrade/DistUpgrade.glade b/DistUpgrade/DistUpgrade.glade index 1464c0f2..58aa10ad 100644 --- a/DistUpgrade/DistUpgrade.glade +++ b/DistUpgrade/DistUpgrade.glade @@ -8,7 +8,7 @@ True Upgrading Ubuntu GTK_WINDOW_TOPLEVEL - GTK_WIN_POS_CENTER + GTK_WIN_POS_CENTER_ALWAYS False False False @@ -39,7 +39,7 @@ True - <span weight="bold" size="x-large">Upgrading Ubuntu</span> + <span weight="bold" size="x-large">Upgrading to Ubuntu "Dapper" 6.04</span> False True GTK_JUSTIFY_LEFT @@ -161,7 +161,7 @@ True - Preparing upgrade + Preparing the upgrade False False GTK_JUSTIFY_LEFT @@ -189,7 +189,7 @@ True - Upgrading software channels + Modifing the software channels False False GTK_JUSTIFY_LEFT @@ -217,7 +217,7 @@ True - Upgrading the system + Downloading and installing the upgrades False False GTK_JUSTIFY_LEFT @@ -439,43 +439,6 @@ True - - - - 6 - GTK_BUTTONBOX_END - 6 - - - - True - True - True - gtk-cancel - True - GTK_RELIEF_NORMAL - True - - - - - - True - True - True - gtk-media-pause - True - GTK_RELIEF_NORMAL - True - - - - - 0 - True - True - - @@ -949,17 +912,18 @@ True False - 0 + 12 True + True False - False + True GTK_JUSTIFY_LEFT - False - False + True + True 0 0.5 0 @@ -977,7 +941,7 @@ - + True GTK_POLICY_AUTOMATIC GTK_POLICY_AUTOMATIC @@ -985,16 +949,22 @@ GTK_CORNER_TOP_LEFT - + True True - False - False - False - True - False - False - False + False + False + True + GTK_JUSTIFY_LEFT + GTK_WRAP_NONE + True + 4 + 4 + 0 + 4 + 4 + 0 + @@ -1022,4 +992,250 @@ + + 6 + + GTK_WINDOW_TOPLEVEL + GTK_WIN_POS_CENTER_ON_PARENT + False + 500 + 400 + False + False + True + True + True + GDK_WINDOW_TYPE_HINT_DIALOG + GDK_GRAVITY_NORTH_WEST + True + True + False + + + + True + False + 6 + + + + True + GTK_BUTTONBOX_END + + + + True + True + True + gtk-cancel + True + GTK_RELIEF_NORMAL + True + -6 + + + + + + True + True + True + _Continue + True + GTK_RELIEF_NORMAL + True + -8 + + + + + 0 + False + True + GTK_PACK_END + + + + + + 6 + True + False + 12 + + + + True + False + 12 + + + + True + gtk-dialog-question + 6 + 0 + 0 + 0 + 0 + + + 0 + False + True + + + + + + True + False + 12 + + + + True + <b><big>Start the upgrade?</big></b> + False + True + GTK_JUSTIFY_LEFT + True + False + 0 + 0 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + False + False + + + + + + True + The upgrade of your system requires + + ... to download 2000 MByte + + ... to install 23 new packages + ... to remove 19 packages + ... to update 200 packages + +This is you last chance to cancel the upgrade. + False + False + GTK_JUSTIFY_LEFT + True + False + 0 + 0 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + False + False + + + + + + True + True + False + 0 + + + + 400 + 200 + True + True + GTK_POLICY_AUTOMATIC + GTK_POLICY_AUTOMATIC + GTK_SHADOW_IN + GTK_CORNER_TOP_LEFT + + + + True + True + False + False + False + True + False + False + False + + + + + + + + True + Details + False + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + label_item + + + + + 0 + False + False + + + + + 0 + False + False + + + + + 0 + False + False + + + + + 0 + True + True + + + + + + diff --git a/DistUpgrade/DistUpgradeViewGtk.py b/DistUpgrade/DistUpgradeViewGtk.py index 9230098f..95d6fdab 100644 --- a/DistUpgrade/DistUpgradeViewGtk.py +++ b/DistUpgrade/DistUpgradeViewGtk.py @@ -42,12 +42,16 @@ from gettext import gettext as _ class GtkOpProgress(apt.progress.OpProgress): def __init__(self, progressbar): self.progressbar = progressbar + self.progressbar.set_pulse_step(0.01) + self.progressbar.pulse() + def update(self, percent): - #self._progressbar.show() - #self.progressbar.set_text(self.op) - self.progressbar.set_fraction(percent/100.0) + # self.progressbar.set_text(self.op) +# self.progressbar.set_fraction(percent/100.0) + self.progressbar.pulse() while gtk.events_pending(): gtk.main_iteration() + def done(self): self.progressbar.set_text(" ") @@ -137,9 +141,10 @@ class GtkInstallProgressAdapter(InstallProgress): self.label_error.set_markup(msg) if errormsg != None: - self.treeview_error_extended.get_buffer().set_text(errormsg) - self.scroll_error_extended.show() - + buffer = self.textview_error.get_buffer() + buffer.set_text(errormsg) + self.scroll_error.show() + self.dialog_error.run() self.dialog_error.destroy() return False @@ -226,8 +231,10 @@ class GtkDistUpgradeView(DistUpgradeView,SimpleGladeApp): #attr = pango.AttrStyle(pango.STYLE_ITALIC, 0, -1) attrlist.insert(attr) label.set_property("attributes",attrlist) + def error(self, summary, msg, extended_msg=None): + self.dialog_error.set_transient_for(self.window_main) self.expander_terminal.set_expanded(True) @@ -236,10 +243,12 @@ class GtkDistUpgradeView(DistUpgradeView,SimpleGladeApp): self.label_error.set_markup(msg) if extended_msg != None: - self.treeview_error_extended.get_buffer().set_text(extended_msg) - self.scroll_error_extended.show() + buffer = self.textview_error.get_buffer() + buffer.set_text(extended_msg) + self.scroll_error.show() self.dialog_error.run() + self.dialog_error.show() self.dialog_error.destroy() return False -- cgit v1.2.3