From a3f1e0a0c64f886a5b90aaf970c11dfe16ca3e6a Mon Sep 17 00:00:00 2001 From: Sebastian Heinlein Date: Tue, 24 Jan 2006 22:17:43 +0100 Subject: * New glade based error dialog * Wording: error dialog and status messages * Do not hide the progressbar at the end --- DistUpgrade/DistUpgrade.glade | 165 ++++++++++++++++++++++++++++++++++++ DistUpgrade/DistUpgradeControler.py | 4 +- DistUpgrade/DistUpgradeViewGtk.py | 75 +++++++--------- 3 files changed, 198 insertions(+), 46 deletions(-) diff --git a/DistUpgrade/DistUpgrade.glade b/DistUpgrade/DistUpgrade.glade index 00b04644..7710fa5e 100644 --- a/DistUpgrade/DistUpgrade.glade +++ b/DistUpgrade/DistUpgrade.glade @@ -858,4 +858,169 @@ + + 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 + True + _Report Bug + True + GTK_RELIEF_NORMAL + True + -8 + + + + + + True + True + True + True + gtk-close + True + GTK_RELIEF_NORMAL + True + -7 + + + + + 0 + False + True + GTK_PACK_END + + + + + + 6 + True + False + 12 + + + + True + gtk-dialog-error + 6 + 0 + 0 + 0 + 0 + + + 0 + False + True + + + + + + True + False + 0 + + + + True + + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + False + True + + + + + + True + GTK_POLICY_AUTOMATIC + GTK_POLICY_AUTOMATIC + GTK_SHADOW_IN + GTK_CORNER_TOP_LEFT + + + + True + True + False + False + False + True + False + False + False + + + + + 0 + True + True + + + + + 0 + True + True + + + + + 0 + True + True + + + + + + diff --git a/DistUpgrade/DistUpgradeControler.py b/DistUpgrade/DistUpgradeControler.py index db6168ef..a0f5a642 100644 --- a/DistUpgrade/DistUpgradeControler.py +++ b/DistUpgrade/DistUpgradeControler.py @@ -251,7 +251,7 @@ class DistUpgradeControler(object): # this is the core def dapperUpgrade(self): # sanity check (check for ubuntu-desktop, brokenCache etc) - self._view.updateStatus(_("Checking update system")) + self._view.updateStatus(_("Checking package manager")) self._view.setStep(1) self.openCache() if not self.cache.sanityCheck(self._view): @@ -270,7 +270,7 @@ class DistUpgradeControler(object): self.abort() # then open the cache (again) - self._view.updateStatus(_("Checking update system")) + self._view.updateStatus(_("Checking package manager")) self.openCache() # calc the dist-upgrade and see if the removals are ok/expected diff --git a/DistUpgrade/DistUpgradeViewGtk.py b/DistUpgrade/DistUpgradeViewGtk.py index d798befa..9230098f 100644 --- a/DistUpgrade/DistUpgradeViewGtk.py +++ b/DistUpgrade/DistUpgradeViewGtk.py @@ -49,7 +49,6 @@ class GtkOpProgress(apt.progress.OpProgress): while gtk.events_pending(): gtk.main_iteration() def done(self): - #self.progressbar.hide() self.progressbar.set_text(" ") @@ -80,9 +79,8 @@ class GtkFetchProgressAdapter(apt.progress.FetchProgress): self.progress.set_fraction(0) self.status.show() def stop(self): - #self.progress.hide() self.progress.set_text(" ") - self.status.set_text("") + self.status.set_text(_("Download is complete")) def pulse(self): # FIXME: move the status_str and progress_str into python-apt # (python-apt need i18n first for this) @@ -119,7 +117,7 @@ class GtkInstallProgressAdapter(InstallProgress): # FIXME: add support for the timeout # of the terminal (to display something useful then) # -> longer term, move this code into python-apt - self.label_status.set_text(_("Installing updates ...")) + self.label_status.set_text(_("Installing updates")) self.progress.set_fraction(0.0) self.progress.set_text(" ") self.expander.set_sensitive(True) @@ -127,30 +125,25 @@ class GtkInstallProgressAdapter(InstallProgress): self.env = ["VTE_PTY_KEEP_FD=%s"% self.writefd, "DEBIAN_FRONTEND=gnome", "APT_LISTCHANGES_FRONTEND=none"] + def error(self, pkg, errormsg): - dialog = gtk.MessageDialog(self.parent.window_main, 0, - gtk.MESSAGE_ERROR, - gtk.BUTTONS_OK,"") - summary = _("Error installing '%s'" % pkg) - msg = _("During the install a error occured. This is usually a bug " - "in the packages, please report it. See the message below " - "for more information. ") - msg="%s\n\n%s" % (summary,msg) - dialog.set_markup(msg) - dialog.vbox.set_spacing(6) + self.dialog_error.set_transient_for(self.window_main) + + self.expander_terminal.set_expanded(True) + + summary = _("Could not install '%s'" % pkg) + msg = _("The upgrade will abort now. Please report the bug.") + msg="%s\n\n%s" % (summary, msg) + self.label_error.set_markup(msg) + if errormsg != None: - scroll = gtk.ScrolledWindow() - scroll.set_size_request(400,200) - textview = gtk.TextView() - textview.set_cursor_visible(False) - textview.set_editable(False) - textview.get_buffer().set_text(errormsg) - textview.show() - scroll.add(textview) - scroll.show() - dialog.vbox.pack_end(scroll) - dialog.run() - dialog.destroy() + self.treeview_error_extended.get_buffer().set_text(errormsg) + self.scroll_error_extended.show() + + self.dialog_error.run() + self.dialog_error.destroy() + return False + def conffile(self, current, new): self.expander.set_expanded=True pass @@ -165,7 +158,6 @@ class GtkInstallProgressAdapter(InstallProgress): self.updateInterface() return self.apt_status def finishUpdate(self): - self.progress.hide() self.label_status.set_text("") def updateInterface(self): InstallProgress.updateInterface(self) @@ -236,24 +228,19 @@ class GtkDistUpgradeView(DistUpgradeView,SimpleGladeApp): label.set_property("attributes",attrlist) def error(self, summary, msg, extended_msg=None): - dialog = gtk.MessageDialog(self.window_main, 0, gtk.MESSAGE_ERROR, - gtk.BUTTONS_OK,"") - msg="%s\n\n%s" % (summary,msg) - dialog.set_markup(msg) - dialog.vbox.set_spacing(6) + self.dialog_error.set_transient_for(self.window_main) + + self.expander_terminal.set_expanded(True) + + msg="%s\n\n%s" % (summary, msg) + self.label_error.set_markup(msg) + if extended_msg != None: - scroll = gtk.ScrolledWindow() - scroll.set_size_request(400,200) - textview = gtk.TextView() - textview.set_cursor_visible(False) - textview.set_editable(False) - textview.get_buffer().set_text(extended_msg) - textview.show() - scroll.add(textview) - scroll.show() - dialog.vbox.pack_end(scroll) - dialog.run() - dialog.destroy() + self.treeview_error_extended.get_buffer().set_text(extended_msg) + self.scroll_error_extended.show() + + self.dialog_error.run() + self.dialog_error.destroy() return False def confirmChanges(self, summary, changes, downloadSize): -- cgit v1.2.3 From 2e75667c58e1ceeafb57c45bb09d48f3d4d52817 Mon Sep 17 00:00:00 2001 From: Sebastian Heinlein Date: Tue, 24 Jan 2006 22:18:51 +0100 Subject: * Hide non functional bug report button --- DistUpgrade/DistUpgrade.glade | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/DistUpgrade/DistUpgrade.glade b/DistUpgrade/DistUpgrade.glade index 7710fa5e..1464c0f2 100644 --- a/DistUpgrade/DistUpgrade.glade +++ b/DistUpgrade/DistUpgrade.glade @@ -887,8 +887,7 @@ GTK_BUTTONBOX_END - - True + True True True -- cgit v1.2.3 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 From 04314c42545fa783b12c9c7b7ec88200afa5e3f2 Mon Sep 17 00:00:00 2001 From: Sebastian Heinlein Date: Wed, 25 Jan 2006 11:44:07 +0100 Subject: DistUpgrade: * set position of main window to "center" and not "center always" Update Manager: * Hopefully fix the close/cancel issue #28932: - Move the install button next to the update treeview. So it is no longer a global action of the dialog and separated from the close button. - Use a close button instead of the cancel button * Check if automatic internet updates is disabled and show an information about the need of reloading as the case may be * unset sensitive of main window during caching * Do not set a title in the download dialog * Show only the time in the progress bar * Use "Downloading file X of Y with 122/s" in the status label * Do not set the update treeview unsensitive during the download of the package related changelog --- DistUpgrade/DistUpgrade.glade | 2 +- UpdateManager/GtkProgress.py | 22 ++- UpdateManager/UpdateManager.py | 25 +++- data/UpdateManager.glade | 322 ++++++++++++++++++++++++++++++----------- 4 files changed, 268 insertions(+), 103 deletions(-) diff --git a/DistUpgrade/DistUpgrade.glade b/DistUpgrade/DistUpgrade.glade index 58aa10ad..affc7019 100644 --- a/DistUpgrade/DistUpgrade.glade +++ b/DistUpgrade/DistUpgrade.glade @@ -8,7 +8,7 @@ True Upgrading Ubuntu GTK_WINDOW_TOPLEVEL - GTK_WIN_POS_CENTER_ALWAYS + GTK_WIN_POS_CENTER False False False diff --git a/UpdateManager/GtkProgress.py b/UpdateManager/GtkProgress.py index d25149e4..025858e3 100644 --- a/UpdateManager/GtkProgress.py +++ b/UpdateManager/GtkProgress.py @@ -27,7 +27,7 @@ import apt_pkg from gettext import gettext as _ class GtkOpProgress(apt.OpProgress): - def __init__(self, window,progressbar, parent): + def __init__(self, window, progressbar, parent): self._parent = parent self._window = window self._progressbar = progressbar @@ -37,11 +37,13 @@ class GtkOpProgress(apt.OpProgress): #print self.Op #print self.SubOp self._window.show() + self._parent.set_sensitive(False) self._progressbar.set_text(self.op) self._progressbar.set_fraction(percent/100.0) while gtk.events_pending(): gtk.main_iteration() def done(self): + self._parent.set_sensitive(True) self._window.hide() class GtkFetchProgress(apt.progress.FetchProgress): @@ -59,7 +61,6 @@ class GtkFetchProgress(apt.progress.FetchProgress): if self.summary != "": self.summary.set_markup("%s \n\n%s" % (summary, descr)) - self.window_fetch.set_title(summary) def start(self): self.progress.set_fraction(0) self.window_fetch.show() @@ -69,15 +70,20 @@ class GtkFetchProgress(apt.progress.FetchProgress): self._continue = False def pulse(self): apt.progress.FetchProgress.pulse(self) - if self.currentCPS > 0: - self.status.set_text(_("Download rate: %s/s - %s remaining" % (apt_pkg.SizeToStr(self.currentCPS), apt_pkg.TimeToStr(self.eta)))) - else: - self.status.set_text(_("Download rate: unkown")) - self.progress.set_fraction(self.percent/100.0) currentItem = self.currentItems + 1 if currentItem > self.totalItems: currentItem = self.totalItems - self.progress.set_text(_("Downloading file %li of %li" % (currentItem, self.totalItems))) + if self.currentCPS > 0: + self.status.set_text(_("Downloading file %li of %li with %s/s" + % (currentItem, self.totalItems, + apt_pkg.SizeToStr(self.currentCPS)))) + else: + self.status.set_text(_("Downloading file %li of %li with unknown " + "speed") % (currentItem, self.totalItems)) + self.progress.set_fraction(self.percent/100.0) +# self.progress.set_text(_("Time remaining %s" % (apt_pkg.TimeToStr(self.eta)))) + self.progress.set_text(_("Time remaining")) + while gtk.events_pending(): gtk.main_iteration() return self._continue diff --git a/UpdateManager/UpdateManager.py b/UpdateManager/UpdateManager.py index d2c2bc54..89f4989e 100644 --- a/UpdateManager/UpdateManager.py +++ b/UpdateManager/UpdateManager.py @@ -213,12 +213,13 @@ class UpdateList: class UpdateManager(SimpleGladeApp): def __init__(self, datadir): - + self.datadir = datadir SimpleGladeApp.__init__(self, datadir+"glade/UpdateManager.glade", None, domain="update-manager") self.gnome_program = gnome.init("update-manager", "0.41") + self.packages = [] self.dl_size = 0 @@ -281,7 +282,7 @@ class UpdateManager(SimpleGladeApp): self.gconfclient = gconf.client_get_default() # restore state self.restore_state() - + def set_changes_buffer(self, changes_buffer, text, name, srcpkg): changes_buffer.set_text("") @@ -342,7 +343,6 @@ class UpdateManager(SimpleGladeApp): self.set_changes_buffer(changes_buffer, changes[0], name, changes[1]) else: if self.expander_details.get_expanded(): - self.treeview_update.set_sensitive(False) self.hbox_footer.set_sensitive(False) lock = thread.allocate_lock() lock.acquire() @@ -360,7 +360,6 @@ class UpdateManager(SimpleGladeApp): # download finished (or canceld, or time-out) button.hide() button.disconnect(id); - self.treeview_update.set_sensitive(True) self.hbox_footer.set_sensitive(True) if self.cache.all_changes.has_key(name): @@ -391,7 +390,7 @@ class UpdateManager(SimpleGladeApp): text_download = "" self.expander_details.set_sensitive(False) self.treeview_update.set_sensitive(False) - self.label_downsize.hide() + self.label_downsize.set_text="" self.button_cancel.grab_default() else: text_header = ""+gettext.ngettext("You can install one update", "You can install %s updates" % len(self.store), len(self.store))+"" @@ -399,8 +398,8 @@ class UpdateManager(SimpleGladeApp): text_download = _("Download size: %s" % apt_pkg.SizeToStr(self.dl_size)) self.expander_details.set_sensitive(True) self.treeview_update.set_sensitive(True) - self.label_downsize.show() self.button_install.grab_default() + self.label_header.set_markup(text_header) self.label_downsize.set_markup(text_download) @@ -863,6 +862,19 @@ class UpdateManager(SimpleGladeApp): self.cache._depcache.ReadPinFile(SYNAPTIC_PINFILE) self.cache._depcache.Init() + + def check_auto_update(self): + # Check if automatic update is enabled. If not show a dialog to inform + # the user about the need of manual "reloads" + update_days = apt_pkg.Config.FindI("APT::Periodic::Update-Package-Lists") + if update_days < 1: + self.dialog_manual_update.set_transient_for(self.window_main) + res = self.dialog_manual_update.run() + self.dialog_manual_update.hide() + if res == gtk.RESPONSE_YES: + self.on_button_reload_clicked(None) + + def main(self): self.meta = MetaRelease() self.meta.connect("new_dist_available",self.new_dist_available) @@ -875,4 +887,5 @@ class UpdateManager(SimpleGladeApp): gtk.main_iteration() self.fillstore() + self.check_auto_update() gtk.main() diff --git a/data/UpdateManager.glade b/data/UpdateManager.glade index c9b50999..78e5cb79 100644 --- a/data/UpdateManager.glade +++ b/data/UpdateManager.glade @@ -33,7 +33,7 @@ 6 True False - 12 + 6 @@ -142,7 +142,7 @@ 1 0 0 - 12 + 0 0 @@ -152,6 +152,23 @@ False 6 + + + True + gtk-dialog-info + 3 + 0 + 0 + 0 + 0 + + + 0 + False + True + + + True @@ -209,7 +226,7 @@ True False - 4 + 6 @@ -246,17 +263,18 @@ True False - 0 + 12 + True False False GTK_JUSTIFY_LEFT False False - 0.5 + 1 0.5 0 0 @@ -265,18 +283,98 @@ False 0 + + 0 + True + True + + + + + + True + True + True + True + GTK_RELIEF_NORMAL + True + + + + + True + 0.5 + 0.5 + 0 + 0 + 0 + 0 + 0 + 0 + + + + True + False + 2 + + + + True + gtk-apply + 4 + 0.5 + 0.5 + 0 + 0 + + + 0 + False + False + + + + + + True + _Install Updates + True + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + False + False + + + + + + + 0 False False - GTK_PACK_END 0 False - False + True @@ -617,6 +715,7 @@ True + Search for updates in the software channels True True GTK_RELIEF_NORMAL @@ -661,7 +760,7 @@ True - _Reload + _Query True False GTK_JUSTIFY_LEFT @@ -694,7 +793,7 @@ True True True - gtk-cancel + gtk-close True GTK_RELIEF_NORMAL True @@ -702,82 +801,6 @@ - - - - True - True - True - True - GTK_RELIEF_NORMAL - True - - - - - True - 0.5 - 0.5 - 0 - 0 - 0 - 0 - 0 - 0 - - - - True - False - 2 - - - - True - gtk-apply - 4 - 0.5 - 0.5 - 0 - 0 - - - 0 - False - False - - - - - - True - _Install - True - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - False - False - - - - - - - - 0 @@ -1303,7 +1326,7 @@ Need to get the changes from the central server True - <big><b>Reading package information</b></big> + <big><b>Loading software information</b></big> False True GTK_JUSTIFY_LEFT @@ -1327,8 +1350,7 @@ Need to get the changes from the central server - True - Reading information about the installed packages. Depending on the speed of your computer this may take a bit. + False False GTK_JUSTIFY_LEFT @@ -1379,4 +1401,128 @@ Need to get the changes from the central server + + 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 + False + False + + + + True + False + 12 + + + + True + GTK_BUTTONBOX_END + + + + True + True + True + _Reload + True + GTK_RELIEF_NORMAL + True + -8 + + + + + + True + True + True + gtk-close + True + GTK_RELIEF_NORMAL + True + -7 + + + + + 0 + False + True + GTK_PACK_END + + + + + + 6 + True + False + 11 + + + + True + gtk-dialog-info + 6 + 0 + 0 + 0 + 0 + + + 0 + False + True + + + + + + True + True + <b><big>You need to manually query for updates</big></b> + +Your system does not search for updates automatically. You can configure this behavior in "System" -> "Administration" -> "Software Properties". + False + True + GTK_JUSTIFY_LEFT + True + True + 0 + 0 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + False + False + + + + + 0 + True + True + + + + + + -- cgit v1.2.3 From 41a6ea707688e2e239ee75212888d01c219f39b1 Mon Sep 17 00:00:00 2001 From: Sebastian Heinlein Date: Wed, 25 Jan 2006 14:32:38 +0100 Subject: SoftwareProperties: * Allow a custom configuration for automatic internet udpates * Wording: "Choose a key-file" -> "Import key" (Import is the label on the button) * use the update-manager icon in the window list UpdateManager: * set window_main to unsensitive at the startup * Wording in the synaptic dialog: - "The updates are being applied." -> "Please wait, this can take some time." - "Upgrade is complete" -> "Update is complete" * set synapitc dialog to type-hint "dialog" and not "normal" * set the main_window to type-hint "dialog" and not "normal" * do not write a status message to treeview_updates during startup "Initializing and getting list of updates..." * Nicer wording in the dialog_manual_update: "You need to manually reload the latest information about updates" "Your system does not check for updates automatically. You can configure this behavior in "System" -> "Administration" -> "Software Properties" --- SoftwareProperties/SoftwareProperties.py | 25 ++++++-- UpdateManager/UpdateManager.py | 9 ++- data/SoftwareProperties.glade | 7 +-- data/UpdateManager.glade | 101 ++++++++++++++++++++++--------- 4 files changed, 100 insertions(+), 42 deletions(-) diff --git a/SoftwareProperties/SoftwareProperties.py b/SoftwareProperties/SoftwareProperties.py index 6b992df7..edcd407d 100644 --- a/SoftwareProperties/SoftwareProperties.py +++ b/SoftwareProperties/SoftwareProperties.py @@ -86,14 +86,27 @@ class SoftwareProperties(SimpleGladeApp): self.combobox_interval_mapping = { 0 : 1, 1 : 2, 2 : 7, - 3 : 14, - 4 : -1} + 3 : 14 } self.combobox_update_interval.set_active(0) + update_days = apt_pkg.Config.FindI(CONF_MAP["autoupdate"]) + + self.combobox_update_interval.append_text("Daily") + self.combobox_update_interval.append_text("Every Two Days") + self.combobox_update_interval.append_text("Weekly") + self.combobox_update_interval.append_text("Every Two Weeks") + + # If a custom period is defined add an corresponding entry + if not update_days in self.combobox_interval_mapping.values(): + self.combobox_update_interval.append_text(_("Every %s Days" + % update_days)) + self.combobox_interval_mapping[4] = update_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 update_days >= 1: self.checkbutton_auto_update.set_active(True) self.combobox_update_interval.set_sensitive(True) @@ -156,8 +169,10 @@ class SoftwareProperties(SimpleGladeApp): def on_combobox_update_interval_changed(self, widget): i = self.combobox_update_interval.get_active() value = self.combobox_interval_mapping[i] - apt_pkg.Config.Set(CONF_MAP["autoupdate"], str(value)) - self.write_config() + # Only wirte the key if it has changed + if not value == apt_pkg.Config.FindI(CONF_MAP["autoupdate"]): + apt_pkg.Config.Set(CONF_MAP["autoupdate"], str(value)) + self.write_config() def opt_autoupdate_toggled(self, widget): if self.checkbutton_auto_update.get_active(): @@ -234,7 +249,7 @@ class SoftwareProperties(SimpleGladeApp): self.modified = True def add_key_clicked(self, widget): - chooser = gtk.FileChooserDialog(title=_("Choose a key-file"), + chooser = gtk.FileChooserDialog(title=_("Import key"), parent=self.window_main, buttons=(gtk.STOCK_CANCEL, gtk.RESPONSE_REJECT, diff --git a/UpdateManager/UpdateManager.py b/UpdateManager/UpdateManager.py index 89f4989e..a4f8ed48 100644 --- a/UpdateManager/UpdateManager.py +++ b/UpdateManager/UpdateManager.py @@ -219,6 +219,7 @@ class UpdateManager(SimpleGladeApp): None, domain="update-manager") self.gnome_program = gnome.init("update-manager", "0.41") + self.window_main.set_sensitive(False) self.packages = [] self.dl_size = 0 @@ -423,9 +424,9 @@ class UpdateManager(SimpleGladeApp): if action == INSTALL: cmd.append("--set-selections") cmd.append("--progress-str") - cmd.append("%s" % _("The updates are being applied.")) + cmd.append("%s" % _("Please wait, this can take some time.")) cmd.append("--finish-str") - cmd.append("%s" % _("Upgrade is complete")) + cmd.append("%s" % _("Update is complete")) proc = subprocess.Popen(cmd, stdin=subprocess.PIPE) f = proc.stdin for s in self.packages: @@ -545,6 +546,7 @@ class UpdateManager(SimpleGladeApp): self.window_main.set_sensitive(False) # create a progress window that will swallow the synaptic progress bars win = gtk.Window() + win.set_property("type-hint", gtk.gdk.WINDOW_TYPE_HINT_DIALOG) win.set_title("") win.set_border_width(12) win.set_transient_for(self.window_main) @@ -880,9 +882,6 @@ class UpdateManager(SimpleGladeApp): self.meta.connect("new_dist_available",self.new_dist_available) self.meta.connect("dist_no_longer_supported",self.dist_no_longer_supported) - self.store.append([True, _("Initializing and getting list of updates..."), - None, None, None, None, None]) - while gtk.events_pending(): gtk.main_iteration() diff --git a/data/SoftwareProperties.glade b/data/SoftwareProperties.glade index 6bf1aa0f..edd12320 100644 --- a/data/SoftwareProperties.glade +++ b/data/SoftwareProperties.glade @@ -14,6 +14,7 @@ False True False + update-manager.png True False False @@ -317,11 +318,7 @@ True - daily -every two days -weekly -every two weeks -custom + False True diff --git a/data/UpdateManager.glade b/data/UpdateManager.glade index 78e5cb79..58413506 100644 --- a/data/UpdateManager.glade +++ b/data/UpdateManager.glade @@ -16,7 +16,7 @@ True False False - GDK_WINDOW_TYPE_HINT_NORMAL + GDK_WINDOW_TYPE_HINT_DIALOG GDK_GRAVITY_NORTH_WEST True False @@ -33,7 +33,7 @@ 6 True False - 6 + 12 @@ -152,23 +152,6 @@ False 6 - - - True - gtk-dialog-info - 3 - 0 - 0 - 0 - 0 - - - 0 - False - True - - - True @@ -197,6 +180,7 @@ True + Upgrade to a new version of Ubuntu True U_pgrade True @@ -274,8 +258,8 @@ GTK_JUSTIFY_LEFT False False - 1 - 0.5 + 0 + 0 0 0 PANGO_ELLIPSIZE_NONE @@ -293,6 +277,7 @@ True + Install the seleceted updates True True True @@ -715,7 +700,7 @@ True - Search for updates in the software channels + Reload the latest information about updates True True GTK_RELIEF_NORMAL @@ -760,7 +745,7 @@ True - _Query + _Reload True False GTK_JUSTIFY_LEFT @@ -1434,11 +1419,73 @@ Need to get the changes from the central server True True True - _Reload - True GTK_RELIEF_NORMAL True -8 + + + + True + 0.5 + 0.5 + 0 + 0 + 0 + 0 + 0 + 0 + + + + True + False + 2 + + + + True + gtk-refresh + 4 + 0.5 + 0.5 + 0 + 0 + + + 0 + False + False + + + + + + True + _Reload + True + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + False + False + + + + + + @@ -1491,9 +1538,9 @@ Need to get the changes from the central server True True - <b><big>You need to manually query for updates</big></b> + <b><big>You need to manually reload the latest information about updates</big></b> -Your system does not search for updates automatically. You can configure this behavior in "System" -> "Administration" -> "Software Properties". +Your system does not check for updates automatically. You can configure this behavior in "System" -> "Administration" -> "Software Properties". False True GTK_JUSTIFY_LEFT -- cgit v1.2.3 From 686048536599316356a300a1f08e95a1983109c6 Mon Sep 17 00:00:00 2001 From: Sebastian Heinlein Date: Thu, 26 Jan 2006 18:43:10 +0100 Subject: * Set the progress bar from pulse to 100% if we exceed 99% --- DistUpgrade/DistUpgradeViewGtk.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/DistUpgrade/DistUpgradeViewGtk.py b/DistUpgrade/DistUpgradeViewGtk.py index 94090322..40597519 100644 --- a/DistUpgrade/DistUpgradeViewGtk.py +++ b/DistUpgrade/DistUpgradeViewGtk.py @@ -47,9 +47,10 @@ class GtkOpProgress(apt.progress.OpProgress): self.progressbar.pulse() def update(self, percent): - # self.progressbar.set_text(self.op) -# self.progressbar.set_fraction(percent/100.0) - self.progressbar.pulse() + if percent > 99: + self.progressbar.set_fraction(1) + else: + self.progressbar.pulse() while gtk.events_pending(): gtk.main_iteration() -- cgit v1.2.3 From 31da72b447877118bd911ba9b4610bf3173f3f50 Mon Sep 17 00:00:00 2001 From: Sebastian Heinlein Date: Thu, 26 Jan 2006 19:17:19 +0100 Subject: * Add a virtual step 5 "complete" and some hidden widgets to the main window. the effect: if the upgrade is complete all progress list points are checked --- DistUpgrade/DistUpgrade.glade | 47 ++++++++++++++++++++++++++++++++++++- DistUpgrade/DistUpgradeControler.py | 1 + DistUpgrade/DistUpgradeView.py | 3 ++- 3 files changed, 49 insertions(+), 2 deletions(-) diff --git a/DistUpgrade/DistUpgrade.glade b/DistUpgrade/DistUpgrade.glade index affc7019..573ea66f 100644 --- a/DistUpgrade/DistUpgrade.glade +++ b/DistUpgrade/DistUpgrade.glade @@ -95,7 +95,7 @@ True - 4 + 5 2 False 6 @@ -288,6 +288,51 @@ fill + + + + 18 + 18 + 0.5 + 0.5 + 0 + 0 + + + 0 + 1 + 4 + 5 + fill + + + + + + + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 1 + 2 + 4 + 5 + fill + + + 0 diff --git a/DistUpgrade/DistUpgradeControler.py b/DistUpgrade/DistUpgradeControler.py index ea2de522..6ab77103 100644 --- a/DistUpgrade/DistUpgradeControler.py +++ b/DistUpgrade/DistUpgradeControler.py @@ -317,6 +317,7 @@ class DistUpgradeControler(object): self.doPostUpgrade() # done, ask for reboot + self._view.setStep(5) self._view.updateStatus(_("System upgrade is complete.")) # FIXME should we look into /var/run/reboot-required here? if self._view.confirmRestart(): diff --git a/DistUpgrade/DistUpgradeView.py b/DistUpgrade/DistUpgradeView.py index abc5b340..4c9103ba 100644 --- a/DistUpgrade/DistUpgradeView.py +++ b/DistUpgrade/DistUpgradeView.py @@ -38,11 +38,12 @@ class DistUpgradeView(object): """ pass def setStep(self, step): - """ we have 4 steps current for a upgrade: + """ we have 5 steps current for a upgrade: 1. Analyzing the system 2. Updating repository information 3. Performing the upgrade 4. Post upgrade stuff + 5. Complete """ pass def confirmChanges(self, summary, changes, downloadSize): -- cgit v1.2.3 From 79bbe42e52af6ddd5d680d118ac09a50dafc9b78 Mon Sep 17 00:00:00 2001 From: Sebastian Heinlein Date: Thu, 26 Jan 2006 19:54:10 +0100 Subject: * Do not use header capitalization in the combo box. The HIG says sentence capitalization * Add a ":" to the checkbox for automatic updates. the sentence does not include the combo box --- SoftwareProperties/SoftwareProperties.py | 6 +++--- data/SoftwareProperties.glade | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/SoftwareProperties/SoftwareProperties.py b/SoftwareProperties/SoftwareProperties.py index edcd407d..961c4fdd 100644 --- a/SoftwareProperties/SoftwareProperties.py +++ b/SoftwareProperties/SoftwareProperties.py @@ -92,13 +92,13 @@ class SoftwareProperties(SimpleGladeApp): update_days = apt_pkg.Config.FindI(CONF_MAP["autoupdate"]) self.combobox_update_interval.append_text("Daily") - self.combobox_update_interval.append_text("Every Two Days") + self.combobox_update_interval.append_text("Every two days") self.combobox_update_interval.append_text("Weekly") - self.combobox_update_interval.append_text("Every Two Weeks") + self.combobox_update_interval.append_text("Every two weeks") # If a custom period is defined add an corresponding entry if not update_days in self.combobox_interval_mapping.values(): - self.combobox_update_interval.append_text(_("Every %s Days" + self.combobox_update_interval.append_text(_("Every %s days" % update_days)) self.combobox_interval_mapping[4] = update_days diff --git a/data/SoftwareProperties.glade b/data/SoftwareProperties.glade index edd12320..0a39a13f 100644 --- a/data/SoftwareProperties.glade +++ b/data/SoftwareProperties.glade @@ -299,7 +299,7 @@ True True - Automatically check for updates + Automatically check for updates: True GTK_RELIEF_NORMAL True -- cgit v1.2.3 From 8200e5372634e26fd41cb5d2e128ff4687db5247 Mon Sep 17 00:00:00 2001 From: Sebastian Heinlein Date: Thu, 26 Jan 2006 20:17:15 +0100 Subject: Polishing the SoftwareProperties: * Add a sanity check: if no autoupdate was specifed do not add and show "Every 0 days" int the combo box. instead select no entry - it's insensitive anyway. * If autoupdated is activated and no frequency was defined before use daily as default --- SoftwareProperties/SoftwareProperties.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/SoftwareProperties/SoftwareProperties.py b/SoftwareProperties/SoftwareProperties.py index 961c4fdd..52351db6 100644 --- a/SoftwareProperties/SoftwareProperties.py +++ b/SoftwareProperties/SoftwareProperties.py @@ -98,9 +98,10 @@ class SoftwareProperties(SimpleGladeApp): # If a custom period is defined add an corresponding entry if not update_days in self.combobox_interval_mapping.values(): - self.combobox_update_interval.append_text(_("Every %s days" - % update_days)) - self.combobox_interval_mapping[4] = update_days + if update_days > 0: + self.combobox_update_interval.append_text(_("Every %s days" + % update_days)) + self.combobox_interval_mapping[4] = update_days for key in self.combobox_interval_mapping: if self.combobox_interval_mapping[key] == update_days: @@ -178,6 +179,10 @@ class SoftwareProperties(SimpleGladeApp): if self.checkbutton_auto_update.get_active(): self.combobox_update_interval.set_sensitive(True) i = self.combobox_update_interval.get_active() + # if no frequency was specified use daily + if i == -1: + i = 0 + self.combobox_update_interval.set_active(i) value = self.combobox_interval_mapping[i] else: self.combobox_update_interval.set_sensitive(False) -- cgit v1.2.3 From fdb6f104af71f36f3e18c737acf91bb87a395687 Mon Sep 17 00:00:00 2001 From: Sebastian Heinlein Date: Fri, 27 Jan 2006 20:22:23 +0100 Subject: * Use the label_status in GtkOpProgress and not the progress bar * Set the progress bar in GtkOpProgress to indeterminate - should be reverted * if apt doesn't resets the progress bar several times * Changed a lot of strings * Replaced many tabs by spaces (used python -tt) * Add additional error messages * Use ERROR and not INFO dialogs in case of an error * Use close button in alert dialogs * Unset title of alter dialogs * Changed the fetch dialog to a window, sinec we cannot hide the unused button box in a dialog --- UpdateManager/GtkProgress.py | 42 +++--- UpdateManager/UpdateManager.py | 150 ++++++++++++--------- data/UpdateManager.glade | 291 +++++++++++++++++++---------------------- 3 files changed, 256 insertions(+), 227 deletions(-) diff --git a/UpdateManager/GtkProgress.py b/UpdateManager/GtkProgress.py index 025858e3..9dd8d6f1 100644 --- a/UpdateManager/GtkProgress.py +++ b/UpdateManager/GtkProgress.py @@ -27,19 +27,28 @@ import apt_pkg from gettext import gettext as _ class GtkOpProgress(apt.OpProgress): - def __init__(self, window, progressbar, parent): + def __init__(self, window, progressbar, status, parent): self._parent = parent self._window = window + self._status = status self._progressbar = progressbar + self._progressbar.set_pulse_step(0.01) + self._progressbar.pulse() window.set_transient_for(parent) def update(self, percent): #print percent #print self.Op #print self.SubOp + # Use pulse until apt doesn't restarts the progress bar + # several times self._window.show() self._parent.set_sensitive(False) - self._progressbar.set_text(self.op) - self._progressbar.set_fraction(percent/100.0) + self._status.set_markup("%s" % self.op) + #self._progressbar.set_fraction(percent/100.0) + if percent > 99: + self._progressbar.set_fraction(1) + else: + self._progressbar.pulse() while gtk.events_pending(): gtk.main_iteration() def done(self): @@ -62,10 +71,10 @@ class GtkFetchProgress(apt.progress.FetchProgress): self.summary.set_markup("%s \n\n%s" % (summary, descr)) def start(self): - self.progress.set_fraction(0) + self.progress.set_fraction(0) self.window_fetch.show() def stop(self): - self.window_fetch.hide() + self.window_fetch.hide() def on_button_fetch_cancel_clicked(self, widget): self._continue = False def pulse(self): @@ -74,16 +83,19 @@ class GtkFetchProgress(apt.progress.FetchProgress): if currentItem > self.totalItems: currentItem = self.totalItems if self.currentCPS > 0: - self.status.set_text(_("Downloading file %li of %li with %s/s" - % (currentItem, self.totalItems, - apt_pkg.SizeToStr(self.currentCPS)))) + statusText = (_("Downloading file %li of %li with %s/s" + % (currentItem, self.totalItems, + apt_pkg.SizeToStr(self.currentCPS)))) else: - self.status.set_text(_("Downloading file %li of %li with unknown " - "speed") % (currentItem, self.totalItems)) - self.progress.set_fraction(self.percent/100.0) -# self.progress.set_text(_("Time remaining %s" % (apt_pkg.TimeToStr(self.eta)))) - self.progress.set_text(_("Time remaining")) + statusText = (_("Downloading file %li of %li with unknown " + "speed") % (currentItem, self.totalItems)) + self.progress.set_fraction(self.percent/100.0) + self.status.set_markup("%s" % statusText) + # TRANSLATORS: show the remaining time in a progress bar: + #self.progress.set_text(_("About %s left" % (apt_pkg.TimeToStr(self.eta)))) + # FIXME: show remaining time + self.progress.set_text("") - while gtk.events_pending(): - gtk.main_iteration() + while gtk.events_pending(): + gtk.main_iteration() return self._continue diff --git a/UpdateManager/UpdateManager.py b/UpdateManager/UpdateManager.py index a4f8ed48..71bbd351 100644 --- a/UpdateManager/UpdateManager.py +++ b/UpdateManager/UpdateManager.py @@ -142,10 +142,15 @@ class MyCache(apt.Cache): self.all_changes[name] = [alllines, srcpkg] except urllib2.HTTPError: if lock.locked(): - self.all_changes[name] = [_("Changes not found, the server may not be updated yet."), srcpkg] + self.all_changes[name] = [_("The list of changes is not " + "available yet. Please try again " + "later."), srcpkg] except IOError: if lock.locked(): - self.all_changes[name] = [_("Failed to download changes. Please check if there is an active internet connection."), srcpkg] + self.all_changes[name] = [_("Failed to download the list" + "of changes. Please " + "check your internet " + "connection."), srcpkg] if lock.locked(): lock.release() @@ -172,24 +177,19 @@ class UpdateList: self.pkgs.sort(lambda x,y: cmp(x.name,y.name)) if cache._depcache.KeepCount > 0: #print "WARNING, keeping packages" - msg=("%s\n\n%s"%(_("It is not possible to upgrade " - "all packages."), - _("This means that " - "besides the actual upgrade of the " - "packages some further action " - "(such as installing or removing " - "packages) " - "is required. Please use Synaptic " - "\"Smart Upgrade\" or " - "\"apt-get dist-upgrade\" to fix " - "the situation." - ))) + msg = ("%s\n\n%s" % \ + (_("Cannot install all available updates"), + _("Some updates require to install or remove further software. " + "Use the function \"Smart Upgrade\" of the package manager " + "\"Synaptic\" or run \"sudo apt-get dist-upgrade\" in a " + "terminal to update your system completely."))) dialog = gtk.MessageDialog(self.parent_window, 0, gtk.MESSAGE_INFO, - gtk.BUTTONS_OK,"") + gtk.BUTTONS_CLOSE,"") dialog.set_default_response(gtk.RESPONSE_OK) dialog.set_markup(msg) + dialog.set_title("") dialog.vbox.set_spacing(6) - label = gtk.Label(_("The following packages are not upgraded: ")) + label = gtk.Label(_("The following updates will be skipped:")) label.set_alignment(0.0,0.5) dialog.set_border_width(6) label.show() @@ -348,7 +348,7 @@ class UpdateManager(SimpleGladeApp): lock = thread.allocate_lock() lock.acquire() t=thread.start_new_thread(self.cache.get_changelog,(name,lock)) - changes_buffer.set_text(_("Downloading changes...")) + changes_buffer.set_text(_("Downloading the list of changes...")) button = self.button_cancel_dl_changelog button.show() id = button.connect("clicked", @@ -465,24 +465,25 @@ class UpdateManager(SimpleGladeApp): #print "on_button_reload_clicked" #self.invoke_manager(UPDATE) progress = GtkProgress.GtkFetchProgress(self, - _("Downloading package " - "information"), - _("The repositories will be " - "checked for new, removed " - "or upgraded software " - "packages.")) + _("Reloading the information about " + "latest updates"), + _("It is important to check " + "the software sources for " + "available upgrades reguarly.")) # FIXME: do a try/except here otherwise it may bomb try: self.cache.update(progress) except (IOError,SystemError), msg: dialog = gtk.MessageDialog(self.window_main, 0, gtk.MESSAGE_ERROR, - gtk.BUTTONS_OK,"") + gtk.BUTTONS_CLOSE,"") + # FIXME: wording dialog.set_markup("%s"%\ - _("Error reloading")) - dialog.format_secondary_text(_("A error occured during the package " - "list reload. Please see the below " - "information for details what went " - "wrong.")) + _("Could not reload the update information")) + #dialog.format_secondary_text(_("An error occured during the package " + # "list reload. Please see the below " + # "information for details what went " + # "wrong.")) + diaolg.set_title("") dialog.set_border_width(6) dialog.set_size_request(width=500,height=-1) scroll = gtk.ScrolledWindow() @@ -533,7 +534,7 @@ class UpdateManager(SimpleGladeApp): "at the same time. Please close " "this other application first."))); dialog = gtk.MessageDialog(self.window_main, 0, gtk.MESSAGE_ERROR, - gtk.BUTTONS_OK,"") + gtk.BUTTONS_CLOSE,"") dialog.set_markup(msg) dialog.run() dialog.destroy() @@ -548,7 +549,7 @@ class UpdateManager(SimpleGladeApp): win = gtk.Window() win.set_property("type-hint", gtk.gdk.WINDOW_TYPE_HINT_DIALOG) win.set_title("") - win.set_border_width(12) + win.set_border_width(6) win.set_transient_for(self.window_main) win.set_position(gtk.WIN_POS_CENTER_ON_PARENT) win.set_property("skip-taskbar-hint", True) @@ -646,7 +647,7 @@ class UpdateManager(SimpleGladeApp): 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,gtk.DIALOG_MODAL, + dialog = gtk.MessageDialog(self.window_main, 0, gtk.MESSAGE_INFO,gtk.BUTTONS_YES_NO,"") dialog.set_markup(primary); dialog.format_secondary_text(secondary); @@ -691,10 +692,10 @@ class UpdateManager(SimpleGladeApp): name = xml.sax.saxutils.escape(pkg.name) summary = xml.sax.saxutils.escape(pkg.summary) contents = "%s\n%s\n\n" % (name, summary) - contents = contents + _("New version: %s (Size: %s)") % (pkg.candidateVersion,apt.SizeToStr(pkg.packageSize)) + "" + contents = contents + _("New version: %s (Size: %s)") % (pkg.candidateVersion,apt.SizeToStr(pkg.packageSize)) + "" iter = self.store.append([True, contents, pkg.name, pkg.summary, pkg.candidateVersion, pkg.description, pkg]) - self.add_update(pkg) + self.add_update(pkg) i = i + 1 @@ -702,9 +703,15 @@ class UpdateManager(SimpleGladeApp): return False def dist_no_longer_supported(self, meta_release): - msg = "%s\n\n%s" % (_("Your distribution is no longer supported"), _("Please upgrade to a newer version of Ubuntu Linux. The version you are running will no longer get security fixes or other critical updates. Please see http://www.ubuntulinux.org for upgrade information.")) + msg = "%s\n\n%s" % \ + (_("Your distribution is not supported anymore"), + _("You will not get any further security fixes or critical updates. " + "Upgrade to a later version of Ubuntu Linux. See " + "http://www.ubuntulinux.org for more information on " + "upgrading.")) dialog = gtk.MessageDialog(self.window_main, 0, gtk.MESSAGE_WARNING, - gtk.BUTTONS_OK,"") + gtk.BUTTONS_CLOSE,"") + dialog.set_title("") dialog.set_markup(msg) dialog.run() dialog.destroy() @@ -734,11 +741,26 @@ class UpdateManager(SimpleGladeApp): res = self.dialog_release_notes.run() self.dialog_release_notes.hide() except urllib2.HTTPError: - # FIXME: make proper error dialogs here - print _("Release notes not found on the server.") + primary = "%s" % \ + _("Could not find the release notes") + secondary = _("Please check your software sources. Only use " \ + "official Ubuntu servers and mirrors.") + dialog = gtk.MessageDialog(self.window_main,gtk.DIALOG_MODAL, + gtk.MESSAGE_ERROR,gtk.BUTTONS_CLOSE,"") + dialog.set_title("") + dialog.set_markup(primary); + dialog.format_secondary_text(secondary); + dialog.run() except IOError: - print _("Failed to download Release Notes. Please " - "check if there is an active internet connection.") + primary = "%s" % \ + _("Could not download the release notes") + secondary = _("Please check your internet connection.") + dialog = gtk.MessageDialog(self.window_main,gtk.DIALOG_MODAL, + gtk.MESSAGE_ERROR,gtk.BUTTONS_CLOSE,"") + dialog.set_title("") + dialog.set_markup(primary); + dialog.format_secondary_text(secondary); + dialog.run() self.window_main.set_sensitive(True) self.window_main.window.set_cursor(None) # user clicked cancel @@ -750,10 +772,11 @@ class UpdateManager(SimpleGladeApp): os.chdir(tmpdir) if self.new_dist.upgradeTool != None: progress = GtkProgress.GtkFetchProgress(self, - _("Downloading upgrade " - "informtion"), - _("The upgrade information " - "are downloaded")) + _("Downloading the upgrade " + "tool"), + _("The upgrade tool will " + "guide you through the " + "upgrade process.")) fetcher = apt_pkg.GetAcquire(progress) uri = self.new_dist.upgradeTool #print "Downloading %s to %s" % (uri, tmpdir) @@ -775,8 +798,17 @@ class UpdateManager(SimpleGladeApp): # see if we have a script file that we can run script = "%s/%s" % (tmpdir, self.new_dist.name) if not os.path.exists(script): - # FIXME: display a proper error message here - print "no script file found in extracted tarbal" + # no script file found in extracted tarbal + primary = "%s" % \ + _("Could not run the upgrade tool") + secondary = _("Please check your software sources. Only use " \ + "official Ubuntu servers and mirrors.") + dialog = gtk.MessageDialog(self.window_main,gtk.DIALOG_MODAL, + gtk.MESSAGE_ERROR,gtk.BUTTONS_CLOSE,"") + dialog.set_title("") + dialog.set_markup(primary); + dialog.format_secondary_text(secondary); + dialog.run() else: #print "runing: %s" % script os.execv(script,[]) @@ -825,13 +857,14 @@ class UpdateManager(SimpleGladeApp): d = gtk.MessageDialog(parent=self.window_main, flags=gtk.DIALOG_MODAL, type=gtk.MESSAGE_ERROR, - buttons=gtk.BUTTONS_OK) + buttons=gtk.BUTTONS_CLOSE) d.set_markup("%s\n\n%s" % ( - _("Unable to get exclusive lock"), - _("This usually means that another package management " - "application (like apt-get or aptitude) already running. " - "Please close that application first"))) + _("Only one software management tool is allowed to " + "run at the same time"), + _("Please close the other application e.g. \"aptitude\" " + "or \"Synaptic\" at first."))) print "error from apt: '%s'" % e + d.set_title("") res = d.run() d.destroy() sys.exit() @@ -839,20 +872,19 @@ class UpdateManager(SimpleGladeApp): try: self.cache = MyCache(GtkProgress.GtkOpProgress(self.dialog_cacheprogress, self.progressbar_cache, + self.label_cache, self.window_main)) except AssertionError: # we assert a clean cache msg=("%s\n\n%s"% \ - (_("Your system has broken packages!"), - _("This means that some dependencies " - "of the installed packages are not " - "satisfied. Please use \"Synaptic\" " - "or \"apt-get\" to fix the " - "situation." - ))) + (_("Software index is broken"), + _("It is impossible to install or remove any software. " + "Please use the package manager \"Synaptic\" or run " + "\"sudo apt-get install -f\" in a terminal to fix " + "this issue at first."))) dialog = gtk.MessageDialog(self.window_main, 0, gtk.MESSAGE_ERROR, - gtk.BUTTONS_OK,"") + gtk.BUTTONS_CLOSE,"") dialog.set_markup(msg) dialog.vbox.set_spacing(6) dialog.run() diff --git a/data/UpdateManager.glade b/data/UpdateManager.glade index 58413506..cd356791 100644 --- a/data/UpdateManager.glade +++ b/data/UpdateManager.glade @@ -66,7 +66,7 @@ True - <big><b>Install software updates</b></big> + <big><b>Keep your system up-to-date</b></big> True True GTK_JUSTIFY_LEFT @@ -489,7 +489,7 @@ True - Cancel downloading of the changelog + Cancel _Download True False GTK_JUSTIFY_LEFT @@ -1051,14 +1051,14 @@ Need to get the changes from the central server GTK_WINDOW_TOPLEVEL GTK_WIN_POS_CENTER_ON_PARENT - True - True + False + False False synaptic.xpm True - False - False - GDK_WINDOW_TYPE_HINT_NORMAL + True + True + GDK_WINDOW_TYPE_HINT_DIALOG GDK_GRAVITY_NORTH_WEST True False @@ -1076,37 +1076,37 @@ Need to get the changes from the central server False 12 + + + True + + False + True + GTK_JUSTIFY_LEFT + True + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + False + False + + + True False 6 - - - True - - False - True - GTK_JUSTIFY_LEFT - True - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - False - False - - - True @@ -1265,127 +1265,6 @@ Need to get the changes from the central server - - 6 - - GTK_WINDOW_TOPLEVEL - GTK_WIN_POS_CENTER_ON_PARENT - False - False - False - True - False - False - GDK_WINDOW_TYPE_HINT_DIALOG - GDK_GRAVITY_NORTH_WEST - True - False - False - - - - True - False - 12 - - - - True - GTK_BUTTONBOX_END - - - 0 - False - True - GTK_PACK_END - - - - - - 6 - True - False - 6 - - - - True - <big><b>Loading software information</b></big> - False - True - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - False - False - - - - - - - False - False - GTK_JUSTIFY_LEFT - True - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - False - False - - - - - - True - GTK_PROGRESS_LEFT_TO_RIGHT - 0 - 0.10000000149 - PANGO_ELLIPSIZE_NONE - - - 0 - False - False - - - - - - - - - 0 - True - True - - - - - - 6 @@ -1572,4 +1451,110 @@ Your system does not check for updates automatically. You can configure this beh + + 6 + + GTK_WINDOW_TOPLEVEL + GTK_WIN_POS_NONE + False + False + False + True + True + True + GDK_WINDOW_TYPE_HINT_DIALOG + GDK_GRAVITY_NORTH_WEST + True + False + + + + 6 + True + False + 12 + + + + True + <big><b>Checking for available updates</b></big> + +Software updates can fix possible security holes, fix possible errors, so called "bugs", or provide new features to you. + False + True + GTK_JUSTIFY_LEFT + True + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + False + False + + + + + + True + False + 6 + + + + True + GTK_PROGRESS_LEFT_TO_RIGHT + 0 + 0.10000000149 + PANGO_ELLIPSIZE_NONE + + + 0 + False + False + + + + + + True + + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + False + False + + + + + 0 + False + False + + + + + + -- cgit v1.2.3 From db29199645e2673c35f68d5364d76f1b2b18d318 Mon Sep 17 00:00:00 2001 From: Sebastian Heinlein Date: Fri, 27 Jan 2006 20:41:22 +0100 Subject: * Remove tooltip from the button "Install Updates" * it is "latest" and not "new" in the upgrade tooltip --- data/UpdateManager.glade | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/data/UpdateManager.glade b/data/UpdateManager.glade index cd356791..2258e394 100644 --- a/data/UpdateManager.glade +++ b/data/UpdateManager.glade @@ -180,7 +180,7 @@ True - Upgrade to a new version of Ubuntu + Upgrade to the latest version of Ubuntu True U_pgrade True @@ -277,7 +277,6 @@ True - Install the seleceted updates True True True -- cgit v1.2.3