From 52421b3b0cfcbd4ddda03adbf598c22519c955a5 Mon Sep 17 00:00:00 2001 From: vspader Date: Sat, 7 Jul 2007 03:59:57 +0000 Subject: [PATCH] Fixed encoding of outputs, and highlighting of preference panes. --- Preferences/General/OutputsArrayController.m | 6 +++--- Preferences/SS_PrefsController.m | 3 ++- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/Preferences/General/OutputsArrayController.m b/Preferences/General/OutputsArrayController.m index 804be6a21..6ab75c40f 100644 --- a/Preferences/General/OutputsArrayController.m +++ b/Preferences/General/OutputsArrayController.m @@ -21,8 +21,8 @@ NSDictionary *defaultDevice = [[[NSUserDefaultsController sharedUserDefaultsController] defaults] objectForKey:@"outputDevice"]; for (i = 0; i < nDevices; ++i) { - char name[64]; - UInt32 maxlen = 64; + char name[256]; + UInt32 maxlen = 256; verify_noerr(AudioDeviceGetProperty(devids[i], 0, false, kAudioDevicePropertyDeviceName, &maxlen, name)); NSLog(@"Device: %d %s", devids[i], name); @@ -36,7 +36,7 @@ if (propSize <= sizeof(UInt32)) continue; NSObject *deviceInfo = [NSDictionary dictionaryWithObjectsAndKeys: - [NSString stringWithCString:name], @"name", + [NSString stringWithUTF8String:name], @"name", [NSNumber numberWithLong:devids[i]], @"deviceID", nil]; [self addObject:deviceInfo]; diff --git a/Preferences/SS_PrefsController.m b/Preferences/SS_PrefsController.m index 831233a1f..4b3cd9248 100644 --- a/Preferences/SS_PrefsController.m +++ b/Preferences/SS_PrefsController.m @@ -345,6 +345,8 @@ // Update defaults NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults]; [defaults setObject:name forKey:Last_Pane_Defaults_Key]; + + [prefsToolbar setSelectedItemIdentifier: name]; return YES; } @@ -428,7 +430,6 @@ float ToolbarHeightForWindow(NSWindow *window) } else if (!alwaysShowsToolbar && prefsToolbarItems && ([prefsToolbarItems count] == 1)) { [self debugLog:@"Not showing toolbar in Preferences window because there is only one preference pane loaded. You can override this behaviour using -[setAlwaysShowsToolbar:YES]."]; } - [prefsToolbar setSelectedItemIdentifier: [panesOrder objectAtIndex: 0]]; }