Hotkey settings now actually should work.

This commit is contained in:
michael starke
2014-10-28 23:07:57 +01:00
parent 7f242646da
commit 9da60cdaea
14 changed files with 121 additions and 50 deletions

View File

@@ -184,7 +184,7 @@
4C7714AA176C998F00549F2A /* 43_TrashTemplate.pdf in Resources */ = {isa = PBXBuildFile; fileRef = 4C7714A9176C998F00549F2A /* 43_TrashTemplate.pdf */; };
4C7714AC176C9D4600549F2A /* 99_InfoTemplate.pdf in Resources */ = {isa = PBXBuildFile; fileRef = 4C7714AB176C9D4600549F2A /* 99_InfoTemplate.pdf */; };
4C77547516E55FE800970E02 /* MPInspectorViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C77547416E55FE800970E02 /* MPInspectorViewController.m */; };
4C77C84118E240E000D1C42B /* DDHotKey+Keydata.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C77C84018E240E000D1C42B /* DDHotKey+Keydata.m */; };
4C77C84118E240E000D1C42B /* DDHotKey+MacPassAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C77C84018E240E000D1C42B /* DDHotKey+MacPassAdditions.m */; };
4C77E36715B84A240093A587 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4C77E36615B84A240093A587 /* Cocoa.framework */; };
4C77E37115B84A240093A587 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 4C77E36F15B84A240093A587 /* InfoPlist.strings */; };
4C77E37315B84A240093A587 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C77E37215B84A240093A587 /* main.m */; };
@@ -705,8 +705,8 @@
4C7714AB176C9D4600549F2A /* 99_InfoTemplate.pdf */ = {isa = PBXFileReference; lastKnownFileType = image.pdf; name = 99_InfoTemplate.pdf; path = Icons/99_InfoTemplate.pdf; sourceTree = "<group>"; };
4C77547316E55FE800970E02 /* MPInspectorViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MPInspectorViewController.h; sourceTree = "<group>"; };
4C77547416E55FE800970E02 /* MPInspectorViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MPInspectorViewController.m; sourceTree = "<group>"; };
4C77C83F18E240E000D1C42B /* DDHotKey+Keydata.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "DDHotKey+Keydata.h"; sourceTree = "<group>"; };
4C77C84018E240E000D1C42B /* DDHotKey+Keydata.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "DDHotKey+Keydata.m"; sourceTree = "<group>"; };
4C77C83F18E240E000D1C42B /* DDHotKey+MacPassAdditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "DDHotKey+MacPassAdditions.h"; sourceTree = "<group>"; };
4C77C84018E240E000D1C42B /* DDHotKey+MacPassAdditions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "DDHotKey+MacPassAdditions.m"; sourceTree = "<group>"; };
4C77E36215B84A240093A587 /* MacPass.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = MacPass.app; sourceTree = BUILT_PRODUCTS_DIR; };
4C77E36615B84A240093A587 /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = System/Library/Frameworks/Cocoa.framework; sourceTree = SDKROOT; };
4C77E36915B84A240093A587 /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = System/Library/Frameworks/AppKit.framework; sourceTree = SDKROOT; };
@@ -1098,8 +1098,8 @@
4CC6DB7917D23719002C6091 /* KPKNode+IconImage.m */,
4CEED1C417D7BD0E007180F1 /* NSError+Messages.h */,
4CEED1C517D7BD0E007180F1 /* NSError+Messages.m */,
4C77C83F18E240E000D1C42B /* DDHotKey+Keydata.h */,
4C77C84018E240E000D1C42B /* DDHotKey+Keydata.m */,
4C77C83F18E240E000D1C42B /* DDHotKey+MacPassAdditions.h */,
4C77C84018E240E000D1C42B /* DDHotKey+MacPassAdditions.m */,
);
name = Categories;
sourceTree = "<group>";
@@ -2357,7 +2357,7 @@
4C245B77176E1E3D0086100E /* DDNumber.m in Sources */,
4C245B78176E1E3D0086100E /* DDRange.m in Sources */,
4C94A0721938DDC20040ABAB /* MPDocument+EditingSession.m in Sources */,
4C77C84118E240E000D1C42B /* DDHotKey+Keydata.m in Sources */,
4C77C84118E240E000D1C42B /* DDHotKey+MacPassAdditions.m in Sources */,
4C3C4EA618D6FEA100153127 /* TTTJSONTransformer.m in Sources */,
4C89B71019B4B4A300DC0A6A /* MPTreeDelegate.m in Sources */,
4C88C66918D9F8D600F43852 /* MPTemporaryFileStorageCenter.m in Sources */,

