Commit f27a64a9 authored by Adrian Robert's avatar Adrian Robert
Browse files

(ns_app_name): New variable. (ns_term_init): Set and use it. (ns_term_shutdown): Use it.

parent abd5747e
...@@ -175,6 +175,7 @@ the Function modifer (laptops). May be any of the modifier lisp symbols. */ ...@@ -175,6 +175,7 @@ the Function modifer (laptops). May be any of the modifier lisp symbols. */
Lisp_Object ns_confirm_quit; Lisp_Object ns_confirm_quit;
NSArray *ns_send_types =0, *ns_return_types =0, *ns_drag_types =0; NSArray *ns_send_types =0, *ns_return_types =0, *ns_drag_types =0;
NSString *ns_app_name = @"Emacs"; /* default changed later */
/* Display variables */ /* Display variables */
struct ns_display_info *x_display_list; /* Chain of existing displays */ struct ns_display_info *x_display_list; /* Chain of existing displays */
...@@ -3820,6 +3821,8 @@ Needs to be here because ns_initialize_display_info () uses AppKit classes. ...@@ -3820,6 +3821,8 @@ Needs to be here because ns_initialize_display_info () uses AppKit classes.
delete_keyboard_wait_descriptor (0); delete_keyboard_wait_descriptor (0);
ns_app_name = [[NSProcessInfo processInfo] processName];
/* Set up OS X app menu */ /* Set up OS X app menu */
#ifdef NS_IMPL_COCOA #ifdef NS_IMPL_COCOA
{ {
...@@ -3848,7 +3851,6 @@ Needs to be here because ns_initialize_display_info () uses AppKit classes. ...@@ -3848,7 +3851,6 @@ Needs to be here because ns_initialize_display_info () uses AppKit classes.
keyEquivalent: @"" keyEquivalent: @""
atIndex: 4]; atIndex: 4];
[appMenu setSubmenu: svcsMenu forItem: item]; [appMenu setSubmenu: svcsMenu forItem: item];
/* [svcsMenu setSupercell: item]; */
[appMenu insertItem: [NSMenuItem separatorItem] atIndex: 5]; [appMenu insertItem: [NSMenuItem separatorItem] atIndex: 5];
[appMenu insertItemWithTitle: @"Hide Emacs" [appMenu insertItemWithTitle: @"Hide Emacs"
action: @selector (hide:) action: @selector (hide:)
...@@ -3865,7 +3867,7 @@ Needs to be here because ns_initialize_display_info () uses AppKit classes. ...@@ -3865,7 +3867,7 @@ Needs to be here because ns_initialize_display_info () uses AppKit classes.
keyEquivalent: @"q" keyEquivalent: @"q"
atIndex: 9]; atIndex: 9];
item = [mainMenu insertItemWithTitle: @"Emacs" item = [mainMenu insertItemWithTitle: ns_app_name
action: @selector (menuDown:) action: @selector (menuDown:)
keyEquivalent: @"" keyEquivalent: @""
atIndex: 0]; atIndex: 0];
...@@ -4099,7 +4101,7 @@ - (NSApplicationTerminateReply)applicationShouldTerminate: (id)sender ...@@ -4099,7 +4101,7 @@ - (NSApplicationTerminateReply)applicationShouldTerminate: (id)sender
if (NILP (ns_confirm_quit)) // || ns_shutdown_properly --> TO DO if (NILP (ns_confirm_quit)) // || ns_shutdown_properly --> TO DO
return NSTerminateNow; return NSTerminateNow;
ret = NSRunAlertPanel([[NSProcessInfo processInfo] processName], ret = NSRunAlertPanel(ns_app_name,
[NSString stringWithUTF8String:"Exit requested. Would you like to Save Buffers and Exit, or Cancel the request?"], [NSString stringWithUTF8String:"Exit requested. Would you like to Save Buffers and Exit, or Cancel the request?"],
@"Save Buffers and Exit", @"Cancel", nil); @"Save Buffers and Exit", @"Cancel", nil);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment