diff --git a/MacPass.xcodeproj/project.pbxproj b/MacPass.xcodeproj/project.pbxproj index 0a58e8fd..570c737f 100644 --- a/MacPass.xcodeproj/project.pbxproj +++ b/MacPass.xcodeproj/project.pbxproj @@ -84,6 +84,8 @@ 4CA0B2F915BCAF6700654E32 /* MPGeneralSettingsController.m in Sources */ = {isa = PBXBuildFile; fileRef = 4CA0B2F815BCAF6700654E32 /* MPGeneralSettingsController.m */; }; 4CA0B2FC15BCAF8600654E32 /* MPSettingsController.m in Sources */ = {isa = PBXBuildFile; fileRef = 4CA0B2FB15BCAF8600654E32 /* MPSettingsController.m */; }; 4CAC6F7816D2B54800D79D5E /* MPMainWindowSplitViewDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 4CAC6F7716D2B54800D79D5E /* MPMainWindowSplitViewDelegate.m */; }; + 4CACB72C16F7C9B600D47C9E /* KdbEntry+Copying.m in Sources */ = {isa = PBXBuildFile; fileRef = 4CACB72B16F7C9B600D47C9E /* KdbEntry+Copying.m */; }; + 4CACB72F16F7CA5100D47C9E /* Kdb4Entry+Copying.m in Sources */ = {isa = PBXBuildFile; fileRef = 4CACB72E16F7CA5100D47C9E /* Kdb4Entry+Copying.m */; }; 4CAD747B15B887FD00104512 /* DDXMLElementAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = 4CAD745715B887FD00104512 /* DDXMLElementAdditions.m */; settings = {COMPILER_FLAGS = "-fobjc-arc"; }; }; 4CAD747C15B887FD00104512 /* NSString+DDXML.m in Sources */ = {isa = PBXBuildFile; fileRef = 4CAD745A15B887FD00104512 /* NSString+DDXML.m */; settings = {COMPILER_FLAGS = "-fobjc-arc"; }; }; 4CAD747D15B887FD00104512 /* DDXMLDocument.m in Sources */ = {isa = PBXBuildFile; fileRef = 4CAD745D15B887FD00104512 /* DDXMLDocument.m */; settings = {COMPILER_FLAGS = "-fobjc-arc"; }; }; @@ -254,6 +256,10 @@ 4CA0B30D15BCB6FD00654E32 /* MPSettingsTabProtocoll.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MPSettingsTabProtocoll.h; sourceTree = ""; }; 4CAC6F7616D2B54800D79D5E /* MPMainWindowSplitViewDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MPMainWindowSplitViewDelegate.h; sourceTree = ""; }; 4CAC6F7716D2B54800D79D5E /* MPMainWindowSplitViewDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MPMainWindowSplitViewDelegate.m; sourceTree = ""; }; + 4CACB72A16F7C9B600D47C9E /* KdbEntry+Copying.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "KdbEntry+Copying.h"; sourceTree = ""; }; + 4CACB72B16F7C9B600D47C9E /* KdbEntry+Copying.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "KdbEntry+Copying.m"; sourceTree = ""; }; + 4CACB72D16F7CA5100D47C9E /* Kdb4Entry+Copying.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "Kdb4Entry+Copying.h"; sourceTree = ""; }; + 4CACB72E16F7CA5100D47C9E /* Kdb4Entry+Copying.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "Kdb4Entry+Copying.m"; sourceTree = ""; }; 4CAD745615B887FD00104512 /* DDXMLElementAdditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DDXMLElementAdditions.h; sourceTree = ""; }; 4CAD745715B887FD00104512 /* DDXMLElementAdditions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DDXMLElementAdditions.m; sourceTree = ""; }; 4CAD745915B887FD00104512 /* NSString+DDXML.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSString+DDXML.h"; sourceTree = ""; }; @@ -343,6 +349,10 @@ 4C2C4C2B16D3BE3700D49295 /* KdbGroup+MPAdditions.m */, 4CC1AEBC16D4467C006D2AAB /* KdbTree+MPAdditions.h */, 4CC1AEBD16D4467C006D2AAB /* KdbTree+MPAdditions.m */, + 4CACB72A16F7C9B600D47C9E /* KdbEntry+Copying.h */, + 4CACB72B16F7C9B600D47C9E /* KdbEntry+Copying.m */, + 4CACB72D16F7CA5100D47C9E /* Kdb4Entry+Copying.h */, + 4CACB72E16F7CA5100D47C9E /* Kdb4Entry+Copying.m */, ); name = KeePassLibAdditions; sourceTree = ""; @@ -886,6 +896,8 @@ 4C811C8316ECD06E00C4BAC6 /* MPKeyfilePathControlDelegate.m in Sources */, 4CE39ABF16ECE34A000FE29D /* MPIconSelectViewController.m in Sources */, 4CE39AC416ECE4F7000FE29D /* MPPopupImageView.m in Sources */, + 4CACB72C16F7C9B600D47C9E /* KdbEntry+Copying.m in Sources */, + 4CACB72F16F7CA5100D47C9E /* Kdb4Entry+Copying.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/MacPass/IconSelection.xib b/MacPass/IconSelection.xib index 6c098adf..20d12c6d 100644 --- a/MacPass/IconSelection.xib +++ b/MacPass/IconSelection.xib @@ -2,10 +2,10 @@ 1080 - 12C3103 + 12D78 3084 - 1187.34 - 625.00 + 1187.37 + 626.00 com.apple.InterfaceBuilder.CocoaPlugin 3084 @@ -18,8 +18,6 @@ NSCollectionViewItem NSCustomObject NSCustomView - NSImageCell - NSImageView NSScrollView NSScroller @@ -57,7 +55,7 @@ -2080374784 134217728 Use Default Icon - + LucidaGrande 13 1044 @@ -75,7 +73,7 @@ - 268 + 4364 @@ -83,7 +81,7 @@ - 274 + 4370 {243, 238} @@ -175,34 +173,46 @@ NSView - + 268 - - Apple PDF pasteboard type - Apple PICT pasteboard type - Apple PNG pasteboard type - NSFilenamesPboardType - NeXT Encapsulated PostScript v1.2 pasteboard type - NeXT TIFF v4.0 pasteboard type - - {48, 48} + + + + 268 + {{10, 10}, {40, 40}} + + + + _NS:9 + YES + + 67108864 + 134217728 + + + _NS:9 + + -2039201792 + 65 + + NSImage + NSAddTemplate + + + + 200 + 25 + + NO + + + {60, 60} - + _NS:9 - YES - - 134217728 - 33554432 - _NS:9 - 0 - 3 - 2 - NO - - NO - YES + NSView @@ -223,6 +233,14 @@ 77 + + + useDefault: + + + + 129 + itemPrototype @@ -235,33 +253,9 @@ view - + - 73 - - - - imageView - - - - 74 - - - - value: representedObject - - - - - - value: representedObject - value - representedObject - 2 - - - 82 + 128 @@ -425,19 +419,6 @@ - - 71 - - - - - - - - 72 - - - 88 @@ -481,6 +462,111 @@ + + 113 + + + + + 10 + 0 + + 10 + 1 + + 0.0 + + 1000 + + 9 + 40 + 2 + + + + 9 + 0 + + 9 + 1 + + 0.0 + + 1000 + + 9 + 40 + 2 + + + + + + + 114 + + + + + + 8 + 0 + + 0 + 1 + + 40 + + 1000 + + 3 + 9 + 1 + + + + 7 + 0 + + 0 + 1 + + 40 + + 1000 + + 3 + 9 + 1 + + + + + + 115 + + + + + 121 + + + + + 123 + + + + + 126 + + + + + 127 + + + @@ -504,6 +590,22 @@ 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 @@ -511,15 +613,13 @@ com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin - 112 + 129 @@ -550,6 +650,27 @@ ./Classes/MPViewController.h + + NSCollectionViewItem + + NSImageView + NSTextField + + + + imageView + NSImageView + + + textField + NSTextField + + + + IBProjectSource + ./Classes/NSCollectionViewItem.h + + NSLayoutConstraint NSObject @@ -564,6 +685,10 @@ IBCocoaFramework YES 3 + + NSAddTemplate + {8, 8} + YES diff --git a/MacPass/Kdb4Entry+Copying.h b/MacPass/Kdb4Entry+Copying.h new file mode 100644 index 00000000..f3bc983d --- /dev/null +++ b/MacPass/Kdb4Entry+Copying.h @@ -0,0 +1,14 @@ +// +// Kdb4Entry+Copying.h +// MacPass +// +// Created by Michael Starke on 18.03.13. +// Copyright (c) 2013 HicknHack Software GmbH. All rights reserved. +// + +#import "KdbLib.h" +#import "Kdb4Node.h" + +@interface Kdb4Entry (Copying) + +@end diff --git a/MacPass/Kdb4Entry+Copying.m b/MacPass/Kdb4Entry+Copying.m new file mode 100644 index 00000000..14e0220f --- /dev/null +++ b/MacPass/Kdb4Entry+Copying.m @@ -0,0 +1,35 @@ +// +// Kdb4Entry+Copying.m +// MacPass +// +// Created by Michael Starke on 18.03.13. +// Copyright (c) 2013 HicknHack Software GmbH. All rights reserved. +// + +#import "Kdb4Entry+Copying.h" +#import "KdbEntry+Copying.h" + +@implementation Kdb4Entry (Copying) + +- (id)copyWithZone:(NSZone *)zone { + Kdb4Entry *entry = [[Kdb4Entry allocWithZone:zone] init]; + entry.uuid = [[self.uuid copy] autorelease]; + entry.titleStringField = [[self.titleStringField copy] autorelease]; + entry.usernameStringField = [[self.usernameStringField copy] autorelease]; + entry.passwordStringField = [[self.passwordStringField copy] autorelease]; + entry.urlStringField = [[self.urlStringField copy] autorelease]; + entry.notesStringField = [[self.notesStringField copy] autorelease]; + entry.customIconUuid = self.customIconUuid; + entry.foregroundColor = self.foregroundColor; + entry.backgroundColor = self.backgroundColor; + entry.overrideUrl = self.overrideUrl; + entry.tags = self.tags; + entry.locationChanged = self.locationChanged; + //entry.stringFields = self.stringFields; + //entry.binaries = self.binaries; + entry.autoType = self.autoType; + //entry.history = self.history; + return entry; +} + +@end diff --git a/MacPass/KdbEntry+Copying.h b/MacPass/KdbEntry+Copying.h new file mode 100644 index 00000000..84ebdb51 --- /dev/null +++ b/MacPass/KdbEntry+Copying.h @@ -0,0 +1,13 @@ +// +// KdbEntry+Copying.h +// MacPass +// +// Created by Michael Starke on 18.03.13. +// Copyright (c) 2013 HicknHack Software GmbH. All rights reserved. +// + +#import "Kdb.h" + +@interface KdbEntry (Copying) + +@end diff --git a/MacPass/KdbEntry+Copying.m b/MacPass/KdbEntry+Copying.m new file mode 100644 index 00000000..d923bb21 --- /dev/null +++ b/MacPass/KdbEntry+Copying.m @@ -0,0 +1,19 @@ +// +// KdbEntry+Copying.m +// MacPass +// +// Created by Michael Starke on 18.03.13. +// Copyright (c) 2013 HicknHack Software GmbH. All rights reserved. +// + +#import "KdbEntry+Copying.h" + +@implementation KdbEntry (Copying) + +- (id)copyWithZone:(NSZone *)zone { + [self doesNotRecognizeSelector:_cmd]; + return nil; +} + + +@end diff --git a/MacPass/MPIconSelectViewController.h b/MacPass/MPIconSelectViewController.h index 25d2d54a..ecbc0888 100644 --- a/MacPass/MPIconSelectViewController.h +++ b/MacPass/MPIconSelectViewController.h @@ -9,6 +9,8 @@ #import "MPViewController.h" @interface MPIconSelectViewController : MPViewController + @property (assign) IBOutlet NSCollectionView *iconCollectionView; +- (IBAction)useDefault:(id)sender; @end diff --git a/MacPass/MPIconSelectViewController.m b/MacPass/MPIconSelectViewController.m index 0940bae1..876bf9ab 100644 --- a/MacPass/MPIconSelectViewController.m +++ b/MacPass/MPIconSelectViewController.m @@ -30,7 +30,16 @@ } - (void)didLoadView { + [self.iconCollectionView setSelectable:YES]; + [self.iconCollectionView setAllowsMultipleSelection:NO]; [self.iconCollectionView setContent:[MPIconHelper availableIcons]]; } +- (IBAction)useDefault:(id)sender { + SEL hidePopup = @selector(hideImagePopup:); + id target = [[NSApplication sharedApplication] targetForAction:hidePopup to:nil from:self]; + if( target ) { + [target performSelector:hidePopup withObject:self]; + } +} @end diff --git a/MacPass/MPInspectorTabViewController.h b/MacPass/MPInspectorTabViewController.h index 3ff8fbf6..674fec22 100644 --- a/MacPass/MPInspectorTabViewController.h +++ b/MacPass/MPInspectorTabViewController.h @@ -27,5 +27,6 @@ @property (assign) IBOutlet NSButton *togglePasswordDisplayButton; - (IBAction)togglePasswordDisplay:(id)sender; +- (void)hideImagePopup:(id)sender; @end diff --git a/MacPass/MPInspectorTabViewController.m b/MacPass/MPInspectorTabViewController.m index 93873a10..fed54c58 100644 --- a/MacPass/MPInspectorTabViewController.m +++ b/MacPass/MPInspectorTabViewController.m @@ -22,6 +22,7 @@ @property (assign, nonatomic) KdbEntry *selectedEntry; @property (assign, nonatomic) KdbGroup *selectedGroup; @property (assign) BOOL showsEntry; +@property (retain) NSPopover *iconPopup; - (void)_didChangeSelectedEntry:(NSNotification *)notification; - (void)_didChangeSelectedGroup:(NSNotification *)notification; @@ -54,6 +55,7 @@ [[NSNotificationCenter defaultCenter] removeObserver:self]; [_selectedGroup release]; [_selectedEntry release]; + [_iconPopup release]; [super dealloc]; } @@ -153,13 +155,18 @@ #pragma mark Actions - (void)_showImagePopup:(id)sender { - NSPopover *popover = [[NSPopover alloc] init]; - popover.behavior = NSPopoverBehaviorTransient; - popover.contentViewController = [[[MPIconSelectViewController alloc] init] autorelease]; - [popover showRelativeToRect:NSZeroRect ofView:self.itemImageView preferredEdge:NSMinYEdge]; - [popover release]; + _iconPopup = [[NSPopover alloc] init]; + self.iconPopup.behavior = NSPopoverBehaviorTransient; + self.iconPopup.contentViewController = [[[MPIconSelectViewController alloc] init] autorelease]; + [self.iconPopup showRelativeToRect:NSZeroRect ofView:self.itemImageView preferredEdge:NSMinYEdge]; + self.iconPopup = nil; } +- (void)hideImagePopup:(id)sender { + [self.iconPopup close]; +} + + #pragma mark Notificiations - (void)_didChangeSelectedEntry:(NSNotification *)notification { diff --git a/MacPass/MacPass-Info.plist b/MacPass/MacPass-Info.plist index 1f9d4ccf..8bd08f9c 100644 --- a/MacPass/MacPass-Info.plist +++ b/MacPass/MacPass-Info.plist @@ -21,7 +21,7 @@ CFBundleSignature ???? CFBundleVersion - 58B + 599 LSMinimumSystemVersion ${MACOSX_DEPLOYMENT_TARGET} NSHumanReadableCopyright