Implementing Registration checks and final touches.
[MenuTunes.git] / PreferencesController.m
index 590e6de..3d9e815 100755 (executable)
@@ -272,22 +272,17 @@ static PreferencesController *prefs = nil;
     id anItem;
     ITDebugLog(@"Registering defaults.");
     [df setObject:[NSArray arrayWithObjects:
     id anItem;
     ITDebugLog(@"Registering defaults.");
     [df setObject:[NSArray arrayWithObjects:
+        @"trackInfo",
+        @"separator",
         @"playPause",
         @"prevTrack",
         @"nextTrack",
         @"playPause",
         @"prevTrack",
         @"nextTrack",
-        @"fastForward",
-        @"rewind",
-        @"showPlayer",
         @"separator",
         @"separator",
-        @"songRating",
-        @"eqPresets",
         @"playlists",
         @"upcomingSongs",
         @"separator",
         @"preferences",
         @"quit",
         @"playlists",
         @"upcomingSongs",
         @"separator",
         @"preferences",
         @"quit",
-        @"separator",
-        @"trackInfo",
         nil] forKey:@"menu"];
 
     [df setInteger:5 forKey:@"SongsInAdvance"];
         nil] forKey:@"menu"];
 
     [df setInteger:5 forKey:@"SongsInAdvance"];
@@ -296,6 +291,13 @@ static PreferencesController *prefs = nil;
     [df setBool:NO forKey:@"showAlbum"];
     [df setBool:NO forKey:@"showTime"];
 
     [df setBool:NO forKey:@"showAlbum"];
     [df setBool:NO forKey:@"showTime"];
 
+    [df setInteger:2100 forKey:@"statusWindowAppearanceEffect"];
+    [df setInteger:2101 forKey:@"statusWindowVanishEffect"];
+    [df setFloat:0.8 forKey:@"statusWindowAppearanceSpeed"];
+    [df setFloat:0.8 forKey:@"statusWindowVanishSpeed"];
+    [df setFloat:4.0 forKey:@"statusWindowVanishDelay"];
+    [df setBool:YES forKey:@"showSongInfoOnChange"];
+
     [df synchronize];
     
     loginWindow = [[df persistentDomainForName:@"loginwindow"] mutableCopy];
     [df synchronize];
     
     loginWindow = [[df persistentDomainForName:@"loginwindow"] mutableCopy];
@@ -723,6 +725,20 @@ static PreferencesController *prefs = nil;
             [launchAtLoginCheckbox setState:NSOnState];
         }
     }
             [launchAtLoginCheckbox setState:NSOnState];
         }
     }
+    
+    // Set the launch player checkbox state
+    ITDebugLog(@"Setting launch player with MenuTunes state.");
+    [launchPlayerAtLaunchCheckbox setState:[df boolForKey:@"LaunchPlayerWithMT"] ? NSOnState : NSOffState];
+    
+    // Setup the positioning controls
+    
+    // Setup effects controls
+    [appearanceEffectPopup selectItem:[appearanceEffectPopup itemAtIndex:[appearanceEffectPopup indexOfItemWithTag:[df integerForKey:@"statusWindowAppearanceEffect"]]]];
+    [vanishEffectPopup     selectItem:[vanishEffectPopup     itemAtIndex:[vanishEffectPopup     indexOfItemWithTag:[df integerForKey:@"statusWindowVanishEffect"]]]];
+    [appearanceSpeedSlider setFloatValue:-([df floatForKey:@"statusWindowAppearanceSpeed"])];
+    [vanishSpeedSlider     setFloatValue:-([df floatForKey:@"statusWindowVanishSpeed"])];
+    [vanishDelaySlider     setFloatValue:[df floatForKey:@"statusWindowVanishDelay"]];
+    [showOnChangeCheckbox  setState:([df boolForKey:@"showSongInfoOnChange"] ? NSOnState : NSOffState)];
 }
 
 - (IBAction)changeMenus:(id)sender
 }
 
 - (IBAction)changeMenus:(id)sender
@@ -891,7 +907,7 @@ static PreferencesController *prefs = nil;
         
         if ([[[info draggingPasteboard] types] containsObject:@"MenuTableViewPboardType"]) {
             NSString *item = [myItems objectAtIndex:[[[info draggingPasteboard] stringForType:@"MenuTableViewPboardType"] intValue]];
         
         if ([[[info draggingPasteboard] types] containsObject:@"MenuTableViewPboardType"]) {
             NSString *item = [myItems objectAtIndex:[[[info draggingPasteboard] stringForType:@"MenuTableViewPboardType"] intValue]];
-            if ([item isEqualToString:@"preferences"]) {
+            if ([item isEqualToString:@"preferences"] || [item isEqualToString:@"quit"]) {
                 return NSDragOperationNone;
             }
         }
                 return NSDragOperationNone;
             }
         }