View File

@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="5056" systemVersion="13E28" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="6250" systemVersion="13F34" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
<dependencies>
<deployment defaultVersion="1080" identifier="macosx"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="5056"/>
<deployment identifier="macosx"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="6250"/>
</dependencies>
<objects>
<customObject id="-2" userLabel="File's Owner" customClass="MPIntegrationSettingsController">
@@ -11,25 +11,23 @@
<outlet property="enableQuicklookCheckbutton" destination="LNw-5t-TS4" id="NRN-7y-W0e"/>
<outlet property="enableServerCheckbutton" destination="2" id="17"/>
<outlet property="hotKeyTextField" destination="Kvg-he-3c8" id="c7p-1F-zth"/>
<outlet property="hotkeyWarningTextField" destination="f5q-EW-RHf" id="Z2Q-Sb-HCS"/>
<outlet property="view" destination="1" id="18"/>
</connections>
</customObject>
<customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/>
<customObject id="-3" userLabel="Application"/>
<customObject id="-3" userLabel="Application" customClass="NSObject"/>
<customView translatesAutoresizingMaskIntoConstraints="NO" id="1">
<rect key="frame" x="0.0" y="0.0" width="400" height="281"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<subviews>
<box autoresizesSubviews="NO" verticalHuggingPriority="500" title="Keepass HTTP" borderType="line" translatesAutoresizingMaskIntoConstraints="NO" id="KbH-0Q-5Tw">
<rect key="frame" x="17" y="207" width="366" height="54"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<view key="contentView">
<rect key="frame" x="1" y="1" width="364" height="38"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<button translatesAutoresizingMaskIntoConstraints="NO" id="2">
<rect key="frame" x="16" y="12" width="187" height="18"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<buttonCell key="cell" type="check" title="Enable KeePassHttp server" bezelStyle="regularSquare" imagePosition="left" state="on" inset="2" id="3">
<behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
<font key="font" metaFont="system"/>
@@ -47,14 +45,12 @@
</box>
<box autoresizesSubviews="NO" verticalHuggingPriority="500" title="Autotype" borderType="line" translatesAutoresizingMaskIntoConstraints="NO" id="P9N-HM-wER">
<rect key="frame" x="17" y="118" width="366" height="85"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<view key="contentView">
<rect key="frame" x="1" y="1" width="364" height="69"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<textField verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="Kvg-he-3c8" customClass="DDHotKeyTextField">
<rect key="frame" x="79" y="15" width="89" height="22"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<constraints>
<constraint firstAttribute="width" constant="89" id="Mia-b8-HCZ"/>
</constraints>
@@ -66,7 +62,6 @@
</textField>
<button translatesAutoresizingMaskIntoConstraints="NO" id="tik-Ar-FJg">
<rect key="frame" x="16" y="43" width="168" height="18"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<buttonCell key="cell" type="check" title="Enable global Autotype" bezelStyle="regularSquare" imagePosition="left" state="on" inset="2" id="1qb-Rd-jYu">
<behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
<font key="font" metaFont="system"/>
@@ -74,13 +69,20 @@
</button>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="buI-Wb-o3V">
<rect key="frame" x="16" y="17" width="57" height="17"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="Shortcut" id="6oN-CH-T0O">
<font key="font" metaFont="system"/>
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="f5q-EW-RHf">
<rect key="frame" x="174" y="20" width="127" height="14"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="Shortcut is missing Key" id="Lxp-wI-yQy">
<font key="font" metaFont="smallSystem"/>
<color key="textColor" name="disabledControlTextColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
</subviews>
</view>
<constraints>
@@ -88,7 +90,10 @@
<constraint firstAttribute="trailing" relation="greaterThanOrEqual" secondItem="Kvg-he-3c8" secondAttribute="trailing" constant="26" id="1cu-ot-jaU"/>
<constraint firstAttribute="bottom" secondItem="Kvg-he-3c8" secondAttribute="bottom" constant="12" id="3bK-25-sTQ"/>
<constraint firstItem="buI-Wb-o3V" firstAttribute="baseline" secondItem="Kvg-he-3c8" secondAttribute="baseline" id="49G-2q-5ye"/>
<constraint firstItem="Kvg-he-3c8" firstAttribute="baseline" secondItem="f5q-EW-RHf" secondAttribute="baseline" constant="3" id="ANl-zC-sOX"/>
<constraint firstItem="f5q-EW-RHf" firstAttribute="leading" secondItem="Kvg-he-3c8" secondAttribute="trailing" constant="8" symbolic="YES" id="AkG-U9-TdD"/>
<constraint firstItem="Kvg-he-3c8" firstAttribute="leading" secondItem="buI-Wb-o3V" secondAttribute="trailing" constant="8" symbolic="YES" id="Khi-Pi-iBU"/>
<constraint firstAttribute="trailing" relation="greaterThanOrEqual" secondItem="f5q-EW-RHf" secondAttribute="trailing" constant="26" id="U3J-vD-O03"/>
<constraint firstItem="Kvg-he-3c8" firstAttribute="top" secondItem="tik-Ar-FJg" secondAttribute="bottom" constant="8" symbolic="YES" id="cn1-4v-XHZ"/>
<constraint firstItem="tik-Ar-FJg" firstAttribute="leading" secondItem="buI-Wb-o3V" secondAttribute="leading" id="eVT-oc-Oz8"/>
<constraint firstItem="tik-Ar-FJg" firstAttribute="leading" secondItem="P9N-HM-wER" secondAttribute="leading" constant="16" id="rMB-zA-WBv"/>
@@ -98,14 +103,12 @@
</box>
<box autoresizesSubviews="NO" verticalHuggingPriority="500" title="Preview" borderType="line" translatesAutoresizingMaskIntoConstraints="NO" id="VVs-b5-cX9">
<rect key="frame" x="17" y="16" width="366" height="98"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<view key="contentView">
<rect key="frame" x="1" y="1" width="364" height="82"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<button translatesAutoresizingMaskIntoConstraints="NO" id="LNw-5t-TS4">
<rect key="frame" x="16" y="56" width="183" height="18"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<buttonCell key="cell" type="check" title="Enable Quicklook Preview" bezelStyle="regularSquare" imagePosition="left" state="on" inset="2" id="ERs-ct-Eyx">
<behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
<font key="font" metaFont="system"/>
@@ -113,7 +116,6 @@
</button>
<textField verticalHuggingPriority="750" horizontalCompressionResistancePriority="250" setsMaxLayoutWidthAtFirstLayout="YES" translatesAutoresizingMaskIntoConstraints="NO" id="V6l-R9-hIj">
<rect key="frame" x="16" y="22" width="322" height="28"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<textFieldCell key="cell" controlSize="small" sendsActionOnEndEditing="YES" title="If enabled attached files will be copied to a tempoary location for preview and deleted after the preview is closed." id="WmI-IB-Aso">
<font key="font" metaFont="smallSystem"/>
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
@@ -147,6 +149,7 @@
<constraint firstItem="VVs-b5-cX9" firstAttribute="leading" secondItem="P9N-HM-wER" secondAttribute="leading" id="z4a-9C-78h"/>
<constraint firstAttribute="bottom" secondItem="VVs-b5-cX9" secondAttribute="bottom" constant="20" id="zdK-YX-54I"/>
</constraints>
<point key="canvasLocation" x="403" y="652.5"/>
</customView>
</objects>
</document>

