diff --git a/hw/xquartz/X11Application.h b/hw/xquartz/X11Application.h index c02073eb6..5e828a440 100644 --- a/hw/xquartz/X11Application.h +++ b/hw/xquartz/X11Application.h @@ -56,6 +56,7 @@ - (void) prefs_set_string:(NSString *)key value:(NSString *)value; - (void) prefs_synchronize; +- (X11Controller *) controller; - (OSX_BOOL) x_active; @end diff --git a/hw/xquartz/X11Application.m b/hw/xquartz/X11Application.m index 736d4e61e..eb0c39add 100644 --- a/hw/xquartz/X11Application.m +++ b/hw/xquartz/X11Application.m @@ -783,6 +783,10 @@ static NSMutableArray * cfarray_to_nsarray (CFArrayRef in) { AppleWMCopyToPasteboard); } +- (X11Controller *) controller { + return _controller; +} + - (OSX_BOOL) x_active { return _x_active; } @@ -966,6 +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]; [[SUUpdater sharedUpdater] resetUpdateCycle]; // [[SUUpdater sharedUpdater] checkForUpdates:X11App]; #endif diff --git a/hw/xquartz/X11Controller.h b/hw/xquartz/X11Controller.h index bb9adb1ce..d8f7ff44d 100644 --- a/hw/xquartz/X11Controller.h +++ b/hw/xquartz/X11Controller.h @@ -30,6 +30,10 @@ #ifndef X11CONTROLLER_H #define X11CONTROLLER_H 1 +#ifdef HAVE_DIX_CONFIG_H +#include +#endif + #if __OBJC__ #include "sanitizedCocoa.h" @@ -64,6 +68,9 @@ IBOutlet NSMenuItem *dock_window_separator; IBOutlet NSMenuItem *apps_separator; IBOutlet NSMenuItem *toggle_fullscreen_item; +#ifdef XQUARTZ_SPARKLE + NSMenuItem *check_for_updates_item; // Programatically enabled +#endif IBOutlet NSMenuItem *copy_menu_item; IBOutlet NSMenu *dock_apps_menu; IBOutlet NSTableView *apps_table; @@ -83,6 +90,9 @@ - (void) set_window_menu:(NSArray *)list; - (void) set_window_menu_check:(NSNumber *)n; - (void) set_apps_menu:(NSArray *)list; +#ifdef XQUARTZ_SPARKLE +- (void) set_check_for_updates_menu_item; +#endif - (void) set_can_quit:(OSX_BOOL)state; - (void) server_ready; diff --git a/hw/xquartz/X11Controller.m b/hw/xquartz/X11Controller.m index adf861ca9..2e05816b0 100644 --- a/hw/xquartz/X11Controller.m +++ b/hw/xquartz/X11Controller.m @@ -53,6 +53,10 @@ #include #include +#ifdef XQUARTZ_SPARKLE +#include +#endif + BOOL xquartz_resetenv_display = NO; @implementation X11Controller @@ -312,6 +316,23 @@ BOOL xquartz_resetenv_display = NO; [self install_apps_menu:list]; } +#ifdef XQUARTZ_SPARKLE +- (void) set_check_for_updates_menu_item { + if(check_for_updates_item) + return; // already did it... + + NSMenu *menu = [x11_about_item menu]; + + check_for_updates_item = [menu insertItemWithTitle:NSLocalizedString(@"Check for X11 Updates...", @"Check for X11 Updates...") + action:@selector (checkForUpdates:) + keyEquivalent:@"" + atIndex:1]; + [check_for_updates_item setTarget:[SUUpdater sharedUpdater]]; + [check_for_updates_item setEnabled:YES]; + +} +#endif + - (void) launch_client:(NSString *)filename { int child1, child2 = 0; diff --git a/hw/xquartz/bundle/Resources/English.lproj/Localizable.strings b/hw/xquartz/bundle/Resources/English.lproj/Localizable.strings index 001227afe..03415026e 100644 Binary files a/hw/xquartz/bundle/Resources/English.lproj/Localizable.strings and b/hw/xquartz/bundle/Resources/English.lproj/Localizable.strings differ