+
+ // Set the launch player checkbox state
+ ITDebugLog(@"Setting launch player with MenuTunes state.");
+ [launchPlayerAtLaunchCheckbox setState:[df boolForKey:@"LaunchPlayerWithMT"] ? NSOnState : NSOffState];
+
+ // Setup the positioning controls
+ [positionMatrix selectCellAtRow:[df integerForKey:@"statusWindowVerticalPosition"]
+ column:[df integerForKey:@"statusWindowHorizontalPosition"]];
+
+ // Setup effects controls
+ // Populate the effects popups
+ [appearanceEffectPopup setAutoenablesItems:NO];
+ [vanishEffectPopup setAutoenablesItems:NO];
+ [self repopulateEffectPopupsForVerticalPosition:[df integerForKey:@"statusWindowVerticalPosition"]
+ horizontalPosition:[df integerForKey:@"statusWindowHorizontalPosition"]];
+
+ // Attempt to find the pref'd effect in the list.
+ // If it's not there, use cut/dissolve.
+ if ( [effectClasses containsObject:NSClassFromString([df stringForKey:@"statusWindowAppearanceEffect"])] ) {
+ [appearanceEffectPopup selectItemAtIndex:[effectClasses indexOfObject:NSClassFromString([df stringForKey:@"statusWindowAppearanceEffect"])]];
+ } else {
+ [appearanceEffectPopup selectItemAtIndex:[effectClasses indexOfObject:NSClassFromString(@"ITCutWindowEffect")]];
+ }
+
+ if ( [effectClasses containsObject:NSClassFromString([df stringForKey:@"statusWindowVanishEffect"])] ) {
+ [vanishEffectPopup selectItemAtIndex:[effectClasses indexOfObject:NSClassFromString([df stringForKey:@"statusWindowVanishEffect"])]];
+ } else {
+ [vanishEffectPopup selectItemAtIndex:[effectClasses indexOfObject:NSClassFromString(@"ITCutWindowEffect")]];
+ }
+
+ [appearanceSpeedSlider setFloatValue:( -([df floatForKey:@"statusWindowAppearanceSpeed"]) )];
+ [vanishSpeedSlider setFloatValue:( -([df floatForKey:@"statusWindowVanishSpeed"]) )];
+ [vanishDelaySlider setFloatValue:[df floatForKey:@"statusWindowVanishDelay"]];
+
+ // Setup General Controls
+ selectedBGStyle = [df integerForKey:@"statusWindowBackgroundMode"];
+ [backgroundStylePopup selectItem:[backgroundStylePopup itemAtIndex:[backgroundStylePopup indexOfItemWithTag:selectedBGStyle]]];
+
+ if ( selectedBGStyle == ITTSWBackgroundColored ) {
+ [backgroundColorWell setEnabled:YES];
+ [backgroundColorPopup setEnabled:YES];
+ } else {
+ [backgroundColorWell setEnabled:NO];
+ [backgroundColorPopup setEnabled:NO];
+ }
+
+ colorData = [df dataForKey:@"statusWindowBackgroundColor"];
+
+ if ( colorData ) {
+ [backgroundColorWell setColor:(NSColor *)[NSUnarchiver unarchiveObjectWithData:colorData]];
+ } else {
+ [backgroundColorWell setColor:[NSColor blueColor]];
+ }
+
+ [showOnChangeCheckbox setState:([df boolForKey:@"showSongInfoOnChange"] ? NSOnState : NSOffState)];
+
+ [windowSizingPopup selectItem:[windowSizingPopup itemAtIndex:[windowSizingPopup indexOfItemWithTag:[df integerForKey:@"statusWindowSizing"]]]];
+
+ // Setup the sharing controls
+ if ([df boolForKey:@"enableSharing"]) {
+ [shareMenuTunesCheckbox setState:NSOnState];
+ [useSharedMenuTunesCheckbox setEnabled:NO];
+ [selectSharedPlayerButton setEnabled:NO];
+ [passwordTextField setEnabled:YES];
+ [nameTextField setEnabled:YES];
+ } else if ([df boolForKey:@"useSharedPlayer"]) {
+ [useSharedMenuTunesCheckbox setState:NSOnState];
+ [shareMenuTunesCheckbox setEnabled:NO];
+ [selectSharedPlayerButton setEnabled:YES];
+ }
+
+ [[NSNotificationCenter defaultCenter] addObserver:sharingTableView selector:@selector(reloadData) name:@"ITMTFoundNetService" object:nil];
+
+ serverName = [df stringForKey:@"sharedPlayerName"];
+ if (!serverName || [serverName length] == 0) {
+ serverName = @"MenuTunes Shared Player";
+ }
+ [nameTextField setStringValue:serverName];
+
+ [selectPlayerBox setContentView:zeroConfView];
+ if ([[df dataForKey:@"sharedPlayerPassword"] length] > 0) {
+ [passwordTextField setStringValue:@"p4s5w0rdMT1.2"];
+ } else {
+ [passwordTextField setStringValue:@""];
+ }
+ if ([df stringForKey:@"sharedPlayerHost"]) {
+ [hostTextField setStringValue:[df stringForKey:@"sharedPlayerHost"]];
+ }
+
+ if ([[NetworkController sharedController] isConnectedToServer]) {
+ [selectedPlayerTextField setStringValue:[[[NetworkController sharedController] networkObject] serverName]];
+ [locationTextField setStringValue:[[NetworkController sharedController] remoteHost]];
+ } else {
+ [selectedPlayerTextField setStringValue:@"No shared player selected."];
+ [locationTextField setStringValue:@"-"];