mirror of
https://github.com/MacPass/MacPass.git
synced 2025-12-14 23:52:21 +00:00
Added export to XML action for Version2 Databases
Small updates to Database Settings window
This commit is contained in:
@@ -162,13 +162,27 @@ NSString *const MPCurrentItemChangedNotification = @"com.hicknhack.macpass.MPCur
|
||||
}
|
||||
|
||||
#pragma mark Actions
|
||||
- (void)exportDatabase:(id)sender {
|
||||
NSSavePanel *savePanel = [NSSavePanel savePanel];
|
||||
[savePanel setAllowsOtherFileTypes:YES];
|
||||
[savePanel beginSheetModalForWindow:self.window completionHandler:^(NSInteger result) {
|
||||
if(result == NSFileHandlingPanelOKButton) {
|
||||
[[self document] writeXMLToURL:savePanel.URL];
|
||||
}
|
||||
}];
|
||||
}
|
||||
- (void)performFindPanelAction:(id)sender {
|
||||
[self.entryViewController showFilter:sender];
|
||||
}
|
||||
|
||||
- (BOOL)validateMenuItem:(NSMenuItem *)menuItem {
|
||||
BOOL enabled = YES;
|
||||
MPDocument *document = [self document];
|
||||
return !( document.isLocked || document.isReadOnly );
|
||||
if([menuItem action] == @selector(exportDatabase:)) {
|
||||
enabled = (nil != document.treeV4);
|
||||
}
|
||||
enabled &= !( document.isLocked || document.isReadOnly );
|
||||
return enabled;
|
||||
}
|
||||
|
||||
- (BOOL)validateToolbarItem:(NSToolbarItem *)theItem {
|
||||
|
||||
Reference in New Issue
Block a user