mirror of
https://github.com/MacPass/MacPass.git
synced 2025-12-19 02:39:21 +00:00
Added removed validation but calling into central document function, since the responder needs to validate the menu items #112
This commit is contained in:
@@ -237,6 +237,18 @@ NSString *const _MPOutlinveViewHeaderViewIdentifier = @"HeaderCell";
|
||||
}
|
||||
}
|
||||
|
||||
#pragma mark Validation
|
||||
- (BOOL)validateMenuItem:(NSMenuItem *)menuItem {
|
||||
MPDocument *document = [[self windowController] document];
|
||||
if(![document validateUserInterfaceItem:menuItem]) {
|
||||
return NO;
|
||||
}
|
||||
id selected = [self _clickedOrSelectedGroup];
|
||||
if(!selected) { return NO; }
|
||||
if(selected == document.trash) { return NO; }
|
||||
return ![document isItemTrashed:selected];
|
||||
}
|
||||
|
||||
#pragma mark -
|
||||
#pragma mark Private
|
||||
|
||||
|
||||
Reference in New Issue
Block a user