From 839727664b81eafb1191589a38158cf5d9f6ea1e Mon Sep 17 00:00:00 2001 From: rogerman Date: Wed, 20 Feb 2013 01:50:43 +0000 Subject: [PATCH] Cocoa Port: - Do some Cocoa bindings cleanup. --- .../translations/English.lproj/MainMenu.xib | 47 ++++++++----------- .../userinterface/EmuControllerDelegate.h | 4 +- .../userinterface/EmuControllerDelegate.mm | 10 ++-- 3 files changed, 24 insertions(+), 37 deletions(-) diff --git a/desmume/src/cocoa/translations/English.lproj/MainMenu.xib b/desmume/src/cocoa/translations/English.lproj/MainMenu.xib index 1201a40f0..ec469b063 100644 --- a/desmume/src/cocoa/translations/English.lproj/MainMenu.xib +++ b/desmume/src/cocoa/translations/English.lproj/MainMenu.xib @@ -13,7 +13,6 @@ YES - YES @@ -15062,7 +15061,7 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA {1.79769e+308, 1.79769e+308} - + 256 YES @@ -15963,7 +15962,6 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA {284, 560} - {{0, 0}, {1920, 1178}} {1.79769e+308, 1.79769e+308} @@ -20172,6 +20170,7 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA mainWindow.useBilinearOutput mainWindow.useVerticalSync mainWindow.screenshotFileFormat + selectedExportRomSaveID EmuControllerDelegate @@ -27414,30 +27413,6 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA 6719 - - - selectExportRomSaveFormat: - - - - 6720 - - - - selectExportRomSaveFormat: - - - - 6721 - - - - selectExportRomSaveFormat: - - - - 6722 - changeCoreEmuFlags: @@ -29237,6 +29212,22 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA 7000 + + + selectedTag: selection.selectedExportRomSaveID + + + + + + selectedTag: selection.selectedExportRomSaveID + selectedTag + selection.selectedExportRomSaveID + 2 + + + 7001 + @@ -46650,7 +46641,7 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA - 7000 + 7001 diff --git a/desmume/src/cocoa/userinterface/EmuControllerDelegate.h b/desmume/src/cocoa/userinterface/EmuControllerDelegate.h index 62ae5646b..2898c371e 100644 --- a/desmume/src/cocoa/userinterface/EmuControllerDelegate.h +++ b/desmume/src/cocoa/userinterface/EmuControllerDelegate.h @@ -49,7 +49,6 @@ NSView *exportRomSavePanelAccessoryView; BOOL isSaveStateEdited; - NSInteger selectedExportRomSaveID; BOOL isWorking; BOOL isRomLoading; @@ -60,6 +59,7 @@ BOOL isShowingFileMigrationDialog; BOOL isUserInterfaceBlockingExecution; NSURL *currentSaveStateURL; + NSInteger selectedExportRomSaveID; NSInteger selectedRomSaveTypeID; NSImage *iconVolumeFull; @@ -114,6 +114,7 @@ @property (assign) BOOL isShowingFileMigrationDialog; @property (assign) BOOL isUserInterfaceBlockingExecution; @property (retain) NSURL *currentSaveStateURL; +@property (assign) NSInteger selectedExportRomSaveID; @property (assign) NSInteger selectedRomSaveTypeID; @property (assign) NSInteger render3DRenderingEngine; @@ -142,7 +143,6 @@ - (IBAction) saveEmuSaveStateSlot:(id)sender; - (IBAction) importRomSave:(id)sender; - (IBAction) exportRomSave:(id)sender; -- (IBAction) selectExportRomSaveFormat:(id)sender; // Edit Menu - (IBAction) copy:(id)sender; diff --git a/desmume/src/cocoa/userinterface/EmuControllerDelegate.mm b/desmume/src/cocoa/userinterface/EmuControllerDelegate.mm index fc30f58ee..466e21747 100644 --- a/desmume/src/cocoa/userinterface/EmuControllerDelegate.mm +++ b/desmume/src/cocoa/userinterface/EmuControllerDelegate.mm @@ -69,6 +69,7 @@ @synthesize isUserInterfaceBlockingExecution; @synthesize currentSaveStateURL; +@synthesize selectedExportRomSaveID; @synthesize selectedRomSaveTypeID; @dynamic render3DRenderingEngine; @@ -110,8 +111,8 @@ isUserInterfaceBlockingExecution = NO; currentSaveStateURL = nil; - selectedExportRomSaveID = 0; selectedRomSaveTypeID = ROMSAVETYPE_AUTOMATIC; + selectedExportRomSaveID = 0; iconExecute = [[NSImage alloc] initWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"Icon_Execute_420x420" ofType:@"png"]]; iconPause = [[NSImage alloc] initWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"Icon_Pause_420x420" ofType:@"png"]]; @@ -749,7 +750,7 @@ NSURL *romSaveURL = [CocoaDSFile fileURLFromRomURL:[[self currentRom] fileURL] toKind:@"ROM Save"]; if (romSaveURL != nil) { - const BOOL isRomSaveExported = [CocoaDSFile exportRomSaveToURL:[panel URL] romSaveURL:romSaveURL fileType:selectedExportRomSaveID]; + const BOOL isRomSaveExported = [CocoaDSFile exportRomSaveToURL:[panel URL] romSaveURL:romSaveURL fileType:[self selectedExportRomSaveID]]; [self setStatusText:(isRomSaveExported) ? NSSTRING_STATUS_ROM_SAVE_EXPORTED : NSSTRING_STATUS_ROM_SAVE_EXPORT_FAILED]; } } @@ -757,11 +758,6 @@ [self restoreCoreState]; } -- (IBAction) selectExportRomSaveFormat:(id)sender -{ - selectedExportRomSaveID = [CocoaDSUtil getIBActionSenderTag:sender]; -} - - (IBAction) copy:(id)sender { [mainWindow copy:sender];