View File

@@ -53,7 +53,7 @@
</textFieldCell>
</textField>
<slider verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="173">
<rect key="frame" x="88" y="220" width="204" height="21"/>
<rect key="frame" x="88" y="220" width="204" height="20"/>
<sliderCell key="cell" state="on" alignment="left" maxValue="100" doubleValue="50" tickMarkPosition="above" sliderType="linear" id="174"/>
</slider>
<textField verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="178">

View File

@@ -8,11 +8,26 @@
#import "DDHotKeyCenter.h"
@interface DDHotKey (Keydata)
@interface DDHotKey (MPKeydata)
@property (readonly, copy) NSData *keyData;
+ (instancetype)defaultHotKey;
+ (instancetype)defaultHotKeyWithTask:(DDHotKeyTask)task;
- (NSData *)keyData;
- (instancetype)initWithKeyData:(NSData *)data task:(DDHotKeyTask)task;
- (instancetype)initWithKeyData:(NSData *)data;
@end
@interface DDHotKey (MPValidation)
/*
A hotkey is considered valid, if the key contains at least a modifier and a non-modifier key.
For example Control+Alt is no valid hotkey, as it's missing a non-modifier. Control+Escape however is valid.
@return YES if the hot key is a valid hotkey, NO otherwise
*/
@property (nonatomic, readonly, getter=isValid) BOOL valid;
@end

