XQuartz: Added a "Check for X11 Updates..." menu item.
(cherry picked from commit 305144bfa4b59791123c44e869fab93a084792d6)
This commit is contained in:
		
							parent
							
								
									1e1dbd1e46
								
							
						
					
					
						commit
						7ff84d350b
					
				|  | @ -56,6 +56,7 @@ | |||
| - (void) prefs_set_string:(NSString *)key value:(NSString *)value; | ||||
| - (void) prefs_synchronize; | ||||
| 
 | ||||
| - (X11Controller *) controller; | ||||
| - (OSX_BOOL) x_active; | ||||
| @end | ||||
| 
 | ||||
|  |  | |||
|  | @ -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 | ||||
|  |  | |||
|  | @ -30,6 +30,10 @@ | |||
| #ifndef X11CONTROLLER_H | ||||
| #define X11CONTROLLER_H 1 | ||||
| 
 | ||||
| #ifdef HAVE_DIX_CONFIG_H | ||||
| #include <dix-config.h> | ||||
| #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; | ||||
| 
 | ||||
|  |  | |||
|  | @ -53,6 +53,10 @@ | |||
| #include <sys/types.h> | ||||
| #include <sys/wait.h> | ||||
| 
 | ||||
| #ifdef XQUARTZ_SPARKLE | ||||
| #include <Sparkle/SUUpdater.h> | ||||
| #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; | ||||
|  |  | |||
										
											Binary file not shown.
										
									
								
							
		Loading…
	
		Reference in New Issue