Fixed crash that occurred when a database was open and another one failed to be opened

Some updates on the Splitter handling
This commit is contained in:
michael starke
2013-03-05 22:00:33 +01:00
parent cb6326480e
commit a90c46f7cd
11 changed files with 601 additions and 24 deletions

View File

@@ -60,6 +60,8 @@ NSString *const _toggleFilterUsernameButton = @"SearchUsername";
@property (assign) IBOutlet NSButton *filterURLButton;
@property (assign) IBOutlet NSTextField *filterLabelTextField;
@property (assign) KdbEntry *selectedEntry;
@property (assign, nonatomic) MPFilterModeType filterMode;
@property (retain, nonatomic) NSDictionary *filterButtonToMode;
@@ -74,7 +76,9 @@ NSString *const _toggleFilterUsernameButton = @"SearchUsername";
- (void)setupFilterBar;
- (void)setupPathBar;
- (void)_setupEntryMenu;
/* Notification handling */
- (void)_didChangeGroupSelectionInOutlineView:(NSNotification *)notification;
- (void)_didChangeEntrySelection:(NSNotification *)notification;
- (void)_showFilterBarAnimated:(BOOL)animate;
- (void)_hideStatusBarAnimated:(BOOL)animate;
@@ -100,10 +104,12 @@ NSString *const _toggleFilterUsernameButton = @"SearchUsername";
_toggleFilterURLButton : @(MPFilterUrls)
} retain];
_entryArrayController = [[NSArrayController alloc] init];
_selectedEntry = nil;
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(_didChangeGroupSelectionInOutlineView:)
name:MPOutlineViewDidChangeGroupSelection
object:nil];
}
return self;
}
@@ -145,7 +151,7 @@ NSString *const _toggleFilterUsernameButton = @"SearchUsername";
[[urlColumn headerCell] setStringValue:@"URL"];
[self.entryTable bind:NSContentBinding toObject:self.entryArrayController withKeyPath:@"arrangedObjects" options:nil];
[self.selectedEntry bind:NSValueBinding toObject:self.entryArrayController withKeyPath:NSSelectedObjectBinding options:nil];
[parentColumn setHidden:YES];
}
@@ -204,6 +210,7 @@ NSString *const _toggleFilterUsernameButton = @"SearchUsername";
}
}
#pragma mark Filtering
- (BOOL)hasFilter {
@@ -393,7 +400,7 @@ NSString *const _toggleFilterUsernameButton = @"SearchUsername";
KdbEntry *selectedEntry = [self _selectedEntry];
if(!selectedEntry) {
return; // nothing found to work with;
}
}
[[MPPasteBoardController defaultController] copyObjects:@[ selectedEntry.password ]];
NSImage *image = [[NSBundle mainBundle] imageForResource:@"00_PasswordTemplate"];
NSString *lable = @"Password copied!";
@@ -410,7 +417,7 @@ NSString *const _toggleFilterUsernameButton = @"SearchUsername";
[[MPPasteBoardController defaultController] copyObjects:@[ selectedEntry.username ]];
NSImage *image = [[NSBundle mainBundle] imageForResource:@"09_IdentityTemplate"];
NSString *lable = @"Username copied!";
[[MPOverlayWindowController sharedController] displayOverlayImage:image label:lable atView:self.view];
[[MPOverlayWindowController sharedController] displayOverlayImage:image label:lable atView:self.view];
}
- (void)deleteEntry:(id)sender {