summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Huddleston <jeremyhu@freedesktop.org>2009-07-20 22:38:25 -0700
committerJeremy Huddleston <jeremyhu@freedesktop.org>2009-07-24 09:41:16 -0700
commit02f6723c96e1b2ed3d2e45d27d84688db1fdb518 (patch)
tree8b9aaeae55c7a8532b875de072842171b12a38ac
parent58c3026499cd4b358a9977b55e87dd6218e3d774 (diff)
XQuartz: Added a "Check for X11 Updates..." menu item.
(cherry picked from commit 305144bfa4b59791123c44e869fab93a084792d6)
-rw-r--r--hw/xquartz/X11Application.h1
-rw-r--r--hw/xquartz/X11Application.m5
-rw-r--r--hw/xquartz/X11Controller.h10
-rw-r--r--hw/xquartz/X11Controller.m21
-rw-r--r--hw/xquartz/bundle/Resources/English.lproj/Localizable.stringsbin2528 -> 2698 bytes
5 files changed, 37 insertions, 0 deletions
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 <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 adf861ca9..2e05816b0 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 001227afe..03415026e 100644
--- a/hw/xquartz/bundle/Resources/English.lproj/Localizable.strings
+++ b/hw/xquartz/bundle/Resources/English.lproj/Localizable.strings
Binary files differ