- if ([setHotKey isEqualToString:@"PlayPause"]) {
- if (([combo isEqual:nextTrackCombo] || [combo isEqual:prevTrackCombo] ||
- [combo isEqual:trackInfoCombo] || [combo isEqual:upcomingSongsCombo] ||
- [combo isEqual:ratingIncrementCombo] || [combo isEqual:ratingDecrementCombo] ||
- [combo isEqual:volumeIncrementCombo] || [combo isEqual:volumeDecrementCombo] ||
- [combo isEqual:toggleLoopCombo] || [combo isEqual:toggleShuffleCombo]) &&
- !(([combo modifiers] == -1) && ([combo keyCode] == -1))) {
-
- [window setLevel:NSNormalWindowLevel];
- NSRunAlertPanel(@"Duplicate Key Combo", @"Please choose a unique key combo.", @"OK", nil, nil, nil);
- [window setLevel:NSStatusWindowLevel];
- return;
+
+ while ( (enumKey = [enumerator nextObject]) ) {
+ if (![enumKey isEqualToString:currentHotKey]) {
+ if (![combo isEqual:[KeyCombo clearKeyCombo]] &&
+ [combo isEqual:[hotKeysDictionary objectForKey:enumKey]]) {
+ [window setLevel:NSNormalWindowLevel];
+ if ( NSRunAlertPanel(NSLocalizedString(@"duplicateCombo", @"Duplicate Key Combo") , NSLocalizedString(@"duplicateCombo_msg", @"The specified key combo is already in use..."), NSLocalizedString(@"replace", @"Replace"), NSLocalizedString(@"cancel", @"Cancel"), nil) ) {
+ [hotKeysDictionary setObject:[KeyCombo clearKeyCombo] forKey:currentHotKey];
+ if ([enumKey isEqualToString:@"PlayPause"]) {
+ [playPauseButton setTitle:@""];
+ } else if ([enumKey isEqualToString:@"NextTrack"]) {
+ [nextTrackButton setTitle:@""];
+ } else if ([enumKey isEqualToString:@"PrevTrack"]) {
+ [previousTrackButton setTitle:@""];
+ } else if ([enumKey isEqualToString:@"ShowPlayer"]) {
+ [showPlayerButton setTitle:@""];
+ } else if ([enumKey isEqualToString:@"TrackInfo"]) {
+ [trackInfoButton setTitle:@""];
+ } else if ([enumKey isEqualToString:@"UpcomingSongs"]) {
+ [upcomingSongsButton setTitle:@""];
+ } else if ([enumKey isEqualToString:@"IncrementVolume"]) {
+ [volumeIncrementButton setTitle:@""];
+ } else if ([enumKey isEqualToString:@"DecrementVolume"]) {
+ [volumeDecrementButton setTitle:@""];
+ } else if ([enumKey isEqualToString:@"IncrementRating"]) {
+ [ratingIncrementButton setTitle:@""];
+ } else if ([enumKey isEqualToString:@"DecrementRating"]) {
+ [ratingDecrementButton setTitle:@""];
+ } else if ([enumKey isEqualToString:@"ToggleShuffle"]) {
+ [toggleShuffleButton setTitle:@""];
+ } else if ([enumKey isEqualToString:@"ToggleLoop"]) {
+ [toggleLoopButton setTitle:@""];
+ }
+ [df setKeyCombo:[KeyCombo clearKeyCombo] forKey:enumKey];
+ } else {
+ return;
+ }
+ [window setLevel:NSStatusWindowLevel];
+ }