diff --git a/MacPass/InspectorTabView.xib b/MacPass/InspectorTabView.xib
index 75426a33..ad98bfda 100644
--- a/MacPass/InspectorTabView.xib
+++ b/MacPass/InspectorTabView.xib
@@ -11,8 +11,16 @@
3084
+ IBNSLayoutConstraint
NSCustomObject
NSCustomView
+ NSImageCell
+ NSImageView
+ NSTabView
+ NSTabViewItem
+ NSTextField
+ NSTextFieldCell
+ NSView
com.apple.InterfaceBuilder.CocoaPlugin
@@ -34,11 +42,138 @@
@@ -52,6 +187,22 @@
10
+
+
+ itemImageView
+
+
+
+ 111
+
+
+
+ itemNameTextfield
+
+
+
+ 112
+
@@ -82,28 +233,376 @@
1
-
+
+
+
+ 5
+ 0
+
+ 6
+ 1
+
+ 8
+
+ 1000
+
+ 6
+ 24
+ 3
+
+
+
+ 6
+ 1
+
+ 6
+ 1
+
+ 20
+
+ 1000
+
+ 9
+ 40
+ 3
+
+
+
+ 5
+ 0
+
+ 5
+ 1
+
+ 80
+
+ 1000
+
+ 9
+ 40
+ 3
+
+
+
+ 10
+ 0
+
+ 10
+ 1
+
+ 0.0
+
+ 1000
+
+ 6
+ 24
+ 2
+
+
+
+ 5
+ 0
+
+ 5
+ 1
+
+ 27
+
+ 1000
+
+ 3
+ 9
+ 3
+
+
+
+ 3
+ 0
+
+ 3
+ 1
+
+ 70
+
+ 1000
+
+ 3
+ 9
+ 3
+
+
+
+ 4
+ 0
+
+ 4
+ 1
+
+ 20
+
+ 1000
+
+ 8
+ 29
+ 3
+
+
+
+ 6
+ 0
+
+ 6
+ 1
+
+ 20
+
+ 1000
+
+ 8
+ 29
+ 3
+
+
+
+ 3
+ 0
+
+ 3
+ 1
+
+ 17
+
+ 1000
+
+ 3
+ 9
+ 3
+
+
+
+
+
+
+ 53
+
+
+
+
+
+
+
+
+ 54
+
+
+
+
+
+
+
+ 55
+
+
+
+
+
+
+
+ 56
+
+
+
+
+ 57
+
+
+
+
+ 62
+
+
+
+
+
+ 7
+ 0
+
+ 0
+ 1
+
+ 48
+
+ 1000
+
+ 3
+ 9
+ 1
+
+
+
+ 8
+ 0
+
+ 0
+ 1
+
+ 48
+
+ 1000
+
+ 3
+ 9
+ 1
+
+
+
+
+
+ 63
+
+
+
+
+ 81
+
+
+
+
+ 82
+
+
+
+
+ 100
+
+
+
+
+
+
+
+ 101
+
+
+
+
+ 102
+
+
+
+
+ 103
+
+
+
+
+ 104
+
+
+
+
+ 105
+
+
+
+
+ 106
+
+
+
+
+ 107
+
+
+
+
+ 108
+
+
+
+
+ 109
+
+
+
+
+ 110
+
+
+
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
- 20
+ 112
MPInspectorTabViewController
MPViewController
+
+ NSImageView
+ NSTextField
+
+
+
+ itemImageView
+ NSImageView
+
+
+ itemNameTextfield
+ NSTextField
+
+
IBProjectSource
./Classes/MPInspectorTabViewController.h
@@ -117,12 +616,24 @@
./Classes/MPViewController.h
+
+ NSLayoutConstraint
+ NSObject
+
+ IBProjectSource
+ ./Classes/NSLayoutConstraint.h
+
+
0
IBCocoaFramework
YES
3
+
+ NSApplicationIcon
+ {128, 128}
+
YES
diff --git a/MacPass/MPDatabaseController.m b/MacPass/MPDatabaseController.m
index 88f12c6a..d9018bd2 100644
--- a/MacPass/MPDatabaseController.m
+++ b/MacPass/MPDatabaseController.m
@@ -9,9 +9,9 @@
#import "MPDatabaseController.h"
#import "MPDatabaseDocument.h"
-NSString *const MPDatabaseControllerDidLoadDatabaseNotification = @"MPDatabaseControllerDidLoadDatabaseNotification";
-NSString *const MPDatabaseControllerDidCloseDatabaseNotification = @"MPDatabaseControllerDidCloseDatabaseNotification";
-NSString *const MPDatabaseControllerDatabaseKey = @"MPDatabaseControllerDatabaseKey";
+NSString *const MPDatabaseControllerDidLoadDatabaseNotification = @"com.macpass.MPDatabaseControllerDidLoadDatabaseNotification";
+NSString *const MPDatabaseControllerDidCloseDatabaseNotification = @"com.macpass.MPDatabaseControllerDidCloseDatabaseNotification";
+NSString *const MPDatabaseControllerDatabaseKey = @"com.macpass.MPDatabaseControllerDatabaseKey";
@interface MPDatabaseController ()
@@ -67,8 +67,8 @@ NSString *const MPDatabaseControllerDatabaseKey = @"MPDatabaseControllerDatabase
userInfo:userInfo];
}
[_database release];
+ _database = [database retain];
if(database) {
- _database = [database retain];
NSDictionary *userInfo = @{ MPDatabaseControllerDatabaseKey: _database };
[[NSNotificationCenter defaultCenter] postNotificationName:MPDatabaseControllerDidLoadDatabaseNotification
object:self
diff --git a/MacPass/MPEntryViewController.h b/MacPass/MPEntryViewController.h
index 9fc8c5f8..a37cff8e 100644
--- a/MacPass/MPEntryViewController.h
+++ b/MacPass/MPEntryViewController.h
@@ -23,14 +23,19 @@ typedef enum {
} MPCopyContentTypeTag;
@class KdbGroup;
+@class KdbEntry;
@class MPOutlineViewDelegate;
@interface MPEntryViewController : MPViewController
+
@property (assign) KdbGroup *activeGroup;
+@property (readonly, assign) KdbEntry *selectedEntry;
+
@property (readonly, retain) NSArrayController *entryArrayController;
@property (nonatomic, retain) NSString *filter;
+
/* Clear the Search filter*/
- (void)clearFilter;
diff --git a/MacPass/MPEntryViewController.m b/MacPass/MPEntryViewController.m
index 56e54280..fb383df8 100644
--- a/MacPass/MPEntryViewController.m
+++ b/MacPass/MPEntryViewController.m
@@ -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 {
diff --git a/MacPass/MPInspectorTabViewController.m b/MacPass/MPInspectorTabViewController.m
index 17c1455a..f4a61fc8 100644
--- a/MacPass/MPInspectorTabViewController.m
+++ b/MacPass/MPInspectorTabViewController.m
@@ -10,6 +10,9 @@
@interface MPInspectorTabViewController ()
+@property (assign) IBOutlet NSImageView *itemImageView;
+@property (assign) IBOutlet NSTextField *itemNameTextfield;
+
@end
@implementation MPInspectorTabViewController
diff --git a/MacPass/MPMainWindowController.h b/MacPass/MPMainWindowController.h
index 06bc609e..87049aa7 100644
--- a/MacPass/MPMainWindowController.h
+++ b/MacPass/MPMainWindowController.h
@@ -9,9 +9,19 @@
#import
@class MPViewController;
+@class MPEntryViewController;
+@class MPInspectorTabViewController;
+@class MPPasswordInputController;
+@class MPOutlineViewController;
@interface MPMainWindowController : NSWindowController
+@property (readonly, retain) MPPasswordInputController *passwordInputController;
+@property (readonly, retain) MPEntryViewController *entryViewController;
+@property (readonly, retain) MPOutlineViewController *outlineViewController;
+@property (readonly, retain) MPInspectorTabViewController *inspectorTabViewController;
+
+
- (void)showEntries;
- (void)showMainWindow:(id)sender;
- (void)performFindPanelAction:(id)sender;
diff --git a/MacPass/MPMainWindowController.m b/MacPass/MPMainWindowController.m
index a4134788..2d0cbdf2 100644
--- a/MacPass/MPMainWindowController.m
+++ b/MacPass/MPMainWindowController.m
@@ -42,7 +42,6 @@ static CGFloat _inspectorSplitterPosition;
/* View show/hide */
- (void)_collapseOutlineView;
- (void)_expandOutlineView;
-- (void)_toggleInspector;
- (void)_setContentViewController:(MPViewController *)viewController;
- (void)_updateWindowTitle;
@@ -193,13 +192,13 @@ static CGFloat _inspectorSplitterPosition;
const BOOL collapsed = [self.splitView isSubviewCollapsed:inspectorView];
if(collapsed) {
CGFloat splitterPosition = MAX(MPMainWindowSplitViewDelegateMinimumInspectorWidth, _inspectorSplitterPosition);
- [self.splitView setPosition:splitterPosition ofDividerAtIndex:1];
+ [self.splitView setPosition:splitterPosition ofDividerAtIndex:MPSplitViewInspectorDividerIndex];
}
else {
_inspectorSplitterPosition = [inspectorView frame].origin.x;
CGFloat splitterPosition = [inspectorView frame].origin.x * [inspectorView frame].size.width;
[[NSAnimationContext currentContext] setDuration:2];
- [[self.splitView animator] setPosition:splitterPosition ofDividerAtIndex:1];
+ [[self.splitView animator] setPosition:splitterPosition ofDividerAtIndex:MPSplitViewInspectorDividerIndex];
}
[inspectorView setHidden:!collapsed];
}
diff --git a/MacPass/MPMainWindowSplitViewDelegate.h b/MacPass/MPMainWindowSplitViewDelegate.h
index 86caf522..de28b07d 100644
--- a/MacPass/MPMainWindowSplitViewDelegate.h
+++ b/MacPass/MPMainWindowSplitViewDelegate.h
@@ -18,6 +18,11 @@ typedef enum {
MPSplitViewInspectorViewIndex,
} MPSplitViewSubViewIndex;
+typedef enum {
+ MPSplitViewOutlineDividerIndex,
+ MPSplitViewInspectorDividerIndex,
+} MPSplitViewDividerIndex;
+
@interface MPMainWindowSplitViewDelegate : NSObject
diff --git a/MacPass/MPMainWindowSplitViewDelegate.m b/MacPass/MPMainWindowSplitViewDelegate.m
index f197a354..60476884 100644
--- a/MacPass/MPMainWindowSplitViewDelegate.m
+++ b/MacPass/MPMainWindowSplitViewDelegate.m
@@ -13,7 +13,6 @@ const CGFloat MPMainWindowSplitViewDelegateMinimumContentWidth = 400.0;
const CGFloat MPMainWindowSplitViewDelegateMinimumInspectorWidth = 200.0;
-
@interface MPMainWindowSplitViewDelegate ()
- (NSView *)_subViewOfType:(MPSplitViewSubViewIndex)subViewType splitView:(NSSplitView *)splitView;
@@ -32,13 +31,17 @@ const CGFloat MPMainWindowSplitViewDelegateMinimumInspectorWidth = 200.0;
- (CGFloat)splitView:(NSSplitView *)splitView constrainMinCoordinate:(CGFloat)proposedMinimumPosition ofSubviewAt:(NSInteger)dividerIndex {
return proposedMinimumPosition;
- //return (proposedMinimumPosition < MPMainWindowSplitViewDelegateMinimumOutlineWidth) ? MPMainWindowSplitViewDelegateMinimumOutlineWidth : proposedMinimumPosition;
+
+ // Update to take inspector into account
+ return (proposedMinimumPosition < MPMainWindowSplitViewDelegateMinimumOutlineWidth) ? MPMainWindowSplitViewDelegateMinimumOutlineWidth : proposedMinimumPosition;
}
- (CGFloat)splitView:(NSSplitView *)splitView constrainMaxCoordinate:(CGFloat)proposedMaximumPosition ofSubviewAt:(NSInteger)dividerIndex {
return proposedMaximumPosition;
- // CGFloat availableWidth = [splitView frame].size.width - [splitView dividerThickness];
- // return (availableWidth - MPMainWindowSplitViewDelegateMinimumOutlineWidth);
+
+ // Update to take inpspector into account
+ CGFloat availableWidth = [splitView frame].size.width - [splitView dividerThickness];
+ return (availableWidth - MPMainWindowSplitViewDelegateMinimumOutlineWidth);
}
- (void)splitView:(NSSplitView *)splitView resizeSubviewsWithOldSize:(NSSize)oldSize {
@@ -51,11 +54,21 @@ const CGFloat MPMainWindowSplitViewDelegateMinimumInspectorWidth = 200.0;
CGFloat outlineWidth = [outlineView isHidden] ? 0.0 : [outlineView frame].size.width;
CGFloat inspectorWidth = [inspectorView isHidden] ? 0.0 : [inspectorView frame].size.width;
- CGFloat contentWidth = newSize.width - outlineWidth - inspectorWidth - 2 * dividierThickness;
- NSRect newContentFrame = NSMakeRect(outlineWidth + dividierThickness, 0, contentWidth, newSize.height);
+
+ CGFloat dividerThicknessCorrection = 0;
+ if(outlineWidth > 0.0) {
+ dividerThicknessCorrection += dividierThickness;
+ }
+ if(inspectorWidth > 0.0 ) {
+ dividerThicknessCorrection += dividierThickness;
+ }
+
+ CGFloat contentWidth = newSize.width - outlineWidth - inspectorWidth - dividerThicknessCorrection;
+ CGFloat contentOriginX = [outlineView isHidden] ? outlineWidth : outlineWidth + dividierThickness;
+ NSRect newContentFrame = NSMakeRect(contentOriginX, 0, contentWidth, newSize.height);
NSRect newOutlineFrame = NSMakeRect(0, 0, outlineWidth, newSize.height);
NSRect newInpectorFrame = NSMakeRect(newContentFrame.origin.x + contentWidth + dividierThickness, 0, inspectorWidth, newSize.height);
-
+
if(NO == [outlineView isHidden]) {
[outlineView setFrame:newOutlineFrame];
}
@@ -65,4 +78,28 @@ const CGFloat MPMainWindowSplitViewDelegateMinimumInspectorWidth = 200.0;
[contentView setFrame:newContentFrame];
};
+- (BOOL)splitView:(NSSplitView *)splitView shouldHideDividerAtIndex:(NSInteger)dividerIndex {
+ NSView *outlineView = [self _subViewOfType:MPSplitViewOutlineViewIndex splitView:splitView];
+ NSView *inspectorView = [self _subViewOfType:MPSplitViewInspectorViewIndex splitView:splitView];
+
+ BOOL shouldHide = NO;
+ switch (dividerIndex) {
+ case MPSplitViewInspectorDividerIndex:
+ shouldHide = [inspectorView isHidden];
+ break;
+
+ case MPSplitViewOutlineDividerIndex:
+ shouldHide = [outlineView isHidden];
+ break;
+
+ default: {
+ NSException *exception = [NSException exceptionWithName:NSInternalInconsistencyException reason:@"Divider Index out of range!" userInfo:nil];
+ @throw exception;
+ }
+ }
+ NSArray *splitterNames = @[ @"Outline", @"Inspector" ];
+ NSLog(@"Should Hide %@: %@", splitterNames[dividerIndex], shouldHide ? @"Yes" : @"No" );
+ return shouldHide;
+}
+
@end
diff --git a/MacPass/MPOutlineViewDelegate.m b/MacPass/MPOutlineViewDelegate.m
index 4b92ee13..a3ef81d3 100644
--- a/MacPass/MPOutlineViewDelegate.m
+++ b/MacPass/MPOutlineViewDelegate.m
@@ -10,7 +10,7 @@
#import "MPIconHelper.h"
#import "KdbLib.h"
-NSString *const MPOutlineViewDidChangeGroupSelection = @"MPOutlineViewDidChangeGroupSelection";
+NSString *const MPOutlineViewDidChangeGroupSelection = @"com.macpass.MPOutlineViewDidChangeGroupSelection";
NSString *const _MPOutlineViewDataViewIdentifier = @"DataCell";
NSString *const _MPOutlinveViewHeaderViewIdentifier = @"HeaderCell";
diff --git a/MacPass/MacPass-Info.plist b/MacPass/MacPass-Info.plist
index 773e6bf7..8ba7b313 100644
--- a/MacPass/MacPass-Info.plist
+++ b/MacPass/MacPass-Info.plist
@@ -21,7 +21,7 @@
CFBundleSignature
????
CFBundleVersion
- 401
+ 41B
LSMinimumSystemVersion
${MACOSX_DEPLOYMENT_TARGET}
NSHumanReadableCopyright