[sulfur] improve treeview usability (showing a loading message)

This commit is contained in:
Fabio Erculiani
2010-01-22 09:53:35 +01:00
parent 7a90b2ad53
commit dc6b49f8b9
2 changed files with 16 additions and 11 deletions
+3 -11
View File
@@ -1542,21 +1542,14 @@ class SulfurApplication(Controller, SulfurApplicationEventsMixin):
self.disable_ugc = True
self.ui_lock(True)
self.set_busy()
loading_data = self.etpbase.get_groups('loading')
self.pkgView.populate(loading_data, empty = True)
allpkgs = []
self.progress.set_mainLabel(_('Generating Metadata, please wait.'))
self.progress.set_subLabel(
_('Entropy is indexing the repositories. It will take a few seconds'))
self.progress.set_extraLabel(
_('While you are waiting, take a break and look outside. Is it rainy?'))
for flt in masks:
msg = "%s: %s" % (_('Calculating'), flt,)
self.set_status_ticker(msg)
allpkgs += self.etpbase.get_groups(flt)
if action == "updates":
msg = "%s: available" % (_('Calculating'),)
self.set_status_ticker(msg)
# speed up first queue taint iteration
self.etpbase.get_groups("available")
def do_more_caching():
@@ -1569,8 +1562,7 @@ class SulfurApplication(Controller, SulfurApplicationEventsMixin):
return False
gobject.idle_add(do_more_caching)
# set updates label
if action == 'updates':
# set updates label
raw_updates = len(self.etpbase.get_raw_groups('updates'))
self._set_updates_label(raw_updates)
+13
View File
@@ -997,6 +997,18 @@ class EntropyPackages:
dummy_type = SulfurConf.dummy_empty)
return [myobj]
def _pkg_get_loading(self):
msg = "<big><b><span foreground='%s'>%s</span></b></big>\n%s.\n%s" % (
SulfurConf.color_title,
_('Please wait, loading...'),
_("The current view is loading."),
_("Be patient, sit down and relax."),
)
myobj = DummyEntropyPackage(namedesc = msg,
dummy_type = SulfurConf.dummy_empty)
return [myobj]
def _pkg_get_empty_search_item(self):
if self._filter_callback:
@@ -1071,6 +1083,7 @@ class EntropyPackages:
"user_unmasked": self._pkg_get_user_unmasked,
"pkgsets": self._pkg_get_pkgsets,
"fake_updates": self._pkg_get_fake_updates,
"loading": self._pkg_get_loading,
"downgrade": self._pkg_get_downgrade,
"glsa_metadata": self._pkg_get_glsa_metadata,
"search": self._pkg_get_search,