From ff7e8aaadde32f83fc2f7a7b227ba345edffdf24 Mon Sep 17 00:00:00 2001 From: michael starke Date: Sun, 10 Mar 2013 03:12:34 +0100 Subject: [PATCH] Removed Search form toolbar and added field to search bar. Searching is broken for now. Added rudimentary add group/entry functionality --- MacPass.xcodeproj/project.pbxproj | 4 - MacPass/FilterBar.xib | 219 ++++++++++++++++++++++++++---- MacPass/MPAppDelegate.m | 12 -- MacPass/MPDatabaseDocument.h | 5 + MacPass/MPDatabaseDocument.m | 14 ++ MacPass/MPEntryViewController.h | 6 +- MacPass/MPEntryViewController.m | 21 ++- MacPass/MPMainWindowController.h | 1 - MacPass/MPMainWindowController.m | 50 +------ MacPass/MPOutlineViewController.h | 1 + MacPass/MPOutlineViewController.m | 36 +++-- MacPass/MPToolbarDelegate.m | 18 +-- MacPass/MacPass-Info.plist | 2 +- MacPass/PathBar.xib | 117 ---------------- MacPass/en.lproj/MainMenu.xib | 162 +++------------------- 15 files changed, 289 insertions(+), 379 deletions(-) delete mode 100644 MacPass/PathBar.xib diff --git a/MacPass.xcodeproj/project.pbxproj b/MacPass.xcodeproj/project.pbxproj index f1dfa1ea..dccc1189 100644 --- a/MacPass.xcodeproj/project.pbxproj +++ b/MacPass.xcodeproj/project.pbxproj @@ -20,7 +20,6 @@ 4C3FFD9E16DAF60600DF9186 /* FilterBar.xib in Resources */ = {isa = PBXBuildFile; fileRef = 4C3FFD9D16DAF60600DF9186 /* FilterBar.xib */; }; 4C431BCD16E2A82800700A81 /* MPPasteBoardController.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C431BCC16E2A82700700A81 /* MPPasteBoardController.m */; }; 4C431BCF16E2BAB000700A81 /* OverlayWindow.xib in Resources */ = {isa = PBXBuildFile; fileRef = 4C431BCE16E2BAB000700A81 /* OverlayWindow.xib */; }; - 4C4E1DC716DC6536007B9B47 /* PathBar.xib in Resources */ = {isa = PBXBuildFile; fileRef = 4C4E1DC616DC6536007B9B47 /* PathBar.xib */; }; 4C586F9E16D07ABD00E7DB57 /* 00_PasswordTemplate.pdf in Resources */ = {isa = PBXBuildFile; fileRef = 4C586F9D16D07ABD00E7DB57 /* 00_PasswordTemplate.pdf */; }; 4C586FA016D07D7200E7DB57 /* 01_PackageNetworkTemplate.pdf in Resources */ = {isa = PBXBuildFile; fileRef = 4C586F9F16D07D7200E7DB57 /* 01_PackageNetworkTemplate.pdf */; }; 4C586FA216D07F6A00E7DB57 /* 02_MessageBoxWarningTemplate.pdf in Resources */ = {isa = PBXBuildFile; fileRef = 4C586FA116D07F6A00E7DB57 /* 02_MessageBoxWarningTemplate.pdf */; }; @@ -127,7 +126,6 @@ 4C431BCB16E2A82700700A81 /* MPPasteBoardController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MPPasteBoardController.h; sourceTree = ""; }; 4C431BCC16E2A82700700A81 /* MPPasteBoardController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MPPasteBoardController.m; sourceTree = ""; }; 4C431BCE16E2BAB000700A81 /* OverlayWindow.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = OverlayWindow.xib; sourceTree = ""; }; - 4C4E1DC616DC6536007B9B47 /* PathBar.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = PathBar.xib; sourceTree = ""; }; 4C586F9D16D07ABD00E7DB57 /* 00_PasswordTemplate.pdf */ = {isa = PBXFileReference; lastKnownFileType = image.pdf; path = 00_PasswordTemplate.pdf; sourceTree = ""; }; 4C586F9F16D07D7200E7DB57 /* 01_PackageNetworkTemplate.pdf */ = {isa = PBXFileReference; lastKnownFileType = image.pdf; path = 01_PackageNetworkTemplate.pdf; sourceTree = ""; }; 4C586FA116D07F6A00E7DB57 /* 02_MessageBoxWarningTemplate.pdf */ = {isa = PBXFileReference; lastKnownFileType = image.pdf; path = 02_MessageBoxWarningTemplate.pdf; sourceTree = ""; }; @@ -313,7 +311,6 @@ 4C6B0E8B16C9B99B00A9ED23 /* PasswordInputView.xib */, 4C25D58416CF0F8800F6806C /* WelcomeView.xib */, 4C3FFD9D16DAF60600DF9186 /* FilterBar.xib */, - 4C4E1DC616DC6536007B9B47 /* PathBar.xib */, 4C77547616E55FFC00970E02 /* InspectorTabView.xib */, 4C69A73816D589DF00EC1B1A /* MPGradientView.h */, 4C69A73916D589DF00EC1B1A /* MPGradientView.m */, @@ -770,7 +767,6 @@ 4C61EA0516D2FFE200AC519E /* OutlineView.xib in Resources */, 4CB9339916D3A0DD00A13B5D /* Credits.rtf in Resources */, 4C3FFD9E16DAF60600DF9186 /* FilterBar.xib in Resources */, - 4C4E1DC716DC6536007B9B47 /* PathBar.xib in Resources */, 4C431BCF16E2BAB000700A81 /* OverlayWindow.xib in Resources */, 4C77547716E55FFC00970E02 /* InspectorTabView.xib in Resources */, 4C888C9016EB6C91003D34A1 /* Localizable.strings in Resources */, diff --git a/MacPass/FilterBar.xib b/MacPass/FilterBar.xib index 60a4d692..566bfa80 100644 --- a/MacPass/FilterBar.xib +++ b/MacPass/FilterBar.xib @@ -2,7 +2,7 @@ 1080 - 12C60 + 12C3103 3084 1187.34 625.00 @@ -16,6 +16,8 @@ NSButtonCell NSCustomObject NSCustomView + NSSearchField + NSSearchFieldCell NSTextField NSTextFieldCell @@ -37,25 +39,97 @@ NSApplication - + 268 + + + 268 + {{369, 5}, {136, 19}} + + + _NS:9 + YES + + 342884416 + 268567616 + + + LucidaGrande + 11 + 3100 + + _NS:9 + + YES + 1 + + 6 + System + textBackgroundColor + + 3 + MQA + + + + 6 + System + controlTextColor + + 3 + MAA + + + + 0 + 0 + search + + _searchFieldSearch: + + 138690560 + 0 + + 400 + 75 + + + 0 + 0 + clear + + + cancel + + + + + _searchFieldCancel: + + 138690560 + 0 + + 400 + 75 + + 255 + + NO + 268 - {{496, 5}, {42, 17}} + {{513, 5}, {42, 17}} + _NS:9 YES -2080374784 134348800 Done - - LucidaGrande - 11 - 3100 - + _NS:9 -2038153216 @@ -72,6 +146,7 @@ 268 {{188, 5}, {38, 17}} + _NS:9 YES @@ -100,6 +175,7 @@ 268 {{104, 5}, {76, 17}} + _NS:9 YES @@ -124,6 +200,7 @@ 268 {{5, 6}, {44, 14}} + _NS:1535 YES @@ -164,6 +241,7 @@ 268 {{54, 4}, {42, 19}} + _NS:9 YES @@ -184,7 +262,9 @@ NO - {546, 28} + {563, 28} + + MPGradientView @@ -302,11 +382,11 @@ 1 - + 5 - 1 - + 0 + 6 1 @@ -350,6 +430,38 @@ 40 3 + + + 5 + 1 + + 6 + 1 + + 8 + + 1000 + + 9 + 40 + 3 + + + + 10 + 0 + + 10 + 1 + + 0.0 + + 1000 + + 9 + 40 + 2 + 10 @@ -515,6 +627,7 @@ + @@ -639,13 +752,57 @@ - 72 - + 73 + - 73 - + 80 + + + + + + 7 + 0 + + 0 + 1 + + 136 + + 1000 + + 9 + 40 + 1 + + + + + + 81 + + + + + 83 + + + + + 85 + + + + + 86 + + + + + 87 + @@ -654,7 +811,7 @@ com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin - + @@ -665,9 +822,11 @@ + + - + com.apple.InterfaceBuilder.CocoaPlugin @@ -696,14 +855,23 @@ 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 - 79 + 87 @@ -711,13 +879,13 @@ MPEntryViewController MPViewController - toggleFilterSpace: + _toggleFilterSpace: id - toggleFilterSpace: + _toggleFilterSpace: - toggleFilterSpace: + _toggleFilterSpace: id @@ -729,6 +897,7 @@ NSButton NSButton NSButton + NSView NSLayoutConstraint NSLayoutConstraint @@ -761,6 +930,10 @@ filterUsernameButton NSButton + + pathBar + NSView + tableToBottom NSLayoutConstraint diff --git a/MacPass/MPAppDelegate.m b/MacPass/MPAppDelegate.m index ef09ccc9..b29b7c1d 100644 --- a/MacPass/MPAppDelegate.m +++ b/MacPass/MPAppDelegate.m @@ -17,10 +17,6 @@ @property (retain) MPSettingsController *settingsController; @property (retain) MPMainWindowController *mainWindowController; -@property (assign) IBOutlet NSMenuItem *toggleOutlineViewMenuItem; -@property (assign) IBOutlet NSMenuItem *toggleInspectorViewMenuItem; - -- (void)_setupMenues; - (IBAction)showPreferences:(id)sender; @end @@ -30,7 +26,6 @@ - (void)applicationDidFinishLaunching:(NSNotification *)aNotification { self.mainWindowController = [[[MPMainWindowController alloc] init] autorelease]; [self.mainWindowController showWindow:[self.mainWindowController window]]; - [self _setupMenues]; } @@ -44,13 +39,6 @@ return [[NSBundle mainBundle] infoDictionary][@"CFBundleName"]; } -#pragma mark Setup - -- (void)_setupMenues { - [self.toggleInspectorViewMenuItem setAction:@selector(toggleInspector:)]; - [self.toggleOutlineViewMenuItem setAction:@selector(toggleOutlineView:)]; -} - #pragma mark Menu Actions - (void)showMainWindow:(id)sender { diff --git a/MacPass/MPDatabaseDocument.h b/MacPass/MPDatabaseDocument.h index 00c928d6..42ea97e8 100644 --- a/MacPass/MPDatabaseDocument.h +++ b/MacPass/MPDatabaseDocument.h @@ -18,6 +18,7 @@ typedef enum { @class KdbPassword; @class KdbGroup; +@class KdbEntry; @interface MPDatabaseDocument : NSObject @@ -40,4 +41,8 @@ typedef enum { - (BOOL)save; - (BOOL)saveAsFile:(NSURL *)file withPassword:(NSString *)password keyfile:(NSURL *)key; +- (KdbGroup *)createGroup:(KdbGroup *)parent; +- (KdbEntry *)createEntry:(KdbGroup *)parent; + + @end diff --git a/MacPass/MPDatabaseDocument.m b/MacPass/MPDatabaseDocument.m index 80b37332..462cdfd9 100644 --- a/MacPass/MPDatabaseDocument.m +++ b/MacPass/MPDatabaseDocument.m @@ -129,4 +129,18 @@ NSString *const MPDidLoadDatabaseNotification = @"DidLoadDataBaseNotification"; return [[[KdbPassword alloc] initWithPassword:self.password passwordEncoding:NSUTF8StringEncoding keyFile:[self.key path]] autorelease]; } +- (KdbEntry *)createEntry:(KdbGroup *)parent { + KdbEntry *newEntry = [self.tree createEntry:parent]; + newEntry.title = NSLocalizedString(@"DEFAULT_ENTRY_TITLE", @"Title for a newly created entry"); + [parent addEntry:newEntry]; + return newEntry; +} + +- (KdbGroup *)createGroup:(KdbGroup *)parent { + KdbGroup *newGroup = [self.tree createGroup:parent]; + newGroup.name = NSLocalizedString(@"DEFAULT_GROUP_NAME", @"Title for a newly created group"); + [parent addGroup:newGroup]; + return newGroup; +} + @end diff --git a/MacPass/MPEntryViewController.h b/MacPass/MPEntryViewController.h index ed5910e2..62ee58f5 100644 --- a/MacPass/MPEntryViewController.h +++ b/MacPass/MPEntryViewController.h @@ -39,12 +39,16 @@ typedef enum { /* Clear the Search filter*/ -- (void)clearFilter; +- (void)showFilter:(id)sender; +- (void)clearFilter:(id)sender; +/* Copy/Paste */ - (void)copyUsername:(id)sender; - (void)copyPassword:(id)sender; - (void)copyURL:(id)sender; - (void)openURL:(id)sender; + +/* Entry Handling*/ - (void)deleteEntry:(id)sender; @end diff --git a/MacPass/MPEntryViewController.m b/MacPass/MPEntryViewController.m index bc32c247..39e9e494 100644 --- a/MacPass/MPEntryViewController.m +++ b/MacPass/MPEntryViewController.m @@ -53,7 +53,6 @@ NSString *const _toggleFilterUsernameButton = @"SearchUsername"; @property (retain) NSArrayController *entryArrayController; @property (retain) NSArray *filteredEntries; @property (retain) IBOutlet NSView *filterBar; -@property (retain) IBOutlet NSView *pathBar; @property (assign) IBOutlet NSTableView *entryTable; @property (assign) BOOL isStatusBarVisible; @property (assign) IBOutlet NSLayoutConstraint *tableToTop; @@ -64,6 +63,7 @@ NSString *const _toggleFilterUsernameButton = @"SearchUsername"; @property (assign) IBOutlet NSButton *filterUsernameButton; @property (assign) IBOutlet NSButton *filterURLButton; @property (assign) IBOutlet NSTextField *filterLabelTextField; +@property (assign) IBOutlet NSSearchField *filterSearchField; @property (assign) KdbEntry *selectedEntry; @@ -80,7 +80,6 @@ NSString *const _toggleFilterUsernameButton = @"SearchUsername"; - (BOOL)hasFilter; - (void)updateFilter; - (void)setupFilterBar; -- (void)setupPathBar; - (void)_setupEntryMenu; /* Notification handling */ - (void)_didChangeGroupSelectionInOutlineView:(NSNotification *)notification; @@ -213,7 +212,7 @@ NSString *const _toggleFilterUsernameButton = @"SearchUsername"; #pragma mark Notifications - (void)_didChangeGroupSelectionInOutlineView:(NSNotification *)notification { if([self hasFilter]) { - [(MPMainWindowController *)[[self.view window] windowController] clearFilter:nil]; + [self.filterSearchField setStringValue:@""]; } MPOutlineViewDelegate *delegate = [notification object]; KdbGroup *group = delegate.selectedGroup; @@ -230,6 +229,10 @@ NSString *const _toggleFilterUsernameButton = @"SearchUsername"; #pragma mark Filtering +- (void)showFilter:(id)sender { + [self _showFilterBarAnimated:NO]; +} + - (BOOL)hasFilter { return ([self.filter length] > 0); } @@ -246,7 +249,7 @@ NSString *const _toggleFilterUsernameButton = @"SearchUsername"; [self.entryTable deselectAll:nil]; } -- (void)clearFilter { +- (void)clearFilter:(id)sender { self.filter = nil; [[self.entryTable tableColumnWithIdentifier:MPEntryTableParentColumnIdentifier] setHidden:YES]; [self _hideStatusBarAnimated:YES]; @@ -295,14 +298,10 @@ NSString *const _toggleFilterUsernameButton = @"SearchUsername"; [[self.filterLabelTextField cell] setBackgroundStyle:NSBackgroundStyleRaised]; [self.filterDoneButton setAction:@selector(clearFilter:)]; [self.filterDoneButton setTarget:nil]; - } -} - -- (void)setupPathBar { - if(!self.pathBar) { - [[NSBundle mainBundle] loadNibNamed:@"PathBar" owner:self topLevelObjects:nil]; - [self.pathBar setAutoresizingMask:NSViewWidthSizable|NSViewMaxYMargin]; + [self.filterSearchField setAction:@selector(updateFilter:)]; + [[self.filterSearchField cell] setSendsSearchStringImmediately:NO]; + } } diff --git a/MacPass/MPMainWindowController.h b/MacPass/MPMainWindowController.h index 94f11103..83531b75 100644 --- a/MacPass/MPMainWindowController.h +++ b/MacPass/MPMainWindowController.h @@ -29,7 +29,6 @@ /* Clears the Search filter */ -- (void)clearFilter:(id)sender; - (void)toggleInspector:(id)sender; - (void)toggleOutlineView:(id)sender; diff --git a/MacPass/MPMainWindowController.m b/MacPass/MPMainWindowController.m index f25ff4c7..8abcf18d 100644 --- a/MacPass/MPMainWindowController.m +++ b/MacPass/MPMainWindowController.m @@ -19,8 +19,6 @@ #define MIN_WINDOW_WIDTH MPMainWindowSplitViewDelegateMinimumContentWidth + MPMainWindowSplitViewDelegateMinimumOutlineWidth + [self.splitView dividerThickness] -static CGFloat _outlineSplitterPosition; - @interface MPMainWindowController () @property (assign) IBOutlet NSView *outlineView; @@ -40,10 +38,6 @@ static CGFloat _outlineSplitterPosition; @property (retain) MPToolbarDelegate *toolbarDelegate; @property (retain) MPMainWindowSplitViewDelegate *splitViewDelegate; -/* View show/hide */ -- (void)_collapseOutlineView; -- (void)_expandOutlineView; - - (void)_setContentViewController:(MPViewController *)viewController; - (void)_updateWindowTitle; @@ -123,9 +117,9 @@ static CGFloat _outlineSplitterPosition; [self.inspectorTabViewController updateResponderChain]; [self.splitView adjustSubviews]; + [self toggleInspector:nil]; [self _setContentViewController:nil]; - [self _collapseOutlineView]; } - (void)_setContentViewController:(MPViewController *)viewController { @@ -162,22 +156,6 @@ static CGFloat _outlineSplitterPosition; [self.window makeFirstResponder:[viewController reconmendedFirstResponder]]; } -- (void)_collapseOutlineView { - NSView *outlineView = [self.splitView subviews][MPSplitViewOutlineViewIndex]; - if([outlineView isHidden]) { - _outlineSplitterPosition = [outlineView frame].size.width; - [self.splitView setPosition:0 ofDividerAtIndex:MPSplitViewOutlineViewIndex]; - } -} - -- (void)_expandOutlineView { - NSView *outlineView = [self.splitView subviews][MPSplitViewOutlineViewIndex]; - if(![outlineView isHidden]) { - CGFloat splitterPosition = MAX( MPMainWindowSplitViewDelegateMinimumOutlineWidth, _outlineSplitterPosition ); - [self.splitView setPosition:splitterPosition ofDividerAtIndex:MPSplitViewOutlineViewIndex]; - } -} - - (void)_updateWindowTitle { if([MPDatabaseController defaultController].database) { NSString *appName = [(MPAppDelegate *)[NSApp delegate] applicationName]; @@ -208,6 +186,10 @@ static CGFloat _outlineSplitterPosition; [inspectorView setHidden:!collapsed]; } +- (void)performFindPanelAction:(id)sender { + [self.entryViewController showFilter:sender]; +} + - (void)toggleOutlineView:(id)sender { } @@ -237,10 +219,6 @@ static CGFloat _outlineSplitterPosition; return [self.toolbarDelegate validateToolbarItem:theItem]; } -- (void)performFindPanelAction:(id)sender { - [self.window makeFirstResponder:[self.toolbarDelegate.searchItem view]]; -} - - (void)showMainWindow:(id)sender { [self showWindow:self.window]; } @@ -261,27 +239,10 @@ static CGFloat _outlineSplitterPosition; if(result == NSFileHandlingPanelOKButton) { NSURL *file = [[openPanel URLs] lastObject]; self.passwordInputController.fileURL = file; - [self _collapseOutlineView]; [self _setContentViewController:self.passwordInputController]; } }]; } - -- (void)updateFilter:(id)sender { - NSSearchField *searchField = sender; - self.entryViewController.filter = [searchField stringValue]; - [((NSOutlineView *)self.outlineViewController.view) deselectAll:self]; -} - -- (void)clearFilter:(id)sender { - NSSearchField *searchField = sender; - if(![sender isKindOfClass:[NSSearchField class]]) { - searchField = [self locateToolbarSearchField]; - } - [searchField setStringValue:@""]; - [self.entryViewController clearFilter]; -} - - (void)clearOutlineSelection:(id)sender { [self.outlineViewController clearSelection]; } @@ -328,7 +289,6 @@ static CGFloat _outlineSplitterPosition; } - (void)showEntries { - [self _expandOutlineView]; if(!self.entryViewController) { _entryViewController = [[MPEntryViewController alloc] init]; } diff --git a/MacPass/MPOutlineViewController.h b/MacPass/MPOutlineViewController.h index c46e8ad3..70485397 100644 --- a/MacPass/MPOutlineViewController.h +++ b/MacPass/MPOutlineViewController.h @@ -13,5 +13,6 @@ - (void)clearSelection; - (void)createGroup:(id)sender; +- (void)createEntry:(id)sender; - (void)deleteEntry:(id)sender; @end diff --git a/MacPass/MPOutlineViewController.m b/MacPass/MPOutlineViewController.m index 41fcd526..4f93bf10 100644 --- a/MacPass/MPOutlineViewController.m +++ b/MacPass/MPOutlineViewController.m @@ -12,6 +12,7 @@ #import "MPDatabaseController.h" #import "MPDatabaseDocument.h" #import "MPAppDelegate.h" +#import "KdbLib.h" @interface MPOutlineViewController () @@ -24,6 +25,7 @@ - (void)_didOpenDocument:(NSNotification *)notification; - (NSMenu *)_contextMenu; +- (KdbGroup *)_clickedOrSelectedGroup; @end @@ -64,12 +66,6 @@ [self.outlineView setAllowsEmptySelection:YES]; } -- (void)mouseUp:(NSEvent *)theEvent { - NSLog(@"Mouse Up!"); - [super mouseUp:theEvent]; -} - - - (void)_didOpenDocument:(NSNotification *)notification { [self.outlineView deselectAll:nil]; [self.outlineView reloadData]; @@ -93,13 +89,35 @@ } - (void)createGroup:(id)sender { - NSLog(@"%@: Create Group", [self class]); + KdbGroup *group = [self _clickedOrSelectedGroup]; + if(group) { + [[MPDatabaseController defaultController].database createGroup:group]; + [self.outlineView reloadData]; + } +} + +- (void)createEntry:(id)sender { + KdbGroup *group = [self _clickedOrSelectedGroup]; + if(group) { + [[MPDatabaseController defaultController].database createEntry:group]; + } } - (void)deleteEntry:(id)sender { - NSLog(@"%@: Delete Entry", [self class]); + KdbGroup *group = [self _clickedOrSelectedGroup]; + if(group) { + [group.parent removeGroup:group]; + [self.outlineView reloadData]; + } +} + +- (KdbGroup *)_clickedOrSelectedGroup { + NSInteger row = [self.outlineView clickedRow]; + if( row < 0 ) { + row = [self.outlineView selectedRow]; + } + return [self.outlineView itemAtRow:row]; } - @end diff --git a/MacPass/MPToolbarDelegate.m b/MacPass/MPToolbarDelegate.m index 2c6bee84..245733aa 100644 --- a/MacPass/MPToolbarDelegate.m +++ b/MacPass/MPToolbarDelegate.m @@ -18,7 +18,6 @@ NSString *const MPToolbarItemAddEntry = @"TOOLBAR_ADD_ENTRY"; NSString *const MPToolbarItemEdit = @"TOOLBAR_EDIT"; NSString *const MPToolbarItemDelete =@"TOOLBAR_DELETE"; NSString *const MPToolbarItemAction = @"TOOLBAR_ACTION"; -NSString *const MPToolbarItemSearch = @"TOOLBAR_SEARCH"; NSString *const MPToolbarItemInspector = @"TOOLBAR_INSPECTOR"; @interface MPToolbarDelegate() @@ -38,7 +37,7 @@ NSString *const MPToolbarItemInspector = @"TOOLBAR_INSPECTOR"; - (id)init { self = [super init]; if (self) { - _toolbarIdentifiers = [@[ MPToolbarItemAddEntry, MPToolbarItemDelete, MPToolbarItemAddGroup, MPToolbarItemAction, NSToolbarFlexibleSpaceItemIdentifier, NSToolbarSpaceItemIdentifier, MPToolbarItemInspector, MPToolbarItemSearch ] retain]; + _toolbarIdentifiers = [@[ MPToolbarItemAddEntry, MPToolbarItemDelete, MPToolbarItemAddGroup, MPToolbarItemAction, NSToolbarFlexibleSpaceItemIdentifier, NSToolbarSpaceItemIdentifier, MPToolbarItemInspector ] retain]; _toolbarImages = [[self createToolbarImages] retain]; _toolbarItems = [[NSMutableDictionary alloc] initWithCapacity:[self.toolbarIdentifiers count]]; } @@ -60,17 +59,7 @@ NSString *const MPToolbarItemInspector = @"TOOLBAR_INSPECTOR"; NSString *label = [self _localizedLabelForToolbarItemIdentifier:itemIdentifier]; [item setLabel:label]; - if([itemIdentifier isEqualToString:MPToolbarItemSearch]) { - NSSearchField *searchfield = [[NSSearchField alloc] initWithFrame:NSMakeRect(0, 0, 70, 32)]; - [item setView:searchfield]; - [searchfield setAction:@selector(updateFilter:)]; - [[searchfield cell] setSendsSearchStringImmediately:NO]; - [[[searchfield cell] cancelButtonCell] setTarget:nil]; - [[[searchfield cell] cancelButtonCell] setAction:@selector(clearFilter:)]; - [searchfield release]; - self.searchItem = item; - } - else if([itemIdentifier isEqualToString:MPToolbarItemAction]) { + if([itemIdentifier isEqualToString:MPToolbarItemAction]) { NSPopUpButton *popupButton = [[NSPopUpButton alloc] initWithFrame:NSMakeRect(0, 0, 50, 32) pullsDown:YES]; [[popupButton cell] setBezelStyle:NSTexturedRoundedBezelStyle]; [[popupButton cell] setImageScaling:NSImageScaleProportionallyDown]; @@ -149,8 +138,7 @@ NSString *const MPToolbarItemInspector = @"TOOLBAR_INSPECTOR"; MPToolbarItemAddGroup: NSLocalizedString(@"ADD_GROUP", @""), MPToolbarItemDelete: NSLocalizedString(@"DELETE", @""), MPToolbarItemEdit: NSLocalizedString(@"EDIT", @""), - MPToolbarItemInspector: NSLocalizedString(@"TOGGLE_INSPECTOR", @""), - MPToolbarItemSearch: NSLocalizedString(@"SEARCH", @"") + MPToolbarItemInspector: NSLocalizedString(@"TOGGLE_INSPECTOR", @"") }; return labelDict[identifier]; } diff --git a/MacPass/MacPass-Info.plist b/MacPass/MacPass-Info.plist index 1257d0f2..9c845887 100644 --- a/MacPass/MacPass-Info.plist +++ b/MacPass/MacPass-Info.plist @@ -21,7 +21,7 @@ CFBundleSignature ???? CFBundleVersion - 4B8 + 4DD LSMinimumSystemVersion ${MACOSX_DEPLOYMENT_TARGET} NSHumanReadableCopyright diff --git a/MacPass/PathBar.xib b/MacPass/PathBar.xib deleted file mode 100644 index 088d6dd1..00000000 --- a/MacPass/PathBar.xib +++ /dev/null @@ -1,117 +0,0 @@ - - - - 1080 - 12C60 - 3084 - 1187.34 - 625.00 - - com.apple.InterfaceBuilder.CocoaPlugin - 3084 - - - NSCustomObject - NSCustomView - - - com.apple.InterfaceBuilder.CocoaPlugin - - - PluginDependencyRecalculationVersion - - - - - NSObject - - - FirstResponder - - - NSApplication - - - - 268 - {480, 24} - - - - MPPathBar - - - - - - - - 0 - - - - - - -2 - - - File's Owner - - - -1 - - - First Responder - - - -3 - - - Application - - - 1 - - - - - - - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - - - - - - 1 - - - - - MPGradientView - NSView - - IBProjectSource - ./Classes/MPGradientView.h - - - - MPPathBar - MPGradientView - - IBProjectSource - ./Classes/MPPathBar.h - - - - - 0 - IBCocoaFramework - YES - 3 - YES - - diff --git a/MacPass/en.lproj/MainMenu.xib b/MacPass/en.lproj/MainMenu.xib index c4116d0b..2925dbb1 100644 --- a/MacPass/en.lproj/MainMenu.xib +++ b/MacPass/en.lproj/MainMenu.xib @@ -362,15 +362,6 @@ - - - Paste and Match Style - V - 1572864 - 2147483647 - - - Delete @@ -422,36 +413,6 @@ 1 - - - Find and Replace… - f - 1572864 - 2147483647 - - - 12 - - - - Find Next - g - 1048576 - 2147483647 - - - 2 - - - - Find Previous - G - 1179648 - 2147483647 - - - 3 - Use Selection for Find @@ -708,14 +669,6 @@ View - - - Toggle Outline View - - 2147483647 - - - Toggle Inspector @@ -1217,30 +1170,6 @@ 468 - - - pasteAsPlainText: - - - - 486 - - - - performFindPanelAction: - - - - 487 - - - - performFindPanelAction: - - - - 488 - performFindPanelAction: @@ -1259,11 +1188,11 @@ - performFindPanelAction: + toggleInspector: - + - 535 + 1199 @@ -1281,22 +1210,6 @@ 1178 - - - toggleOutlineViewMenuItem - - - - 1182 - - - - toggleInspectorViewMenuItem - - - - 1183 - @@ -1470,7 +1383,6 @@ - @@ -1567,20 +1479,12 @@ 220 - - - - - 213 - - - 210 @@ -1591,11 +1495,6 @@ - - 208 - - - 209 @@ -1730,7 +1629,6 @@ - @@ -1882,11 +1780,6 @@ - - 485 - - - 490 @@ -1913,11 +1806,6 @@ - - 534 - - - 1176 @@ -1933,11 +1821,6 @@ - - 1180 - - - 1181 @@ -1953,7 +1836,6 @@ 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 @@ -1982,12 +1864,10 @@ 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 @@ -2023,13 +1903,11 @@ 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 @@ -2049,10 +1927,28 @@ - 1183 + 1199 + + FirstResponder + + toggleInspector: + id + + + toggleInspector: + + toggleInspector: + id + + + + IBUserSource + + + MPAppDelegate NSObject @@ -2070,20 +1966,6 @@ id - - NSMenuItem - NSMenuItem - - - - toggleInspectorViewMenuItem - NSMenuItem - - - toggleOutlineViewMenuItem - NSMenuItem - - IBProjectSource ./Classes/MPAppDelegate.h