From 324d4bd436562e780260f1d0996b584fe5dc8f0b Mon Sep 17 00:00:00 2001 From: Sebastian Heinlein Date: Thu, 23 Mar 2006 19:29:20 +0100 Subject: * remove some old duplicated code * do not hide the checkbutton column at startup --- UpdateManager/UpdateManager.py | 25 ++++++------------------- 1 file changed, 6 insertions(+), 19 deletions(-) (limited to 'UpdateManager/UpdateManager.py') diff --git a/UpdateManager/UpdateManager.py b/UpdateManager/UpdateManager.py index 9b7b3e28..bdbfc20f 100644 --- a/UpdateManager/UpdateManager.py +++ b/UpdateManager/UpdateManager.py @@ -266,7 +266,7 @@ class UpdateManager(SimpleGladeApp): #self.treeview_update.set_fixed_height_mode(True) self.treeview_update.append_column(self.cb) - self.cb.set_visible(False) + self.cb.set_visible(True) self.treeview_update.append_column(c0) self.treeview_update.set_search_column(LIST_NAME) @@ -419,6 +419,8 @@ class UpdateManager(SimpleGladeApp): self.button_install.set_sensitive(True) def update_count(self): + """activate or disable widgets and show dialog texts correspoding to + the number of available updates""" if self.list.num_updates == 0: text_header= ""+_("Your system is up-to-date")+"" text_download = "" @@ -426,6 +428,8 @@ class UpdateManager(SimpleGladeApp): self.treeview_update.set_sensitive(False) self.label_downsize.set_text="" self.button_close.grab_default() + 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))+"" @@ -600,24 +604,7 @@ class UpdateManager(SimpleGladeApp): # fill them again self.list.update(self.cache) - if self.list.num_updates < 1: - # set the label and treeview and hide the checkbox column - self.cb.set_visible(False) - text = "%s\n\n%s" % (_("Your system is up-to-date"), - _("There are no updates available.")) - self.label_header.set_markup(text) - # make sure no install is possible - self.button_install.set_sensitive(False) - self.textview_changes.get_buffer().set_text("") - self.textview_descr.get_buffer().set_text("") - else: - self.cb.set_visible(True) - self.treeview_update.set_headers_visible(False) - text = _("Available Updates\n" - "\n" - "The following packages are found to be upgradable. You can upgrade them by " - "using the Install button.") - self.label_header.set_markup(text) + if self.list.num_updates > 0: i=0 for pkg in self.list.pkgs: -- cgit v1.2.3