Reformat to AppCode style.
This commit is contained in:
@@ -30,8 +30,8 @@
|
||||
|
||||
[[NSNotificationCenter defaultCenter] addObserverForName:NSWindowWillCloseNotification object:self.window
|
||||
queue:nil usingBlock:^(NSNotification *note) {
|
||||
[MPMacAppDelegate get].initialWindowController = nil;
|
||||
}];
|
||||
[MPMacAppDelegate get].initialWindowController = nil;
|
||||
}];
|
||||
}
|
||||
|
||||
#pragma mark - Actions
|
||||
|
@@ -123,12 +123,10 @@ static OSStatus MPHotKeyHander(EventHandlerCallRef nextHandler, EventRef theEven
|
||||
^(MPMacAppDelegate *self, NSNotification *note) {
|
||||
PearlMainQueue( ^{
|
||||
NSString *key = note.object;
|
||||
if (!key || [key isEqualToString:NSStringFromSelector( @
|
||||
selector( hidePasswords ) )])
|
||||
self.hidePasswordsItem.state = [[MPConfig get].hidePasswords boolValue]? NSOnState: NSOffState;
|
||||
if (!key || [key isEqualToString:NSStringFromSelector( @
|
||||
selector( rememberLogin ) )])
|
||||
self.rememberPasswordItem.state = [[MPConfig get].rememberLogin boolValue]? NSOnState: NSOffState;
|
||||
if (!key || [key isEqualToString:NSStringFromSelector( @selector( hidePasswords ) )])
|
||||
self.hidePasswordsItem.state = [[MPConfig get].hidePasswords boolValue]? NSOnState: NSOffState;
|
||||
if (!key || [key isEqualToString:NSStringFromSelector( @selector( rememberLogin ) )])
|
||||
self.rememberPasswordItem.state = [[MPConfig get].rememberLogin boolValue]? NSOnState: NSOffState;
|
||||
} );
|
||||
} );
|
||||
[self updateUsers];
|
||||
@@ -136,7 +134,8 @@ static OSStatus MPHotKeyHander(EventHandlerCallRef nextHandler, EventRef theEven
|
||||
// Global hotkey.
|
||||
EventHotKeyRef hotKeyRef;
|
||||
EventTypeSpec hotKeyEvents[1] = { { .eventClass = kEventClassKeyboard, .eventKind = kEventHotKeyPressed } };
|
||||
OSStatus status = InstallApplicationEventHandler( NewEventHandlerUPP( MPHotKeyHander ), GetEventTypeCount( hotKeyEvents ), hotKeyEvents, (__bridge void *)self, NULL );
|
||||
OSStatus status = InstallApplicationEventHandler( NewEventHandlerUPP( MPHotKeyHander ), GetEventTypeCount( hotKeyEvents ), hotKeyEvents,
|
||||
(__bridge void *)self, NULL );
|
||||
if (status != noErr)
|
||||
err( @"Error installing application event handler: %i", (int)status );
|
||||
status = RegisterEventHotKey( 35 /* p */, controlKey + cmdKey, MPShowHotKey, GetApplicationEventTarget(), 0, &hotKeyRef );
|
||||
@@ -318,17 +317,17 @@ static OSStatus MPHotKeyHander(EventHandlerCallRef nextHandler, EventRef theEven
|
||||
break;
|
||||
case MPImportResultInternalError:
|
||||
[[NSAlert alertWithError:[NSError errorWithDomain:MPErrorDomain code:0 userInfo:@{
|
||||
NSLocalizedDescriptionKey : @"Import failed because of an internal error."
|
||||
NSLocalizedDescriptionKey: @"Import failed because of an internal error."
|
||||
}]] runModal];
|
||||
break;
|
||||
case MPImportResultMalformedInput:
|
||||
[[NSAlert alertWithError:[NSError errorWithDomain:MPErrorDomain code:0 userInfo:@{
|
||||
NSLocalizedDescriptionKey : @"The import doesn't look like a Master Password export."
|
||||
NSLocalizedDescriptionKey: @"The import doesn't look like a Master Password export."
|
||||
}]] runModal];
|
||||
break;
|
||||
case MPImportResultInvalidPassword:
|
||||
[[NSAlert alertWithError:[NSError errorWithDomain:MPErrorDomain code:0 userInfo:@{
|
||||
NSLocalizedDescriptionKey : @"Incorrect master password for the import sites."
|
||||
NSLocalizedDescriptionKey: @"Incorrect master password for the import sites."
|
||||
}]] runModal];
|
||||
break;
|
||||
}
|
||||
@@ -441,7 +440,7 @@ static OSStatus MPHotKeyHander(EventHandlerCallRef nextHandler, EventRef theEven
|
||||
|
||||
prof_new( @"showPasswordWindow" );
|
||||
[NSApp activateIgnoringOtherApps:YES];
|
||||
prof_rewind(@"activateIgnoringOtherApps");
|
||||
prof_rewind( @"activateIgnoringOtherApps" );
|
||||
|
||||
// If no user, can't activate.
|
||||
if (![self activeUserForMainThread]) {
|
||||
|
@@ -5,7 +5,7 @@
|
||||
|
||||
#import "MPMacApplication.h"
|
||||
|
||||
@interface NSResponder (Editing)
|
||||
@interface NSResponder(Editing)
|
||||
|
||||
- (void)undo:(id)sender;
|
||||
- (void)redo:(id)sender;
|
||||
|
@@ -17,8 +17,8 @@
|
||||
return self;
|
||||
|
||||
[self.defaults registerDefaults:@{
|
||||
NSStringFromSelector( @selector( appleID ) ) : @"510296984",
|
||||
NSStringFromSelector( @selector( fullScreen ) ) : @YES,
|
||||
NSStringFromSelector( @selector( appleID ) ) : @"510296984",
|
||||
NSStringFromSelector( @selector( fullScreen ) ): @YES,
|
||||
}];
|
||||
|
||||
return self;
|
||||
|
@@ -18,6 +18,5 @@
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
|
||||
@interface MPNoStateButtonCell : NSButtonCell
|
||||
@end
|
||||
|
@@ -18,9 +18,7 @@
|
||||
|
||||
#import "MPNoStateButton.h"
|
||||
|
||||
|
||||
@implementation MPNoStateButtonCell {
|
||||
|
||||
}
|
||||
|
||||
- (void)setState:(NSInteger)state {
|
||||
|
@@ -18,7 +18,6 @@
|
||||
|
||||
#import <Cocoa/Cocoa.h>
|
||||
|
||||
|
||||
@interface MPPasswordWindow : NSWindow
|
||||
|
||||
@end
|
||||
|
@@ -37,7 +37,7 @@
|
||||
}
|
||||
else if (self.level != NSNormalWindowLevel) {
|
||||
[self setLevel:NSNormalWindowLevel];
|
||||
[self setFrame:NSMakeRect( 0, 0, 640, 600) display:NO];
|
||||
[self setFrame:NSMakeRect( 0, 0, 640, 600 ) display:NO];
|
||||
[self center];
|
||||
}
|
||||
|
||||
|
@@ -173,7 +173,7 @@
|
||||
[self.progressView stopAnimation:self];
|
||||
if (!success)
|
||||
[[NSAlert alertWithError:[NSError errorWithDomain:MPErrorDomain code:0 userInfo:@{
|
||||
NSLocalizedDescriptionKey : strf( @"Incorrect master password for user %@", userName )
|
||||
NSLocalizedDescriptionKey: strf( @"Incorrect master password for user %@", userName )
|
||||
}]] beginSheetModalForWindow:self.window completionHandler:nil];
|
||||
} );
|
||||
}];
|
||||
|
@@ -25,25 +25,25 @@
|
||||
|
||||
@interface MPSiteModel : NSObject
|
||||
|
||||
@property (nonatomic) NSString *name;
|
||||
@property (nonatomic) NSAttributedString *displayedName;
|
||||
@property (nonatomic) MPSiteType type;
|
||||
@property (nonatomic) NSString *typeName;
|
||||
@property (nonatomic) NSString *content;
|
||||
@property (nonatomic) NSString *displayedContent;
|
||||
@property (nonatomic) NSString *question;
|
||||
@property (nonatomic) NSString *answer;
|
||||
@property (nonatomic) NSString *loginName;
|
||||
@property (nonatomic) BOOL loginGenerated;
|
||||
@property (nonatomic) NSNumber *uses;
|
||||
@property (nonatomic) NSUInteger counter;
|
||||
@property (nonatomic) NSDate *lastUsed;
|
||||
@property (nonatomic) id<MPAlgorithm> algorithm;
|
||||
@property (nonatomic) MPAlgorithmVersion algorithmVersion;
|
||||
@property (nonatomic, readonly) BOOL outdated;
|
||||
@property (nonatomic, readonly) BOOL generated;
|
||||
@property (nonatomic, readonly) BOOL stored;
|
||||
@property (nonatomic, readonly) BOOL transient;
|
||||
@property(nonatomic) NSString *name;
|
||||
@property(nonatomic) NSAttributedString *displayedName;
|
||||
@property(nonatomic) MPSiteType type;
|
||||
@property(nonatomic) NSString *typeName;
|
||||
@property(nonatomic) NSString *content;
|
||||
@property(nonatomic) NSString *displayedContent;
|
||||
@property(nonatomic) NSString *question;
|
||||
@property(nonatomic) NSString *answer;
|
||||
@property(nonatomic) NSString *loginName;
|
||||
@property(nonatomic) BOOL loginGenerated;
|
||||
@property(nonatomic) NSNumber *uses;
|
||||
@property(nonatomic) NSUInteger counter;
|
||||
@property(nonatomic) NSDate *lastUsed;
|
||||
@property(nonatomic) id<MPAlgorithm> algorithm;
|
||||
@property(nonatomic) MPAlgorithmVersion algorithmVersion;
|
||||
@property(nonatomic, readonly) BOOL outdated;
|
||||
@property(nonatomic, readonly) BOOL generated;
|
||||
@property(nonatomic, readonly) BOOL stored;
|
||||
@property(nonatomic, readonly) BOOL transient;
|
||||
|
||||
- (instancetype)initWithEntity:(MPSiteEntity *)entity fuzzyGroups:(NSArray *)fuzzyGroups;
|
||||
- (instancetype)initWithName:(NSString *)siteName forUser:(MPUserEntity *)user;
|
||||
|
@@ -93,8 +93,8 @@
|
||||
NSMutableParagraphStyle *paragraphStyle = [NSMutableParagraphStyle new];
|
||||
paragraphStyle.alignment = NSCenterTextAlignment;
|
||||
self.displayedName = stra( siteName, @{
|
||||
NSBackgroundColorAttributeName : [NSColor alternateSelectedControlColor],
|
||||
NSParagraphStyleAttributeName : paragraphStyle,
|
||||
NSBackgroundColorAttributeName: [NSColor alternateSelectedControlColor],
|
||||
NSParagraphStyleAttributeName : paragraphStyle,
|
||||
} );
|
||||
self.name = siteName;
|
||||
self.algorithm = MPAlgorithmDefault;
|
||||
|
Reference in New Issue
Block a user