Cocoa Port:

- Another file handling code update that I missed.
- Integrate DeSmuME's directory structure into this port.
This commit is contained in:
rogerman 2012-01-06 16:47:12 +00:00
parent a46431a236
commit 0bcaded804
3 changed files with 16 additions and 8 deletions

View File

@ -17,6 +17,7 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#import "cocoa_util.h"
#import "rom_info.h"
#import "../nds_control.h"
@ -86,7 +87,7 @@ inline void setUpTextField(NSTextField *text, bool data)
if(my_window == nil)
{
messageDialog(NSLocalizedString(@"Error", nil), @"ROM Info window couldn't be created");
[CocoaDSUtil quickDialogUsingTitle:NSLocalizedString(@"Error", nil) message:NSLocalizedString(@"ROM Info window couldn't be created", nil)];
return;
}
@ -169,7 +170,7 @@ inline void setUpTextField(NSTextField *text, bool data)
#define text sjdkasdladsjkalsd
//Rom file value
rom_file = [[NSTextField alloc] initWithFrame:NSMakeRect(127+sectionMaxWidth,173,120,17)];
[rom_file setStringValue:[[DS ROMFile] lastPathComponent]];
[rom_file setStringValue:[DS romFileName]];
setUpTextField(rom_file, true);
if([rom_file frame].size.width > valueMaxWidth)valueMaxWidth = [rom_file frame].size.width;
[[my_window contentView] addSubview:rom_file];
@ -229,7 +230,7 @@ inline void setUpTextField(NSTextField *text, bool data)
my_window_controller = [[NSWindowController alloc] initWithWindow:my_window];
if(my_window_controller == nil)
{
messageDialog(NSLocalizedString(@"Error", nil), @"ROM Info window controller couldn't be created");
[CocoaDSUtil quickDialogUsingTitle:NSLocalizedString(@"Error", nil) message:NSLocalizedString(@"ROM Info window controller couldn't be created", nil)];
[my_window release];
return;
}
@ -245,7 +246,7 @@ inline void setUpTextField(NSTextField *text, bool data)
[rom_icon setImage:[DS ROMIcon]];
[rom_file setStringValue:[[DS ROMFile] lastPathComponent]];
[rom_file setStringValue:[DS romFileName]];
[rom_file sizeToFit];
if([rom_file frame].size.width > valueMaxWidth)valueMaxWidth = [rom_file frame].size.width;

View File

@ -496,6 +496,16 @@ int main(int argc, char *argv[])
- (void)applicationWillFinishLaunching:(NSNotification*)notification
{
// Create the needed directories in Application Support if they haven't already
// been created.
if (![CocoaDSFile setupAllAppDirectories])
{
[CocoaDSUtil quickDialogUsingTitle:NSLocalizedString(@"Error", nil) message:NSLocalizedString(@"Could not create the required directories in your Application Support folder. DeSmuME will now quit.", nil)];
return;
}
[CocoaDSFile setupAllFilePaths];
SNDOSXStartup();
//Set default values for all preferences
@ -514,9 +524,6 @@ int main(int argc, char *argv[])
{
//Bring the application to the front
[NSApp activateIgnoringOtherApps:TRUE];
//create the video output window (the only window that opens with the app)
//main_window = [[VideoOutputWindow alloc] init];
//check if it should load something by default
if([[[NSUserDefaults standardUserDefaults] stringForKey:PREF_AFTER_LAUNCHED] compare:PREF_AFTER_LAUNCHED_OPTION_LAST_ROM]==NSOrderedSame)

View File

@ -124,7 +124,7 @@ public:
std::vector<std::string> parts = tokenize_str(filename,"|");
SetRomName(parts[parts.size()-1].c_str());
LoadModulePath();
#ifndef WIN32
#if !defined(WIN32) && !defined(DESMUME_COCOA)
ReadPathSettings();
#endif