Fix removal of quit item from info menu

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@29077 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
rfm 2009-11-28 17:31:24 +00:00
parent 1181b02b98
commit 5208c44f6e

View file

@ -150,6 +150,7 @@ static BOOL _isInInterfaceBuilder = NO;
if (_menu.horizontal == NO)
{
NSMenuItem *appItem;
NSMenu *sub;
SEL sel = @selector(terminate:);
/* The title of the main menu should be the process name.
@ -173,21 +174,18 @@ static BOOL _isInInterfaceBuilder = NO;
[self addItem: quitItem];
}
/* An OSX main menu has the first item named with the process name
* and this item points to a submenu whose contents are much the
* same as a GNUstep info menu.
/* An OSX main menu has the first item pointing to a submenu
* whose contents are much the same as a GNUstep info menu.
*/
appItem = (NSMenuItem*)[self itemAtIndex: 0]; // Info item.
if (YES == [[appItem title] isEqualToString: processName]
&& [appItem submenu] != nil)
sub = [appItem submenu];
if (sub != nil)
{
NSString *infoString;
NSMenu *sub;
NSInteger index;
infoString = NSLocalizedString (@"Info", @"Info");
[appItem setTitle: infoString];
sub = [appItem submenu];
[sub setTitle: infoString];
/* The submenu may contain a 'quit' item ... if so we need to
* remove it as we already added one to the main menu.