summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Huddleston <jeremyhu@freedesktop.org>2008-04-20 22:18:45 -0700
committerJeremy Huddleston <jeremyhu@freedesktop.org>2008-04-21 19:08:30 -0700
commit590688131d89595bdc78ca562ee88df86c9012a6 (patch)
tree5c5ec1e22d6580daaaa010cdb37716e94bacc92a
parentd20b3ac22d960fa44632cc4a14be079daa2d5a33 (diff)
XQuartz: Fixed quit dialog to be more conforming with HIG.
(cherry picked from commit 14c6b837bb03bd0956f90882f550847f13d0ca09)
-rw-r--r--hw/xquartz/X11Controller.m30
1 files changed, 16 insertions, 14 deletions
diff --git a/hw/xquartz/X11Controller.m b/hw/xquartz/X11Controller.m
index f2dee2c4d..98cb395a2 100644
--- a/hw/xquartz/X11Controller.m
+++ b/hw/xquartz/X11Controller.m
@@ -690,24 +690,26 @@ objectValueForTableColumn:(NSTableColumn *)tableColumn row:(int)row
DarwinSendDDXEvent(kXquartzControllerNotify, 1, AppleWMShowAll);
}
-- (NSApplicationTerminateReply) applicationShouldTerminate:sender
-{
- NSString *msg;
-
- if (can_quit || [X11App prefs_get_boolean:@PREFS_NO_QUIT_ALERT default:NO])
- return NSTerminateNow;
+- (NSApplicationTerminateReply) applicationShouldTerminate:sender {
+ NSString *msg;
+ NSString *title;
- /* Make sure we're frontmost. */
- [NSApp activateIgnoringOtherApps:YES];
+ if (can_quit || [X11App prefs_get_boolean:@PREFS_NO_QUIT_ALERT default:NO])
+ return NSTerminateNow;
- msg = NSLocalizedString (@"Are you sure you want to quit X11?\n\nIf you quit X11, any X11 applications you are running will stop immediately and you will lose any changes you have not saved.", @"Dialog when quitting");
+ /* Make sure we're frontmost. */
+ [NSApp activateIgnoringOtherApps:YES];
- /* FIXME: safe to run the alert in here? Or should we return Later
- and then run the alert on a timer? It seems to work here, so.. */
+ title = NSLocalizedString(@"Do you really want to quit X11?", @"Dialog title when quitting");
+ msg = NSLocalizedString(@"Any open X11 applications will stop immediately, and you will lose any unsaved changes.", @"Dialog when quitting");
+
+ /* FIXME: safe to run the alert in here? Or should we return Later
+ * and then run the alert on a timer? It seems to work here, so..
+ */
- return (NSRunAlertPanel (nil, msg, NSLocalizedString (@"Quit", @""),
- NSLocalizedString (@"Cancel", @""), nil)
- == NSAlertDefaultReturn) ? NSTerminateNow : NSTerminateCancel;
+ return (NSRunAlertPanel (title, msg, NSLocalizedString (@"Quit", @""),
+ NSLocalizedString (@"Cancel", @""), nil)
+ == NSAlertDefaultReturn) ? NSTerminateNow : NSTerminateCancel;
}
- (void) applicationWillTerminate:(NSNotification *)aNotification