From 1b878c4d0b2c059191d4633d50a7a3e10af7691d Mon Sep 17 00:00:00 2001 From: michael starke Date: Fri, 22 Feb 2013 01:43:29 +0100 Subject: [PATCH] filter bar now works --- MacPass/EntryView.xib | 709 +++++++++++++++++--------- MacPass/GeneralSettings.xib | 203 +++----- MacPass/MPEntryViewController.h | 1 + MacPass/MPEntryViewController.m | 116 ++++- MacPass/MPGeneralSettingsController.h | 4 +- MacPass/MPGeneralSettingsController.m | 7 +- MacPass/MPMainWindowController.m | 6 +- MacPass/MPToolbarDelegate.m | 2 +- MacPass/MacPass-Info.plist | 2 +- MacPass/MainWindow.xib | 18 +- 10 files changed, 671 insertions(+), 397 deletions(-) diff --git a/MacPass/EntryView.xib b/MacPass/EntryView.xib index d6c82c7e..bc5c0351 100644 --- a/MacPass/EntryView.xib +++ b/MacPass/EntryView.xib @@ -18,6 +18,7 @@ NSCustomView NSImageCell NSImageView + NSProgressIndicator NSScrollView NSScroller NSTableCellView @@ -52,26 +53,36 @@ 268 - + 268 - {{244, 5}, {50, 17}} + {{593, 6}, {16, 16}} + + + _NS:945 + 28938 + 100 + + + + 268 + {{198, 5}, {38, 17}} _NS:9 YES - - 67108864 + + -2080374784 134348800 - Notes + URL LucidaGrande-Bold 12 16 _NS:9 - + -1232846848 173 @@ -81,47 +92,23 @@ NO - - - 268 - {{198, 5}, {38, 17}} - - - - _NS:9 - YES - - 67108864 - 134348800 - URL - - _NS:9 - - -1232846848 - 173 - - - 400 - 75 - - NO - - + 268 + {{114, 5}, {76, 17}} - + _NS:9 YES - - 67108864 + + -2080374784 134348800 Username _NS:9 - + -1232846848 173 @@ -137,7 +124,7 @@ {{64, 5}, {42, 17}} - + _NS:9 YES @@ -198,7 +185,7 @@ NO - {{0, 450}, {610, 30}} + {{0, 450}, {615, 30}} @@ -217,7 +204,7 @@ 256 - {610, 433} + {615, 433} @@ -228,7 +215,7 @@ 256 - {610, 17} + {615, 17} @@ -360,7 +347,7 @@ URL Column - 239 + 113.18359375 10 3.4028234663852886e+38 @@ -385,6 +372,32 @@ YES + + 128 + 10 + 3.4028234663852886e+38 + + 75497536 + 2048 + + + + + + + 337641536 + 2048 + Text Cell + + + + + + 3 + YES + YES + + 3 2 @@ -410,7 +423,7 @@ 1 - {{0, 17}, {610, 433}} + {{0, 17}, {615, 433}} @@ -436,7 +449,7 @@ -2147483392 - {{0, 245}, {359, 16}} + {{0, 434}, {619, 16}} _NS:60 @@ -444,7 +457,7 @@ 1 _doScroller: - 0.98898071625344353 + 0.9935794542536116 @@ -452,7 +465,7 @@ - {610, 17} + {615, 17} @@ -462,7 +475,7 @@ 4 - {610, 450} + {615, 450} @@ -478,7 +491,7 @@ 1 - {610, 480} + {615, 480} @@ -574,6 +587,62 @@ 577 + + + searchTitleButton + + + + 605 + + + + searchURLButton + + + + 609 + + + + searchUsernameButton + + + + 610 + + + + toggleFilterSpace: + + + + 611 + + + + toggleFilterSpace: + + + + 612 + + + + toggleFilterSpace: + + + + 613 + + + + progressIndicator + + + + 626 + textField @@ -618,6 +687,7 @@ 268 + Apple PDF pasteboard type Apple PICT pasteboard type @@ -695,9 +765,9 @@ 266 - {239, 17} + {113, 17} - + {250, 750} YES @@ -712,7 +782,7 @@ NO - {{369, 1}, {239, 17}} + {{369, 1}, {113, 17}} @@ -753,6 +823,40 @@ 431 + + + textField + + + 274 + + + + 266 + {128, 17} + + + {250, 750} + YES + + 67108928 + 272631808 + Table View Cell + + + + + + NO + + + {{485, 1}, {128, 17}} + + + + + 619 + @@ -875,15 +979,31 @@ 349 - - + + 3 0 - + 3 1 - 8 + 0.0 + + 1000 + + 6 + 24 + 2 + + + + 6 + 0 + + 6 + 1 + + 6 1000 @@ -891,11 +1011,43 @@ 9 3 - - + + + 11 + 0 + + 11 + 1 + + 0.0 + + 1000 + + 6 + 24 + 2 + + + 5 0 - + + 6 + 1 + + 8 + + 1000 + + 6 + 24 + 3 + + + + 5 + 0 + 6 1 @@ -908,10 +1060,10 @@ 3 - + 11 0 - + 11 1 @@ -923,40 +1075,8 @@ 24 2 - - - 11 - 0 - - 11 - 1 - - 0.0 - - 1000 - - 6 - 24 - 2 - - - - 5 - 0 - - 6 - 1 - - 8 - - 1000 - - 6 - 24 - 3 - - - + + 11 0 @@ -971,38 +1091,6 @@ 24 2 - - - 5 - 0 - - 6 - 1 - - 8 - - 1000 - - 6 - 24 - 3 - - - - 11 - 0 - - 11 - 1 - - 0.0 - - 1000 - - 6 - 24 - 2 - 5 @@ -1019,6 +1107,22 @@ 24 3 + + + 10 + 0 + + 10 + 1 + + 0.0 + + 1000 + + 5 + 22 + 2 + 5 @@ -1053,9 +1157,9 @@ - - - + + + @@ -1106,6 +1210,7 @@ + @@ -1653,45 +1758,6 @@ - - 447 - - - - - - - - 448 - - - - - 452 - - - - - - - - 453 - - - - - 456 - - - - - - - - 457 - - - 478 @@ -1702,46 +1768,6 @@ - - 490 - - - - - 492 - - - - - 495 - - - - - 496 - - - - - 497 - - - - - 500 - - - - - 501 - - - - - 502 - - - 344 @@ -1762,6 +1788,175 @@ + + 581 + + + + + 582 + + + + + 594 + + + + + + + + 595 + + + + + 597 + + + + + 598 + + + + + 599 + + + + + + + + 600 + + + + + 601 + + + + + 602 + + + + + 614 + + + + + + + + + 615 + + + + + 616 + + + + + + 5 + 0 + + 5 + 1 + + 3 + + 1000 + + 8 + 29 + 3 + + + + 10 + 0 + + 10 + 1 + + 0.0 + + 1000 + + 5 + 22 + 2 + + + + 6 + 0 + + 6 + 1 + + 3 + + 1000 + + 8 + 29 + 3 + + + + + + 617 + + + + + + + + 618 + + + + + 620 + + + + + 621 + + + + + 622 + + + + + 623 + + + + + 624 + + + + + 625 + + + @@ -1841,18 +2036,18 @@ com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin - + + - - - - - + - - + + + + + com.apple.InterfaceBuilder.CocoaPlugin @@ -1903,25 +2098,8 @@ 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 @@ -1932,21 +2110,70 @@ 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 - 579 + 626 MPEntryViewController MPViewController + + toggleFilterSpace: + id + + + toggleFilterSpace: + + toggleFilterSpace: + id + + NSTableView + NSProgressIndicator NSTextField + NSButton + NSButton + NSButton NSView NSLayoutConstraint NSLayoutConstraint @@ -1956,10 +2183,26 @@ entryTable NSTableView + + progressIndicator + NSProgressIndicator + searchLabelTextField NSTextField + + searchTitleButton + NSButton + + + searchURLButton + NSButton + + + searchUsernameButton + NSButton + statusBar NSView diff --git a/MacPass/GeneralSettings.xib b/MacPass/GeneralSettings.xib index ad1d39ac..a49d9f9d 100644 --- a/MacPass/GeneralSettings.xib +++ b/MacPass/GeneralSettings.xib @@ -18,6 +18,7 @@ NSMenuItem NSPopUpButton NSPopUpButtonCell + NSProgressIndicator NSTextField NSTextFieldCell @@ -42,23 +43,21 @@ 268 - + 268 - {{20, 20}, {250, 137}} + {{129, 93}, {32, 32}} - - - _NS:9 - MPGradientView + _NS:945 + 20490 + 100 268 {{146, 174}, {127, 26}} - - + _NS:9 {750, 751} YES @@ -138,7 +137,6 @@ 268 {{17, 180}, {127, 17}} - _NS:1505 YES @@ -173,7 +171,6 @@ {290, 218} - NSView @@ -196,6 +193,14 @@ 83 + + + spinner + + + + 174 + @@ -229,6 +234,38 @@ + + + 10 + 0 + + 10 + 1 + + 0.0 + + 1000 + + 5 + 22 + 2 + + + + 9 + 0 + + 9 + 1 + + 0.0 + + 1000 + + 5 + 22 + 2 + 11 @@ -309,70 +346,6 @@ 40 3 - - - 4 - 0 - - 4 - 1 - - 20 - - 1000 - - 8 - 29 - 3 - - - - 6 - 0 - - 6 - 1 - - 20 - - 1000 - - 8 - 29 - 3 - - - - 5 - 0 - - 5 - 1 - - 20 - - 1000 - - 8 - 29 - 3 - - - - 3 - 0 - - 4 - 1 - - 20 - - 1000 - - 6 - 24 - 3 - 7 @@ -421,7 +394,7 @@ 40 3 - + @@ -520,28 +493,18 @@ - 143 - + 155 + - 148 - + 168 + - 151 - - - - - 152 - - - - - 154 - + 167 + @@ -554,15 +517,13 @@ - - - - + + com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin @@ -571,14 +532,12 @@ 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 @@ -594,47 +553,9 @@ - 154 - - - - - MPGeneralSettingsController - NSViewController - - encodingPopup - NSPopUpButton - - - encodingPopup - - encodingPopup - NSPopUpButton - - - - IBProjectSource - ./Classes/MPGeneralSettingsController.h - - - - MPGradientView - NSView - - IBProjectSource - ./Classes/MPGradientView.h - - - - NSLayoutConstraint - NSObject - - IBProjectSource - ./Classes/NSLayoutConstraint.h - - - + 174 + 0 IBCocoaFramework YES diff --git a/MacPass/MPEntryViewController.h b/MacPass/MPEntryViewController.h index 05f14ca0..523c429c 100644 --- a/MacPass/MPEntryViewController.h +++ b/MacPass/MPEntryViewController.h @@ -12,6 +12,7 @@ APPKIT_EXTERN NSString *const MPEntryTableUserNameColumnIdentifier; APPKIT_EXTERN NSString *const MPEntryTableTitleColumnIdentifier; APPKIT_EXTERN NSString *const MPEntryTablePasswordColumnIdentifier; APPKIT_EXTERN NSString *const MPEntryTableParentColumnIdentifier; +APPKIT_EXTERN NSString *const MPEntryTableURLColumnIdentifier; @class KdbGroup; diff --git a/MacPass/MPEntryViewController.m b/MacPass/MPEntryViewController.m index bbc9549f..29e269fb 100644 --- a/MacPass/MPEntryViewController.m +++ b/MacPass/MPEntryViewController.m @@ -17,15 +17,27 @@ #define STATUS_BAR_ANIMATION_TIME 0.2 +typedef enum { + MPFilterNone = 0, + MPFilterUrls = 2, + MPFilterUsernames = 4, + MPFilterTitles = 8, +} MPFilterModeType; + NSString *const MPEntryTableUserNameColumnIdentifier = @"MPUserNameColumnIdentifier"; NSString *const MPEntryTableTitleColumnIdentifier = @"MPTitleColumnIdentifier"; NSString *const MPEntryTablePasswordColumnIdentifier = @"MPPasswordColumnIdentifier"; NSString *const MPEntryTableParentColumnIdentifier = @"MPParentColumnIdentifier"; +NSString *const MPEntryTableURLColumnIdentifier = @"MPEntryTableURLColumnIdentifier"; NSString *const _MPTableImageCellView = @"ImageCell"; NSString *const _MPTableStringCellView = @"StringCell"; NSString *const _MPTAbleSecurCellView = @"PasswordCell"; +NSString *const _toggleSearchURLButton = @"SearchURL"; +NSString *const _toggleSearchTitleButton = @"SearchTitle"; +NSString *const _toggleSearchUsernameButton = @"SearchUsername"; + @interface MPEntryViewController () @property (retain) NSArrayController *entryArrayController; @@ -36,7 +48,20 @@ NSString *const _MPTAbleSecurCellView = @"PasswordCell"; @property (assign) BOOL isStatusBarVisible; @property (retain) IBOutlet NSLayoutConstraint *statusBarToTop; @property (retain) IBOutlet NSLayoutConstraint *tableToTop; +@property (assign) IBOutlet NSProgressIndicator *progressIndicator; +@property (assign) IBOutlet NSButton *searchTitleButton; +@property (assign) IBOutlet NSButton *searchUsernameButton; +@property (assign) IBOutlet NSButton *searchURLButton; + +@property (assign, nonatomic) MPFilterModeType filterMode; +@property (retain, nonatomic) NSDictionary *filterButtonToMode; + +- (IBAction)toggleFilterSpace:(id)sender; + +- (BOOL)shouldFilterURLs; +- (BOOL)shouldFilterTitles; +- (BOOL)shouldFilterUsernames; - (BOOL)hasFilter; - (void)updateFilter; @@ -57,6 +82,11 @@ NSString *const _MPTAbleSecurCellView = @"PasswordCell"; self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]; if(self) { _isStatusBarVisible = YES; + _filterMode = MPFilterTitles; + _filterButtonToMode = [@{ _toggleSearchUsernameButton : @(MPFilterUsernames), + _toggleSearchTitleButton : @(MPFilterTitles), + _toggleSearchURLButton : @(MPFilterUrls) + } retain]; _entryArrayController = [[NSArrayController alloc] init]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(didChangeGroupSelectionInOutlineView:) @@ -67,26 +97,33 @@ NSString *const _MPTAbleSecurCellView = @"PasswordCell"; } - (void)didLoadView { - [self.view setWantsLayer:YES]; [self hideStatusBarAnimated:NO]; [[self.searchLabelTextField cell] setBackgroundStyle:NSBackgroundStyleRaised]; + + [self.searchURLButton setIdentifier:_toggleSearchURLButton]; + [self.searchUsernameButton setIdentifier:_toggleSearchUsernameButton]; + [self.searchTitleButton setIdentifier:_toggleSearchTitleButton]; + [self.entryTable setDelegate:self]; NSTableColumn *parentColumn = [self.entryTable tableColumns][0]; NSTableColumn *titleColumn = [self.entryTable tableColumns][1]; NSTableColumn *userNameColumn = [self.entryTable tableColumns][2]; NSTableColumn *passwordColumn = [self.entryTable tableColumns][3]; + NSTableColumn *urlColumn = [self.entryTable tableColumns][4]; [parentColumn setIdentifier:MPEntryTableParentColumnIdentifier]; [titleColumn setIdentifier:MPEntryTableTitleColumnIdentifier]; [userNameColumn setIdentifier:MPEntryTableUserNameColumnIdentifier]; [passwordColumn setIdentifier:MPEntryTablePasswordColumnIdentifier]; + [urlColumn setIdentifier:MPEntryTableURLColumnIdentifier]; [[parentColumn headerCell] setStringValue:@"Group"]; [[titleColumn headerCell] setStringValue:@"Title"]; [[userNameColumn headerCell] setStringValue:@"Username"]; [[passwordColumn headerCell] setStringValue:@"Password"]; + [[urlColumn headerCell] setStringValue:@"URL"]; [self.entryTable bind:NSContentBinding toObject:self.entryArrayController withKeyPath:@"arrangedObjects" options:nil]; @@ -102,6 +139,7 @@ NSString *const _MPTAbleSecurCellView = @"PasswordCell"; const BOOL isGroupColumn = [[tableColumn identifier] isEqualToString:MPEntryTableParentColumnIdentifier]; const BOOL isPasswordColum = [[tableColumn identifier] isEqualToString:MPEntryTablePasswordColumnIdentifier]; const BOOL isUsernameColumn = [[tableColumn identifier] isEqualToString:MPEntryTableUserNameColumnIdentifier]; + const BOOL isURLColumn = [[tableColumn identifier] isEqualToString:MPEntryTableURLColumnIdentifier]; NSTableCellView *view = nil; if(isTitleColumn || isGroupColumn) { @@ -113,19 +151,19 @@ NSString *const _MPTAbleSecurCellView = @"PasswordCell"; else { [[view textField] setStringValue:entry.parent.name]; } - return view; } - - if( isPasswordColum ) { + else if( isPasswordColum ) { view = [tableView makeViewWithIdentifier:_MPTAbleSecurCellView owner:self]; [[view textField] setStringValue:entry.password]; - return view; } - - if( isUsernameColumn ) { + else if( isUsernameColumn || isURLColumn ) { view = [tableView makeViewWithIdentifier:_MPTableStringCellView owner:self]; - [[view textField] setStringValue:entry.username]; - return view; + if(isURLColumn) { + [[view textField] setStringValue:entry.url]; + } + else { + [[view textField] setStringValue:entry.username]; + } } return view; @@ -165,11 +203,22 @@ NSString *const _MPTAbleSecurCellView = @"PasswordCell"; if(openDatabase && [self hasFilter]) { [self showStatusBarAnimated:YES]; + dispatch_queue_t backgroundQueue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0); dispatch_async(backgroundQueue, ^{ - NSPredicate *filterPredicate = [NSPredicate predicateWithFormat:@"SELF.title CONTAINS[cd] %@", self.filter]; - self.filteredEntries = [[openDatabase.root childEntries] filteredArrayUsingPredicate:filterPredicate]; + NSMutableArray *prediactes = [NSMutableArray arrayWithCapacity:3]; + if( [self shouldFilterTitles] ) { + [prediactes addObject:[NSPredicate predicateWithFormat:@"SELF.title CONTAINS[cd] %@", self.filter]]; + } + if( [self shouldFilterUsernames] ) { + [prediactes addObject:[NSPredicate predicateWithFormat:@"SELF.username CONTAINS[cd] %@", self.filter]]; + } + if( [self shouldFilterURLs] ) { + [prediactes addObject:[NSPredicate predicateWithFormat:@"SELF.url CONTAINS[cd] %@", self.filter]]; + } + NSPredicate *fullFilter = [NSCompoundPredicate orPredicateWithSubpredicates:prediactes]; + self.filteredEntries = [[openDatabase.root childEntries] filteredArrayUsingPredicate:fullFilter]; dispatch_sync(dispatch_get_main_queue(), ^{ [self.entryArrayController setContent:self.filteredEntries]; @@ -192,10 +241,15 @@ NSString *const _MPTAbleSecurCellView = @"PasswordCell"; if(self.isStatusBarVisible) { return; // nothign to to } + + [self.searchTitleButton setState:[self shouldFilterTitles] ? NSOnState : NSOffState]; + [self.searchURLButton setState:[self shouldFilterURLs] ? NSOnState : NSOffState ]; + [self.searchUsernameButton setState:[self shouldFilterUsernames] ? NSOnState : NSOffState]; + 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; @@ -230,5 +284,43 @@ NSString *const _MPTAbleSecurCellView = @"PasswordCell"; } } +#pragma mark Actions + +- (void)toggleFilterSpace:(id)sender { + NSButton *button = sender; + NSNumber *value = self.filterButtonToMode[[button identifier]]; + MPFilterModeType toggledMode = (MPFilterModeType)[value intValue]; + switch ([button state]) { + case NSOnState: + self.filterMode |= toggledMode; + break; + + case NSOffState: + self.filterMode ^= toggledMode; + break; + + default: + break; + } +} + +- (void)setFilterMode:(MPFilterModeType)newFilterMode { + if(_filterMode != newFilterMode) { + _filterMode = newFilterMode; + [self updateFilter]; + } +} + +- (BOOL)shouldFilterTitles { + return ( MPFilterNone != (self.filterMode & MPFilterTitles)); +} + +- (BOOL)shouldFilterURLs { + return ( MPFilterNone != (self.filterMode & MPFilterUrls)); +} + +- (BOOL)shouldFilterUsernames { + return ( MPFilterNone != (self.filterMode & MPFilterUsernames)); +} @end diff --git a/MacPass/MPGeneralSettingsController.h b/MacPass/MPGeneralSettingsController.h index e5c36213..804e7e2a 100644 --- a/MacPass/MPGeneralSettingsController.h +++ b/MacPass/MPGeneralSettingsController.h @@ -8,7 +8,9 @@ #import #import "MPSettingsTabProtocoll.h" +#import "MPViewController.h" -@interface MPGeneralSettingsController : NSViewController +@interface MPGeneralSettingsController : MPViewController +@property (assign) IBOutlet NSProgressIndicator *spinner; @end diff --git a/MacPass/MPGeneralSettingsController.m b/MacPass/MPGeneralSettingsController.m index b0a1c9d1..bab707cc 100644 --- a/MacPass/MPGeneralSettingsController.m +++ b/MacPass/MPGeneralSettingsController.m @@ -35,11 +35,6 @@ NSString *const MPGeneralSetingsIdentifier = @"GeneralSettingsTab"; return self; } -- (void)loadView { - [super loadView]; - [self didLoadView]; -} - - (void)didLoadView { // setup connections NSMenu *encodingMenu = [[NSMenu allocWithZone:[NSMenu menuZone]] init]; @@ -57,6 +52,8 @@ NSString *const MPGeneralSetingsIdentifier = @"GeneralSettingsTab"; [_encodingPopup setMenu:encodingMenu]; [encodingMenu release]; + + } @end diff --git a/MacPass/MPMainWindowController.m b/MacPass/MPMainWindowController.m index 03a200ec..2cb3733b 100644 --- a/MacPass/MPMainWindowController.m +++ b/MacPass/MPMainWindowController.m @@ -114,6 +114,7 @@ else { [self.contentView addSubview:newContentView]; } + [self.contentView setNeedsDisplay:YES]; [self.splitView adjustSubviews]; /* Set focus AFTER having added the view @@ -132,7 +133,6 @@ NSView *outlineView = [self.splitView subviews][0]; if([outlineView isHidden]) { [self.splitView setPosition:MPMainWindowSplitViewDelegateMinimumOutlineWidth ofDividerAtIndex:0]; - } } @@ -172,6 +172,10 @@ self.entryViewController.filter = [searchField stringValue]; } +- (void)cancelFilter:(id)sender { + NSLog(@"Whooo"); +} + #pragma mark Notifications - (void)didOpenDocument:(NSNotification *)notification { diff --git a/MacPass/MPToolbarDelegate.m b/MacPass/MPToolbarDelegate.m index 30593a50..d9db2430 100644 --- a/MacPass/MPToolbarDelegate.m +++ b/MacPass/MPToolbarDelegate.m @@ -54,7 +54,7 @@ NSString *const MPToolbarItemSearch = @"Search"; NSSearchField *searchfield = [[NSSearchField alloc] initWithFrame:NSMakeRect(0, 0, 70, 32)]; [item setView:searchfield]; [searchfield setAction:@selector(updateFilter:)]; - [[searchfield cell] setSendsSearchStringImmediately:YES]; + [[searchfield cell] setSendsSearchStringImmediately:NO]; [searchfield release]; self.searchItem = item; } diff --git a/MacPass/MacPass-Info.plist b/MacPass/MacPass-Info.plist index 640ad819..a31aaf9d 100644 --- a/MacPass/MacPass-Info.plist +++ b/MacPass/MacPass-Info.plist @@ -21,7 +21,7 @@ CFBundleSignature ???? CFBundleVersion - 1C8 + 201 LSMinimumSystemVersion ${MACOSX_DEPLOYMENT_TARGET} NSHumanReadableCopyright diff --git a/MacPass/MainWindow.xib b/MacPass/MainWindow.xib index 9406f6a3..df42a85d 100644 --- a/MacPass/MainWindow.xib +++ b/MacPass/MainWindow.xib @@ -70,7 +70,16 @@ {{257, 0}, {470, 630}} - + YES + + subviews + + fade + + type + + + _NS:13 NSView @@ -89,7 +98,7 @@ - {{0, 0}, {2560, 1418}} + {{0, 0}, {1680, 1028}} {400, 422} {10000000000000, 10000000000000} YES @@ -223,6 +232,7 @@ NSView NSView NSSplitView + NSTextField NSView @@ -238,6 +248,10 @@ splitView NSSplitView + + welcomeText + NSTextField + welcomeView NSView