X-Git-Url: http://git.ithinksw.org/MenuTunes.git/blobdiff_plain/46b610a25dea1e26f1348dac4024d72514130bb3..d33e9b61891ddd4d4e70422f3f20c693d0ee030c:/PreferencesController.m diff --git a/PreferencesController.m b/PreferencesController.m index f8245d2..638be40 100755 --- a/PreferencesController.m +++ b/PreferencesController.m @@ -6,6 +6,7 @@ #import "StatusWindow.h" #import "StatusWindowController.h" #import "CustomMenuTableView.h" +#import "AudioscrobblerController.h" #import @@ -85,6 +86,10 @@ static PreferencesController *prefs = nil; SecKeychainAttribute attributes[3]; SecKeychainAttributeList list; + if ((user == nil) || ([user length] == 0)) { + return nil; + } + ITDebugLog(@"Audioscrobbler: Searching for keychain item for %@.", user); attributes[0].tag = kSecAccountItemAttr; attributes[0].data = (char *)[user UTF8String]; @@ -433,6 +438,7 @@ static PreferencesController *prefs = nil; [PreferencesController deleteKeychainItemForUser:currentAccount]; } [PreferencesController createKeychainItemForUser:newAccount andPassword:[audioscrobblerPasswordTextField stringValue]]; + [[AudioscrobblerController sharedController] attemptHandshake:YES]; } } else if ( [sender tag ] == 6030) { //Here we set the password for an existing keychain item or we create a new keychain item. @@ -1105,6 +1111,7 @@ static PreferencesController *prefs = nil; [audioscrobblerPasswordTextField setStringValue:password]; } } + [audioscrobblerUseCacheCheckbox setState:[df boolForKey:@"audioscrobblerCacheSubmissions"]]; [[NSNotificationCenter defaultCenter] addObserver:sharingTableView selector:@selector(reloadData) name:@"ITMTFoundNetService" object:nil];