diff options
author | Jeremy Huddleston <jeremyhu@freedesktop.org> | 2009-07-21 00:22:12 -0700 |
---|---|---|
committer | Jeremy Huddleston <jeremyhu@freedesktop.org> | 2009-07-24 09:41:42 -0700 |
commit | d86d06201c64428d296c7b9c10a6d48bd14391ef (patch) | |
tree | b599e1e88a86d19f583064bb6d367c8368f70503 | |
parent | 02f6723c96e1b2ed3d2e45d27d84688db1fdb518 (diff) |
XQuartz: Set can_quit to true during a Sparkle-initiated relaunch.
(cherry picked from commit b2e9a77111d4572402d8ca95e3368db97ba7d598)
-rw-r--r-- | hw/xquartz/X11Application.m | 2 | ||||
-rw-r--r-- | hw/xquartz/X11Controller.h | 7 | ||||
-rw-r--r-- | hw/xquartz/X11Controller.m | 14 |
3 files changed, 16 insertions, 7 deletions
diff --git a/hw/xquartz/X11Application.m b/hw/xquartz/X11Application.m index eb0c39add..f5fa5eed3 100644 --- a/hw/xquartz/X11Application.m +++ b/hw/xquartz/X11Application.m @@ -970,7 +970,7 @@ void X11ApplicationMain (int argc, char **argv, char **envp) { fprintf(stderr, "Error initializing xpbproxy\n"); #if XQUARTZ_SPARKLE - [[X11App controller] set_check_for_updates_menu_item]; + [[X11App controller] setup_sparkle]; [[SUUpdater sharedUpdater] resetUpdateCycle]; // [[SUUpdater sharedUpdater] checkForUpdates:X11App]; #endif diff --git a/hw/xquartz/X11Controller.h b/hw/xquartz/X11Controller.h index d8f7ff44d..7e0d6b5ef 100644 --- a/hw/xquartz/X11Controller.h +++ b/hw/xquartz/X11Controller.h @@ -39,6 +39,10 @@ #include "sanitizedCocoa.h" #include "xpr/x-list.h" +#ifdef XQUARTZ_SPARKLE +#include <Sparkle/SUUpdater.h> +#endif + @interface X11Controller : NSObject { IBOutlet NSPanel *prefs_panel; @@ -91,7 +95,8 @@ - (void) set_window_menu_check:(NSNumber *)n; - (void) set_apps_menu:(NSArray *)list; #ifdef XQUARTZ_SPARKLE -- (void) set_check_for_updates_menu_item; +- (void) setup_sparkle; +- (void) updater:(SUUpdater *)updater willInstallUpdate:(SUAppcastItem *)update; #endif - (void) set_can_quit:(OSX_BOOL)state; - (void) server_ready; diff --git a/hw/xquartz/X11Controller.m b/hw/xquartz/X11Controller.m index 2e05816b0..4e08c1323 100644 --- a/hw/xquartz/X11Controller.m +++ b/hw/xquartz/X11Controller.m @@ -53,10 +53,6 @@ #include <sys/types.h> #include <sys/wait.h> -#ifdef XQUARTZ_SPARKLE -#include <Sparkle/SUUpdater.h> -#endif - BOOL xquartz_resetenv_display = NO; @implementation X11Controller @@ -317,7 +313,7 @@ BOOL xquartz_resetenv_display = NO; } #ifdef XQUARTZ_SPARKLE -- (void) set_check_for_updates_menu_item { +- (void) setup_sparkle { if(check_for_updates_item) return; // already did it... @@ -330,7 +326,15 @@ BOOL xquartz_resetenv_display = NO; [check_for_updates_item setTarget:[SUUpdater sharedUpdater]]; [check_for_updates_item setEnabled:YES]; + // Set X11Controller as the delegate for the updater. + [[SUUpdater sharedUpdater] setDelegate:self]; } + +// Sent immediately before installing the specified update. +- (void)updater:(SUUpdater *)updater willInstallUpdate:(SUAppcastItem *)update { + [self set_can_quit:YES]; +} + #endif - (void) launch_client:(NSString *)filename |