Expermintes with NSCopying and Iconselection window

This commit is contained in:
michael starke
2013-03-23 00:14:29 +01:00
parent a91c1a64d9
commit 476e18b870
11 changed files with 316 additions and 79 deletions

View File

@@ -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 = "<group>"; };
4CAC6F7616D2B54800D79D5E /* MPMainWindowSplitViewDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MPMainWindowSplitViewDelegate.h; sourceTree = "<group>"; };
4CAC6F7716D2B54800D79D5E /* MPMainWindowSplitViewDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MPMainWindowSplitViewDelegate.m; sourceTree = "<group>"; };
4CACB72A16F7C9B600D47C9E /* KdbEntry+Copying.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "KdbEntry+Copying.h"; sourceTree = "<group>"; };
4CACB72B16F7C9B600D47C9E /* KdbEntry+Copying.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "KdbEntry+Copying.m"; sourceTree = "<group>"; };
4CACB72D16F7CA5100D47C9E /* Kdb4Entry+Copying.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "Kdb4Entry+Copying.h"; sourceTree = "<group>"; };
4CACB72E16F7CA5100D47C9E /* Kdb4Entry+Copying.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "Kdb4Entry+Copying.m"; sourceTree = "<group>"; };
4CAD745615B887FD00104512 /* DDXMLElementAdditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DDXMLElementAdditions.h; sourceTree = "<group>"; };
4CAD745715B887FD00104512 /* DDXMLElementAdditions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DDXMLElementAdditions.m; sourceTree = "<group>"; };
4CAD745915B887FD00104512 /* NSString+DDXML.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSString+DDXML.h"; sourceTree = "<group>"; };
@@ -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 = "<group>";
@@ -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;
};

View File

@@ -2,10 +2,10 @@
<archive type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="8.00">
<data>
<int key="IBDocument.SystemTarget">1080</int>
<string key="IBDocument.SystemVersion">12C3103</string>
<string key="IBDocument.SystemVersion">12D78</string>
<string key="IBDocument.InterfaceBuilderVersion">3084</string>
<string key="IBDocument.AppKitVersion">1187.34</string>
<string key="IBDocument.HIToolboxVersion">625.00</string>
<string key="IBDocument.AppKitVersion">1187.37</string>
<string key="IBDocument.HIToolboxVersion">626.00</string>
<object class="NSMutableDictionary" key="IBDocument.PluginVersions">
<string key="NS.key.0">com.apple.InterfaceBuilder.CocoaPlugin</string>
<string key="NS.object.0">3084</string>
@@ -18,8 +18,6 @@
<string>NSCollectionViewItem</string>
<string>NSCustomObject</string>
<string>NSCustomView</string>
<string>NSImageCell</string>
<string>NSImageView</string>
<string>NSScrollView</string>
<string>NSScroller</string>
</array>
@@ -57,7 +55,7 @@
<int key="NSCellFlags">-2080374784</int>
<int key="NSCellFlags2">134217728</int>
<string key="NSContents">Use Default Icon</string>
<object class="NSFont" key="NSSupport">
<object class="NSFont" key="NSSupport" id="747112258">
<string key="NSName">LucidaGrande</string>
<double key="NSSize">13</double>
<int key="NSfFlags">1044</int>
@@ -75,7 +73,7 @@
</object>
<object class="NSScrollView" id="170990502">
<reference key="NSNextResponder" ref="1005"/>
<int key="NSvFlags">268</int>
<int key="NSvFlags">4364</int>
<array class="NSMutableArray" key="NSSubviews">
<object class="NSClipView" id="785205210">
<reference key="NSNextResponder" ref="170990502"/>
@@ -83,7 +81,7 @@
<array class="NSMutableArray" key="NSSubviews">
<object class="NSCollectionView" id="697027275">
<reference key="NSNextResponder" ref="785205210"/>
<int key="NSvFlags">274</int>
<int key="NSvFlags">4370</int>
<string key="NSFrameSize">{243, 238}</string>
<reference key="NSSuperview" ref="785205210"/>
<reference key="NSWindow"/>
@@ -175,34 +173,46 @@
<string key="NSClassName">NSView</string>
</object>
<object class="NSCollectionViewItem" id="417473882"/>
<object class="NSImageView" id="704432434">
<object class="NSCustomView" id="340719917">
<reference key="NSNextResponder"/>
<int key="NSvFlags">268</int>
<set class="NSMutableSet" key="NSDragTypes">
<string>Apple PDF pasteboard type</string>
<string>Apple PICT pasteboard type</string>
<string>Apple PNG pasteboard type</string>
<string>NSFilenamesPboardType</string>
<string>NeXT Encapsulated PostScript v1.2 pasteboard type</string>
<string>NeXT TIFF v4.0 pasteboard type</string>
</set>
<string key="NSFrameSize">{48, 48}</string>
<array class="NSMutableArray" key="NSSubviews">
<object class="NSButton" id="612603831">
<reference key="NSNextResponder" ref="340719917"/>
<int key="NSvFlags">268</int>
<string key="NSFrame">{{10, 10}, {40, 40}}</string>
<reference key="NSSuperview" ref="340719917"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView"/>
<string key="NSReuseIdentifierKey">_NS:9</string>
<bool key="NSEnabled">YES</bool>
<object class="NSButtonCell" key="NSCell" id="344314901">
<int key="NSCellFlags">67108864</int>
<int key="NSCellFlags2">134217728</int>
<string key="NSContents"/>
<reference key="NSSupport" ref="747112258"/>
<string key="NSCellIdentifier">_NS:9</string>
<reference key="NSControlView" ref="612603831"/>
<int key="NSButtonFlags">-2039201792</int>
<int key="NSButtonFlags2">65</int>
<object class="NSCustomResource" key="NSNormalImage">
<string key="NSClassName">NSImage</string>
<string key="NSResourceName">NSAddTemplate</string>
</object>
<string key="NSAlternateContents"/>
<string key="NSKeyEquivalent"/>
<int key="NSPeriodicDelay">200</int>
<int key="NSPeriodicInterval">25</int>
</object>
<bool key="NSAllowsLogicalLayoutDirection">NO</bool>
</object>
</array>
<string key="NSFrameSize">{60, 60}</string>
<reference key="NSSuperview"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView"/>
<reference key="NSNextKeyView" ref="612603831"/>
<string key="NSReuseIdentifierKey">_NS:9</string>
<bool key="NSEnabled">YES</bool>
<object class="NSImageCell" key="NSCell" id="655614209">
<int key="NSCellFlags">134217728</int>
<int key="NSCellFlags2">33554432</int>
<string key="NSCellIdentifier">_NS:9</string>
<int key="NSAlign">0</int>
<int key="NSScale">3</int>
<int key="NSStyle">2</int>
<bool key="NSAnimates">NO</bool>
</object>
<bool key="NSAllowsLogicalLayoutDirection">NO</bool>
<bool key="NSEditable">YES</bool>
<string key="NSClassName">NSView</string>
</object>
</array>
<object class="IBObjectContainer" key="IBDocument.Objects">
@@ -223,6 +233,14 @@
</object>
<int key="connectionID">77</int>
</object>
<object class="IBConnectionRecord">
<object class="IBActionConnection" key="connection">
<string key="label">useDefault:</string>
<reference key="source" ref="1001"/>
<reference key="destination" ref="317760263"/>
</object>
<int key="connectionID">129</int>
</object>
<object class="IBConnectionRecord">
<object class="IBOutletConnection" key="connection">
<string key="label">itemPrototype</string>
@@ -235,33 +253,9 @@
<object class="IBOutletConnection" key="connection">
<string key="label">view</string>
<reference key="source" ref="417473882"/>
<reference key="destination" ref="704432434"/>
<reference key="destination" ref="340719917"/>
</object>
<int key="connectionID">73</int>
</object>
<object class="IBConnectionRecord">
<object class="IBOutletConnection" key="connection">
<string key="label">imageView</string>
<reference key="source" ref="417473882"/>
<reference key="destination" ref="704432434"/>
</object>
<int key="connectionID">74</int>
</object>
<object class="IBConnectionRecord">
<object class="IBBindingConnection" key="connection">
<string key="label">value: representedObject</string>
<reference key="source" ref="704432434"/>
<reference key="destination" ref="417473882"/>
<object class="NSNibBindingConnector" key="connector">
<reference key="NSSource" ref="704432434"/>
<reference key="NSDestination" ref="417473882"/>
<string key="NSLabel">value: representedObject</string>
<string key="NSBinding">value</string>
<string key="NSKeyPath">representedObject</string>
<int key="NSNibBindingConnectorVersion">2</int>
</object>
</object>
<int key="connectionID">82</int>
<int key="connectionID">128</int>
</object>
</array>
<object class="IBMutableOrderedSet" key="objectRecords">
@@ -425,19 +419,6 @@
<reference key="object" ref="417473882"/>
<reference key="parent" ref="0"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">71</int>
<reference key="object" ref="704432434"/>
<array class="NSMutableArray" key="children">
<reference ref="655614209"/>
</array>
<reference key="parent" ref="0"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">72</int>
<reference key="object" ref="655614209"/>
<reference key="parent" ref="704432434"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">88</int>
<reference key="object" ref="655672626"/>
@@ -481,6 +462,111 @@
<reference key="object" ref="494913411"/>
<reference key="parent" ref="1005"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">113</int>
<reference key="object" ref="340719917"/>
<array class="NSMutableArray" key="children">
<object class="IBNSLayoutConstraint" id="436230129">
<reference key="firstItem" ref="340719917"/>
<int key="firstAttribute">10</int>
<int key="relation">0</int>
<reference key="secondItem" ref="612603831"/>
<int key="secondAttribute">10</int>
<float key="multiplier">1</float>
<object class="IBLayoutConstant" key="constant">
<double key="value">0.0</double>
</object>
<float key="priority">1000</float>
<reference key="containingView" ref="340719917"/>
<int key="scoringType">9</int>
<float key="scoringTypeFloat">40</float>
<int key="contentType">2</int>
</object>
<object class="IBNSLayoutConstraint" id="766436605">
<reference key="firstItem" ref="340719917"/>
<int key="firstAttribute">9</int>
<int key="relation">0</int>
<reference key="secondItem" ref="612603831"/>
<int key="secondAttribute">9</int>
<float key="multiplier">1</float>
<object class="IBLayoutConstant" key="constant">
<double key="value">0.0</double>
</object>
<float key="priority">1000</float>
<reference key="containingView" ref="340719917"/>
<int key="scoringType">9</int>
<float key="scoringTypeFloat">40</float>
<int key="contentType">2</int>
</object>
<reference ref="612603831"/>
</array>
<reference key="parent" ref="0"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">114</int>
<reference key="object" ref="612603831"/>
<array class="NSMutableArray" key="children">
<reference ref="344314901"/>
<object class="IBNSLayoutConstraint" id="463236706">
<reference key="firstItem" ref="612603831"/>
<int key="firstAttribute">8</int>
<int key="relation">0</int>
<nil key="secondItem"/>
<int key="secondAttribute">0</int>
<float key="multiplier">1</float>
<object class="IBLayoutConstant" key="constant">
<double key="value">40</double>
</object>
<float key="priority">1000</float>
<reference key="containingView" ref="612603831"/>
<int key="scoringType">3</int>
<float key="scoringTypeFloat">9</float>
<int key="contentType">1</int>
</object>
<object class="IBNSLayoutConstraint" id="477773969">
<reference key="firstItem" ref="612603831"/>
<int key="firstAttribute">7</int>
<int key="relation">0</int>
<nil key="secondItem"/>
<int key="secondAttribute">0</int>
<float key="multiplier">1</float>
<object class="IBLayoutConstant" key="constant">
<double key="value">40</double>
</object>
<float key="priority">1000</float>
<reference key="containingView" ref="612603831"/>
<int key="scoringType">3</int>
<float key="scoringTypeFloat">9</float>
<int key="contentType">1</int>
</object>
</array>
<reference key="parent" ref="340719917"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">115</int>
<reference key="object" ref="344314901"/>
<reference key="parent" ref="612603831"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">121</int>
<reference key="object" ref="477773969"/>
<reference key="parent" ref="612603831"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">123</int>
<reference key="object" ref="463236706"/>
<reference key="parent" ref="612603831"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">126</int>
<reference key="object" ref="766436605"/>
<reference key="parent" ref="340719917"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">127</int>
<reference key="object" ref="436230129"/>
<reference key="parent" ref="340719917"/>
</object>
</array>
</object>
<dictionary class="NSMutableDictionary" key="flattenedProperties">
@@ -504,6 +590,22 @@
<string key="110.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<string key="111.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<string key="112.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<array class="NSMutableArray" key="113.IBNSViewMetadataConstraints">
<reference ref="766436605"/>
<reference ref="436230129"/>
</array>
<string key="113.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<array key="114.IBNSViewMetadataConstraints">
<reference ref="477773969"/>
<reference ref="463236706"/>
</array>
<boolean value="NO" key="114.IBNSViewMetadataTranslatesAutoresizingMaskIntoConstraints"/>
<string key="114.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<string key="115.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<string key="121.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<string key="123.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<string key="126.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<string key="127.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<boolean value="NO" key="57.IBNSViewMetadataTranslatesAutoresizingMaskIntoConstraints"/>
<string key="57.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<reference key="58.IBCollectionViewIntegration.primaryColor" ref="228713979"/>
@@ -511,15 +613,13 @@
<string key="59.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<string key="60.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<string key="61.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<string key="71.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<string key="72.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<string key="88.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
</dictionary>
<dictionary class="NSMutableDictionary" key="unlocalizedProperties"/>
<nil key="activeLocalization"/>
<dictionary class="NSMutableDictionary" key="localizations"/>
<nil key="sourceID"/>
<int key="maxID">112</int>
<int key="maxID">129</int>
</object>
<object class="IBClassDescriber" key="IBDocument.Classes">
<array class="NSMutableArray" key="referencedPartialClassDescriptions">
@@ -550,6 +650,27 @@
<string key="minorKey">./Classes/MPViewController.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSCollectionViewItem</string>
<dictionary class="NSMutableDictionary" key="outlets">
<string key="imageView">NSImageView</string>
<string key="textField">NSTextField</string>
</dictionary>
<dictionary class="NSMutableDictionary" key="toOneOutletInfosByName">
<object class="IBToOneOutletInfo" key="imageView">
<string key="name">imageView</string>
<string key="candidateClassName">NSImageView</string>
</object>
<object class="IBToOneOutletInfo" key="textField">
<string key="name">textField</string>
<string key="candidateClassName">NSTextField</string>
</object>
</dictionary>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBProjectSource</string>
<string key="minorKey">./Classes/NSCollectionViewItem.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSLayoutConstraint</string>
<string key="superclassName">NSObject</string>
@@ -564,6 +685,10 @@
<string key="IBDocument.TargetRuntimeIdentifier">IBCocoaFramework</string>
<bool key="IBDocument.PluginDeclaredDependenciesTrackSystemTargetVersion">YES</bool>
<int key="IBDocument.defaultPropertyAccessControl">3</int>
<object class="NSMutableDictionary" key="IBDocument.LastKnownImageSizes">
<string key="NS.key.0">NSAddTemplate</string>
<string key="NS.object.0">{8, 8}</string>
</object>
<bool key="IBDocument.UseAutolayout">YES</bool>
</data>
</archive>

View File

@@ -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

View File

@@ -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

View File

@@ -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) <NSCopying>
@end

View File

@@ -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

View File

@@ -9,6 +9,8 @@
#import "MPViewController.h"
@interface MPIconSelectViewController : MPViewController <NSCollectionViewDelegate>
@property (assign) IBOutlet NSCollectionView *iconCollectionView;
- (IBAction)useDefault:(id)sender;
@end

View File

@@ -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

View File

@@ -27,5 +27,6 @@
@property (assign) IBOutlet NSButton *togglePasswordDisplayButton;
- (IBAction)togglePasswordDisplay:(id)sender;
- (void)hideImagePopup:(id)sender;
@end

View File

@@ -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 {

View File

@@ -21,7 +21,7 @@
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>58B</string>
<string>599</string>
<key>LSMinimumSystemVersion</key>
<string>${MACOSX_DEPLOYMENT_TARGET}</string>
<key>NSHumanReadableCopyright</key>