mirror of
https://github.com/MacPass/MacPass.git
synced 2025-12-13 21:42:32 +00:00
Preparations to save global hotkey for auto type in preferences
This commit is contained in:
@@ -179,6 +179,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 */; };
|
||||
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 */; };
|
||||
@@ -679,6 +680,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>"; };
|
||||
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; };
|
||||
@@ -1044,6 +1047,8 @@
|
||||
4CC6DB7917D23719002C6091 /* KPKNode+IconImage.m */,
|
||||
4CEED1C417D7BD0E007180F1 /* NSError+Messages.h */,
|
||||
4CEED1C517D7BD0E007180F1 /* NSError+Messages.m */,
|
||||
4C77C83F18E240E000D1C42B /* DDHotKey+Keydata.h */,
|
||||
4C77C84018E240E000D1C42B /* DDHotKey+Keydata.m */,
|
||||
);
|
||||
name = Categories;
|
||||
sourceTree = "<group>";
|
||||
@@ -2264,6 +2269,7 @@
|
||||
4C245B76176E1E3D0086100E /* DDData.m in Sources */,
|
||||
4C245B77176E1E3D0086100E /* DDNumber.m in Sources */,
|
||||
4C245B78176E1E3D0086100E /* DDRange.m in Sources */,
|
||||
4C77C84118E240E000D1C42B /* DDHotKey+Keydata.m in Sources */,
|
||||
4C3C4EA618D6FEA100153127 /* TTTJSONTransformer.m in Sources */,
|
||||
4C88C66918D9F8D600F43852 /* MPTemporaryFileStorageCenter.m in Sources */,
|
||||
4C245B79176E1E3D0086100E /* HTTPAuthenticationRequest.m in Sources */,
|
||||
|
||||
16
MacPass/DDHotKey+Keydata.h
Normal file
16
MacPass/DDHotKey+Keydata.h
Normal file
@@ -0,0 +1,16 @@
|
||||
//
|
||||
// DDHotKey+Coding.h
|
||||
// MacPass
|
||||
//
|
||||
// Created by Michael Starke on 25/03/14.
|
||||
// Copyright (c) 2014 HicknHack Software GmbH. All rights reserved.
|
||||
//
|
||||
|
||||
#import "DDHotKeyCenter.h"
|
||||
|
||||
@interface DDHotKey (Keydata)
|
||||
|
||||
- (NSData *)keyData;
|
||||
- (instancetype)initWithKeyData:(NSData *)data;
|
||||
|
||||
@end
|
||||
30
MacPass/DDHotKey+Keydata.m
Normal file
30
MacPass/DDHotKey+Keydata.m
Normal file
@@ -0,0 +1,30 @@
|
||||
//
|
||||
// DDHotKey+Coding.m
|
||||
// MacPass
|
||||
//
|
||||
// Created by Michael Starke on 25/03/14.
|
||||
// Copyright (c) 2014 HicknHack Software GmbH. All rights reserved.
|
||||
//
|
||||
|
||||
#import "DDHotKey+Keydata.h"
|
||||
|
||||
@implementation DDHotKey (Keydata)
|
||||
|
||||
- (instancetype)initWithKeyData:(NSData *)data {
|
||||
NSKeyedUnarchiver *unarchiver = [[NSKeyedUnarchiver alloc] initForReadingWithData:data];
|
||||
unsigned short keyCode = [unarchiver decodeIntForKey:NSStringFromSelector(@selector(keyCode))];
|
||||
NSUInteger modiferFlags = [unarchiver decodeIntegerForKey:NSStringFromSelector(@selector(modifierFlags))];
|
||||
self = [DDHotKey hotKeyWithKeyCode:keyCode modifierFlags:modiferFlags task:nil];
|
||||
return self;
|
||||
}
|
||||
|
||||
- (NSData *)keyData {
|
||||
NSMutableData *data = [[NSMutableData alloc] init];
|
||||
NSKeyedArchiver *archiver = [[NSKeyedArchiver alloc] initForWritingWithMutableData:data];
|
||||
[archiver encodeInt:self.keyCode forKey:NSStringFromSelector(@selector(keyCode))];
|
||||
[archiver encodeInteger:self.modifierFlags forKey:NSStringFromSelector(@selector(modifierFlags))];
|
||||
[archiver finishEncoding];
|
||||
return [data copy];
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -49,6 +49,7 @@ APPKIT_EXTERN NSString *const kMPSettingsKeyRememberKeyFilesForDatabases;
|
||||
/* Autotype */
|
||||
APPKIT_EXTERN NSString *const kMPSettingsKeySendCommandForControlKey;
|
||||
APPKIT_EXTERN NSString *const kMPSettingsKeyEnableGlobalAutotype;
|
||||
APPKIT_EXTERN NSString *const kMPSettingsKeyGlobalAutotypeKeyKey;
|
||||
|
||||
/* Search */
|
||||
APPKIT_EXTERN NSString *const kMPSettingsKeyEntrySearchFilterMode;
|
||||
|
||||
@@ -34,6 +34,7 @@ NSString *const kMPSettingsKeyRememberKeyFilesForDatabases = @"RememberKeyFiles
|
||||
|
||||
NSString *const kMPSettingsKeySendCommandForControlKey = @"SendCommandKeyForControlKey";
|
||||
NSString *const kMPSettingsKeyEnableGlobalAutotype = @"EnableGlobalAutotype";
|
||||
NSString *const kMPSettingsKeyGlobalAutotypeKeyKey = @"GlobalAutotypeKey";
|
||||
|
||||
NSString *const kMPSettingsKeyEntrySearchFilterMode = @"EntrySearchFilterMode";
|
||||
|
||||
|
||||
Reference in New Issue
Block a user