X-Git-Url: http://git.ithinksw.org/MenuTunes.git/blobdiff_plain/ea3dc416d45e5e72dc83a757a2031a2a763bbe51..f0a93087145b1920a1e96931203343a4b2b8793f:/PreferencesController.m diff --git a/PreferencesController.m b/PreferencesController.m index b4cba9e..4e5a84f 100755 --- a/PreferencesController.m +++ b/PreferencesController.m @@ -13,7 +13,7 @@ mt = [tunes retain]; [mt registerDefaultsIfNeeded]; - + //Load the nib [NSBundle loadNibNamed:@"Preferences" owner:self]; @@ -134,7 +134,6 @@ - (IBAction)apply:(id)sender { - ProcessSerialNumber psn; NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults]; [defaults setObject:myItems forKey:@"menu"]; @@ -210,9 +209,16 @@ [defaults setInteger:5 forKey:@"SongsInAdvance"]; } - psn = [mt iTunesPSN]; - if (!((psn.highLongOfPSN == kNoProcess) && (psn.lowLongOfPSN == 0))) { - [mt rebuildMenu]; + { + NSArray *apps = [[NSWorkspace sharedWorkspace] launchedApplications]; + int i; + + for (i = 0; i < [apps count]; i++) { + if ([[[apps objectAtIndex:i] objectForKey:@"NSApplicationName"] + isEqualToString:@"iTunes"]) { + [mt rebuildMenu]; + } + } } [mt clearHotKeys]; } @@ -237,15 +243,7 @@ - (IBAction)okHotKey:(id)sender { - NSString *string; - if (([combo modifiers] <= 0) && ([combo keyCode] >= 0)) { - [window setLevel:NSNormalWindowLevel]; - NSRunAlertPanel(@"Bad Key Combo", @"Please enter a valid key combo. A valid combo must have a modifier key in it. (Command, option, shift, control).", @"OK", nil, nil, nil); - [window setLevel:NSStatusWindowLevel]; - return; - } - - string = [combo userDisplayRep]; + NSString *string = [combo userDisplayRep]; if (string == nil) { string = @"None";