From 8401b26bfaeafc08dfa6dcd025349e127e5bfff5 Mon Sep 17 00:00:00 2001 From: markgrebe Date: Mon, 2 Aug 2004 04:09:10 +0000 Subject: [PATCH] Added preference to allow user to select the directory in which ROM images are stored. This simply sets the default directory to start the browsing in, and doesn't preclude the user from selecting a file outside that directory git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@333 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba --- stella/src/macosx/Menus.h | 5 +- stella/src/macosx/Menus.m | 54 ++++++++++++++++-- stella/src/macosx/SDLMain.nib/classes.nib | 2 + stella/src/macosx/SDLMain.nib/info.nib | 4 +- stella/src/macosx/SDLMain.nib/objects.nib | Bin 7911 -> 8380 bytes stella/src/macosx/SettingsMACOSX.cxx | 7 ++- stella/src/macosx/mainSDL.cxx | 20 +++++-- .../src/macosx/stella.pbproj/project.pbxproj | 4 +- 8 files changed, 79 insertions(+), 17 deletions(-) diff --git a/stella/src/macosx/Menus.h b/stella/src/macosx/Menus.h index 5b216e914..051ad7503 100755 --- a/stella/src/macosx/Menus.h +++ b/stella/src/macosx/Menus.h @@ -4,7 +4,7 @@ Mark Grebe */ -/* $Id: Menus.h,v 1.2 2004-07-14 06:54:17 markgrebe Exp $ */ +/* $Id: Menus.h,v 1.3 2004-08-02 04:08:10 markgrebe Exp $ */ #import @@ -15,11 +15,13 @@ IBOutlet id videoModeMatrix; IBOutlet id volumeSlider; IBOutlet id aspectRatioField; + IBOutlet id romDirField; int openGlEnabled; int gameMenusEnabled; } + (Menus *)sharedInstance; +- (NSString *) browseDir; - (void)setSpeedLimitMenu:(int)limit; - (void)initVideoMenu:(int)openGl; - (void)setPaddleMenu:(int)number; @@ -28,6 +30,7 @@ - (void)pushKeyEvent:(int)key:(bool)shift; - (IBAction) paddleChange:(id) sender; - (IBAction) prefsOK:(id) sender; +- (IBAction) romdirSelect:(id) sender; - (IBAction)prefsMenu:(id)sender; - (IBAction)biggerScreen:(id)sender; - (IBAction)smallerScreen:(id)sender; diff --git a/stella/src/macosx/Menus.m b/stella/src/macosx/Menus.m index ed4b5c40f..4c37bd50d 100755 --- a/stella/src/macosx/Menus.m +++ b/stella/src/macosx/Menus.m @@ -4,7 +4,7 @@ Mark Grebe */ -/* $Id: Menus.m,v 1.2 2004-07-14 06:54:17 markgrebe Exp $ */ +/* $Id: Menus.m,v 1.3 2004-08-02 04:08:10 markgrebe Exp $ */ #import #import "Menus.h" @@ -17,8 +17,10 @@ #define QZ_COMMA 0x2B extern void setPaddleMode(int mode); -extern void getPrefsSettings(int *gl, int *volume, float *aspect); -extern void setPrefsSettings(int gl, int volume, float aspect); +extern void getPrefsSettings(int *gl, int *volume, float *aspect, const char **romdir); +extern void setPrefsSettings(int gl, int volume, float aspect, const char *romdir); +void getRomdirSetting(char *romdir); + /*------------------------------------------------------------------------------ * releaseCmdKeys - This method fixes an issue when modal windows are used with @@ -52,22 +54,29 @@ void releaseCmdKeys(NSString *character, int keyCode) char *browseFile(void) { NSOpenPanel *openPanel = nil; char *fileName; + NSString *dirName; + char cdirName[FILENAME_MAX]; fileName = malloc(FILENAME_MAX); if (fileName == NULL) return NULL; + getRomdirSetting(cdirName); + dirName = [NSString stringWithCString:cdirName]; + openPanel = [NSOpenPanel openPanel]; [openPanel setCanChooseDirectories:NO]; [openPanel setCanChooseFiles:YES]; - if ([openPanel runModalForDirectory:nil file:nil types:nil] == NSOKButton) { + if ([openPanel runModalForDirectory:dirName file:nil types:nil] == NSOKButton) { [[[openPanel filenames] objectAtIndex:0] getCString:fileName]; releaseCmdKeys(@"o",QZ_o); + [dirName release]; return fileName; } else { releaseCmdKeys(@"o",QZ_o); + [dirName release]; return NULL; } } @@ -129,6 +138,22 @@ static Menus *sharedInstance = nil; return(self); } +/*------------------------------------------------------------------------------ +* browseDir - Method which allows user to choose a directory. +*-----------------------------------------------------------------------------*/ +- (NSString *) browseDir { + NSOpenPanel *openPanel; + + openPanel = [NSOpenPanel openPanel]; + [openPanel setCanChooseDirectories:YES]; + [openPanel setCanChooseFiles:NO]; + + if ([openPanel runModalForTypes:nil] == NSOKButton) + return([[openPanel filenames] objectAtIndex:0]); + else + return nil; + } + - (void)setSpeedLimitMenu:(int)limit { if (limit) @@ -167,20 +192,27 @@ static Menus *sharedInstance = nil; { int gl, volume; float aspectRatio; + const char *romdir; + const char *newRomdir; + NSString *romDirString; - getPrefsSettings(&gl, &volume, &aspectRatio); + getPrefsSettings(&gl, &volume, &aspectRatio, &romdir); + romDirString = [NSString stringWithCString:romdir]; [volumeSlider setIntValue:volume]; [videoModeMatrix selectCellWithTag:gl]; [aspectRatioField setFloatValue:aspectRatio]; + [romDirField setStringValue:romDirString]; [NSApp runModalForWindow:[volumeSlider window]]; gl = [[videoModeMatrix selectedCell] tag]; volume = [volumeSlider intValue]; aspectRatio = [aspectRatioField floatValue]; + romDirString = [romDirField stringValue]; + newRomdir = [romDirString cString]; - setPrefsSettings(gl, volume, aspectRatio); + setPrefsSettings(gl, volume, aspectRatio, newRomdir); } - (IBAction) prefsOK:(id) sender @@ -188,6 +220,16 @@ static Menus *sharedInstance = nil; [NSApp stopModal]; [[volumeSlider window] close]; } + +- (IBAction) romdirSelect:(id) sender +{ + NSString *directory; + + directory = [self browseDir]; + if (directory != nil) + [romDirField setStringValue:directory]; +} + - (IBAction)prefsMenu:(id)sender { [[Menus sharedInstance] prefsStart]; diff --git a/stella/src/macosx/SDLMain.nib/classes.nib b/stella/src/macosx/SDLMain.nib/classes.nib index 21c23e381..c924199ee 100644 --- a/stella/src/macosx/SDLMain.nib/classes.nib +++ b/stella/src/macosx/SDLMain.nib/classes.nib @@ -23,6 +23,7 @@ prefsMenu = id; prefsOK = id; rightJoyChange = id; + romdirSelect = id; smallerScreen = id; speedLimit = id; toggleGlFilter = id; @@ -41,6 +42,7 @@ filterMenu = id; limitSpeedMenu = id; paddlesMenu = id; + romDirField = id; videoModeMatrix = id; volumeSlider = id; }; diff --git a/stella/src/macosx/SDLMain.nib/info.nib b/stella/src/macosx/SDLMain.nib/info.nib index f05116f85..43a619b76 100644 --- a/stella/src/macosx/SDLMain.nib/info.nib +++ b/stella/src/macosx/SDLMain.nib/info.nib @@ -3,7 +3,7 @@ IBDocumentLocation - 495 397 359 316 0 0 1280 1002 + 451 517 359 316 0 0 1280 1002 IBEditorPositions 29 @@ -13,8 +13,8 @@ 349.0 IBOpenObjects - 29 578 + 29 IBSystem Version 7H63 diff --git a/stella/src/macosx/SDLMain.nib/objects.nib b/stella/src/macosx/SDLMain.nib/objects.nib index e2c67dc2f640089d934eaef4aa143aafaaa8d8c8..9f7952cb15248b4d7885ac75a8f1c60321695a94 100644 GIT binary patch literal 8380 zcmb7J3v^t?d7c?bw%)dEWEZEYH-KX!Bin18^f)#TJsdxdt%tqlbtp|%yI0c2t6gOu zwyaWY3dOg^tZoty4k#vb%oMSI7_bWi_4W149vqzO*|^;W5=kRP znp;C8;@!t=doIZ9;lNOF%Dz7}Y*zqr>sEzbzdoQTR5Y}Q<1ts3&fp+Rvi`d#CMH+{ zMCZ47%+_{V(QrKCv#uSGiZ7JX?d`OZ7^_`E)}}7Yx4YXL*_})#?1$xd0RggtGzWSu zzbEF6SpY#}_?Oh;993JWY>QYOR>TVVtmvv$s}x0kU9z9eXBjabN_;zf4F~jbnXo!4moScODC@$AU zkw){(U33d#A*@VYt^^p<)G9pCy%lmb20A;HA0V(+&SqhQRhh=}bbEurG+OP9XfNm3 zm2Qd$gHg>=^QxE;NlQ4pFXzZsczP_$@7f;d4#d*p1ZStL{J*r#8;6r__IB$W#d~H) zxm;nY)6vt~1HEoW@C1Sxp*m*gpoE&2#%@!ZjUgQ>leEo_ce#?~1^m=BWLHMx?cK;A z4L((7*6S2Jid=lDgff=rVXD$JdjlcmV{?>s#*eZiQ#l>eq=%EKchf6=eDM`yI{$+L z6j0U_4#gs2#;9rzD~||7T?W;) zMyr3#Z0er@)2%Vx(=d6iw#|UKR%5Q6hAA$IS*J1UrePKsOc+z^)M%%4bHv;3(i_%j zozu|LWmrMWP-Hg22Bya3S!T|yfsj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lULyFAIt{5nr!yhj2|nPA2GsPb-nMR8`@k18ur{q**t4K7X=qgx z&FER6(|HiCUn`=zXgT)=1M0zNwza8v^;k$(279~%4(-`0?-1FG-Z70XPYfp;{hT7%$hMX>XE zw1bzUy_-kVpqXfIhPA1R)0#l_zDicx_e&I-7LI9FJBhQ42;l2#- zX{wd`Wp{Um2=C|FRFIjhe2@qAt1j&ftPk^CYES{q!#(%#sDmH->``W%5~rE*=Yknk zj2;#8dZ)X@g`_ycj9qv=#OUKLq?Ba{BMkgMKvRTgz-Ny`bAN~$WO$1M!$*)#Lge% z@g}49;_(Qh-C_|lqT*&|xZ-JMJSSdcMvvIdXsd`ax>-zo0z4Uv4rBTMG5VNT&FJ0Y z1N`=y&k;_l$l)Agfv~1fvg$cNqN>@l$4uiFQWYv8;m8Z;Nh5H;Ku0 zqJh!h1rBHQ>j0H7`h<9&(Qk+sm~pQ-%#1$-@Ry9{@c3^=zl_JjjQk3ZSD5ihJUm86 z#cRwM7d?#r4kmuiXjDAQj30<4%y?70$LN!o{Rw2i<8K-LJv{z}QBwqfEXJ9!SyVAH zEI{w9xU~;Zm~OXtiW%R>`0p6qDeyZj7jHBAuy~0X9bmJR(Zgbl8Gj`{UMm(b!@|m6 zG5V)?yogjupi~?Xmzu;Ij6NcU4UuGY1hD^M^bhcOl^L(&@gI!#iF1tZ!1!Mo?Zx9U zMmLIQnDM+=%8WO}yNrHKtYfqVpnqia_r*ud*fz@Ou~Cx4&9Gq0#@1vwX>LN9Y3)zS H-)8?GYCH35 diff --git a/stella/src/macosx/SettingsMACOSX.cxx b/stella/src/macosx/SettingsMACOSX.cxx index 8dd9f59a4..bf6460140 100644 --- a/stella/src/macosx/SettingsMACOSX.cxx +++ b/stella/src/macosx/SettingsMACOSX.cxx @@ -13,7 +13,7 @@ // See the file "license" for information on usage and redistribution of // this file, and for a DISCLAIMER OF ALL WARRANTIES. // -// $Id: SettingsMACOSX.cxx,v 1.1.1.1 2004-06-16 02:30:30 markgrebe Exp $ +// $Id: SettingsMACOSX.cxx,v 1.2 2004-08-02 04:08:10 markgrebe Exp $ //============================================================================ #include @@ -41,6 +41,8 @@ void prefsSave(void); // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - SettingsMACOSX::SettingsMACOSX() { + char workingDir[FILENAME_MAX]; + // First set variables that the parent class needs myBaseDir = "./"; string stelladir = myBaseDir; @@ -65,6 +67,9 @@ SettingsMACOSX::SettingsMACOSX() #ifdef SNAPSHOT_SUPPORT set("ssdir", "./"); #endif + getwd(workingDir); + set("romdir", workingDir); + } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/stella/src/macosx/mainSDL.cxx b/stella/src/macosx/mainSDL.cxx index 47045402d..9bb5614e5 100644 --- a/stella/src/macosx/mainSDL.cxx +++ b/stella/src/macosx/mainSDL.cxx @@ -13,7 +13,7 @@ // See the file "license" for information on usage and redistribution of // this file, and for a DISCLAIMER OF ALL WARRANTIES. // -// $Id: mainSDL.cxx,v 1.5 2004-08-02 00:28:48 markgrebe Exp $ +// $Id: mainSDL.cxx,v 1.6 2004-08-02 04:08:10 markgrebe Exp $ //============================================================================ #include @@ -56,8 +56,9 @@ int stellaMain(int argc, char* argv[]); void setPaddleMode(int mode); void setLeftJoystickMode(int mode); void setRightJoystickMode(int mode); -void getPrefsSettings(int *gl, int *volume, float *aspect); -void setPrefsSettings(int gl, int volume, float aspect); +void getPrefsSettings(int *gl, int *volume, float *aspect, const char **romdir); +void setPrefsSettings(int gl, int volume, float aspect, const char *romdir); +void getRomdirSetting(char *romdir); char *browseFile(void); void prefsStart(void); void hideApp(void); @@ -286,7 +287,7 @@ void setPaddleMode(int mode) theSettings->setInt("paddle",thePaddleMode); } -void getPrefsSettings(int *gl, int *volume, float *aspect) +void getPrefsSettings(int *gl, int *volume, float *aspect, const char **romdir) { if (theSettings->getString("video") == "gl") *gl = 1; @@ -298,9 +299,16 @@ void getPrefsSettings(int *gl, int *volume, float *aspect) *volume = 100; *aspect = theSettings->getFloat("gl_aspect"); + + *romdir = theSettings->getString("romdir").c_str(); } -void setPrefsSettings(int gl, int volume, float aspect) +void getRomdirSetting(char *romdir) +{ + strcpy(romdir, theSettings->getString("romdir").c_str()); +} + +void setPrefsSettings(int gl, int volume, float aspect, const char *romdir) { if (gl) theSettings->setString("video","gl"); @@ -311,6 +319,8 @@ void setPrefsSettings(int gl, int volume, float aspect) theSound->setVolume(volume); theSettings->setFloat("gl_aspect",aspect); + + theSettings->setString("romdir",romdir); } /** diff --git a/stella/src/macosx/stella.pbproj/project.pbxproj b/stella/src/macosx/stella.pbproj/project.pbxproj index 9abe54455..516757a25 100755 --- a/stella/src/macosx/stella.pbproj/project.pbxproj +++ b/stella/src/macosx/stella.pbproj/project.pbxproj @@ -392,7 +392,7 @@ CFBundleExecutable StellaOSX CFBundleGetInfoString - 1.4 + 1.4.1 CFBundleHelpBookFolder docs CFBundleHelpBookName @@ -408,7 +408,7 @@ CFBundleSignature StLa CFBundleVersion - 1.4 + 1.4.1 NSMainNibFile SDLMain.nib NSPrincipalClass