| Line 34... |
Line 34... |
@implementation TruePreviewPreferencesModule
|
@implementation TruePreviewPreferencesModule
|
|
|
#pragma mark NSPreferencesModule instance methods
|
#pragma mark NSPreferencesModule instance methods
|
|
|
- (NSString*)preferencesNibName {
|
- (NSString*)preferencesNibName {
|
|
TRUEPREVIEW_LOG();
|
|
|
return @"TruePreviewPreferencesPanel";
|
return @"TruePreviewPreferencesPanel";
|
}
|
}
|
|
|
- (void)willBeDisplayed {
|
- (void)willBeDisplayed {
|
|
TRUEPREVIEW_LOG();
|
|
|
[super willBeDisplayed];
|
[super willBeDisplayed];
|
|
|
// build the list of accounts
|
// build the list of accounts
|
NSDictionary* theAccountDict = [[NSUserDefaults standardUserDefaults] objectForKey:@"TruePreviewAccountSettings"];
|
NSDictionary* theAccountDict = [[NSUserDefaults standardUserDefaults] objectForKey:@"TruePreviewAccountSettings"];
|
NSMutableArray* theAccounts = [NSMutableArray array];
|
NSMutableArray* theAccounts = [NSMutableArray array];
|
| Line 107... |
Line 111... |
|
|
- (void)observeValueForKeyPath:(NSString*)inPath
|
- (void)observeValueForKeyPath:(NSString*)inPath
|
ofObject:(id)inObject
|
ofObject:(id)inObject
|
change:(NSDictionary*)inChange
|
change:(NSDictionary*)inChange
|
context:(void*)inContext {
|
context:(void*)inContext {
|
|
TRUEPREVIEW_LOG(@"%@, %@, %@, %p", inPath, inObject, inChange, inContext);
|
|
|
NSMutableDictionary* theAccountDict = [NSMutableDictionary dictionary];
|
NSMutableDictionary* theAccountDict = [NSMutableDictionary dictionary];
|
|
|
// build the account settings dictionary to save in the user defaults
|
// build the account settings dictionary to save in the user defaults
|
for (NSDictionary* theAccount in (NSArray*)inContext) {
|
for (NSDictionary* theAccount in (NSArray*)inContext) {
|
[theAccountDict setObject:theAccount forKey:[theAccount objectForKey:@"displayName"]];
|
[theAccountDict setObject:theAccount forKey:[theAccount objectForKey:@"displayName"]];
|
}
|
}
|
|
|
[[NSUserDefaults standardUserDefaults] setObject:theAccountDict forKey:@"TruePreviewAccountSettings"];
|
[[NSUserDefaults standardUserDefaults] setObject:theAccountDict forKey:@"TruePreviewAccountSettings"];
|
[[NSUserDefaults standardUserDefaults] synchronize];
|
[[NSUserDefaults standardUserDefaults] synchronize];
|
|
}
|
|
|
|
#pragma mark Instance methods
|
|
|
|
- (NSString*)truePreviewVersion {
|
|
return [[[NSBundle bundleForClass: [TruePreview class]] infoDictionary ] objectForKey:@"CFBundleVersion" ];
|
}
|
}
|
|
|
@end
|
@end
|
|
|
|
|