diff --git a/Classes/Dialogs/Preferences/PreferencesController.m b/Classes/Dialogs/Preferences/PreferencesController.m index 4bd88cc5..86e32ad9 100644 --- a/Classes/Dialogs/Preferences/PreferencesController.m +++ b/Classes/Dialogs/Preferences/PreferencesController.m @@ -207,7 +207,14 @@ - (NSArray*)availableSounds { static NSArray* ary; if (!ary) { - ary = [NSArray arrayWithObjects:@"-", @"Beep", @"Basso", @"Blow", @"Bottle", @"Frog", @"Funk", @"Glass", @"Hero", @"Morse", @"Ping", @"Pop", @"Purr", @"Sosumi", @"Submarine", @"Tink", nil]; + NSMutableArray* arr = [NSMutableArray arrayWithObject:@"-"]; + for (NSString *path in [NSSearchPathForDirectoriesInDomains(NSLibraryDirectory, + NSAllDomainsMask, YES) objectEnumerator]) + for (NSString *soundFile in [[NSFileManager defaultManager] + enumeratorAtPath:[path stringByAppendingPathComponent:@"Sounds"]]) + if ([NSSound soundNamed:[soundFile stringByDeletingPathExtension]]) + [arr addObject:[soundFile stringByDeletingPathExtension]]; + ary = [arr copy]; } return ary; }