View File

@@ -6,10 +6,13 @@
// Copyright (c) 2014 HicknHack Software GmbH. All rights reserved.
//
#import "DDHotKey+Keydata.h"
#import "DDHotKey+MacPassAdditions.h"
#import "MPFlagsHelper.h"
#import <Carbon/Carbon.h>
@implementation DDHotKey (Keydata)
@implementation DDHotKey (MPKeydata)
+ (instancetype)defaultHotKey {
return [DDHotKey defaultHotKeyWithTask:nil];
@@ -59,3 +62,34 @@
return YES;
}
@end
@implementation DDHotKey (MPValidation)
- (BOOL)isValid {
NSEventModifierFlags flags = 0;
switch(self.keyCode) {
case kVK_Command:
flags = NSCommandKeyMask;
break;
case kVK_Shift:
case kVK_RightShift:
flags = NSShiftKeyMask;
break;
case kVK_Option:
case kVK_RightOption:
flags = NSAlternateKeyMask;
break;
case kVK_Control:
case kVK_RightControl:
flags = NSControlKeyMask;
break;
}
BOOL missingModifier = self.modifierFlags == 0;
BOOL onlyModifiers = MPIsFlagSetInOptions(flags, self.modifierFlags) || (self.modifierFlags != 0 && flags != 0);
BOOL isInvalid = onlyModifiers || missingModifier;
NSLog(@"%@ valid:%d", self, !isInvalid);
return !isInvalid;
}
@end

View File

@@ -21,7 +21,8 @@
#import "KPKEntry.h"
#import "DDHotKeyCenter.h"
#import "DDHotKey+Keydata.h"
#import "DDHotKey+MacPassAdditions.h"
#import <Carbon/Carbon.h>
NSString *const kMPWindowTitleKey = @"kMPWindowTitleKey";

View File

