Revision: 29000 http://sourceforge.net/p/bibdesk/svn/29000 Author: hofman Date: 2025-02-07 17:14:53 +0000 (Fri, 07 Feb 2025) Log Message: ----------- implement validateMenuItem in main tableview for method that expects a menu item
Modified Paths: -------------- trunk/bibdesk/BDSKMainTableView.m Modified: trunk/bibdesk/BDSKMainTableView.m =================================================================== --- trunk/bibdesk/BDSKMainTableView.m 2025-02-07 17:02:09 UTC (rev 28999) +++ trunk/bibdesk/BDSKMainTableView.m 2025-02-07 17:14:53 UTC (rev 29000) @@ -643,8 +643,6 @@ return [self canAlternateDelete]; else if (action == @selector(alternateCut:)) return [self canAlternateCut]; - else if (action == @selector(columnsMenuSelectTableColumn:)) - return ([[(NSMenuItem *)item representedObject] isEqualToString:BDSKImportOrderString] == NO && [[(NSMenuItem *)item representedObject] isEqualToString:BDSKRelevanceString] == NO && [self numberOfColumns] > 1); else if (action == @selector(columnsMenuAddTableColumn:)) return YES; else @@ -651,6 +649,15 @@ return [super validateUserInterfaceItem:item]; } +- (BOOL)validateMenuItem:(NSMenuItem *)menuItem { + if ([menuItem action] == @selector(columnsMenuSelectTableColumn:)) + return ([[menuItem representedObject] isEqualToString:BDSKImportOrderString] == NO && [[menuItem representedObject] isEqualToString:BDSKRelevanceString] == NO && [self numberOfColumns] > 1); + else if ([[BDSKMainTableView superclass] instancesRespondToSelector:_cmd]) + return [super validateMenuItem:menuItem]; + else + return [self validateUserInterfaceItem:menuItem]; +} + // override private method from OmniAppKit/NSTableView-OAColumnConfigurationExtensions - (BOOL)_allowsAutoresizing{ return YES; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. _______________________________________________ Bibdesk-commit mailing list Bibdesk-commit@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/bibdesk-commit