- NSMutableDictionary *loginwindow;
- NSMutableArray *loginarray;
- ITDebugLog(@"Setting launches at login: %i", flag);
- [df synchronize];
- loginwindow = [[df persistentDomainForName:@"loginwindow"] mutableCopy];
- loginarray = [loginwindow objectForKey:@"AutoLaunchedApplicationDictionary"];
-
- if (flag) {
- NSDictionary *itemDict = [NSDictionary dictionaryWithObjectsAndKeys:
- [[NSBundle mainBundle] bundlePath], @"Path",
- [NSNumber numberWithInt:0], @"Hide", nil];
- [loginarray addObject:itemDict];
- } else {
- int i;
- for (i = 0; i < [loginarray count]; i++) {
- NSDictionary *tempDict = [loginarray objectAtIndex:i];
- if ([[[tempDict objectForKey:@"Path"] lastPathComponent] isEqualToString:[[[NSBundle mainBundle] bundlePath] lastPathComponent]]) {
- [loginarray removeObjectAtIndex:i];
- break;
- }
+ StatusWindow *sw = [StatusWindow sharedWindow];
+
+ float time = ([df floatForKey:@"statusWindowVanishSpeed"] ? [df floatForKey:@"statusWindowVanishSpeed"] : 0.8);
+ [df setObject:NSStringFromClass(effectClass) forKey:@"statusWindowVanishEffect"];
+
+ [sw setExitEffect:[[[effectClass alloc] initWithWindow:sw] autorelease]];
+ [[sw exitEffect] setEffectTime:time];
+}
+
+- (void)setCustomColor:(NSColor *)color updateWell:(BOOL)update
+{
+ [(ITTSWBackgroundView *)[[StatusWindow sharedWindow] contentView] setBackgroundColor:color];
+ [df setObject:[NSArchiver archivedDataWithRootObject:color] forKey:@"statusWindowBackgroundColor"];
+
+ if ( update ) {
+ [backgroundColorWell setColor:color];
+ }
+}
+
+- (void)repopulateEffectPopupsForVerticalPosition:(ITVerticalWindowPosition)vPos horizontalPosition:(ITHorizontalWindowPosition)hPos
+{
+ NSEnumerator *effectEnum = [effectClasses objectEnumerator];
+ id anItem;
+
+ [appearanceEffectPopup removeAllItems];
+ [vanishEffectPopup removeAllItems];
+
+ while ( (anItem = [effectEnum nextObject]) ) {
+ [appearanceEffectPopup addItemWithTitle:[anItem effectName]];
+ [vanishEffectPopup addItemWithTitle:[anItem effectName]];
+
+ [[appearanceEffectPopup lastItem] setRepresentedObject:anItem];
+ [[vanishEffectPopup lastItem] setRepresentedObject:anItem];
+
+ if ( [self effect:anItem supportsVerticalPosition:vPos withHorizontalPosition:hPos] ) {
+ [[appearanceEffectPopup lastItem] setEnabled:YES];
+ [[vanishEffectPopup lastItem] setEnabled:YES];
+ } else {
+ [[appearanceEffectPopup lastItem] setEnabled:NO];
+ [[vanishEffectPopup lastItem] setEnabled:NO];
+ }
+ }
+
+}
+
+- (BOOL)effect:(Class)effectClass supportsVerticalPosition:(ITVerticalWindowPosition)vPos withHorizontalPosition:(ITHorizontalWindowPosition)hPos
+{
+ BOOL valid = NO;
+
+ if ( vPos == ITWindowPositionTop ) {
+ if ( hPos == ITWindowPositionLeft ) {
+ valid = ( [[[[effectClass supportedPositions] objectForKey:@"Top"] objectForKey:@"Left"] boolValue] ) ;
+ } else if ( hPos == ITWindowPositionCenter ) {
+ valid = ( [[[[effectClass supportedPositions] objectForKey:@"Top"] objectForKey:@"Center"] boolValue] );
+ } else if ( hPos == ITWindowPositionRight ) {
+ valid = ( [[[[effectClass supportedPositions] objectForKey:@"Top"] objectForKey:@"Right"] boolValue] );
+ }
+ } else if ( vPos == ITWindowPositionMiddle ) {
+ if ( hPos == ITWindowPositionLeft ) {
+ valid = ( [[[[effectClass supportedPositions] objectForKey:@"Middle"] objectForKey:@"Left"] boolValue] );
+ } else if ( hPos == ITWindowPositionCenter ) {
+ valid = ( [[[[effectClass supportedPositions] objectForKey:@"Middle"] objectForKey:@"Center"] boolValue] );
+ } else if ( hPos == ITWindowPositionRight ) {
+ valid = ( [[[[effectClass supportedPositions] objectForKey:@"Middle"] objectForKey:@"Right"] boolValue] );
+ }
+ } else if ( vPos == ITWindowPositionBottom ) {
+ if ( hPos == ITWindowPositionLeft ) {
+ valid = ( [[[[effectClass supportedPositions] objectForKey:@"Bottom"] objectForKey:@"Left"] boolValue] );
+ } else if ( hPos == ITWindowPositionCenter ) {
+ valid = ( [[[[effectClass supportedPositions] objectForKey:@"Bottom"] objectForKey:@"Center"] boolValue] );
+ } else if ( hPos == ITWindowPositionRight ) {
+ valid = ( [[[[effectClass supportedPositions] objectForKey:@"Bottom"] objectForKey:@"Right"] boolValue] );