+- (void)setupScreenPopup
+{
+ ITDebugLog(@"Setting up screen popup");
+ NSArray *screens = [NSScreen screens];
+ if ([screens count] > 1) {
+ int i, index = [df integerForKey:@"statusWindowScreenIndex"];
+ [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]];
+ }
+ }
+ [screenPopup selectItemAtIndex:index];
+ [[StatusWindow sharedWindow] setScreen:[[NSScreen screens] objectAtIndex:index]];
+ } else {
+ while ([screenPopup numberOfItems] > 1) {
+ [screenPopup removeItemAtIndex:1];
+ }
+ [screenPopup setEnabled:NO];
+ [[StatusWindow sharedWindow] setScreen:[NSScreen mainScreen]];
+ }
+}
+