#import <ITKit/ITWindowPositioning.h>
#import <ITKit/ITKeyBroadcaster.h>
+#import <ITKit/ITTSWBackgroundView.h>
#import <ITKit/ITCutWindowEffect.h>
#import <ITKit/ITDissolveWindowEffect.h>
#import <ITKit/ITSlideHorizontallyWindowEffect.h>
controller = nil;
[self setupWindow]; // Load in the nib, and perform any initial setup.
+ [[NSColorPanel sharedColorPanel] setShowsAlpha:YES];
}
return self;
}
[window performSelector:@selector(makeKeyAndOrderFront:) withObject:self afterDelay:0.0];
}
+- (IBAction)showTestWindow:(id)sender
+{
+ [controller showTestWindow];
+}
+
- (IBAction)changeGeneralSetting:(id)sender
{
ITDebugLog(@"Changing general setting of tag %i.", [sender tag]);
[sw setExitDelay:[sender floatValue]];
} else if ( [sender tag] == 2080) {
[df setBool:SENDER_STATE forKey:@"showSongInfoOnChange"];
+ } else if ( [sender tag] == 2090) {
+
+ int setting = [sender indexOfSelectedItem];
+
+ if ( setting == 0 ) {
+ [(ITTSWBackgroundView *)[sw contentView] setBackgroundMode:ITTSWBackgroundApple];
+ [backgroundColorWell setEnabled:NO];
+ } else if ( setting == 1 ) {
+ [(ITTSWBackgroundView *)[sw contentView] setBackgroundMode:ITTSWBackgroundReadable];
+ [backgroundColorWell setEnabled:NO];
+ } else if ( setting == 2 ) {
+ [(ITTSWBackgroundView *)[sw contentView] setBackgroundMode:ITTSWBackgroundColored];
+ [backgroundColorWell setEnabled:YES];
+ }
+
+ [df setInteger:setting forKey:@"statusWindowBackgroundMode"];
+
+ } else if ( [sender tag] == 2091) {
+ [(ITTSWBackgroundView *)[sw contentView] setBackgroundColor:[sender color]];
+ [df setObject:[NSArchiver archivedDataWithRootObject:[sender color]] forKey:@"statusWindowBackgroundColor"];
}
+
[df synchronize];
}
NSMutableArray *loginarray;
NSEnumerator *loginEnum, *keyArrayEnum;
NSString *serverName;
+ int selectedBGStyle;
id anItem;
ITDebugLog(@"Setting up preferences UI.");
[appearanceSpeedSlider setFloatValue:-([df floatForKey:@"statusWindowAppearanceSpeed"])];
[vanishSpeedSlider setFloatValue:-([df floatForKey:@"statusWindowVanishSpeed"])];
[vanishDelaySlider setFloatValue:[df floatForKey:@"statusWindowVanishDelay"]];
- [showOnChangeCheckbox setState:([df boolForKey:@"showSongInfoOnChange"] ? NSOnState : NSOffState)];
+
+ // Setup General Controls
+ selectedBGStyle = [df integerForKey:@"statusWindowBackgroundMode"];
+ [backgroundStylePopup selectItem:[backgroundStylePopup itemAtIndex:[backgroundStylePopup indexOfItemWithTag:selectedBGStyle]]];
+
+ if ( selectedBGStyle == ITTSWBackgroundColored ) {
+ [backgroundColorWell setEnabled:YES];
+ } else {
+ [backgroundColorWell setEnabled:NO];
+ }
+
+ [backgroundColorWell setColor:(NSColor *)[NSUnarchiver unarchiveObjectWithData:[df dataForKey:@"statusWindowBackgroundColor"]]];
+ [showOnChangeCheckbox setState:([df boolForKey:@"showSongInfoOnChange"] ? NSOnState : NSOffState)];
+
// Setup the sharing controls
if ([df boolForKey:@"enableSharing"]) {
[shareMenuTunesCheckbox setState:NSOnState];
NSString *object = [myItems objectAtIndex:rowIndex];
if ([[aTableColumn identifier] isEqualToString:@"name"]) {
if ([object isEqualToString:@"showPlayer"]) {
- NSString *string;
+ NSString *string = nil;
NS_DURING
string = [NSString stringWithFormat:@"%@ %@", NSLocalizedString(@"show", @"Show"), [[controller currentRemote] playerSimpleName]];
NS_HANDLER
NSString *object = [availableItems objectAtIndex:rowIndex];
if ([[aTableColumn identifier] isEqualToString:@"name"]) {
if ([object isEqualToString:@"showPlayer"]) {
- NSString *string;
+ NSString *string = nil;
NS_DURING
string = [NSString stringWithFormat:@"%@ %@", NSLocalizedString(@"show", @"Show"), [[controller currentRemote] playerSimpleName]];
NS_HANDLER