@@ -185,7 +185,7 @@ typedef void (^MPPasswordChangedBlock)(BOOL didChangePassword);
- (void)_didUnlockDatabase:(NSNotification *)notification {
[self showEntries];
/* Show password reminders */
[self _presentPasswordIntervalAlters];
[self _presentPasswordIntervalAlerts];
}
#pragma mark Actions
@@ -226,7 +226,7 @@ typedef void (^MPPasswordChangedBlock)(BOOL didChangePassword);
[weakDocument saveDocument:nil];
}
};
[self _presentPasswordIntervalAlters];
[self _presentPasswordIntervalAlerts];
return;
}
/* All set and good ready to save */
@@ -463,7 +463,7 @@ typedef void (^MPPasswordChangedBlock)(BOOL didChangePassword);
}
#pragma mark NSAlert handling
- (void)_presentPasswordIntervalAlters {
- (void)_presentPasswordIntervalAlerts {
MPDocument *document = [self document];
if(document.shouldEnforcePasswordChange) {
NSAlert *alert = [[NSAlert alloc] init];

View File

@@ -17,5 +17,6 @@
@property (weak) IBOutlet NSButton *enableGlobalAutotypeCheckbutton;
@property (weak) IBOutlet NSButton *enableQuicklookCheckbutton;
@property (weak) IBOutlet DDHotKeyTextField *hotKeyTextField;
@property (weak) IBOutlet NSTextField *hotkeyWarningTextField;
@end

View File

@@ -11,7 +11,7 @@
#import "MPIconHelper.h"
#import "DDHotKeyCenter.h"
#import "DDHotKey+Keydata.h"
#import "DDHotKey+MacPassAdditions.h"
#import "DDHotKeyTextField.h"
@interface MPIntegrationSettingsController ()
@@ -39,7 +39,6 @@
}
- (void)awakeFromNib {
self.hotKey = [DDHotKey defaultHotKey];
NSUserDefaultsController *defaultsController = [NSUserDefaultsController sharedUserDefaultsController];
NSString *serverKeyPath = [MPSettingsHelper defaultControllerPathForKey:kMPSettingsKeyEnableHttpServer];
NSString *enableGlobalAutotypeKeyPath = [MPSettingsHelper defaultControllerPathForKey:kMPSettingsKeyEnableGlobalAutotype];
@@ -49,25 +48,40 @@
[self.enableGlobalAutotypeCheckbutton bind:NSValueBinding toObject:defaultsController withKeyPath:enableGlobalAutotypeKeyPath options:nil];
[self.enableQuicklookCheckbutton bind:NSValueBinding toObject:defaultsController withKeyPath:quicklookKeyPath options:nil];
[self.hotKeyTextField bind:NSEnabledBinding toObject:defaultsController withKeyPath:enableGlobalAutotypeKeyPath options:nil];
self.hotKeyTextField.hotKey = self.hotKey;
self.hotKeyTextField.delegate = self;
[self _showWarning:NO];
}
- (void)willShowTab {
_hotKey = [[DDHotKey alloc] initWithKeyData:[[NSUserDefaults standardUserDefaults] dataForKey:kMPSettingsKeyGlobalAutotypeKeyDataKey]];
/* Change any invalid hotkeys to valid ones? */
self.hotKeyTextField.hotKey = self.hotKey;
}
#pragma mark -
#pragma mark Properties
- (void)setHotKey:(DDHotKey *)hotKey {
static NSData *defaultHotKeyData = nil;
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
defaultHotKeyData = [[DDHotKey defaultHotKey] keyData];
});
NSData *newData = [hotKey keyData];
if(![newData isEqualToData:defaultHotKeyData]) {
[[NSUserDefaults standardUserDefaults] setObject:newData forKey:kMPSettingsKeyGlobalAutotypeKeyDataKey];
if([self.hotKey isEqual:hotKey]) {
return; // Nothing of interest has changed;
}
_hotKey = hotKey;
[[NSUserDefaults standardUserDefaults] setObject:self.hotKey.keyData forKey:kMPSettingsKeyGlobalAutotypeKeyDataKey];
}
#pragma mark -
#pragma mark NSTextFieldDelegate
- (void)controlTextDidChange:(NSNotification *)obj {
NSLog(@"controlTextDidChange:");
BOOL validHotKey = self.hotKeyTextField.hotKey.valid;
[self _showWarning:!validHotKey];
if(validHotKey) {
self.hotKey = self.hotKeyTextField.hotKey;
}
}
- (void)_showWarning:(BOOL)show {
self.hotkeyWarningTextField.hidden = !show;
}
@end

View File

@@ -9,6 +9,7 @@
#import "MPSettingsHelper.h"
#import "NSString+MPPasswordCreation.h"
#import "MPEntryViewController.h" // Sort descriptors
#import "DDHotKey+MacPassAdditions.h" // Default hotkey;
NSString *const kMPSettingsKeyPasteboardClearTimeout = @"ClipboardClearTimeout";
NSString *const kMPSettingsKeyClearPasteboardOnQuit = @"ClearClipboardOnQuit";
@@ -102,6 +103,7 @@ NSString *const kMPDeprecatedSettingsKeyEntrySearchFilterMode = @"En
kMPSettingsKeyRememberKeyFilesForDatabases: @NO,
kMPSettingsKeySendCommandForControlKey: @YES,
kMPSettingsKeyEnableGlobalAutotype: @NO,
kMPSettingsKeyGlobalAutotypeKeyDataKey: [[DDHotKey defaultHotKey] keyData],
kMPSettingsKeyDefaultGlobalAutotypeSequence: @"{USERNAME}{TAB}{PASSWORD}{ENTER}",
kMPSettingsKeyEnableQuicklookPreview: @NO,
kMPSettingsKeyCopyGeneratedPasswordToClipboard: @NO,

View File

@@ -21,8 +21,8 @@
- (NSString *)label;
- (NSImage *)image;
/* Called when the tab is about to be selected and displayed */
- (void)willSelectTab;
- (void)willShowTab;
/* Called whent the tab was selected and is being displayed */
- (void)didSelectTab;
- (void)didShowTab;
@end

View File

@@ -63,9 +63,6 @@
NSLog(@"Warning. Unknow settingscontroller for identifier: %@. Did you miss to add the controller?", identifier);
return;
}
if([tab respondsToSelector:@selector(willSelectTab)]) {
[tab willSelectTab];
}
[self.toolbar setSelectedItemIdentifier:identifier];
if([tab respondsToSelector:@selector(label)]) {
[[self window] setTitle:[tab label]];
@@ -73,7 +70,11 @@
else {
[[self window] setTitle:[tab identifier]];
}
/* Access the view before calling the willShoTab to make sure the view is fully loaded */
NSView *tabView = [(NSViewController *)tab view];
if([tab respondsToSelector:@selector(willShowTab)]) {
[tab willShowTab];
}
NSView *contentView = [[self window] contentView];
if( [[contentView subviews] count] == 1) {
[[contentView subviews][0] removeFromSuperview];
@@ -90,8 +91,8 @@
views:NSDictionaryOfVariableBindings(tabView)]];
[contentView layoutSubtreeIfNeeded];
if([tab respondsToSelector:@selector(didSelectTab)]) {
[tab didSelectTab];
if([tab respondsToSelector:@selector(didShowTab)]) {
[tab didShowTab];
}
[[self window] makeKeyAndOrderFront:[self window]];
}

View File

@@ -42,7 +42,7 @@
return NSLocalizedString(@"WORKFLOW_SETTINGS", "");
}
- (void)willSelectTab {
- (void)willShowTab {
[self _updateBrowserSelection];
}

View File

@@ -54,7 +54,7 @@
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>2536</string>
<string>2537</string>
<key>LSMinimumSystemVersion</key>
<string>${MACOSX_DEPLOYMENT_TARGET}</string>
<key>NSHumanReadableCopyright</key>