Fixed encoding of outputs, and highlighting of preference panes.

CQTexperiment
vspader 2007-07-07 03:59:57 +00:00
parent 31175e8c6d
commit 52421b3b0c
2 changed files with 5 additions and 4 deletions

View File

@ -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];

View File

@ -346,6 +346,8 @@
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]];
}