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"]; NSDictionary *defaultDevice = [[[NSUserDefaultsController sharedUserDefaultsController] defaults] objectForKey:@"outputDevice"];
for (i = 0; i < nDevices; ++i) { for (i = 0; i < nDevices; ++i) {
char name[64]; char name[256];
UInt32 maxlen = 64; UInt32 maxlen = 256;
verify_noerr(AudioDeviceGetProperty(devids[i], 0, false, kAudioDevicePropertyDeviceName, &maxlen, name)); verify_noerr(AudioDeviceGetProperty(devids[i], 0, false, kAudioDevicePropertyDeviceName, &maxlen, name));
NSLog(@"Device: %d %s", devids[i], name); NSLog(@"Device: %d %s", devids[i], name);
@ -36,7 +36,7 @@
if (propSize <= sizeof(UInt32)) continue; if (propSize <= sizeof(UInt32)) continue;
NSObject *deviceInfo = [NSDictionary dictionaryWithObjectsAndKeys: NSObject *deviceInfo = [NSDictionary dictionaryWithObjectsAndKeys:
[NSString stringWithCString:name], @"name", [NSString stringWithUTF8String:name], @"name",
[NSNumber numberWithLong:devids[i]], @"deviceID", [NSNumber numberWithLong:devids[i]], @"deviceID",
nil]; nil];
[self addObject:deviceInfo]; [self addObject:deviceInfo];

View File

@ -345,6 +345,8 @@
// Update defaults // Update defaults
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults]; NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
[defaults setObject:name forKey:Last_Pane_Defaults_Key]; [defaults setObject:name forKey:Last_Pane_Defaults_Key];
[prefsToolbar setSelectedItemIdentifier: name];
return YES; return YES;
} }
@ -428,7 +430,6 @@ float ToolbarHeightForWindow(NSWindow *window)
} else if (!alwaysShowsToolbar && prefsToolbarItems && ([prefsToolbarItems count] == 1)) { } 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]."]; [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]];
} }