More work on password generation

This commit is contained in:
michael starke
2013-04-02 14:53:46 +02:00
parent a70aedb51e
commit b6504b3dc4
22 changed files with 1043 additions and 556 deletions

View File

@@ -7,12 +7,14 @@
//
#import "MPPasteBoardController.h"
#import "MPSettingsHelper.h"
@interface MPPasteBoardController ()
@property (assign) BOOL isEmpty;
- (void)_clearPasteboardContents;
- (void)_setupBindings;
- (void)_updateNotifications;
@end
@@ -32,9 +34,7 @@
self = [super init];
if (self) {
_isEmpty = YES;
/* User preferences and bindings */
_clearTimeout = 30;
_clearPasteboardOnShutdown = YES;
[self _setupBindings];
[self _updateNotifications];
}
return self;
@@ -84,4 +84,13 @@
}
self.isEmpty = YES;
}
- (void)_setupBindings {
NSUserDefaultsController *userDefaultsController = [NSUserDefaultsController sharedUserDefaultsController];
NSString *clearOnShutdownKeyPath = [NSString stringWithFormat:@"values.%@", kMPSettingsKeyClearPasteboardOnQuit];
NSString *clearTimoutKeyPath = [NSString stringWithFormat:@"value.%@", kMPSettingsKeyPasteboardClearTimeout];
[self bind:@"clearPasteboardOnShutdown" toObject:userDefaultsController withKeyPath:clearOnShutdownKeyPath options:nil];
[self bind:@"clearTimeout" toObject:userDefaultsController withKeyPath:clearTimoutKeyPath options:nil];
}
@end