Renamed Assets Catalog, modernized code
@@ -178,7 +178,7 @@
|
|||||||
4C7B637D1C0CB55600D7038C /* Sparkle.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4C7B637A1C0CB55600D7038C /* Sparkle.framework */; };
|
4C7B637D1C0CB55600D7038C /* Sparkle.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4C7B637A1C0CB55600D7038C /* Sparkle.framework */; };
|
||||||
4C7B637F1C0CB57300D7038C /* KeePassKit.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = 4C7B63791C0CB55600D7038C /* KeePassKit.framework */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; };
|
4C7B637F1C0CB57300D7038C /* KeePassKit.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = 4C7B63791C0CB55600D7038C /* KeePassKit.framework */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; };
|
||||||
4C7B63801C0CB57300D7038C /* Sparkle.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = 4C7B637A1C0CB55600D7038C /* Sparkle.framework */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; };
|
4C7B63801C0CB57300D7038C /* Sparkle.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = 4C7B637A1C0CB55600D7038C /* Sparkle.framework */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; };
|
||||||
4C7BD07619FE94C900C7AA5C /* MacPassImages.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 4C7BD07519FE94C900C7AA5C /* MacPassImages.xcassets */; };
|
4C7BD07619FE94C900C7AA5C /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 4C7BD07519FE94C900C7AA5C /* Assets.xcassets */; };
|
||||||
4C7F8B681A10B68400CCB83D /* WelcomeWindow.xib in Resources */ = {isa = PBXBuildFile; fileRef = 4C7F8B6A1A10B68400CCB83D /* WelcomeWindow.xib */; };
|
4C7F8B681A10B68400CCB83D /* WelcomeWindow.xib in Resources */ = {isa = PBXBuildFile; fileRef = 4C7F8B6A1A10B68400CCB83D /* WelcomeWindow.xib */; };
|
||||||
4C80304A1E2FBAA300133E4C /* MPTestKeyMapper.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C8030491E2FBAA300133E4C /* MPTestKeyMapper.m */; };
|
4C80304A1E2FBAA300133E4C /* MPTestKeyMapper.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C8030491E2FBAA300133E4C /* MPTestKeyMapper.m */; };
|
||||||
4C82046A1FCDC07800EB24A4 /* MPPickfieldViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C8204681FCDC07800EB24A4 /* MPPickfieldViewController.m */; };
|
4C82046A1FCDC07800EB24A4 /* MPPickfieldViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C8204681FCDC07800EB24A4 /* MPPickfieldViewController.m */; };
|
||||||
@@ -629,7 +629,7 @@
|
|||||||
4C7B63701C0CB51F00D7038C /* TTTStringTransformers.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TTTStringTransformers.m; sourceTree = "<group>"; };
|
4C7B63701C0CB51F00D7038C /* TTTStringTransformers.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TTTStringTransformers.m; sourceTree = "<group>"; };
|
||||||
4C7B63791C0CB55600D7038C /* KeePassKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = KeePassKit.framework; path = Carthage/Build/Mac/KeePassKit.framework; sourceTree = "<group>"; };
|
4C7B63791C0CB55600D7038C /* KeePassKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = KeePassKit.framework; path = Carthage/Build/Mac/KeePassKit.framework; sourceTree = "<group>"; };
|
||||||
4C7B637A1C0CB55600D7038C /* Sparkle.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Sparkle.framework; path = Carthage/Build/Mac/Sparkle.framework; sourceTree = "<group>"; };
|
4C7B637A1C0CB55600D7038C /* Sparkle.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Sparkle.framework; path = Carthage/Build/Mac/Sparkle.framework; sourceTree = "<group>"; };
|
||||||
4C7BD07519FE94C900C7AA5C /* MacPassImages.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = MacPassImages.xcassets; sourceTree = "<group>"; };
|
4C7BD07519FE94C900C7AA5C /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
|
||||||
4C7F8B691A10B68400CCB83D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/WelcomeWindow.xib; sourceTree = "<group>"; };
|
4C7F8B691A10B68400CCB83D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/WelcomeWindow.xib; sourceTree = "<group>"; };
|
||||||
4C7F8B741A10B69300CCB83D /* nl */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = nl; path = nl.lproj/WelcomeWindow.strings; sourceTree = "<group>"; };
|
4C7F8B741A10B69300CCB83D /* nl */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = nl; path = nl.lproj/WelcomeWindow.strings; sourceTree = "<group>"; };
|
||||||
4C7F8B761A10B69400CCB83D /* zh-Hans */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "zh-Hans"; path = "zh-Hans.lproj/WelcomeWindow.strings"; sourceTree = "<group>"; };
|
4C7F8B761A10B69400CCB83D /* zh-Hans */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "zh-Hans"; path = "zh-Hans.lproj/WelcomeWindow.strings"; sourceTree = "<group>"; };
|
||||||
@@ -1406,7 +1406,7 @@
|
|||||||
4C37A84215B8B495005EF8EE /* Model */,
|
4C37A84215B8B495005EF8EE /* Model */,
|
||||||
4C37A84115B8B47D005EF8EE /* Delegates */,
|
4C37A84115B8B47D005EF8EE /* Delegates */,
|
||||||
4C77E36D15B84A240093A587 /* Supporting Files */,
|
4C77E36D15B84A240093A587 /* Supporting Files */,
|
||||||
4C7BD07519FE94C900C7AA5C /* MacPassImages.xcassets */,
|
4C7BD07519FE94C900C7AA5C /* Assets.xcassets */,
|
||||||
);
|
);
|
||||||
path = MacPass;
|
path = MacPass;
|
||||||
sourceTree = "<group>";
|
sourceTree = "<group>";
|
||||||
@@ -1841,7 +1841,7 @@
|
|||||||
4C6D1D25178579570014C5A5 /* 48_FolderTemplate.pdf in Resources */,
|
4C6D1D25178579570014C5A5 /* 48_FolderTemplate.pdf in Resources */,
|
||||||
4C701CBC178618A000581B88 /* 12_RemoteTemplate.pdf in Resources */,
|
4C701CBC178618A000581B88 /* 12_RemoteTemplate.pdf in Resources */,
|
||||||
4CF29BF417879D0000851B60 /* 26_FileSaveTemplate.pdf in Resources */,
|
4CF29BF417879D0000851B60 /* 26_FileSaveTemplate.pdf in Resources */,
|
||||||
4C7BD07619FE94C900C7AA5C /* MacPassImages.xcassets in Resources */,
|
4C7BD07619FE94C900C7AA5C /* Assets.xcassets in Resources */,
|
||||||
4CA182781F96523600DD4A4A /* DuplicateEntryOptionsWindow.xib in Resources */,
|
4CA182781F96523600DD4A4A /* DuplicateEntryOptionsWindow.xib in Resources */,
|
||||||
4C52A88E1788628B00868229 /* 06_BlockDeviceTemplate.pdf in Resources */,
|
4C52A88E1788628B00868229 /* 06_BlockDeviceTemplate.pdf in Resources */,
|
||||||
4C52A88F1788628B00868229 /* 13_KeysTemplate.pdf in Resources */,
|
4C52A88F1788628B00868229 /* 13_KeysTemplate.pdf in Resources */,
|
||||||
|
|||||||
@@ -27,10 +27,10 @@
|
|||||||
"color" : {
|
"color" : {
|
||||||
"color-space" : "srgb",
|
"color-space" : "srgb",
|
||||||
"components" : {
|
"components" : {
|
||||||
"red" : "0.300",
|
"red" : "0.200",
|
||||||
"alpha" : "1.000",
|
"alpha" : "1.000",
|
||||||
"blue" : "0.300",
|
"blue" : "0.200",
|
||||||
"green" : "0.300"
|
"green" : "0.200"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -27,10 +27,10 @@
|
|||||||
"color" : {
|
"color" : {
|
||||||
"color-space" : "srgb",
|
"color-space" : "srgb",
|
||||||
"components" : {
|
"components" : {
|
||||||
"red" : "0.300",
|
"red" : "0.200",
|
||||||
"alpha" : "1.000",
|
"alpha" : "1.000",
|
||||||
"blue" : "0.300",
|
"blue" : "0.200",
|
||||||
"green" : "0.300"
|
"green" : "0.200"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -27,10 +27,10 @@
|
|||||||
"color" : {
|
"color" : {
|
||||||
"color-space" : "srgb",
|
"color-space" : "srgb",
|
||||||
"components" : {
|
"components" : {
|
||||||
"red" : "0.300",
|
"red" : "0.200",
|
||||||
"alpha" : "1.000",
|
"alpha" : "1.000",
|
||||||
"blue" : "0.300",
|
"blue" : "0.200",
|
||||||
"green" : "0.300"
|
"green" : "0.200"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -27,10 +27,10 @@
|
|||||||
"color" : {
|
"color" : {
|
||||||
"color-space" : "srgb",
|
"color-space" : "srgb",
|
||||||
"components" : {
|
"components" : {
|
||||||
"red" : "0.300",
|
"red" : "0.200",
|
||||||
"alpha" : "1.000",
|
"alpha" : "1.000",
|
||||||
"blue" : "0.300",
|
"blue" : "0.200",
|
||||||
"green" : "0.300"
|
"green" : "0.200"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 14 KiB |
|
Before Width: | Height: | Size: 38 KiB After Width: | Height: | Size: 38 KiB |
|
Before Width: | Height: | Size: 3.6 KiB After Width: | Height: | Size: 3.6 KiB |
|
Before Width: | Height: | Size: 4.5 KiB After Width: | Height: | Size: 4.5 KiB |
|
Before Width: | Height: | Size: 38 KiB After Width: | Height: | Size: 38 KiB |
|
Before Width: | Height: | Size: 116 KiB After Width: | Height: | Size: 116 KiB |
|
Before Width: | Height: | Size: 4.5 KiB After Width: | Height: | Size: 4.5 KiB |
|
Before Width: | Height: | Size: 6.9 KiB After Width: | Height: | Size: 6.9 KiB |
|
Before Width: | Height: | Size: 116 KiB After Width: | Height: | Size: 116 KiB |
|
Before Width: | Height: | Size: 257 KiB After Width: | Height: | Size: 257 KiB |
|
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 14 KiB |
|
Before Width: | Height: | Size: 33 KiB After Width: | Height: | Size: 33 KiB |
|
Before Width: | Height: | Size: 715 B After Width: | Height: | Size: 715 B |
|
Before Width: | Height: | Size: 2.0 KiB After Width: | Height: | Size: 2.0 KiB |
|
Before Width: | Height: | Size: 33 KiB After Width: | Height: | Size: 33 KiB |
|
Before Width: | Height: | Size: 80 KiB After Width: | Height: | Size: 80 KiB |
|
Before Width: | Height: | Size: 2.0 KiB After Width: | Height: | Size: 2.0 KiB |
|
Before Width: | Height: | Size: 5.5 KiB After Width: | Height: | Size: 5.5 KiB |
|
Before Width: | Height: | Size: 80 KiB After Width: | Height: | Size: 80 KiB |
|
Before Width: | Height: | Size: 202 KiB After Width: | Height: | Size: 202 KiB |
@@ -424,8 +424,12 @@ static CGKeyCode kMPNumpadKeyCodes[] = {
|
|||||||
|
|
||||||
/* Send the event */
|
/* Send the event */
|
||||||
CGEventPost(kCGHIDEventTap, pressKey);
|
CGEventPost(kCGHIDEventTap, pressKey);
|
||||||
|
/* TODO: Evaluate postToPid */
|
||||||
|
//CGEventPostToPid(0, pressKey);
|
||||||
usleep(0.05 * NSEC_PER_MSEC);
|
usleep(0.05 * NSEC_PER_MSEC);
|
||||||
CGEventPost(kCGHIDEventTap, releaseKey);
|
CGEventPost(kCGHIDEventTap, releaseKey);
|
||||||
|
/* TODO: Evaluate postToPid */
|
||||||
|
//CGEventPostToPid(0, releaseKey);
|
||||||
usleep(0.05 * NSEC_PER_MSEC);
|
usleep(0.05 * NSEC_PER_MSEC);
|
||||||
|
|
||||||
CFRelease(pressKey);
|
CFRelease(pressKey);
|
||||||
|
|||||||
@@ -51,12 +51,11 @@
|
|||||||
|
|
||||||
- (void)execute {
|
- (void)execute {
|
||||||
if([self.pasteData length] > 0) {
|
if([self.pasteData length] > 0) {
|
||||||
MPPasteBoardController *controller = [MPPasteBoardController defaultController];
|
[MPPasteBoardController.defaultController stashObjects];
|
||||||
[controller stashObjects];
|
[MPPasteBoardController.defaultController copyObjectsWithoutTimeout:@[self.pasteData]];
|
||||||
[controller copyObjectsWithoutTimeout:@[self.pasteData]];
|
|
||||||
[self sendPasteKeyCode];
|
[self sendPasteKeyCode];
|
||||||
usleep(0.1 * NSEC_PER_MSEC); // on 10.10 we need to wait a bit before restoring the pasteboard contents
|
usleep(0.2 * NSEC_PER_MSEC); // on 10.10 we need to wait a bit before restoring the pasteboard contents
|
||||||
[controller restoreObjects];
|
[MPPasteBoardController.defaultController restoreObjects];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -24,7 +24,7 @@
|
|||||||
|
|
||||||
@interface MPOverlayWindowController : NSWindowController
|
@interface MPOverlayWindowController : NSWindowController
|
||||||
|
|
||||||
+ (MPOverlayWindowController *)sharedController;
|
@property (nonatomic, strong, readonly, class) MPOverlayWindowController *sharedController;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Displays an overlay HUD style image with the given text, image centered at the given view.
|
* Displays an overlay HUD style image with the given text, image centered at the given view.
|
||||||
|
|||||||
@@ -56,13 +56,14 @@
|
|||||||
|
|
||||||
- (void)windowDidLoad {
|
- (void)windowDidLoad {
|
||||||
[super windowDidLoad];
|
[super windowDidLoad];
|
||||||
[self.window setStyleMask:NSBorderlessWindowMask];
|
self.window.styleMask = NSBorderlessWindowMask;
|
||||||
[self.window setAlphaValue:0];
|
self.window.alphaValue = 0;
|
||||||
[self.window setOpaque:NO];
|
self.window.opaque = NO;
|
||||||
[self.window setHasShadow:YES];
|
self.window.hasShadow = YES;
|
||||||
[[self.textField cell] setBackgroundStyle:NSBackgroundStyleLowered];
|
|
||||||
[[self.imageView cell] setBackgroundStyle:NSBackgroundStyleDark];
|
self.textField.cell.backgroundStyle = NSBackgroundStyleLowered;
|
||||||
[[self.imageView cell] setImageAlignment:NSImageAlignCenter];
|
self.imageView.cell.backgroundStyle = NSBackgroundStyleDark;
|
||||||
|
((NSImageCell *)self.imageView.cell).imageAlignment = NSImageAlignCenter;
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)displayOverlayImage:(NSImage *)imageOrNil label:(NSString *)labelOrNil atView:(NSView *)view {
|
- (void)displayOverlayImage:(NSImage *)imageOrNil label:(NSString *)labelOrNil atView:(NSView *)view {
|
||||||
|
|||||||
@@ -74,6 +74,7 @@ NSString *const MPPasteBoardControllerDidClearClipboard = @"com.hicknhack.macpas
|
|||||||
for (NSPasteboardItem *item in NSPasteboard.generalPasteboard.pasteboardItems) {
|
for (NSPasteboardItem *item in NSPasteboard.generalPasteboard.pasteboardItems) {
|
||||||
NSPasteboardItem *newItem = [[NSPasteboardItem alloc] init];
|
NSPasteboardItem *newItem = [[NSPasteboardItem alloc] init];
|
||||||
for (NSString *type in item.types) {
|
for (NSString *type in item.types) {
|
||||||
|
/* mutable copy to ensure actual deep copy */
|
||||||
NSData *data = [[item dataForType:type] mutableCopy];
|
NSData *data = [[item dataForType:type] mutableCopy];
|
||||||
if (data) {
|
if (data) {
|
||||||
[newItem setData:data forType:type];
|
[newItem setData:data forType:type];
|
||||||
@@ -118,26 +119,26 @@ NSString *const MPPasteBoardControllerDidClearClipboard = @"com.hicknhack.macpas
|
|||||||
NSString *infoText = nil;
|
NSString *infoText = nil;
|
||||||
switch(overlayInfoType) {
|
switch(overlayInfoType) {
|
||||||
case MPPasteboardOverlayInfoPassword:
|
case MPPasteboardOverlayInfoPassword:
|
||||||
infoImage = [[NSBundle mainBundle] imageForResource:@"00_PasswordTemplate"];
|
infoImage = [NSBundle.mainBundle imageForResource:@"00_PasswordTemplate"];
|
||||||
infoText = NSLocalizedString(@"COPIED_PASSWORD", @"Password was copied to the pasteboard");
|
infoText = NSLocalizedString(@"COPIED_PASSWORD", @"Password was copied to the pasteboard");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case MPPasteboardOverlayInfoURL:
|
case MPPasteboardOverlayInfoURL:
|
||||||
infoImage = [[NSBundle mainBundle] imageForResource:@"01_PackageNetworkTemplate"];
|
infoImage = [NSBundle.mainBundle imageForResource:@"01_PackageNetworkTemplate"];
|
||||||
infoText = NSLocalizedString(@"COPIED_URL", @"URL was copied to the pasteboard");
|
infoText = NSLocalizedString(@"COPIED_URL", @"URL was copied to the pasteboard");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case MPPasteboardOverlayInfoUsername:
|
case MPPasteboardOverlayInfoUsername:
|
||||||
infoImage = [[NSBundle mainBundle] imageForResource:@"09_IdentityTemplate"];
|
infoImage = [NSBundle.mainBundle imageForResource:@"09_IdentityTemplate"];
|
||||||
infoText = NSLocalizedString(@"COPIED_USERNAME", @"Username was copied to the pasteboard");
|
infoText = NSLocalizedString(@"COPIED_USERNAME", @"Username was copied to the pasteboard");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case MPPasteboardOverlayInfoCustom:
|
case MPPasteboardOverlayInfoCustom:
|
||||||
infoImage = [[NSBundle mainBundle] imageForResource:@"00_PasswordTemplate"];
|
infoImage = [NSBundle.mainBundle imageForResource:@"00_PasswordTemplate"];
|
||||||
infoText = [NSString stringWithFormat:NSLocalizedString(@"COPIED_FIELD_%@", "Field name that was copied to the pasteboard"), name];
|
infoText = [NSString stringWithFormat:NSLocalizedString(@"COPIED_FIELD_%@", "Field name that was copied to the pasteboard"), name];
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
[[MPOverlayWindowController sharedController] displayOverlayImage:infoImage label:infoText atView:view];
|
[MPOverlayWindowController.sharedController displayOverlayImage:infoImage label:infoText atView:view];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)_clearPasteboardContents {
|
- (void)_clearPasteboardContents {
|
||||||
|
|||||||