diff --git a/Cartfile b/Cartfile index 7f43ce54..e72aa64d 100644 --- a/Cartfile +++ b/Cartfile @@ -1,3 +1,3 @@ github "sparkle-project/Sparkle" ~> 1.18.1 -github "MacPass/KeePassKit" ~> 1.7.6 +github "MacPass/KeePassKit" ~> 1.8 github "mstarke/HNHUi" ~> 1.4.1 diff --git a/Cartfile.resolved b/Cartfile.resolved index 188246e5..7acc5cfd 100644 --- a/Cartfile.resolved +++ b/Cartfile.resolved @@ -1,3 +1,3 @@ -github "MacPass/KeePassKit" "1.7.7" +github "MacPass/KeePassKit" "1.8" github "mstarke/HNHUi" "1.4.1" github "sparkle-project/Sparkle" "1.18.1" diff --git a/MacPass.xcodeproj/project.pbxproj b/MacPass.xcodeproj/project.pbxproj index a1c33d7d..1cf58951 100644 --- a/MacPass.xcodeproj/project.pbxproj +++ b/MacPass.xcodeproj/project.pbxproj @@ -199,6 +199,7 @@ 4CA2335A176DBFE100F0B6AC /* MPLockDaemon.m in Sources */ = {isa = PBXBuildFile; fileRef = 4CA23359176DBFE100F0B6AC /* MPLockDaemon.m */; }; 4CA334CA18AD60D1008A3322 /* MPWindowAssociationsTableViewDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 4CA334C918AD60D1008A3322 /* MPWindowAssociationsTableViewDelegate.m */; }; 4CA3530B18A53CB800839B0F /* MPKeyMapper.m in Sources */ = {isa = PBXBuildFile; fileRef = 4CA3530A18A53CB800839B0F /* MPKeyMapper.m */; }; + 4CA4B3461FC8833A007DF507 /* PickcharView.xib in Resources */ = {isa = PBXBuildFile; fileRef = 4CA4B3451FC88339007DF507 /* PickcharView.xib */; }; 4CAAA8271D787B8B00CDE977 /* MPAutotypeBuilderViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 4CAAA8251D787B8B00CDE977 /* MPAutotypeBuilderViewController.m */; }; 4CAD748C15B889B700104512 /* Security.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4CAD748B15B889B700104512 /* Security.framework */; }; 4CAD748E15B88AC100104512 /* libz.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 4CAD748D15B88AC100104512 /* libz.dylib */; }; @@ -218,6 +219,7 @@ 4CD034AA1BFE113B003C002C /* MPPlugin.m in Sources */ = {isa = PBXBuildFile; fileRef = 4CD034A51BFE113B003C002C /* MPPlugin.m */; }; 4CD034AC1BFE113B003C002C /* MPPluginHost.m in Sources */ = {isa = PBXBuildFile; fileRef = 4CD034A91BFE113B003C002C /* MPPluginHost.m */; }; 4CD2B9061849424B0051B395 /* MPAutotypeContext.m in Sources */ = {isa = PBXBuildFile; fileRef = 4CD2B9051849424B0051B395 /* MPAutotypeContext.m */; }; + 4CD4EE131FC7284000EA6EB3 /* MPPickcharViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 4CD4EE111FC7284000EA6EB3 /* MPPickcharViewController.m */; }; 4CD5D705177A5F3300100649 /* MPDatabaseSettingsWindowController.m in Sources */ = {isa = PBXBuildFile; fileRef = 4CD5D704177A5F3300100649 /* MPDatabaseSettingsWindowController.m */; }; 4CD60C131C104AD4005BE5F8 /* HNHUi.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = 4CC281881C0F675B00B9174D /* HNHUi.framework */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; }; 4CD7223B17A7CB0700F5A1E1 /* MPWorkflowSettingsController.m in Sources */ = {isa = PBXBuildFile; fileRef = 4CD7223A17A7CB0700F5A1E1 /* MPWorkflowSettingsController.m */; }; @@ -681,6 +683,7 @@ 4CA334C918AD60D1008A3322 /* MPWindowAssociationsTableViewDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MPWindowAssociationsTableViewDelegate.m; sourceTree = ""; }; 4CA3530918A53CB800839B0F /* MPKeyMapper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MPKeyMapper.h; sourceTree = ""; }; 4CA3530A18A53CB800839B0F /* MPKeyMapper.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MPKeyMapper.m; sourceTree = ""; }; + 4CA4B3451FC88339007DF507 /* PickcharView.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = PickcharView.xib; sourceTree = ""; }; 4CAAA8241D787B8B00CDE977 /* MPAutotypeBuilderViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MPAutotypeBuilderViewController.h; sourceTree = ""; }; 4CAAA8251D787B8B00CDE977 /* MPAutotypeBuilderViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MPAutotypeBuilderViewController.m; sourceTree = ""; }; 4CAD748B15B889B700104512 /* Security.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Security.framework; path = System/Library/Frameworks/Security.framework; sourceTree = SDKROOT; }; @@ -715,6 +718,8 @@ 4CD034A91BFE113B003C002C /* MPPluginHost.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = MPPluginHost.m; path = MacPass/MPPluginHost.m; sourceTree = SOURCE_ROOT; }; 4CD2B9041849424B0051B395 /* MPAutotypeContext.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MPAutotypeContext.h; sourceTree = ""; }; 4CD2B9051849424B0051B395 /* MPAutotypeContext.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MPAutotypeContext.m; sourceTree = ""; }; + 4CD4EE101FC7284000EA6EB3 /* MPPickcharViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MPPickcharViewController.h; sourceTree = ""; }; + 4CD4EE111FC7284000EA6EB3 /* MPPickcharViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MPPickcharViewController.m; sourceTree = ""; }; 4CD5D703177A5F3300100649 /* MPDatabaseSettingsWindowController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MPDatabaseSettingsWindowController.h; sourceTree = ""; }; 4CD5D704177A5F3300100649 /* MPDatabaseSettingsWindowController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MPDatabaseSettingsWindowController.m; sourceTree = ""; }; 4CD7223917A7CB0700F5A1E1 /* MPWorkflowSettingsController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MPWorkflowSettingsController.h; sourceTree = ""; }; @@ -1432,6 +1437,12 @@ 4CA182711F963FF600DD4A4A /* MPTitlebarColorAccessoryViewController.h */, 4CA182721F963FF600DD4A4A /* MPTitlebarColorAccessoryViewController.m */, 4CA182731F963FF600DD4A4A /* TitlebarColorAccessoryViewController.xib */, + 4C6DCC5E1FA24C2100C8AD3F /* MPAutotypeCandidateSelectionViewController.h */, + 4C6DCC5F1FA24C2100C8AD3F /* MPAutotypeCandidateSelectionViewController.m */, + FA9FD3291FB5E8F4003CEDD6 /* AutotypeCandidateSelectionView.xib */, + 4CD4EE101FC7284000EA6EB3 /* MPPickcharViewController.h */, + 4CD4EE111FC7284000EA6EB3 /* MPPickcharViewController.m */, + 4CA4B3451FC88339007DF507 /* PickcharView.xib */, ); name = "View Controller"; sourceTree = ""; @@ -1496,9 +1507,6 @@ 4C8990F41EE978EB0043B48D /* MPDuplicateEntryOptionsWindowController.h */, 4C8990F51EE978EB0043B48D /* MPDuplicateEntryOptionsWindowController.m */, 4CA1827A1F96523600DD4A4A /* DuplicateEntryOptionsWindow.xib */, - 4C6DCC5E1FA24C2100C8AD3F /* MPAutotypeCandidateSelectionViewController.h */, - 4C6DCC5F1FA24C2100C8AD3F /* MPAutotypeCandidateSelectionViewController.m */, - FA9FD3291FB5E8F4003CEDD6 /* AutotypeCandidateSelectionView.xib */, ); name = "Window Controller"; sourceTree = ""; @@ -1710,6 +1718,7 @@ 4C431BCF16E2BAB000700A81 /* OverlayWindow.xib in Resources */, 4C3826B61AD04D8E007D7D67 /* 41_VectorTemplate.pdf in Resources */, 4C17F105184E630200E85625 /* 14_BatteryTemplate.pdf in Resources */, + 4CA4B3461FC8833A007DF507 /* PickcharView.xib in Resources */, 4C76156D1764C0E20015A1A6 /* InspectorView.xib in Resources */, 4C888C9016EB6C91003D34A1 /* Localizable.strings in Resources */, 4C3826B01AD04D8E007D7D67 /* 35_BrowserWindowTemplate.pdf in Resources */, @@ -1891,6 +1900,7 @@ 4CD2B9061849424B0051B395 /* MPAutotypeContext.m in Sources */, 4CFB18E418A17FA20097A34B /* MPUpdateSettingsController.m in Sources */, 4C7B63771C0CB51F00D7038C /* TTTStringTransformers.m in Sources */, + 4CD4EE131FC7284000EA6EB3 /* MPPickcharViewController.m in Sources */, 4CCEDE2A179F203B008402BE /* MPOutlineView.m in Sources */, 4CB33F861EAF54A000C9341E /* KPKNode+MPIsHistory.m in Sources */, 4CCEDE2E179F213B008402BE /* MPNotifications.m in Sources */, diff --git a/MacPass/Base.lproj/AutotypeCandidateSelectionView.xib b/MacPass/Base.lproj/AutotypeCandidateSelectionView.xib index 30d4eb0a..866396cd 100644 --- a/MacPass/Base.lproj/AutotypeCandidateSelectionView.xib +++ b/MacPass/Base.lproj/AutotypeCandidateSelectionView.xib @@ -1,8 +1,8 @@ - + - + @@ -142,7 +142,7 @@ DQ - + diff --git a/MacPass/Base.lproj/EntryInspectorView.xib b/MacPass/Base.lproj/EntryInspectorView.xib index 5fe962a8..f2048e0b 100644 --- a/MacPass/Base.lproj/EntryInspectorView.xib +++ b/MacPass/Base.lproj/EntryInspectorView.xib @@ -1,8 +1,8 @@ - + - + @@ -532,7 +532,7 @@ - + @@ -900,7 +900,7 @@ - + diff --git a/MacPass/MPAutotypeDaemon.m b/MacPass/MPAutotypeDaemon.m index 6b19184a..efa83b9b 100644 --- a/MacPass/MPAutotypeDaemon.m +++ b/MacPass/MPAutotypeDaemon.m @@ -239,8 +239,7 @@ static MPAutotypeDaemon *_sharedInstance; usleep(1 * NSEC_PER_MSEC); } dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{ - NSArray *commands = [MPAutotypeCommand commandsForContext:context]; - for(MPAutotypeCommand *command in commands) { + for(MPAutotypeCommand *command in [MPAutotypeCommand commandsForContext:context]) { [command execute]; } }); diff --git a/MacPass/MPAutotypePickchars.m b/MacPass/MPAutotypePickchars.m deleted file mode 100644 index 164f4bb3..00000000 --- a/MacPass/MPAutotypePickchars.m +++ /dev/null @@ -1,38 +0,0 @@ -// -// MPAutotypePickchars.m -// MacPass -// -// Created by Michael Starke on 23.11.17. -// Copyright © 2017 HicknHack Software GmbH. All rights reserved. -// - -#import "MPAutotypePickchars.h" -#import "MPPickcharViewController.h" - -@implementation MPAutotypePickchars - -- (void)execute { - dispatch_sync(dispatch_get_main_queue(), ^{ - - - MPPickcharViewController *vc = [[MPPickcharViewController alloc] init]; - vc.sourceValue = @"ThisIsANicePassword"; - vc.countToPick = 10; - - - NSPanel *panel = [[NSPanel alloc] initWithContentRect:NSMakeRect(0, 0, 100, 100) - styleMask:NSWindowStyleMaskNonactivatingPanel|NSWindowStyleMaskTitled - backing:NSBackingStoreRetained - defer:YES]; - panel.level = NSScreenSaverWindowLevel; - panel.contentViewController = vc; - [panel center]; - [panel makeKeyAndOrderFront:self]; - - if(NSModalResponseOK == [NSApp runModalForWindow:panel]) { - // Do some stuff! - } - }); -} - -@end diff --git a/MacPass/MPPickcharViewController.h b/MacPass/MPPickcharViewController.h new file mode 100644 index 00000000..e177190a --- /dev/null +++ b/MacPass/MPPickcharViewController.h @@ -0,0 +1,23 @@ +// +// MPPickcharViewController.h +// MacPass +// +// Created by Michael Starke on 23.11.17. +// Copyright © 2017 HicknHack Software GmbH. All rights reserved. +// + +#import +NS_ASSUME_NONNULL_BEGIN + +@interface MPPickcharViewController : NSViewController + +@property (copy) NSString *sourceValue; +@property (nonatomic, copy) NSString *pickedValue; +@property NSInteger countToPick; +@property (nonatomic) BOOL hideSource; + +- (IBAction)reset:(id)sender; + +@end + +NS_ASSUME_NONNULL_END diff --git a/MacPass/MPPickcharViewController.m b/MacPass/MPPickcharViewController.m new file mode 100644 index 00000000..c077b663 --- /dev/null +++ b/MacPass/MPPickcharViewController.m @@ -0,0 +1,121 @@ +// +// MPPickcharViewController.m +// MacPass +// +// Created by Michael Starke on 23.11.17. +// Copyright © 2017 HicknHack Software GmbH. All rights reserved. +// + +#import "MPPickcharViewController.h" +#import "NSString+MPComposedCharacterAdditions.h" + +#import + +@interface MPPickcharViewController () +@property (weak) IBOutlet NSTableView *characterTableView; +@property (weak) IBOutlet NSTextField *pickedValueTextField; +@property (weak) IBOutlet NSButton *togglePasswordDisplayButton; +@property (weak) IBOutlet NSTextField *pickedStatusTextField; +@end + +@implementation MPPickcharViewController + +- (NSNibName)nibName { + return @"PickcharView"; +} + +- (instancetype)initWithCoder:(NSCoder *)coder { + self = [super initWithCoder:coder]; + if(self) { + self.hideSource = NO; + } + return self; +} + +- (instancetype)initWithNibName:(NSNibName)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil { + self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]; + if(self) { + self.hideSource = NO; + } + return self; +} +- (void)reset:(id)sender { + self.pickedValue = @""; +} + +- (void)viewDidLoad { + [super viewDidLoad]; + for(NSTableColumn *column in self.characterTableView.tableColumns) { + [self.characterTableView removeTableColumn:column]; + } + for(NSUInteger count = 0; count < self.sourceValue.composedCharacterLength; count++) { + + NSString *columnTitle = [NSString stringWithFormat:@"%ld", count]; + NSTableColumn *column = [[NSTableColumn alloc] initWithIdentifier:columnTitle]; + column.maxWidth = 32.0; + column.minWidth = column.maxWidth; + column.headerCell.stringValue = columnTitle; + [self.characterTableView addTableColumn:column]; + } + self.characterTableView.enclosingScrollView.horizontalScroller.scrollerStyle = NSScrollerStyleLegacy; + [self.pickedValueTextField bind:NSValueBinding toObject:self withKeyPath:NSStringFromSelector(@selector(pickedValue)) options:nil]; + [self.togglePasswordDisplayButton bind:NSValueBinding toObject:self.pickedValueTextField withKeyPath:NSStringFromSelector(@selector(showPassword)) options:nil]; + + [self reset:self]; +} + +- (void)setHideSource:(BOOL)hideSource { + if(_hideSource != hideSource) { + _hideSource = hideSource; + [self.characterTableView reloadData]; + } +} + +- (void)setPickedValue:(NSString *)pickedValue { + _pickedValue = [pickedValue copy]; + [self _updatePickedStatus]; +} + +- (void)_updatePickedStatus { + self.pickedStatusTextField.stringValue = [NSString stringWithFormat:@"%ld characters remaining", self.pickedValue.composedCharacterLength]; +} + +- (NSInteger)numberOfRowsInTableView:(NSTableView *)tableView { + if(tableView != self.characterTableView) { + return 0; + } + return 1; +} + +- (NSView *)tableView:(NSTableView *)tableView viewForTableColumn:(NSTableColumn *)tableColumn row:(NSInteger)row { + NSTableCellView *view = [tableView makeViewWithIdentifier:@"Cell" owner:self]; + NSInteger index = [tableView.tableColumns indexOfObjectIdenticalTo:tableColumn]; + if(index == NSNotFound) { + view.textField.stringValue = @"?"; + } + view.textField.stringValue = self.hideSource ? @"•" : [self.sourceValue composedCharacterAtIndex:index]; + return view; +} + +- (void)tableView:(NSTableView *)tableView didClickTableColumn:(NSTableColumn *)tableColumn { + NSInteger index = [tableView.tableColumns indexOfObjectIdenticalTo:tableColumn]; + if(index == NSNotFound) { + return; + } + if(self.pickedValue) { + self.pickedValue = [self.pickedValue stringByAppendingString:[self.sourceValue composedCharacterAtIndex:index]]; + } + else { + self.pickedValue = [self.sourceValue composedCharacterAtIndex:index]; + } +} + +- (IBAction)finishedPicking:(id)sender { + [NSApp stopModalWithCode:NSModalResponseOK]; +} + +- (IBAction)cancelPicking:(id)sender { + [NSApp stopModalWithCode:NSModalResponseCancel]; +} + +@end diff --git a/MacPass/MPPlugin.h b/MacPass/MPPlugin.h index 1b4edd38..a75759f3 100644 --- a/MacPass/MPPlugin.h +++ b/MacPass/MPPlugin.h @@ -25,6 +25,8 @@ NS_ASSUME_NONNULL_BEGIN @class MPPluginHost; +@class MPAutotypeCommand; +@class KPKEntry; FOUNDATION_EXPORT NSString *const kMPPluginFileExtension; @@ -35,6 +37,14 @@ FOUNDATION_EXPORT NSString *const kMPPluginFileExtension; @property (copy, readonly) NSString *version; @property (nonatomic, strong, readonly) NSBundle *bundle; + +/** + If your plugin needs initalization override this method but you have to call [super initWithPluginHost:] + Otherwise your plugin might not get registered correctly + + @param host plugin host hosting the pluing - MacPass + @return the plugin instance ready for use + */ - (instancetype)initWithPluginHost:(MPPluginHost *)host NS_DESIGNATED_INITIALIZER; - (instancetype)init NS_UNAVAILABLE; @@ -49,6 +59,43 @@ FOUNDATION_EXPORT NSString *const kMPPluginFileExtension; @end +/* Adopt this protocoll if you plugin supplied additinal autotype commands */ +@protocol MPAutotypePlugin +@required +/** + Returns an array of string of commands supported by this pluing. Leave out enclosing curly brackets! + E.g. if you support {FOO} and {BAR} you will return @[ @"FOO", @"BAR" ]. The autotype system is case insenstivie. + */ +@property (nonatomic,copy) NSArray *commandStrings; +/** + Will be called by the plugin host to generate autotype commands for the corresponding string. + Command strings are considered case insensitive but mostly will be used in upper case. + You should therefore compare case insensitive. + + @param commandString The command string without any enclosing curly brackets. The string is normalized to upper cased. + @param entry The entry for which the command will be used + @return a command for the supplied string, return nil if parsing fails or an unsupported command is supplied + */ +- (MPAutotypeCommand * _Nullable)commandForString:(NSString *)commandString entry:(KPKEntry *)entry; +@end + +/* + Adopt this protocoll if your plugin supports actions on entries. + Actions will get listed in various places in menues. You should shoudl supply a valid menu item + that is wired up with the correct target and action. Since there's responder chain resolving involved + as well as a + */ +@protocol MPEntryActionPlugin +@optional +- (NSMenuItem * _Nullable)menuItemForEntry; +@end + +@protocol MPCustomAttributePlugin +@optional +/* Supply a list of attribute keys that will get suggested for autocompletion as well as added to the extend add for custom fields */ +@property (nonatomic,copy) NSArray* attributeKeys; +@end + @interface MPPlugin (Deprecated) - (instancetype)initWithPluginManager:(id)manager; diff --git a/MacPass/MPPluginHost.h b/MacPass/MPPluginHost.h index bb774135..300aef2d 100644 --- a/MacPass/MPPluginHost.h +++ b/MacPass/MPPluginHost.h @@ -44,4 +44,8 @@ FOUNDATION_EXPORT NSString *const MPPluginHostPluginBundleIdentifiyerKey; - (void)disablePlugin:(MPPlugin *)plugin; - (void)enablePlugin:(MPPlugin *)plugin; +/* +- (NSArray *)autotypePlugins; +- (NSArray *)entryContextMenuPlugins; +*/ @end diff --git a/MacPass/MPTreeDelegate.m b/MacPass/MPTreeDelegate.m index 70bdb709..77c2fbfb 100644 --- a/MacPass/MPTreeDelegate.m +++ b/MacPass/MPTreeDelegate.m @@ -24,6 +24,7 @@ #import "MPDocument.h" #import "MPSettingsHelper.h" +#import "MPPickcharViewController.h" @interface MPTreeDelegate (); @@ -53,15 +54,12 @@ return self.document.undoManager; } -- (NSString *)resolvePlaceholder:(NSString *)placeholder forTree:(KPKTree *)tree { +- (NSString *)tree:(KPKTree *)tree resolvePlaceholder:(NSString *)placeholder forEntry:(KPKEntry *)entry { if([placeholder isEqualToString:kKPKPlaceholderDatabasePath]) { return self.document.fileURL.path; } if([placeholder isEqualToString:kKPKPlaceholderDatabaseFolder]) { - return self.document.fileURL.path; - } - if([placeholder isEqualToString:kKPKPlaceholderDatabaseName]) { - return self.document.tree.metaData.databaseName; + return self.document.fileURL.path; } if([placeholder isEqualToString:kKPKPlaceholderDatabaseBasename]) { return @""; @@ -80,4 +78,35 @@ } return @""; } + +- (NSString *)tree:(KPKTree *)tree resolvePickFieldPlaceholderForEntry:(KPKEntry *)entry { + return @""; +} + +- (NSString *)tree:(KPKTree *)tree resolvePickCharsPlaceholderForEntry:(KPKEntry *)entry field:(NSString *)field options:(NSString *)options { + + NSString *value = [[entry valueForAttributeWithKey:field] kpk_finalValueForEntry:entry]; + if(value.length == 0) { + return @""; // error while retrieving source value + } + + MPPickcharViewController *pickCharViewController = [[MPPickcharViewController alloc] init]; + + pickCharViewController.sourceValue = value; + pickCharViewController.countToPick = 10; + + + NSPanel *panel = [[NSPanel alloc] initWithContentRect:NSMakeRect(0, 0, 100, 100) + styleMask:NSWindowStyleMaskNonactivatingPanel|NSWindowStyleMaskTitled|NSWindowStyleMaskResizable + backing:NSBackingStoreRetained + defer:YES]; + panel.level = NSScreenSaverWindowLevel; + panel.contentViewController = pickCharViewController; + [panel center]; + if(NSModalResponseOK == [NSApp runModalForWindow:panel]) { + /* add appropriate key press comamnds? or let the pick-char view-controller handel this? */ + return pickCharViewController.pickedValue; + } + return @""; +} @end diff --git a/MacPass/PickcharView.xib b/MacPass/PickcharView.xib new file mode 100644 index 00000000..9f71504a --- /dev/null +++ b/MacPass/PickcharView.xib @@ -0,0 +1,163 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +