XQuartz: Added a "Check for X11 Updates..." menu item.

This commit is contained in:
Jeremy Huddleston 2009-07-20 22:38:25 -07:00
parent f1aa4746e5
commit 305144bfa4
5 changed files with 37 additions and 0 deletions

View File

@ -56,6 +56,7 @@
- (void) prefs_set_string:(NSString *)key value:(NSString *)value;
- (void) prefs_synchronize;
- (X11Controller *) controller;
- (OSX_BOOL) x_active;
@end

View File

@ -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

View File

@ -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;

View File

@ -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;