Improve menu item validation by falling back to -validateUserInterfaceItem:

if the validator doesn't respond to -validateMenuItem:.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@27625 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Wolfgang Lux 2009-01-18 14:59:24 +00:00
parent 6f61fe0106
commit d40bb8140a
2 changed files with 10 additions and 1 deletions

View file

@ -1,8 +1,12 @@
2009-01-18 Wolfgang Lux <wolfgang.lux@gmail.com>
* Source/NSMenu.m (-upate, -setAutoenablesItems:, initWithCoder):
* Source/NSMenu.m (-update, -setAutoenablesItems:, initWithCoder):
Revert NSMenu changes from r27569.
* Source/NSMenu.m (-update): Improve menu item validation by
falling back to -validateUserInterfaceItem: if the validator
doesn't respond to -validateMenuItem:.
2009-01-17 Wolfgang Lux <wolfgang.lux@gmail.com>
* Source/NSDocument.m (-windowForSheet): Return nil if the

View file

@ -1042,6 +1042,11 @@ static BOOL menuBarVisible = YES;
{
shouldBeEnabled = [validator validateMenuItem: item];
}
else if ([validator
respondsToSelector: @selector(validateUserInterfaceItem:)])
{
shouldBeEnabled = [validator validateUserInterfaceItem: item];
}
else
{
shouldBeEnabled = YES;