(-updateServicesMenu): Always enable an item with a submenu.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@17999 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Alexander Malmberg 2003-10-29 01:22:50 +00:00
parent 27c626ce07
commit 6aef871f82
2 changed files with 13 additions and 2 deletions

View file

@ -1,3 +1,8 @@
2003-10-29 02:22 Alexander Malmberg <alexander@malmberg.org>
* Source/GSServicesManager.m (-updateServicesMenu): Always enable
an item with a submenu.
2003-10-27 Richard Frith-Macdonald <rfm@gnu.org>
* Source/NSSavePanel.m: Change to have entire window accept DnD.

View file

@ -1252,13 +1252,20 @@ static NSString *disabledName = @".GNUstepDisabled";
/*
* If there is no title mapping, this item must be a
* submenu - so we check the submenu items.
*
* We always enable the submenu item itself. We do this
* to prevent confusion (if the user is trying to use
* a disabled item, it's clearer to show that item disabled
* than to hide it in a disabled submenu), and to encourage
* the user to explore the interface (it makes it possible
* to browse the service list at any time).
*/
if (title == nil && [[item submenu] isKindOfClass: [NSMenu class]])
{
NSArray *sub = [[item submenu] itemArray];
unsigned j;
shouldBeEnabled = NO;
shouldBeEnabled = YES;
for (j = 0; j < [sub count]; j++)
{
NSMenuItem *subitem = [sub objectAtIndex: j];
@ -1267,7 +1274,6 @@ static NSString *disabledName = @".GNUstepDisabled";
if ([self validateMenuItem: subitem] == YES)
{
shouldBeEnabled = YES; /* Enabled menu */
subShouldBeEnabled = YES;
}
if (subWasEnabled != subShouldBeEnabled)