From 95549ba913f264882396e3688821a2b8e001ac3f Mon Sep 17 00:00:00 2001 From: Thomas Leonard Date: Mon, 28 Jan 2008 22:08:24 +0000 Subject: [PATCH] GUI's refresh feature works again. Passes test-gui suite. --- zeroinstall/0launch-gui/0launch-gui | 3 +-- zeroinstall/0launch-gui/gui.py | 23 +++++++++++------------ 2 files changed, 12 insertions(+), 14 deletions(-) diff --git a/zeroinstall/0launch-gui/0launch-gui b/zeroinstall/0launch-gui/0launch-gui index 267e79a..81c2394 100755 --- a/zeroinstall/0launch-gui/0launch-gui +++ b/zeroinstall/0launch-gui/0launch-gui @@ -93,8 +93,7 @@ if options.before or options.not_before: policy = gui.GUIPolicy(interface_uri, download_only = bool(options.download_only), - refresh = bool(options.refresh), src = options.source, restrictions = restrictions) -main = tasks.Task(policy.main(), "main") +main = tasks.Task(policy.main(bool(options.refresh)), "main") policy.handler.wait_for_blocker(main.finished) diff --git a/zeroinstall/0launch-gui/gui.py b/zeroinstall/0launch-gui/gui.py index bcb55bc..09438d7 100644 --- a/zeroinstall/0launch-gui/gui.py +++ b/zeroinstall/0launch-gui/gui.py @@ -72,7 +72,7 @@ class GUIPolicy(Policy): download_only = None widgets = None # Glade - def __init__(self, interface, download_only, refresh, src = False, restrictions = None): + def __init__(self, interface, download_only, src = False, restrictions = None): Policy.__init__(self, interface, GUIHandler(self), src = src) self.solver.record_details = True global policy @@ -92,15 +92,6 @@ class GUIPolicy(Policy): root = iface_cache.get_interface(self.root) self.window.browser.set_root(root) - if refresh: - # If we have feeds then treat this as a refresh, - # even if we've never seen the main interface before. - # Used the first time the GUI is used, for example. - if root.name is not None or root.feeds: - self.checking = CheckingBox(root) - - self.refresh_all(force = False) - self.watchers.append(self.update_display) def show_details(self): @@ -124,8 +115,16 @@ class GUIPolicy(Policy): def update_display(self): self.window.set_response_sensitive(gtk.RESPONSE_OK, self.ready) - def main(self): - solved = tasks.Task(self.solve_with_downloads(), "solve_with_downloads") + def main(self, refresh): + if refresh: + # If we have feeds then treat this as an update check, + # even if we've never seen the main interface before. + # Used the first time the GUI is used, for example. + root = self.get_interface(self.root) + if root.name is not None or root.feeds: + self.checking = CheckingBox(root) + + solved = tasks.Task(self.solve_with_downloads(force = refresh), "solve_with_downloads") if self.checking: self.checking.show() -- 2.11.4.GIT