From ad07c0de6c0bf7b1482a734fcd464453b0365659 Mon Sep 17 00:00:00 2001 From: Kurt Date: Mon, 29 Jul 2013 21:31:29 -0400 Subject: [PATCH] Adding a setting to enable launching URLs on double-click --- MacPass/Base.lproj/GeneralSettings.xib | 416 ++++++++++++++++++----- MacPass/MPEntryViewController.m | 6 +- MacPass/MPGeneralSettingsController.h | 1 + MacPass/MPGeneralSettingsController.m | 2 + MacPass/MPSettingsHelper.h | 1 + MacPass/MPSettingsHelper.m | 2 + MacPass/SettingsWindow.xib | 6 +- MacPass/de.lproj/GeneralSettings.strings | 6 + MacPass/en.lproj/GeneralSettings.strings | 6 + 9 files changed, 357 insertions(+), 89 deletions(-) diff --git a/MacPass/Base.lproj/GeneralSettings.xib b/MacPass/Base.lproj/GeneralSettings.xib index 7440c042..24140ec9 100644 --- a/MacPass/Base.lproj/GeneralSettings.xib +++ b/MacPass/Base.lproj/GeneralSettings.xib @@ -126,7 +126,7 @@ _NS:11 - {{17, 157}, {366, 74}} + {{17, 213}, {366, 74}} @@ -172,7 +172,7 @@ 268 - {{15, 93}, {124, 17}} + {{15, 91}, {124, 17}} @@ -209,7 +209,7 @@ 268 - {{179, 90}, {170, 22}} + {{179, 88}, {170, 22}} @@ -299,7 +299,7 @@ 268 - {{31, 69}, {172, 18}} + {{31, 67}, {172, 18}} @@ -411,7 +411,7 @@ 268 - {{31, 12}, {122, 18}} + {{31, 14}, {122, 18}} _NS:9 @@ -456,14 +456,14 @@ NO - {{1, 1}, {364, 121}} + {{1, 1}, {364, 119}} _NS:11 - {{17, 16}, {366, 137}} + {{17, 16}, {366, 135}} @@ -488,8 +488,74 @@ 2 NO + + + 12 + + + + 274 + + + + 268 + {{16, 12}, {234, 18}} + + + _NS:9 + {250, 252} + YES + + 67108864 + 268435456 + Double-click entry URL to Launch + + _NS:9 + + 1211912448 + 2 + + + + + 200 + 25 + + NO + + + {{1, 1}, {364, 38}} + + + + _NS:11 + + + {{17, 155}, {366, 54}} + + + + _NS:9 + {0, 0} + + 67108864 + 0 + General + + + + 3 + MCAwLjgwMDAwMDAxMTkAA + + + + 1 + 0 + 2 + NO + - {400, 251} + {400, 307} @@ -554,6 +620,14 @@ 920 + + + doubleClickURLToLaunchCheckButton + + + + 958 + @@ -585,27 +659,43 @@ 1 - + 4 0 4 1 - + 20 1000 - 8 - 29 + 9 + 40 3 - + 3 0 - + + 3 + 1 + + 156 + + 1000 + + 3 + 9 + 3 + + + + 3 + 0 + 4 1 @@ -613,8 +703,8 @@ 1000 - 9 - 40 + 6 + 24 3 @@ -649,6 +739,54 @@ 40 3 + + + 6 + 0 + + 6 + 1 + + 20 + + 1000 + + 8 + 29 + 3 + + + + 5 + 0 + + 5 + 1 + + 20 + + 1000 + + 8 + 29 + 3 + + + + 3 + 0 + + 4 + 1 + + 8 + + 1000 + + 6 + 24 + 3 + 3 @@ -705,7 +843,7 @@ 0 1 - 251 + 307 1000 @@ -729,8 +867,9 @@ 40 1 - + + @@ -754,22 +893,6 @@ 29 3 - - - 4 - 0 - - 4 - 1 - - 33 - - 1000 - - 3 - 9 - 3 - 4 @@ -834,6 +957,38 @@ 24 2 + + + 4 + 0 + + 4 + 1 + + 13 + + 1000 + + 3 + 9 + 3 + + + + 3 + 0 + + 4 + 1 + + 8 + + 1000 + + 6 + 24 + 3 + 5 @@ -850,22 +1005,6 @@ 24 2 - - - 4 - 0 - - 4 - 1 - - 11 - - 1000 - - 8 - 29 - 3 - 4 @@ -981,9 +1120,9 @@ + - @@ -1193,11 +1332,6 @@ - - 801 - - - 803 @@ -1221,21 +1355,11 @@ - - 788 - - - 861 - - 862 - - - 867 @@ -1431,21 +1555,11 @@ - - 906 - - - 916 - - 917 - - - 918 @@ -1456,6 +1570,114 @@ + + 788 + + + + + 928 + + + + + 4 + 0 + + 4 + 1 + + 11 + + 1000 + + 9 + 40 + 3 + + + + 5 + 0 + + 5 + 1 + + 16 + + 1000 + + 8 + 29 + 3 + + + + + + + 935 + + + + + 933 + + + + + 929 + + + + + + + + 937 + + + + + 944 + + + + + 945 + + + + + 947 + + + + + 949 + + + + + 950 + + + + + 952 + + + + + 953 + + + + + 956 + + + @@ -1468,10 +1690,14 @@ + + + - - + + + @@ -1507,13 +1733,13 @@ - + + - @@ -1538,14 +1764,12 @@ 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 com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin @@ -1574,17 +1798,34 @@ 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 + 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 - 920 + 958 @@ -1595,6 +1836,7 @@ NSButton NSPopUpButton NSButton + NSButton NSPopUpButton NSButton NSButton @@ -1612,6 +1854,10 @@ createUntitledOnActivation NSButton + + doubleClickURLToLaunchCheckButton + NSButton + idleTimeOutPopup NSPopUpButton diff --git a/MacPass/MPEntryViewController.m b/MacPass/MPEntryViewController.m index 988edc1e..1f061668 100644 --- a/MacPass/MPEntryViewController.m +++ b/MacPass/MPEntryViewController.m @@ -17,6 +17,7 @@ #import "MPContextMenuHelper.h" #import "MPActionHelper.h" +#import "MPSettingsHelper.h" #import "MPConstants.h" #import "MPEntryTableDataSource.h" #import "MPStringLengthValueTransformer.h" @@ -633,7 +634,10 @@ NSString *const _toggleFilterUsernameButton = @"SearchUsername"; [self copyUsername:nil]; } else if([identifier isEqualToString:MPEntryTableURLColumnIdentifier]) { - [self copyURL:nil]; + if([[NSUserDefaults standardUserDefaults] boolForKey:kMPSettingsKeyDoubleClickURLToLaunch]) + [self openURL:nil]; + else + [self copyURL:nil]; } } diff --git a/MacPass/MPGeneralSettingsController.h b/MacPass/MPGeneralSettingsController.h index 3c92b34e..99d1d1b7 100644 --- a/MacPass/MPGeneralSettingsController.h +++ b/MacPass/MPGeneralSettingsController.h @@ -13,6 +13,7 @@ @interface MPGeneralSettingsController : MPViewController @property (weak) IBOutlet NSButton *clearPasteboardOnQuitCheckButton; +@property (weak) IBOutlet NSButton *doubleClickURLToLaunchCheckButton; @property (weak) IBOutlet NSPopUpButton *clearPasteboardTimeoutPopup; @property (weak) IBOutlet NSPopUpButton *idleTimeOutPopup; @property (weak) IBOutlet NSButton *lockOnSleepCheckButton; diff --git a/MacPass/MPGeneralSettingsController.m b/MacPass/MPGeneralSettingsController.m index 84b59b12..8b39da1b 100644 --- a/MacPass/MPGeneralSettingsController.m +++ b/MacPass/MPGeneralSettingsController.m @@ -35,10 +35,12 @@ NSString *const MPGeneralSetingsIdentifier = @"GeneralSettingsTab"; NSString *reopenLastFilePath = [NSString stringWithFormat:@"values.%@", kMPSettingsKeyReopenLastDatabaseOnLaunch]; //NSString *createUntitledOnActivatePaht = [NSString stringWithFormat:@"values.%@", kMPSettingsKeyOpenEmptyDatabaseOnLaunch]; NSString *clearPasteboardKeyPath = [NSString stringWithFormat:@"values.%@", kMPSettingsKeyClearPasteboardOnQuit]; + NSString *doubleClickURLToLaunchKeyPath = [NSString stringWithFormat:@"values.%@", kMPSettingsKeyDoubleClickURLToLaunch]; NSString *clearPasteboardTimeOutKeyPath = [NSString stringWithFormat:@"values.%@", kMPSettingsKeyPasteboardClearTimeout]; NSString *idleTimeOutKeyPath = [NSString stringWithFormat:@"values.%@", kMPSettingsKeyIdleLockTimeOut]; NSString *lockOnSleepKeyPath = [NSString stringWithFormat:@"values.%@", kMPSettingsKeyLockOnSleep]; [self.clearPasteboardOnQuitCheckButton bind:NSValueBinding toObject:defaultsController withKeyPath:clearPasteboardKeyPath options:nil]; + [self.doubleClickURLToLaunchCheckButton bind:NSValueBinding toObject:defaultsController withKeyPath:doubleClickURLToLaunchKeyPath options:nil]; [self.clearPasteboardTimeoutPopup bind:NSSelectedTagBinding toObject:defaultsController withKeyPath:clearPasteboardTimeOutKeyPath options:nil]; [self.lockOnSleepCheckButton bind:NSValueBinding toObject:defaultsController withKeyPath:lockOnSleepKeyPath options:nil]; [self.idleTimeOutPopup bind:NSSelectedTagBinding toObject:defaultsController withKeyPath:idleTimeOutKeyPath options:nil]; diff --git a/MacPass/MPSettingsHelper.h b/MacPass/MPSettingsHelper.h index 2bd5ee9c..48245e88 100644 --- a/MacPass/MPSettingsHelper.h +++ b/MacPass/MPSettingsHelper.h @@ -16,6 +16,7 @@ APPKIT_EXTERN NSString *const kMPSettingsKeyClearPasteboardOnQuit; APPKIT_EXTERN NSString *const kMPSettingsKeyPasswordEncoding; APPKIT_EXTERN NSString *const kMPSettingsKeyOpenEmptyDatabaseOnLaunch; APPKIT_EXTERN NSString *const kMPSettingsKeyReopenLastDatabaseOnLaunch; +APPKIT_EXTERN NSString *const kMPSettingsKeyDoubleClickURLToLaunch; /* Server Settings */ APPKIT_EXTERN NSString *const kMPSettingsKeyHttpPort; diff --git a/MacPass/MPSettingsHelper.m b/MacPass/MPSettingsHelper.m index 5db6dcd8..4ceb2bf0 100644 --- a/MacPass/MPSettingsHelper.m +++ b/MacPass/MPSettingsHelper.m @@ -10,6 +10,7 @@ NSString *const kMPSettingsKeyPasteboardClearTimeout = @"ClipboardClearTimeout"; NSString *const kMPSettingsKeyClearPasteboardOnQuit = @"ClearClipboardOnQuit"; +NSString *const kMPSettingsKeyDoubleClickURLToLaunch = @"DoubleClickURLToLaunch"; NSString *const kMPSettingsKeyOpenEmptyDatabaseOnLaunch = @"OpenEmptyDatabaseOnLaunch"; NSString *const kMPSettingsKeyReopenLastDatabaseOnLaunch = @"ReopenLastDatabaseOnLaunch"; NSString *const kMPSettingsKeyHttpPort =@"HttpPort"; @@ -38,6 +39,7 @@ NSString *const kMPSettingsKeyLastDatabasePath = @"MPLastDatabasePath"; kMPSettingsKeyShowInspector: @YES, // Show the Inspector by default kMPSettingsKeyPasteboardClearTimeout: @30, // 30 seconds kMPSettingsKeyClearPasteboardOnQuit: @YES, + kMPSettingsKeyDoubleClickURLToLaunch: @NO, kMPSettingsKeyOpenEmptyDatabaseOnLaunch: @NO, kMPSettingsKeyReopenLastDatabaseOnLaunch: @YES, kMPSettingsKeyHttpPort: @19455, diff --git a/MacPass/SettingsWindow.xib b/MacPass/SettingsWindow.xib index 4eb407b1..bcfd5942 100644 --- a/MacPass/SettingsWindow.xib +++ b/MacPass/SettingsWindow.xib @@ -35,7 +35,7 @@ 7 2 - {{196, 240}, {400, 200}} + {{196, 240}, {400, 300}} 544736256 Window NSWindow @@ -45,11 +45,11 @@ 256 - {400, 200} + {400, 300} - {{0, 0}, {1920, 1058}} + {{0, 0}, {1680, 1028}} {10000000000000, 10000000000000} YES diff --git a/MacPass/de.lproj/GeneralSettings.strings b/MacPass/de.lproj/GeneralSettings.strings index eaa66e6d..bda05754 100644 --- a/MacPass/de.lproj/GeneralSettings.strings +++ b/MacPass/de.lproj/GeneralSettings.strings @@ -26,6 +26,12 @@ /* Class = "NSButtonCell"; title = "Reopen last Database after Launch"; ObjectID = "531"; */ "531.title" = "Letzte Datenbank beim Start wieder öffnen"; +/* Class = "NSBox"; title = "General"; ObjectID = "928"; */ +"928.title" = "Allgemeine"; + +/* Class = "NSButtonCell"; title = "Double-click entry URL to Launch"; ObjectID = "937"; */ +"937.title" = "Doppelklicken Sie auf Eintrag URL zu öffnen"; + /* Class = "NSMenu"; title = "LockTimes"; ObjectID = "586"; */ "586.title" = "LockTimes"; diff --git a/MacPass/en.lproj/GeneralSettings.strings b/MacPass/en.lproj/GeneralSettings.strings index d9c79ab5..129cefe2 100644 --- a/MacPass/en.lproj/GeneralSettings.strings +++ b/MacPass/en.lproj/GeneralSettings.strings @@ -26,6 +26,12 @@ /* Class = "NSButtonCell"; title = "Reopen last Database after Launch"; ObjectID = "531"; */ "531.title" = "Reopen last Database after Launch"; +/* Class = "NSBox"; title = "General"; ObjectID = "928"; */ +"928.title" = "General"; + +/* Class = "NSButtonCell"; title = "Double-click entry URL to Launch"; ObjectID = "937"; */ +"937.title" = "Double-click entry URL to Launch"; + /* Class = "NSMenu"; title = "LockTimes"; ObjectID = "586"; */ "586.title" = "LockTimes";