From: Kent Sutherland Date: Wed, 1 Dec 2004 02:38:13 +0000 (+0000) Subject: Added multiscreen options. Doesn't save them across runs, but I'll add that. X-Git-Tag: v1.5~8 X-Git-Url: http://git.ithinksw.org/MenuTunes.git/commitdiff_plain/300a07d55a963cc39d6fdc8152a2651b55054055 Added multiscreen options. Doesn't save them across runs, but I'll add that. Enabled the popup in the nib, and added code in prefscontroller to populate it if needed. --- diff --git a/English.lproj/Preferences.nib/classes.nib b/English.lproj/Preferences.nib/classes.nib index 6405f45..0b64f56 100755 --- a/English.lproj/Preferences.nib/classes.nib +++ b/English.lproj/Preferences.nib/classes.nib @@ -45,6 +45,7 @@ positionMatrix = NSMatrix; ratingCheckbox = NSButton; runScriptsCheckbox = NSButton; + screenPopup = NSPopUpButton; selectPlayerBox = NSBox; selectPlayerSheet = NSPanel; selectSharedPlayerButton = NSButton; diff --git a/English.lproj/Preferences.nib/keyedobjects.nib b/English.lproj/Preferences.nib/keyedobjects.nib index 026313a..82b46aa 100755 Binary files a/English.lproj/Preferences.nib/keyedobjects.nib and b/English.lproj/Preferences.nib/keyedobjects.nib differ diff --git a/PreferencesController.h b/PreferencesController.h index 844f4ed..aa4c1c6 100755 --- a/PreferencesController.h +++ b/PreferencesController.h @@ -48,6 +48,7 @@ IBOutlet NSMatrix *positionMatrix; IBOutlet NSButton *ratingCheckbox; IBOutlet NSButton *runScriptsCheckbox; + IBOutlet NSPopUpButton *screenPopup; IBOutlet NSTextField *selectedPlayerTextField; IBOutlet NSBox *selectPlayerBox; IBOutlet NSPanel *selectPlayerSheet; diff --git a/PreferencesController.m b/PreferencesController.m index 7e953d9..8d74cc7 100755 --- a/PreferencesController.m +++ b/PreferencesController.m @@ -464,7 +464,9 @@ static PreferencesController *prefs = nil; } else if ( [sender tag] == 2020) { // Update screen selection. - + [[StatusWindow sharedWindow] setScreen:[[NSScreen screens] objectAtIndex:[sender indexOfSelectedItem]]]; + [(MainController *)controller showCurrentTrackInfo]; + } else if ( [sender tag] == 2030) { [self setStatusWindowEntryEffect:[[sender selectedItem] representedObject]]; @@ -781,7 +783,8 @@ static PreferencesController *prefs = nil; NSData *colorData; int selectedBGStyle; id anItem; - + NSArray *screens = [NSScreen screens]; + [df setInteger:MT_CURRENT_VERSION forKey:@"appVersion"]; ITDebugLog(@"Setting up preferences UI."); @@ -800,6 +803,18 @@ static PreferencesController *prefs = nil; } } + ITDebugLog(@"Setting up screen popup"); + if ([screens count] > 1) { + int i; + [screenPopup setEnabled:YES]; + for (i = 0; i < [screens count]; i++) { + NSScreen *screen = [screens objectAtIndex:i]; + if (![screen isEqual:[NSScreen mainScreen]]) { + [screenPopup addItemWithTitle:[NSString stringWithFormat:@"Screen %i", i + 1]]; + } + } + } + ITDebugLog(@"Setting up track info checkboxes."); // Check current track info buttons [albumCheckbox setState:[df boolForKey:@"showAlbum"] ? NSOnState : NSOffState]; diff --git a/StatusWindow.m b/StatusWindow.m index 9c8888a..253f075 100755 --- a/StatusWindow.m +++ b/StatusWindow.m @@ -53,7 +53,7 @@ - (void)dealloc { - [_image release]; + [_image release]; [super dealloc]; } @@ -80,7 +80,6 @@ _sizing = newSizing; } - /*************************************************************************/ #pragma mark - #pragma mark INSTANCE METHODS @@ -123,7 +122,7 @@ ITImageView *imageView; BOOL shouldAnimate = ( ! (([self visibilityState] == ITWindowAppearingState) || ([self visibilityState] == ITWindowVanishingState)) ); - + if ( _sizing == ITTransientStatusWindowSmall ) { divisor = SMALL_DIVISOR; } else if ( _sizing == ITTransientStatusWindowMini ) {