diff --git a/MacPass.xcodeproj/project.pbxproj b/MacPass.xcodeproj/project.pbxproj index f0be1580..532f3eb8 100644 --- a/MacPass.xcodeproj/project.pbxproj +++ b/MacPass.xcodeproj/project.pbxproj @@ -13,6 +13,7 @@ 4C0104BE17C37DA400173EF3 /* KPKXmlUtilities.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C0104BD17C37DA400173EF3 /* KPKXmlUtilities.m */; }; 4C01C2421764D8980016D5D0 /* MPContextMenuHelper.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C01C2411764D8980016D5D0 /* MPContextMenuHelper.m */; }; 4C01C245176500C40016D5D0 /* HNHLevelIndicatorCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C01C244176500C40016D5D0 /* HNHLevelIndicatorCell.m */; }; + 4C066A7F1BD8E2C60082CB39 /* KPKReferenceKeys.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C066A7E1BD8E2C60082CB39 /* KPKReferenceKeys.m */; settings = {ASSET_TAGS = (); }; }; 4C0728BD17B5B7F7005A7DD9 /* MPPasswordEditWindowController.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C0728BC17B5B7F7005A7DD9 /* MPPasswordEditWindowController.m */; }; 4C0728BF17B68ED0005A7DD9 /* SavePanelAccessoryView.xib in Resources */ = {isa = PBXBuildFile; fileRef = 4C0728BE17B68ED0005A7DD9 /* SavePanelAccessoryView.xib */; }; 4C08C3AE17B3022400BBBC95 /* KPKLegacyHeaderWriter.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C08C3AD17B3022400BBBC95 /* KPKLegacyHeaderWriter.m */; }; @@ -409,6 +410,8 @@ 4C01C2411764D8980016D5D0 /* MPContextMenuHelper.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; path = MPContextMenuHelper.m; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objc; }; 4C01C243176500C40016D5D0 /* HNHLevelIndicatorCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HNHLevelIndicatorCell.h; sourceTree = ""; }; 4C01C244176500C40016D5D0 /* HNHLevelIndicatorCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HNHLevelIndicatorCell.m; sourceTree = ""; }; + 4C066A7D1BD8E2C60082CB39 /* KPKReferenceKeys.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = KPKReferenceKeys.h; sourceTree = ""; }; + 4C066A7E1BD8E2C60082CB39 /* KPKReferenceKeys.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = KPKReferenceKeys.m; sourceTree = ""; }; 4C0728BB17B5B7F7005A7DD9 /* MPPasswordEditWindowController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MPPasswordEditWindowController.h; sourceTree = ""; }; 4C0728BC17B5B7F7005A7DD9 /* MPPasswordEditWindowController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MPPasswordEditWindowController.m; sourceTree = ""; }; 4C0728BE17B68ED0005A7DD9 /* SavePanelAccessoryView.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = SavePanelAccessoryView.xib; sourceTree = ""; }; @@ -1160,6 +1163,8 @@ 4CD4900F18513C180017397F /* KPKXmlElements.m */, 4CDFD35618AED5C5002BB267 /* KPKAutotypeCommands.h */, 4CDFD35718AED5C5002BB267 /* KPKAutotypeCommands.m */, + 4C066A7D1BD8E2C60082CB39 /* KPKReferenceKeys.h */, + 4C066A7E1BD8E2C60082CB39 /* KPKReferenceKeys.m */, ); name = Format; sourceTree = ""; @@ -2425,6 +2430,7 @@ 4C26C34B18D8D5A300CF1A1C /* MPPreviewViewController.m in Sources */, 4C4B728518E4B9B400A1A5D5 /* MPDockTileHelper.m in Sources */, 4C52A244177D7B9F0000D88F /* HNHScrollView.m in Sources */, + 4C066A7F1BD8E2C60082CB39 /* KPKReferenceKeys.m in Sources */, 4CC7EA1B17807E7E0089D4F3 /* HNHRoundedTextFieldCellHelper.m in Sources */, 4C5FE9AE17843CE20001D5A8 /* MPSelectedAttachmentTableCellView.m in Sources */, 4C3666411787327E00B249F1 /* MPDocument+Attachments.m in Sources */, diff --git a/MacPass.xcodeproj/xcshareddata/xcschemes/MacPass.xcscheme b/MacPass.xcodeproj/xcshareddata/xcschemes/MacPass.xcscheme index 0c57b203..e5642bb1 100644 --- a/MacPass.xcodeproj/xcshareddata/xcschemes/MacPass.xcscheme +++ b/MacPass.xcodeproj/xcshareddata/xcschemes/MacPass.xcscheme @@ -26,7 +26,8 @@ buildConfiguration = "Debug" selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" - shouldUseLaunchSchemeArgsEnv = "NO"> + shouldUseLaunchSchemeArgsEnv = "NO" + codeCoverageEnabled = "YES"> diff --git a/MacPass/MPContextToolbarButton.m b/MacPass/MPContextToolbarButton.m index 2e11c450..b728fb55 100644 --- a/MacPass/MPContextToolbarButton.m +++ b/MacPass/MPContextToolbarButton.m @@ -89,6 +89,23 @@ } - (void)setControlSize:(NSControlSize)controlSize { + NSImageRep *rep = [[self imageForSegment:0] bestRepresentationForRect:NSMakeRect(0, 0, 100, 100) context:nil hints:nil]; + CGFloat scale = rep.size.width / rep.size.height; + switch (controlSize) { + case NSRegularControlSize: + [self imageForSegment:0].size = NSMakeSize(16 * scale, 16); + break; + + case NSSmallControlSize: + [self imageForSegment:0].size = NSMakeSize(14 * scale, 14); + break; + + case NSMiniControlSize: + [self imageForSegment:0].size = NSMakeSize(8 * scale, 8); + + default: + break; + } self.cell.controlSize = controlSize; } diff --git a/MacPass/MPReferenceBuilderViewController.m b/MacPass/MPReferenceBuilderViewController.m index 7bad7162..d3f2887c 100644 --- a/MacPass/MPReferenceBuilderViewController.m +++ b/MacPass/MPReferenceBuilderViewController.m @@ -7,6 +7,7 @@ // #import "MPReferenceBuilderViewController.h" +#import "KPKReferenceKeys.h" @interface MPReferenceBuilderViewController () @@ -40,7 +41,7 @@ if(allowCustomAttributes) { [menu addItemWithTitle:NSLocalizedString(@"CUSTOM_ATTRIBUTE","") action:NULL keyEquivalent:@""]; } - NSArray *keys = @[ @"I", @"T", @"U", @"P", @"A", @"N", @"S" ]; + NSArray *keys = @[ kKPKReferenceUUIDKey, kKPKReferenceTitleKey, kKPKReferenceUsernameKey, kKPKReferencePasswordKey, kKPKReferenceURLKey, kKPKReferenceNotesKey, @"S" ]; [menu.itemArray enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop) { NSMenuItem *item = (NSMenuItem *)obj; NSAssert(keys.count > idx, @""); diff --git a/MacPass/MPToolbarButton.m b/MacPass/MPToolbarButton.m index 7dcec7cd..e473e9c5 100644 --- a/MacPass/MPToolbarButton.m +++ b/MacPass/MPToolbarButton.m @@ -21,6 +21,7 @@ // #import "MPToolbarButton.h" +#import "HNHCommon.h" @implementation MPToolbarButton @@ -54,7 +55,12 @@ default: break; } - super.controlSize = controlSize; + if([self.superclass instancesRespondToSelector:@selector(setControlSize:)]) { + super.controlSize = controlSize; + } + else { + self.cell.controlSize = controlSize; + } } - (NSControlSize)controlSize { diff --git a/MacPass/MacPass-Info.plist b/MacPass/MacPass-Info.plist index c0af4c22..2591673f 100644 --- a/MacPass/MacPass-Info.plist +++ b/MacPass/MacPass-Info.plist @@ -62,9 +62,20 @@ CFBundleSignature ???? CFBundleVersion - 2558 + 2560 LSMinimumSystemVersion ${MACOSX_DEPLOYMENT_TARGET} + NSAppTransportSecurity + + NSExceptionDomains + + www.nomadsland.de + + NSExceptionAllowsInsecureHTTPLoads + + + + NSHumanReadableCopyright Copyright © 2012-2014 HicknHack Software GmbH. All rights reserved. NSMainNibFile @@ -114,16 +125,5 @@ - NSAppTransportSecurity - - NSExceptionDomains - - www.nomadsland.de - - NSExceptionAllowsInsecureHTTPLoads - - - - diff --git a/MacPassTests/KPKTestAutotype.m b/MacPassTests/KPKTestAutotype.m index 1c10d6ec..54e0dfa0 100644 --- a/MacPassTests/KPKTestAutotype.m +++ b/MacPassTests/KPKTestAutotype.m @@ -15,6 +15,10 @@ @implementation KPKTestAutotype +- (void)testCommandValidation { + XCTAssertFalse([@"" validateCommmand], @"Emptry strings aren't valid commands"); +} + - (void)testSimpleNormalization { NSString *normalized = [@"Whoo %{%}{^}{SHIFT}+ {SPACE}{ENTER}^V%V~T" normalizedAutotypeSequence]; XCTAssertTrue([normalized isEqualToString:@"Whoo{SPACE}{ALT}{%}{^}{SHIFT}{SHIFT}{SPACE}{SPACE}{ENTER}{CONTROL}V{ALT}V{ENTER}T"]);