From 36229ef2e521dab36782ce60c1d271eaf2a31353 Mon Sep 17 00:00:00 2001 From: Thomas Leonard Date: Sun, 19 Jun 2005 14:57:19 +0000 Subject: [PATCH] Moved refresh processing to gui. Recalculate when cancelling a download, since the cached setting may have changed. git-svn-id: file:///home/talex/Backups/sf.net/Subversion/zero-install/injector/injector-gui@348 9f8c893c-44ee-0310-b757-c8ca8341c71e --- 0launch-gui | 7 +++---- download_box.py | 1 + gui.py | 5 ++++- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/0launch-gui b/0launch-gui index b0cb682..4925b8b 100755 --- a/0launch-gui +++ b/0launch-gui @@ -8,7 +8,7 @@ __builtins__._ = lambda x: x parser = OptionParser(usage="usage: %prog [options] interface [args]") parser.add_option("-d", "--download-only", help="fetch but don't run", action='store_true') parser.add_option("-n", "--no-self-update", help="don't check for updates to the GUI itself", action='store_true') -parser.add_option("-r", "--refresh", help="refresh all used interfaces", action='store_true') +parser.add_option("-r", "--refresh", help="check for updates of all interfaces", action='store_true') parser.add_option("-v", "--version", help="display version information", action='store_true') parser.disable_interspersed_args() @@ -51,7 +51,6 @@ if options.no_self_update is not True: download_only = False policy = gui.GUIPolicy(interface_uri, prog_args, - download_only = bool(options.download_only)) -if options.refresh: - policy.refresh_all(force = False) + download_only = bool(options.download_only), + refresh = bool(options.refresh)) policy.main() diff --git a/download_box.py b/download_box.py index 53a344d..5440285 100644 --- a/download_box.py +++ b/download_box.py @@ -89,6 +89,7 @@ class DownloadProgessBox(Dialog): self.idle_timeout = None self.destroy() mainwindow.show() + policy.recalculate() self.connect('response', resp) def update_bars(): diff --git a/gui.py b/gui.py index ca9550e..524f271 100644 --- a/gui.py +++ b/gui.py @@ -16,7 +16,7 @@ class GUIPolicy(Policy): pulse = None monitored_downloads = None - def __init__(self, interface, prog_args, download_only): + def __init__(self, interface, prog_args, download_only, refresh): Policy.__init__(self, interface) global policy assert policy is None @@ -27,6 +27,9 @@ class GUIPolicy(Policy): self.window = mainwindow.MainWindow(prog_args, download_only) self.window.browser.set_root(policy.get_interface(policy.root)) + if refresh: + self.refresh_all(force = False) + def monitor_download(self, dl): self.monitored_downloads.append(dl) -- 2.11.4.GIT