Fixes #2 MPToolbarItem now validates more sanely

This commit is contained in:
michael starke
2013-06-09 11:33:52 +02:00
parent e1e5d2c1f2
commit cadf3a32ff
2 changed files with 7 additions and 4 deletions

View File

@@ -14,9 +14,12 @@
- (void)validate { - (void)validate {
if(![self.view menu]) { if(![self.view menu]) {
id target = [NSApp targetForAction:[self action] to:nil from:self]; id target = [NSApp targetForAction:[self action] to:nil from:self];
BOOL isValid = [[[[NSApplication sharedApplication] keyWindow] windowController] validateToolbarItem:self]; id windowController = [[self.view window] windowController];
[self setEnabled:( isValid && (nil != target) )]; BOOL isValid = (nil != target);
if( [windowController respondsToSelector:@selector(validateToolbarItem:)]) {
isValid &= [windowController validateToolbarItem:self];
}
[self setEnabled:isValid];
} }
} }
@end @end

View File

@@ -48,7 +48,7 @@
<key>CFBundleSignature</key> <key>CFBundleSignature</key>
<string>????</string> <string>????</string>
<key>CFBundleVersion</key> <key>CFBundleVersion</key>
<string>AB7</string> <string>AB9</string>
<key>LSMinimumSystemVersion</key> <key>LSMinimumSystemVersion</key>
<string>${MACOSX_DEPLOYMENT_TARGET}</string> <string>${MACOSX_DEPLOYMENT_TARGET}</string>
<key>NSHumanReadableCopyright</key> <key>NSHumanReadableCopyright</key>