mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-06-02 07:10:59 +00:00
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:
parent
1181b02b98
commit
5208c44f6e
1 changed files with 21 additions and 23 deletions
|
@ -150,6 +150,7 @@ static BOOL _isInInterfaceBuilder = NO;
|
||||||
if (_menu.horizontal == NO)
|
if (_menu.horizontal == NO)
|
||||||
{
|
{
|
||||||
NSMenuItem *appItem;
|
NSMenuItem *appItem;
|
||||||
|
NSMenu *sub;
|
||||||
SEL sel = @selector(terminate:);
|
SEL sel = @selector(terminate:);
|
||||||
|
|
||||||
/* The title of the main menu should be the process name.
|
/* The title of the main menu should be the process name.
|
||||||
|
@ -173,21 +174,18 @@ static BOOL _isInInterfaceBuilder = NO;
|
||||||
[self addItem: quitItem];
|
[self addItem: quitItem];
|
||||||
}
|
}
|
||||||
|
|
||||||
/* An OSX main menu has the first item named with the process name
|
/* An OSX main menu has the first item pointing to a submenu
|
||||||
* and this item points to a submenu whose contents are much the
|
* whose contents are much the same as a GNUstep info menu.
|
||||||
* same as a GNUstep info menu.
|
|
||||||
*/
|
*/
|
||||||
appItem = (NSMenuItem*)[self itemAtIndex: 0]; // Info item.
|
appItem = (NSMenuItem*)[self itemAtIndex: 0]; // Info item.
|
||||||
if (YES == [[appItem title] isEqualToString: processName]
|
sub = [appItem submenu];
|
||||||
&& [appItem submenu] != nil)
|
if (sub != nil)
|
||||||
{
|
{
|
||||||
NSString *infoString;
|
NSString *infoString;
|
||||||
NSMenu *sub;
|
|
||||||
NSInteger index;
|
NSInteger index;
|
||||||
|
|
||||||
infoString = NSLocalizedString (@"Info", @"Info");
|
infoString = NSLocalizedString (@"Info", @"Info");
|
||||||
[appItem setTitle: infoString];
|
[appItem setTitle: infoString];
|
||||||
sub = [appItem submenu];
|
|
||||||
[sub setTitle: infoString];
|
[sub setTitle: infoString];
|
||||||
/* The submenu may contain a 'quit' item ... if so we need to
|
/* The submenu may contain a 'quit' item ... if so we need to
|
||||||
* remove it as we already added one to the main menu.
|
* remove it as we already added one to the main menu.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue