From 22a105aaf85d06bcdcafa4f3037f7fe42724f091 Mon Sep 17 00:00:00 2001 From: michael starke Date: Sat, 20 Apr 2013 21:35:22 +0200 Subject: [PATCH] Open and New now work when the main windows is closed --- MacPass/MPAppDelegate.h | 3 +++ MacPass/MPAppDelegate.m | 10 ++++++++++ MacPass/MPMainWindowController.h | 4 ++++ MacPass/MPMainWindowController.m | 3 ++- MacPass/MacPass-Info.plist | 2 +- 5 files changed, 20 insertions(+), 2 deletions(-) diff --git a/MacPass/MPAppDelegate.h b/MacPass/MPAppDelegate.h index 7f60a5ee..614a0bdc 100644 --- a/MacPass/MPAppDelegate.h +++ b/MacPass/MPAppDelegate.h @@ -33,4 +33,7 @@ typedef enum { */ - (NSArray *)contextMenuItemsWithItems:(MPContextMenuItemsFlags)flags; +- (void)openDocument:(id)sender; +- (void)newDocument:(id)sender; + @end \ No newline at end of file diff --git a/MacPass/MPAppDelegate.m b/MacPass/MPAppDelegate.m index a886daa8..7b10540f 100644 --- a/MacPass/MPAppDelegate.m +++ b/MacPass/MPAppDelegate.m @@ -55,6 +55,16 @@ [self.mainWindowController showMainWindow:sender]; } +- (void)newDocument:(id)sender { + [self.mainWindowController showMainWindow:sender]; + [self.mainWindowController newDocument:sender]; +} + +- (void)openDocument:(id)sender { + [self.mainWindowController showMainWindow:sender]; + [self.mainWindowController openDocument:sender]; +} + - (void)showPreferences:(id)sender { if(self.settingsController == nil) { self.settingsController = [[[MPSettingsController alloc] init] autorelease]; diff --git a/MacPass/MPMainWindowController.h b/MacPass/MPMainWindowController.h index 0c3a7e4c..6fa9134f 100644 --- a/MacPass/MPMainWindowController.h +++ b/MacPass/MPMainWindowController.h @@ -24,6 +24,10 @@ @property (readonly, retain) MPCreationViewController *creationViewController; +/* Document handling */ +- (void)newDocument:(id)sender; +- (void)openDocument:(id)sender; + - (void)showEntries; - (void)showMainWindow:(id)sender; - (void)performFindPanelAction:(id)sender; diff --git a/MacPass/MPMainWindowController.m b/MacPass/MPMainWindowController.m index 0b6bc547..e23c93be 100644 --- a/MacPass/MPMainWindowController.m +++ b/MacPass/MPMainWindowController.m @@ -222,7 +222,8 @@ } - (void)showMainWindow:(id)sender { - [self showWindow:self.window]; + [[self window] makeKeyAndOrderFront:sender]; + //[self showWindow:self.window]; } - (void)openDocument:(id)sender { diff --git a/MacPass/MacPass-Info.plist b/MacPass/MacPass-Info.plist index 7a10700d..be7e1083 100644 --- a/MacPass/MacPass-Info.plist +++ b/MacPass/MacPass-Info.plist @@ -21,7 +21,7 @@ CFBundleSignature ???? CFBundleVersion - 62E + 633 LSMinimumSystemVersion ${MACOSX_DEPLOYMENT_TARGET} NSHumanReadableCopyright