mirror of
https://github.com/MacPass/MacPass.git
synced 2025-12-14 07:02:39 +00:00
Using (class) properties
This commit is contained in:
@@ -42,10 +42,10 @@
|
|||||||
|
|
||||||
|
|
||||||
- (void)registerNotificationsForDocument:(MPDocument *)document {
|
- (void)registerNotificationsForDocument:(MPDocument *)document {
|
||||||
[[NSNotificationCenter defaultCenter] addObserver:self
|
[NSNotificationCenter.defaultCenter addObserver:self
|
||||||
selector:@selector(_didAddGroup:)
|
selector:@selector(_didAddGroup:)
|
||||||
name:MPDocumentDidAddGroupNotification
|
name:MPDocumentDidAddGroupNotification
|
||||||
object:document];
|
object:document];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)viewDidAppear {
|
- (void)viewDidAppear {
|
||||||
@@ -129,8 +129,8 @@
|
|||||||
options:nil];
|
options:nil];
|
||||||
}
|
}
|
||||||
- (IBAction)toggleExpire:(NSButton*)sender {
|
- (IBAction)toggleExpire:(NSButton*)sender {
|
||||||
KPKGroup *group = [self representedObject];
|
KPKGroup *group = self.representedObject;
|
||||||
if([sender state] == NSOnState && [group.timeInfo.expirationDate isEqualToDate:[NSDate distantFuture]]) {
|
if(sender.state == NSOnState && [group.timeInfo.expirationDate isEqualToDate:NSDate.distantFuture]) {
|
||||||
[NSApp sendAction:self.expireDateSelectButton.action to:nil from:self.expireDateSelectButton];
|
[NSApp sendAction:self.expireDateSelectButton.action to:nil from:self.expireDateSelectButton];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -139,7 +139,8 @@
|
|||||||
- (void)_didAddGroup:(NSNotification *)notification {
|
- (void)_didAddGroup:(NSNotification *)notification {
|
||||||
if(!self.titleTextField.window) {
|
if(!self.titleTextField.window) {
|
||||||
self.focusTitleOnceViewAppears = true;
|
self.focusTitleOnceViewAppears = true;
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
[self.titleTextField becomeFirstResponder];
|
[self.titleTextField becomeFirstResponder];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -53,7 +53,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
- (void)awakeFromNib {
|
- (void)awakeFromNib {
|
||||||
NSUserDefaultsController *defaultsController = [NSUserDefaultsController sharedUserDefaultsController];
|
NSUserDefaultsController *defaultsController = NSUserDefaultsController.sharedUserDefaultsController;
|
||||||
NSString *enableGlobalAutotypeKeyPath = [MPSettingsHelper defaultControllerPathForKey:kMPSettingsKeyEnableGlobalAutotype];
|
NSString *enableGlobalAutotypeKeyPath = [MPSettingsHelper defaultControllerPathForKey:kMPSettingsKeyEnableGlobalAutotype];
|
||||||
NSString *quicklookKeyPath = [MPSettingsHelper defaultControllerPathForKey:kMPSettingsKeyEnableQuicklookPreview];
|
NSString *quicklookKeyPath = [MPSettingsHelper defaultControllerPathForKey:kMPSettingsKeyEnableQuicklookPreview];
|
||||||
[self.enableGlobalAutotypeCheckBox bind:NSValueBinding toObject:defaultsController withKeyPath:enableGlobalAutotypeKeyPath options:nil];
|
[self.enableGlobalAutotypeCheckBox bind:NSValueBinding toObject:defaultsController withKeyPath:enableGlobalAutotypeKeyPath options:nil];
|
||||||
|
|||||||
Reference in New Issue
Block a user