diff --git a/MacPass.xcodeproj/project.pbxproj b/MacPass.xcodeproj/project.pbxproj index 78fd7105..1f7eb149 100644 --- a/MacPass.xcodeproj/project.pbxproj +++ b/MacPass.xcodeproj/project.pbxproj @@ -260,8 +260,8 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 4C8FECC816D57E3200BF26CF /* QuartzCore.framework in Frameworks */, 4CAD748E15B88AC100104512 /* libz.dylib in Frameworks */, + 4C8FECC816D57E3200BF26CF /* QuartzCore.framework in Frameworks */, 4CAD748C15B889B700104512 /* Security.framework in Frameworks */, 4C77E36715B84A240093A587 /* Cocoa.framework in Frameworks */, ); @@ -273,15 +273,15 @@ 4C06398C15B980480004DE27 /* Views */ = { isa = PBXGroup; children = ( + 4C25D58616CF0FAA00F6806C /* EntryView.xib */, 4CF5D49516D5B6E900CB78BD /* EntryEditView.xib */, - 4C77E37B15B84A240093A587 /* MainMenu.xib */, - 4CA0B2EC15BCADAC00654E32 /* SettingsWindow.xib */, 4CA0B2EF15BCADC800654E32 /* GeneralSettings.xib */, + 4C77E37B15B84A240093A587 /* MainMenu.xib */, 4CD884B615BD47080042BBF8 /* MainWindow.xib */, + 4C61EA0416D2FFE200AC519E /* OutlineView.xib */, + 4CA0B2EC15BCADAC00654E32 /* SettingsWindow.xib */, 4C6B0E8B16C9B99B00A9ED23 /* PasswordInputView.xib */, 4C25D58416CF0F8800F6806C /* WelcomeView.xib */, - 4C25D58616CF0FAA00F6806C /* EntryView.xib */, - 4C61EA0416D2FFE200AC519E /* OutlineView.xib */, 4C69A73816D589DF00EC1B1A /* MPGradientView.h */, 4C69A73916D589DF00EC1B1A /* MPGradientView.m */, ); @@ -871,7 +871,7 @@ GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "MacPass/MacPass-Prefix.pch"; INFOPLIST_FILE = "MacPass/MacPass-Info.plist"; - MACOSX_DEPLOYMENT_TARGET = 10.8; + MACOSX_DEPLOYMENT_TARGET = 10.7; PRODUCT_NAME = "$(TARGET_NAME)"; WRAPPER_EXTENSION = app; }; @@ -884,7 +884,7 @@ GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "MacPass/MacPass-Prefix.pch"; INFOPLIST_FILE = "MacPass/MacPass-Info.plist"; - MACOSX_DEPLOYMENT_TARGET = 10.8; + MACOSX_DEPLOYMENT_TARGET = 10.7; PRODUCT_NAME = "$(TARGET_NAME)"; WRAPPER_EXTENSION = app; }; diff --git a/MacPass/EntryEditView.xib b/MacPass/EntryEditView.xib index 0e80fe03..2231f22e 100644 --- a/MacPass/EntryEditView.xib +++ b/MacPass/EntryEditView.xib @@ -60,7 +60,6 @@ {{13, 10}, {482, 597}} - _NS:9 @@ -678,7 +677,6 @@ AQABAAEAAQAB//+dkAEA//+PgAAE//+dkAEI//+dkAEMUERUAFBTVABQV1QAUFBUAAAAAAEAAAABA{{382, 10}, {69, 32}} - _NS:9 YES @@ -740,7 +738,6 @@ AQABAAEAAQAB//+dkAEA//+PgAAE//+dkAEI//+dkAEMUERUAFBTVABQV1QAUFBUAAAAAAEAAAABA256 {{10, 33}, {462, 551}} - _NS:28 Advanced @@ -765,7 +762,7 @@ AQABAAEAAQAB//+dkAEA//+PgAAE//+dkAEI//+dkAEMUERUAFBTVABQV1QAUFBUAAAAAAEAAAABANSView - + 268 Apple PDF pasteboard type @@ -776,7 +773,6 @@ AQABAAEAAQAB//+dkAEA//+PgAAE//+dkAEI//+dkAEMUERUAFBTVABQV1QAUFBUAAAAAAEAAAABANeXT TIFF v4.0 pasteboard type {54, 54} - _NS:9 YES diff --git a/MacPass/EntryView.xib b/MacPass/EntryView.xib index 5c632594..d6c82c7e 100644 --- a/MacPass/EntryView.xib +++ b/MacPass/EntryView.xib @@ -52,29 +52,28 @@ 268 - + 268 - - {{190, 5}, {122, 19}} + {{244, 5}, {50, 17}} - + _NS:9 YES - - -2080374784 - 134217728 - Round Rect Button - - LucidaGrande + + 67108864 + 134348800 + Notes + + LucidaGrande-Bold 12 16 _NS:9 - + -1232846848 - 164 + 173 400 @@ -82,25 +81,74 @@ NO - + 268 - - {{60, 5}, {122, 19}} + {{198, 5}, {38, 17}} - + _NS:9 YES - - -2080374784 - 134217728 - Round Rect Button - + + 67108864 + 134348800 + URL + _NS:9 - + -1232846848 - 164 + 173 + + + 400 + 75 + + NO + + + + 268 + {{114, 5}, {76, 17}} + + + + _NS:9 + YES + + 67108864 + 134348800 + Username + + _NS:9 + + -1232846848 + 173 + + + 400 + 75 + + NO + + + + 268 + {{64, 5}, {42, 17}} + + + + _NS:9 + YES + + -2080374784 + 142737408 + Title + + _NS:9 + + -1232846848 + 173 400 @@ -111,27 +159,20 @@ 268 - {{17, 7}, {38, 17}} + {{7, 7}, {52, 17}} - - - 1 - - 1 - MSAxIDEAA - - + _NS:1535 YES 68157504 272630784 - Label - - LucidaGrande + Search: + + LucidaGrande-Bold 13 - 1044 + 2072 _NS:1535 @@ -157,11 +198,10 @@ NO - {{0, 297}, {522, 30}} + {{0, 450}, {610, 30}} - YES _NS:9 MPGradientView @@ -177,7 +217,7 @@ 256 - {522, 280} + {610, 433} @@ -188,7 +228,7 @@ 256 - {522, 17} + {610, 17} @@ -240,7 +280,11 @@ 337641536 2048 Text Cell - + + LucidaGrande + 13 + 1044 + 6 @@ -289,7 +333,7 @@ Password Column - 85.1015625 + 116.6953125 10 3.4028234663852886e+38 @@ -316,7 +360,7 @@ URL Column - 183 + 239 10 3.4028234663852886e+38 @@ -366,7 +410,7 @@ 1 - {{0, 17}, {522, 280}} + {{0, 17}, {610, 433}} @@ -395,7 +439,6 @@ {{0, 245}, {359, 16}} - _NS:60 NO 1 @@ -409,7 +452,7 @@ - {522, 17} + {610, 17} @@ -419,7 +462,7 @@ 4 - {522, 297} + {610, 450} @@ -435,7 +478,7 @@ 1 - {522, 327} + {610, 480} @@ -461,6 +504,76 @@ 395 + + + searchLabelTextField + + + + 437 + + + + statusBar + + + + 520 + + + + entryTableScrollView + + + + 562 + + + + statusBarToTop + + + + 3 + 0 + + 3 + 1 + + 0.0 + + 1000 + + 9 + 40 + 3 + + + 575 + + + + tableToTop + + + + 3 + 0 + + 3 + 1 + + 30 + + 1000 + + 9 + 40 + 3 + + + 577 + textField @@ -582,7 +695,7 @@ 266 - {183, 17} + {239, 17} {250, 750} @@ -599,7 +712,7 @@ NO - {{337, 1}, {183, 17}} + {{369, 1}, {239, 17}} @@ -616,7 +729,7 @@ 266 - {85, 17} + {117, 17} {250, 750} @@ -633,7 +746,7 @@ NO - {{249, 1}, {85, 17}} + {{249, 1}, {117, 17}} @@ -671,38 +784,7 @@ 336 - - - 3 - 0 - - 4 - 1 - - 0.0 - - 1000 - - 9 - 40 - 3 - - - - 3 - 0 - - 3 - 1 - - 30 - - 1000 - - 9 - 40 - 3 - + 6 @@ -751,28 +833,12 @@ 29 3 - + - 3 + 5 0 - 3 - 1 - - 0.0 - - 1000 - - 9 - 40 - 3 - - - - 6 - 0 - - 6 + 5 1 0.0 @@ -783,12 +849,13 @@ 29 3 - + + - 5 + 6 0 - 5 + 6 1 0.0 @@ -808,11 +875,43 @@ 349 + + + 3 + 0 + + 3 + 1 + + 8 + + 1000 + + 3 + 9 + 3 + + + + 5 + 0 + + 6 + 1 + + 8 + + 1000 + + 6 + 24 + 3 + - + 11 0 - + 11 1 @@ -824,11 +923,27 @@ 24 2 - - + + + 11 + 0 + + 11 + 1 + + 0.0 + + 1000 + + 6 + 24 + 2 + + + 5 0 - + 6 1 @@ -840,12 +955,12 @@ 24 3 - - - 3 + + + 11 0 - 3 + 11 1 0.0 @@ -856,8 +971,40 @@ 24 2 - - + + + 5 + 0 + + 6 + 1 + + 8 + + 1000 + + 6 + 24 + 3 + + + + 11 + 0 + + 11 + 1 + + 0.0 + + 1000 + + 6 + 24 + 2 + + + 5 0 @@ -872,36 +1019,20 @@ 24 3 - - - 10 - 0 - - 10 - 1 - - 0.0 - - 1000 - - 5 - 22 - 2 - - + 5 0 5 1 - - 20 + + 10 1000 - 8 - 29 + 9 + 40 3 @@ -921,8 +1052,10 @@ 1 - - + + + + @@ -944,62 +1077,6 @@ - - 378 - - - - - 380 - - - - - - - - 381 - - - - - 385 - - - - - 386 - - - - - 387 - - - - - - - - 388 - - - - - 389 - - - - - 390 - - - - - 392 - - - 54 @@ -1021,11 +1098,6 @@ - - 344 - - - 55 @@ -1381,26 +1453,6 @@ - - 350 - - - - - 396 - - - - - 393 - - - - - 417 - - - 418 @@ -1588,6 +1640,128 @@ + + 442 + + + + + + + + 443 + + + + + 447 + + + + + + + + 448 + + + + + 452 + + + + + + + + 453 + + + + + 456 + + + + + + + + 457 + + + + + 478 + + + + + 484 + + + + + 490 + + + + + 492 + + + + + 495 + + + + + 496 + + + + + 497 + + + + + 500 + + + + + 501 + + + + + 502 + + + + + 344 + + + + + 576 + + + + + 572 + + + + + 561 + + + @@ -1653,53 +1827,46 @@ com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin - - + + - - + + com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin - + - - - - - + + + + + + + + + com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin - + + + 1 + MSAxIDEAA + + com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin @@ -1733,19 +1900,44 @@ com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin - 434 + 579 @@ -1754,17 +1946,32 @@ MPViewController NSTableView + NSTextField NSView + NSLayoutConstraint + NSLayoutConstraint entryTable NSTableView + + searchLabelTextField + NSTextField + statusBar NSView + + statusBarToTop + NSLayoutConstraint + + + tableToTop + NSLayoutConstraint + IBProjectSource diff --git a/MacPass/MPEntryViewController.m b/MacPass/MPEntryViewController.m index f3c031da..bbc9549f 100644 --- a/MacPass/MPEntryViewController.m +++ b/MacPass/MPEntryViewController.m @@ -13,6 +13,10 @@ #import "MPIconHelper.h" #import "KdbGroup+MPAdditions.h" +#import + +#define STATUS_BAR_ANIMATION_TIME 0.2 + NSString *const MPEntryTableUserNameColumnIdentifier = @"MPUserNameColumnIdentifier"; NSString *const MPEntryTableTitleColumnIdentifier = @"MPTitleColumnIdentifier"; NSString *const MPEntryTablePasswordColumnIdentifier = @"MPPasswordColumnIdentifier"; @@ -28,11 +32,17 @@ NSString *const _MPTAbleSecurCellView = @"PasswordCell"; @property (retain) NSArray *filteredEntries; @property (assign) IBOutlet NSTableView *entryTable; @property (assign) IBOutlet NSView *statusBar; +@property (assign) IBOutlet NSTextField *searchLabelTextField; +@property (assign) BOOL isStatusBarVisible; +@property (retain) IBOutlet NSLayoutConstraint *statusBarToTop; +@property (retain) IBOutlet NSLayoutConstraint *tableToTop; -- (BOOL)hasActiveFilter; +- (BOOL)hasFilter; - (void)updateFilter; - (void)didChangeGroupSelectionInOutlineView:(NSNotification *)notification; +- (void)showStatusBarAnimated:(BOOL)animate; +- (void)hideStatusBarAnimated:(BOOL)animate; @end @@ -46,6 +56,7 @@ NSString *const _MPTAbleSecurCellView = @"PasswordCell"; - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil { self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]; if(self) { + _isStatusBarVisible = YES; _entryArrayController = [[NSArrayController alloc] init]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(didChangeGroupSelectionInOutlineView:) @@ -57,8 +68,11 @@ NSString *const _MPTAbleSecurCellView = @"PasswordCell"; - (void)didLoadView { + [self.view setWantsLayer:YES]; + [self hideStatusBarAnimated:NO]; + [[self.searchLabelTextField cell] setBackgroundStyle:NSBackgroundStyleRaised]; [self.entryTable setDelegate:self]; - + NSTableColumn *parentColumn = [self.entryTable tableColumns][0]; NSTableColumn *titleColumn = [self.entryTable tableColumns][1]; NSTableColumn *userNameColumn = [self.entryTable tableColumns][2]; @@ -83,7 +97,7 @@ NSString *const _MPTAbleSecurCellView = @"PasswordCell"; - (NSView *)tableView:(NSTableView *)tableView viewForTableColumn:(NSTableColumn *)tableColumn row:(NSInteger)row { KdbEntry *entry = [self.entryArrayController arrangedObjects][row]; - + const BOOL isTitleColumn = [[tableColumn identifier] isEqualToString:MPEntryTableTitleColumnIdentifier]; const BOOL isGroupColumn = [[tableColumn identifier] isEqualToString:MPEntryTableParentColumnIdentifier]; const BOOL isPasswordColum = [[tableColumn identifier] isEqualToString:MPEntryTablePasswordColumnIdentifier]; @@ -103,7 +117,7 @@ NSString *const _MPTAbleSecurCellView = @"PasswordCell"; } if( isPasswordColum ) { - view = [tableView makeViewWithIdentifier:_MPTAbleSecurCellView owner:self]; + view = [tableView makeViewWithIdentifier:_MPTAbleSecurCellView owner:self]; [[view textField] setStringValue:entry.password]; return view; } @@ -119,15 +133,9 @@ NSString *const _MPTAbleSecurCellView = @"PasswordCell"; #pragma mark Notifications - (void)didChangeGroupSelectionInOutlineView:(NSNotification *)notification { - /* - If we have an active search, do not mess with the content - */ - if([self hasActiveFilter]) { - return; - } - else { - [[self.entryTable tableColumnWithIdentifier:MPEntryTableParentColumnIdentifier] setHidden:YES]; - } + + self.filter = @""; // will update the reast automatically + MPOutlineViewDelegate *delegate = [notification object]; KdbGroup *group = delegate.selectedGroup; if(group) { @@ -140,7 +148,7 @@ NSString *const _MPTAbleSecurCellView = @"PasswordCell"; #pragma mark Filtering -- (BOOL)hasActiveFilter { +- (BOOL)hasFilter { return ([self.filter length] > 0); } @@ -154,21 +162,16 @@ NSString *const _MPTAbleSecurCellView = @"PasswordCell"; - (void)updateFilter { MPDatabaseDocument *openDatabase = [MPDatabaseController defaultController].database; - if(openDatabase) { + if(openDatabase && [self hasFilter]) { + [self showStatusBarAnimated:YES]; - /* - Search in the background - */ dispatch_queue_t backgroundQueue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0); dispatch_async(backgroundQueue, ^{ - if([self.filter length] == 0) { - self.filteredEntries = [openDatabase.root childEntries]; - } - else { - NSPredicate *filterPredicate = [NSPredicate predicateWithFormat:@"SELF.title CONTAINS[cd] %@", self.filter]; - self.filteredEntries = [[openDatabase.root childEntries] filteredArrayUsingPredicate:filterPredicate]; - } - dispatch_async(dispatch_get_main_queue(), ^{ + + NSPredicate *filterPredicate = [NSPredicate predicateWithFormat:@"SELF.title CONTAINS[cd] %@", self.filter]; + self.filteredEntries = [[openDatabase.root childEntries] filteredArrayUsingPredicate:filterPredicate]; + + dispatch_sync(dispatch_get_main_queue(), ^{ [self.entryArrayController setContent:self.filteredEntries]; [[self.entryTable tableColumnWithIdentifier:MPEntryTableParentColumnIdentifier] setHidden:NO]; }); @@ -177,6 +180,53 @@ NSString *const _MPTAbleSecurCellView = @"PasswordCell"; else { [self.entryArrayController setContent:nil]; self.filteredEntries = nil; + [[self.entryTable tableColumnWithIdentifier:MPEntryTableParentColumnIdentifier] setHidden:YES]; + [self hideStatusBarAnimated:YES]; + } +} + +#pragma mark Animation + +- (void)showStatusBarAnimated:(BOOL)animate { + + if(self.isStatusBarVisible) { + return; // nothign to to + } + self.isStatusBarVisible = YES; + self.statusBarToTop.constant = 0; + self.tableToTop.constant = [self.statusBar frame].size.height; + + if(animate) { + [NSAnimationContext runAnimationGroup:^(NSAnimationContext* context) { + context.duration = STATUS_BAR_ANIMATION_TIME; + context.allowsImplicitAnimation = YES; + [self.view layoutSubtreeIfNeeded]; + } completionHandler:nil] ; + } + else { + [self.view layoutSubtreeIfNeeded]; + } +} + +- (void)hideStatusBarAnimated:(BOOL)animate { + + if(!self.isStatusBarVisible) { + return; // nothing to do; + } + + self.isStatusBarVisible = NO; + self.statusBarToTop.constant = -[self.statusBar frame].size.height; + self.tableToTop.constant = -1; + + if(animate) { + [NSAnimationContext runAnimationGroup:^(NSAnimationContext* context) { + context.duration = STATUS_BAR_ANIMATION_TIME; + context.allowsImplicitAnimation = YES; + [self.view layoutSubtreeIfNeeded]; + } completionHandler:nil] ; + } + else { + [self.view layoutSubtreeIfNeeded]; } } diff --git a/MacPass/MPGradientView.m b/MacPass/MPGradientView.m index b3f3aad4..cb134a80 100644 --- a/MacPass/MPGradientView.m +++ b/MacPass/MPGradientView.m @@ -20,7 +20,6 @@ @implementation MPGradientView - - (id)initWithFrame:(NSRect)frameRect { NSColor *activeTop = [NSColor colorWithCalibratedWhite:0.85 alpha:1]; NSColor *activeBottom = [NSColor colorWithCalibratedWhite:0.7 alpha:1]; @@ -40,12 +39,17 @@ return self; } +#pragma mark Drawing - (void)drawRect:(NSRect)dirtyRect { + /* + We draw a Gradient, so make sure we always redraw the full view + */ NSGradient *gradient = self.isRenderedActive ? self.activeGradient : self.inactiveGradient; - [gradient drawInRect:dirtyRect angle:90]; + [gradient drawInRect:self.bounds angle:90]; } +#pragma mark State Refresh - (void)_registerWindow:(NSWindow *)newWindow { if([self window]) { [[NSNotificationCenter defaultCenter] removeObserver:self name:NSWindowDidBecomeKeyNotification object:[self window]]; @@ -55,7 +59,6 @@ [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(refreshActiveState) name:NSWindowDidBecomeKeyNotification object:newWindow]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(refreshActiveState) name:NSWindowDidResignKeyNotification object:newWindow]; } - } - (void)viewWillMoveToWindow:(NSWindow *)newWindow { @@ -67,6 +70,7 @@ self.isRenderedActive = [[self window] isKeyWindow]; } +# pragma mark Custom Properties - (void)setIsRenderedActive:(BOOL)isRenderedActive { if(_isRenderedActive != isRenderedActive) { _isRenderedActive = isRenderedActive; diff --git a/MacPass/MPMainWindowController.m b/MacPass/MPMainWindowController.m index 929b1b13..03a200ec 100644 --- a/MacPass/MPMainWindowController.m +++ b/MacPass/MPMainWindowController.m @@ -16,12 +16,12 @@ @interface MPMainWindowController () - @property (assign) IBOutlet NSView *outlineView; @property (assign) IBOutlet NSSplitView *splitView; @property (assign) IBOutlet NSView *contentView; @property (retain) IBOutlet NSView *welcomeView; +@property (assign) IBOutlet NSTextField *welcomeText; @property (retain) NSToolbar *toolbar; @property (retain) MPPasswordInputController *passwordInputController; @@ -31,6 +31,9 @@ @property (retain) MPToolbarDelegate *toolbarDelegate; @property (retain) MPMainWindowSplitViewDelegate *splitViewDelegate; +- (void)collapseOutlineView; +- (void)expandOutlineView; + @end @implementation MPMainWindowController @@ -58,9 +61,14 @@ [super dealloc]; } +#pragma mark View Handling + - (void)windowDidLoad { [super windowDidLoad]; + + [[self.welcomeText cell] setBackgroundStyle:NSBackgroundStyleRaised]; + const CGFloat minimumWindowWidth = MPMainWindowSplitViewDelegateMinimumContentWidth + MPMainWindowSplitViewDelegateMinimumOutlineWidth + [self.splitView dividerThickness]; [self.window setMinSize:NSMakeSize( minimumWindowWidth, 400)]; @@ -72,13 +80,13 @@ [self.splitView setDelegate:self.splitViewDelegate]; NSRect frame = [self.outlineView frame]; -// frame.size.height -= 1; -// frame.origin.y = 10; [self.outlineViewController.view setFrame:frame]; [self.outlineViewController.view setAutoresizingMask:NSViewWidthSizable | NSViewHeightSizable]; [self.splitView replaceSubview:self.outlineView with:[self.outlineViewController view]]; [self.splitView adjustSubviews]; + [self setContentViewController:nil]; + [self collapseOutlineView]; } - (void)setContentViewController:(MPViewController *)viewController { @@ -113,6 +121,21 @@ [self.window makeFirstResponder:[viewController reconmendedFirstResponder]]; } +- (void)collapseOutlineView { + NSView *outlineView = [self.splitView subviews][0]; + if(![outlineView isHidden]) { + [self.splitView setPosition:0 ofDividerAtIndex:0]; + } +} + +- (void)expandOutlineView { + NSView *outlineView = [self.splitView subviews][0]; + if([outlineView isHidden]) { + [self.splitView setPosition:MPMainWindowSplitViewDelegateMinimumOutlineWidth ofDividerAtIndex:0]; + + } +} + #pragma mark Actions - (void)performFindPanelAction:(id)sender { @@ -124,7 +147,7 @@ } - (void)openDocument:(id)sender { - + if(!self.passwordInputController) { self.passwordInputController = [[[MPPasswordInputController alloc] init] autorelease]; } @@ -134,6 +157,7 @@ [openPanel setCanChooseFiles:YES]; [openPanel setCanCreateDirectories:NO]; [openPanel setAllowsMultipleSelection:NO]; + [openPanel setAllowedFileTypes:@[ @"kdbx", @"kdb"]]; [openPanel beginSheetModalForWindow:self.window completionHandler:^(NSInteger result){ if(result == NSFileHandlingPanelOKButton) { NSURL *file = [[openPanel URLs] lastObject]; @@ -155,10 +179,13 @@ } - (void)showEntries { + [self expandOutlineView]; if(!self.entryViewController) { _entryViewController = [[MPEntryViewController alloc] init]; } [self setContentViewController:self.entryViewController]; } +- (IBAction)changedFileType:(id)sender { +} @end diff --git a/MacPass/MacPass-Info.plist b/MacPass/MacPass-Info.plist index 14e8a0a0..640ad819 100644 --- a/MacPass/MacPass-Info.plist +++ b/MacPass/MacPass-Info.plist @@ -21,7 +21,7 @@ CFBundleSignature ???? CFBundleVersion - 15D + 1C8 LSMinimumSystemVersion ${MACOSX_DEPLOYMENT_TARGET} NSHumanReadableCopyright diff --git a/MacPass/WelcomeView.xib b/MacPass/WelcomeView.xib index 7acbe263..913687c3 100644 --- a/MacPass/WelcomeView.xib +++ b/MacPass/WelcomeView.xib @@ -41,17 +41,10 @@ 268 - {{210, 211}, {177, 34}} + {{223, 214}, {152, 29}} - - 1 - - 1 - MSAxIDEAA - - _NS:1535 YES @@ -60,7 +53,7 @@ No Database LucidaGrande - 28 + 24 16 _NS:1535 @@ -91,7 +84,6 @@ - YES NSView @@ -105,6 +97,14 @@ 12 + + + welcomeText + + + + 17 + @@ -136,27 +136,11 @@ 1 - - - 10 - 0 - - 10 - 1 - - 0.0 - - 1000 - - 9 - 40 - 2 - - - + + 9 0 - + 9 1 @@ -164,8 +148,24 @@ 1000 - 9 - 40 + 5 + 22 + 2 + + + + 10 + 0 + + 10 + 1 + + 0.0 + + 1000 + + 5 + 22 2 @@ -186,13 +186,13 @@ - 10 - + 21 + - 11 - + 22 + @@ -202,46 +202,39 @@ com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin - - + + com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin - + + + 1 + MSAxIDEAA + + + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin - 12 + 22 MPMainWindowController NSWindowController - - usePassword: - id - - - usePassword: - - usePassword: - id - - NSView - NSPathControl - NSOutlineView - NSTextField - NSView + NSView + NSSplitView + NSTextField NSView @@ -249,22 +242,18 @@ contentView NSView - - keyPathControl - NSPathControl - outlineView - NSOutlineView - - - passwordTextField - NSTextField - - - passwordView NSView + + splitView + NSSplitView + + + welcomeText + NSTextField + welcomeView NSView