From 76b9689bf2d638660d347fca02ed7f81b196d3d7 Mon Sep 17 00:00:00 2001 From: rogerman Date: Wed, 11 Mar 2015 03:45:51 +0000 Subject: [PATCH] Cocoa Port: - All display window settings panels now show the window number of the corresponding display window. --- .../translations/English.lproj/MainMenu.xib | 76 +++++++++++++++---- .../userinterface/DisplayWindowController.mm | 2 + .../userinterface/EmuControllerDelegate.h | 12 +++ .../userinterface/EmuControllerDelegate.mm | 34 +++++++++ 4 files changed, 110 insertions(+), 14 deletions(-) diff --git a/desmume/src/cocoa/translations/English.lproj/MainMenu.xib b/desmume/src/cocoa/translations/English.lproj/MainMenu.xib index ab8ff5a3e..d8b3c4ca8 100644 --- a/desmume/src/cocoa/translations/English.lproj/MainMenu.xib +++ b/desmume/src/cocoa/translations/English.lproj/MainMenu.xib @@ -17454,7 +17454,7 @@ y7bMNcy1zTXNtc42zrbPN8+40DnQutE80b7SP9LB00TTxtRJ1MvVTtXR1lXW2Ndc1+DYZNjo2WzZ8dp2 -2080374784 134217728 Save Settings as Default - + YES 12 787 @@ -17935,7 +17935,7 @@ y7bMNcy1zTXNtc42zrbPN8+40DnQutE80b7SP9LB00TTxtRJ1MvVTtXR1lXW2Ndc1+DYZNjo2WzZ8dp2 -2080374784 134217728 Apply - + -2038153216 164 @@ -19501,7 +19501,7 @@ y7bMNcy1zTXNtc42zrbPN8+40DnQutE80b7SP9LB00TTxtRJ1MvVTtXR1lXW2Ndc1+DYZNjo2WzZ8dp2 -2080374784 134217728 Save Settings as Default - + -2038153216 164 @@ -19584,7 +19584,7 @@ y7bMNcy1zTXNtc42zrbPN8+40DnQutE80b7SP9LB00TTxtRJ1MvVTtXR1lXW2Ndc1+DYZNjo2WzZ8dp2 -2080374784 134217728 Save Settings as Default - + -2038153216 164 @@ -20968,7 +20968,7 @@ y7bMNcy1zTXNtc42zrbPN8+40DnQutE80b7SP9LB00TTxtRJ1MvVTtXR1lXW2Ndc1+DYZNjo2WzZ8dp2 -2080374784 134217728 Save Settings as Default - + -2038153216 164 @@ -21455,7 +21455,7 @@ y7bMNcy1zTXNtc42zrbPN8+40DnQutE80b7SP9LB00TTxtRJ1MvVTtXR1lXW2Ndc1+DYZNjo2WzZ8dp2 67108864 134217728 Input Preferences - + _NS:610 -2038284288 @@ -23000,7 +23000,7 @@ y7bMNcy1zTXNtc42zrbPN8+40DnQutE80b7SP9LB00TTxtRJ1MvVTtXR1lXW2Ndc1+DYZNjo2WzZ8dp2 -2080374784 134217728 Save Settings as Default - + -2038153216 164 @@ -24759,6 +24759,7 @@ y7bMNcy1zTXNtc42zrbPN8+40DnQutE80b7SP9LB00TTxtRJ1MvVTtXR1lXW2Ndc1+DYZNjo2WzZ8dp2 268 {{88, 119}, {32, 34}} + YES 67371264 @@ -24782,6 +24783,7 @@ y7bMNcy1zTXNtc42zrbPN8+40DnQutE80b7SP9LB00TTxtRJ1MvVTtXR1lXW2Ndc1+DYZNjo2WzZ8dp2 268 {{85, 161}, {38, 17}} + YES 68157504 @@ -24800,6 +24802,7 @@ y7bMNcy1zTXNtc42zrbPN8+40DnQutE80b7SP9LB00TTxtRJ1MvVTtXR1lXW2Ndc1+DYZNjo2WzZ8dp2 268 {{85, 94}, {39, 17}} + YES 68157504 @@ -24818,6 +24821,7 @@ y7bMNcy1zTXNtc42zrbPN8+40DnQutE80b7SP9LB00TTxtRJ1MvVTtXR1lXW2Ndc1+DYZNjo2WzZ8dp2 268 {{44, 127}, {39, 17}} + YES 68157504 @@ -24836,6 +24840,7 @@ y7bMNcy1zTXNtc42zrbPN8+40DnQutE80b7SP9LB00TTxtRJ1MvVTtXR1lXW2Ndc1+DYZNjo2WzZ8dp2 268 {{125, 127}, {38, 17}} + YES 68157504 @@ -24854,6 +24859,7 @@ y7bMNcy1zTXNtc42zrbPN8+40DnQutE80b7SP9LB00TTxtRJ1MvVTtXR1lXW2Ndc1+DYZNjo2WzZ8dp2 268 {{127, 69}, {57, 17}} + YES 68157504 @@ -24915,6 +24921,7 @@ y7bMNcy1zTXNtc42zrbPN8+40DnQutE80b7SP9LB00TTxtRJ1MvVTtXR1lXW2Ndc1+DYZNjo2WzZ8dp2 268 {{24, 69}, {101, 17}} + YES 68157504 @@ -24933,12 +24940,13 @@ y7bMNcy1zTXNtc42zrbPN8+40DnQutE80b7SP9LB00TTxtRJ1MvVTtXR1lXW2Ndc1+DYZNjo2WzZ8dp2 268 {{23, 42}, {162, 19}} + YES -2080374784 134217728 Set to 0ยบ - + -2038153216 164 @@ -24959,7 +24967,7 @@ y7bMNcy1zTXNtc42zrbPN8+40DnQutE80b7SP9LB00TTxtRJ1MvVTtXR1lXW2Ndc1+DYZNjo2WzZ8dp2 -2080374784 134217728 Save Settings as Default - + -2038153216 164 @@ -24972,6 +24980,7 @@ y7bMNcy1zTXNtc42zrbPN8+40DnQutE80b7SP9LB00TTxtRJ1MvVTtXR1lXW2Ndc1+DYZNjo2WzZ8dp2 {213, 198} + {{0, 0}, {1920, 1177}} {10000000000000, 10000000000000} @@ -25191,7 +25200,7 @@ y7bMNcy1zTXNtc42zrbPN8+40DnQutE80b7SP9LB00TTxtRJ1MvVTtXR1lXW2Ndc1+DYZNjo2WzZ8dp2 -2080374784 134217728 Set to 0% - + -2038153216 164 @@ -25213,7 +25222,7 @@ y7bMNcy1zTXNtc42zrbPN8+40DnQutE80b7SP9LB00TTxtRJ1MvVTtXR1lXW2Ndc1+DYZNjo2WzZ8dp2 -2080374784 134217728 Set to 100% - + -2038153216 164 @@ -25234,7 +25243,7 @@ y7bMNcy1zTXNtc42zrbPN8+40DnQutE80b7SP9LB00TTxtRJ1MvVTtXR1lXW2Ndc1+DYZNjo2WzZ8dp2 -2080374784 134217728 Save Settings as Default - + -2038153216 164 @@ -25859,7 +25868,7 @@ y7bMNcy1zTXNtc42zrbPN8+40DnQutE80b7SP9LB00TTxtRJ1MvVTtXR1lXW2Ndc1+DYZNjo2WzZ8dp2 -2080374784 134217728 Start - + _NS:2460 -2038153216 @@ -34729,6 +34738,30 @@ y7bMNcy1zTXNtc42zrbPN8+40DnQutE80b7SP9LB00TTxtRJ1MvVTtXR1lXW2Ndc1+DYZNjo2WzZ8dp2 9995 + + + displayVideoSettingsPanel + + + + 10016 + + + + displaySeparationPanel + + + + 10017 + + + + displayRotationPanel + + + + 10018 + content @@ -55706,7 +55739,7 @@ y7bMNcy1zTXNtc42zrbPN8+40DnQutE80b7SP9LB00TTxtRJ1MvVTtXR1lXW2Ndc1+DYZNjo2WzZ8dp2 - 10015 + 10018 @@ -56713,6 +56746,9 @@ y7bMNcy1zTXNtc42zrbPN8+40DnQutE80b7SP9LB00TTxtRJ1MvVTtXR1lXW2Ndc1+DYZNjo2WzZ8dp2 NSArrayController NSObjectController CheatWindowDelegate + NSWindow + NSWindow + NSWindow NSWindow NSView NSObjectController @@ -56748,6 +56784,18 @@ y7bMNcy1zTXNtc42zrbPN8+40DnQutE80b7SP9LB00TTxtRJ1MvVTtXR1lXW2Ndc1+DYZNjo2WzZ8dp2 cheatWindowDelegate CheatWindowDelegate + + displayRotationPanel + NSWindow + + + displaySeparationPanel + NSWindow + + + displayVideoSettingsPanel + NSWindow + executionControlWindow NSWindow diff --git a/desmume/src/cocoa/userinterface/DisplayWindowController.mm b/desmume/src/cocoa/userinterface/DisplayWindowController.mm index 1ebf417ac..ac6fe2b56 100644 --- a/desmume/src/cocoa/userinterface/DisplayWindowController.mm +++ b/desmume/src/cocoa/userinterface/DisplayWindowController.mm @@ -1120,6 +1120,7 @@ static std::unordered_map _screenMap; // - (void)windowDidBecomeMain:(NSNotification *)notification { [emuControl setMainWindow:self]; + [emuControl updateDisplayPanelTitles]; [view setNextResponder:[self window]]; [[view inputManager] setHidInputTarget:view]; } @@ -1219,6 +1220,7 @@ static std::unordered_map _screenMap; // } [emuControl updateAllWindowTitles]; + [emuControl updateDisplayPanelTitles]; } - (BOOL)validateToolbarItem:(NSToolbarItem *)theItem diff --git a/desmume/src/cocoa/userinterface/EmuControllerDelegate.h b/desmume/src/cocoa/userinterface/EmuControllerDelegate.h index e1193c988..3cdf02525 100644 --- a/desmume/src/cocoa/userinterface/EmuControllerDelegate.h +++ b/desmume/src/cocoa/userinterface/EmuControllerDelegate.h @@ -50,6 +50,13 @@ class AudioSampleBlockGenerator; NSArrayController *cheatListController; NSArrayController *cheatDatabaseController; + NSWindow *displayRotationPanel; + NSWindow *displaySeparationPanel; + NSWindow *displayVideoSettingsPanel; + NSString *displayRotationPanelTitle; + NSString *displaySeparationPanelTitle; + NSString *displayVideoSettingsPanelTitle; + NSWindow *executionControlWindow; NSWindow *slot1ManagerWindow; NSWindow *saveFileMigrationSheet; @@ -121,6 +128,10 @@ class AudioSampleBlockGenerator; @property (readonly) IBOutlet NSArrayController *cheatListController; @property (readonly) IBOutlet NSArrayController *cheatDatabaseController; +@property (readonly) IBOutlet NSWindow *displayRotationPanel; +@property (readonly) IBOutlet NSWindow *displaySeparationPanel; +@property (readonly) IBOutlet NSWindow *displayVideoSettingsPanel; + @property (readonly) IBOutlet NSWindow *executionControlWindow; @property (readonly) IBOutlet NSWindow *slot1ManagerWindow; @property (readonly) IBOutlet NSWindow *saveFileMigrationSheet; @@ -271,6 +282,7 @@ class AudioSampleBlockGenerator; - (void) didEndChooseSlot1R4Directory:(NSOpenPanel *)sheet returnCode:(int)returnCode contextInfo:(void *)contextInfo; - (void) updateAllWindowTitles; +- (void) updateDisplayPanelTitles; - (void) setupUserDefaults; @end diff --git a/desmume/src/cocoa/userinterface/EmuControllerDelegate.mm b/desmume/src/cocoa/userinterface/EmuControllerDelegate.mm index 39ca161ae..eed103a26 100644 --- a/desmume/src/cocoa/userinterface/EmuControllerDelegate.mm +++ b/desmume/src/cocoa/userinterface/EmuControllerDelegate.mm @@ -52,6 +52,10 @@ @synthesize cheatDatabaseController; @synthesize slot2WindowController; +@synthesize displayRotationPanel; +@synthesize displaySeparationPanel; +@synthesize displayVideoSettingsPanel; + @synthesize executionControlWindow; @synthesize slot1ManagerWindow; @synthesize saveFileMigrationSheet; @@ -109,6 +113,10 @@ mainWindow = nil; windowList = [[NSMutableArray alloc] initWithCapacity:32]; + displayRotationPanelTitle = nil; + displaySeparationPanelTitle = nil; + displayVideoSettingsPanelTitle = nil; + currentRom = nil; cdsFirmware = nil; cdsSpeaker = nil; @@ -2111,6 +2119,32 @@ } } +- (void) updateDisplayPanelTitles +{ + // If the original panel titles haven't been saved yet, then save them now. + if (displayRotationPanelTitle == nil) + { + displayRotationPanelTitle = [[displayRotationPanel title] copy]; + displaySeparationPanelTitle = [[displaySeparationPanel title] copy]; + displayVideoSettingsPanelTitle = [[displayVideoSettingsPanel title] copy]; + } + + // Set the panel titles to the window number. + if ([windowList count] <= 1) + { + [displayRotationPanel setTitle:displayRotationPanelTitle]; + [displaySeparationPanel setTitle:displaySeparationPanelTitle]; + [displayVideoSettingsPanel setTitle:displayVideoSettingsPanelTitle]; + } + else + { + unsigned long windowNumber = (unsigned long)[windowList indexOfObject:mainWindow] + 1; + [displayRotationPanel setTitle:[displayRotationPanelTitle stringByAppendingFormat:@":%ld", windowNumber]]; + [displaySeparationPanel setTitle:[displaySeparationPanelTitle stringByAppendingFormat:@":%ld", windowNumber]]; + [displayVideoSettingsPanel setTitle:[displayVideoSettingsPanelTitle stringByAppendingFormat:@":%ld", windowNumber]]; + } +} + - (void) setupUserDefaults { CocoaDSCore *cdsCore = (CocoaDSCore *)[cdsCoreController content];