Fixed: NSMenu autoEnablesItems was not supported by nib2cib.

This commit is contained in:
Aparajita Fishman committed 2013-07-22 21:13:15 -04:00
1 parent 771370e64b
commit a5e62ed132
3 files changed
+9 -5

No files matched your search

+7 -4
View File
@@ -621,7 +621,7 @@ var _CPMenuBarVisible = NO,
*/
- (void)update
{
if (![self autoenablesItems])
if (!_autoenablesItems)
return;
var items = [self itemArray];
@@ -634,7 +634,6 @@ var _CPMenuBarVisible = NO,
continue;
var validator = [CPApp targetForAction:[item action] to:[item target] from:item],
shouldBeEnabled = YES;
if (!validator)
@@ -1184,7 +1183,8 @@ var _CPMenuBarVisible = NO,
var CPMenuTitleKey = @"CPMenuTitleKey",
CPMenuNameKey = @"CPMenuNameKey",
CPMenuItemsKey = @"CPMenuItemsKey",
CPMenuShowsStateColumnKey = @"CPMenuShowsStateColumnKey";
CPMenuShowsStateColumnKey = @"CPMenuShowsStateColumnKey",
CPMenuAutoEnablesItemsKey = @"CPMenuAutoEnablesItemsKey";
@implementation CPMenu (CPCoding)
@@ -1206,7 +1206,7 @@ var CPMenuTitleKey = @"CPMenuTitleKey",
_showsStateColumn = ![aCoder containsValueForKey:CPMenuShowsStateColumnKey] || [aCoder decodeBoolForKey:CPMenuShowsStateColumnKey];
_autoenablesItems = YES;
_autoenablesItems = ![aCoder containsValueForKey:CPMenuAutoEnablesItemsKey] || [aCoder decodeBoolForKey:CPMenuAutoEnablesItemsKey];
[self setMinimumWidth:0];
}
@@ -1229,6 +1229,9 @@ var CPMenuTitleKey = @"CPMenuTitleKey",
if (!_showsStateColumn)
[aCoder encodeBool:_showsStateColumn forKey:CPMenuShowsStateColumnKey];
if (!_autoenablesItems)
[aCoder encodeBool:_autoenablesItems forKey:CPMenuAutoEnablesItemsKey];
}
@end
-1
View File
@@ -112,7 +112,6 @@
_view = menuItemView;
}
}
else if ([_menuItem menu] == [CPApp mainMenu])
{
if (![_view isKindOfClass:[_CPMenuItemMenuBarView class]])
+2
View File
@@ -52,6 +52,8 @@ NS_CPMenuNameMap =
_name = mappedName;
_showsStateColumn = ![aCoder containsValueForKey:@"NSMenuExcludeMarkColumn"] || ![aCoder decodeBoolForKey:@"NSMenuExcludeMarkColumn"];
_autoenablesItems = ![aCoder containsValueForKey:@"NSNoAutoenable"] || ![aCoder decodeBoolForKey:@"NSNoAutoenable"];
}
return self;