xserver: Branch 'xorg-server-1.5-apple'

Jeremy Huddleston jeremyhu at kemper.freedesktop.org
Mon Jul 20 22:38:46 PDT 2009


 hw/xquartz/X11Application.h                                   |    1 
 hw/xquartz/X11Application.m                                   |    5 ++
 hw/xquartz/X11Controller.h                                    |   10 ++++
 hw/xquartz/X11Controller.m                                    |   21 ++++++++++
 hw/xquartz/bundle/Resources/English.lproj/Localizable.strings |binary
 5 files changed, 37 insertions(+)

New commits:
commit 305144bfa4b59791123c44e869fab93a084792d6
Author: Jeremy Huddleston <jeremyhu at freedesktop.org>
Date:   Mon Jul 20 22:38:25 2009 -0700

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

diff --git a/hw/xquartz/X11Application.h b/hw/xquartz/X11Application.h
index c02073e..5e828a4 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 736d4e6..eb0c39a 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 bb9adb1..d8f7ff4 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 <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;
 
diff --git a/hw/xquartz/X11Controller.m b/hw/xquartz/X11Controller.m
index adf861c..2e05816 100644
--- a/hw/xquartz/X11Controller.m
+++ b/hw/xquartz/X11Controller.m
@@ -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;
diff --git a/hw/xquartz/bundle/Resources/English.lproj/Localizable.strings b/hw/xquartz/bundle/Resources/English.lproj/Localizable.strings
index 001227a..0341502 100644
Binary files a/hw/xquartz/bundle/Resources/English.lproj/Localizable.strings and b/hw/xquartz/bundle/Resources/English.lproj/Localizable.strings differ


More information about the xorg-commit mailing list