Search
lxdream.org :: lxdream/src/cocoaui/cocoaui.m :: diff
lxdream 0.9.1
released Jun 29
Download Now
filename src/cocoaui/cocoaui.m
changeset 1041:5fcc39857c5c
prev1040:9e3e41eab2db
next1098:4f2750753a6c
author nkeynes
date Fri Jun 26 05:47:04 2009 +0000 (11 years ago)
permissions -rw-r--r--
last change Refactor path operations into lxpaths.[ch]
file annotate diff log raw
1.1 --- a/src/cocoaui/cocoaui.m Thu Jun 25 21:21:18 2009 +0000
1.2 +++ b/src/cocoaui/cocoaui.m Fri Jun 26 05:47:04 2009 +0000
1.3 @@ -25,6 +25,7 @@
1.4 #include "dream.h"
1.5 #include "dreamcast.h"
1.6 #include "config.h"
1.7 +#include "lxpaths.h"
1.8 #include "display.h"
1.9 #include "gui.h"
1.10 #include "gdrom/gdrom.h"
1.11 @@ -240,47 +241,47 @@
1.12 - (void) load_action: (id)sender
1.13 {
1.14 NSOpenPanel *panel = [NSOpenPanel openPanel];
1.15 - NSString *path = [NSString stringWithCString: gui_get_configurable_path(CONFIG_SAVE_PATH)];
1.16 + NSString *path = [NSString stringWithCString: get_gui_path(CONFIG_SAVE_PATH)];
1.17 NSArray *fileTypes = [NSArray arrayWithObject: @"dst"];
1.18 int result = [panel runModalForDirectory: path file: nil types: fileTypes];
1.19 if( result == NSOKButton && [[panel filenames] count] > 0 ) {
1.20 NSString *filename = [[panel filenames] objectAtIndex: 0];
1.21 dreamcast_load_state( [filename UTF8String] );
1.22 - gui_set_configurable_path(CONFIG_SAVE_PATH, [[panel directory] UTF8String]);
1.23 + set_gui_path(CONFIG_SAVE_PATH, [[panel directory] UTF8String]);
1.24 }
1.25 }
1.26 - (void) save_action: (id)sender
1.27 {
1.28 NSSavePanel *panel = [NSSavePanel savePanel];
1.29 - NSString *path = [NSString stringWithCString: gui_get_configurable_path(CONFIG_SAVE_PATH)];
1.30 + NSString *path = [NSString stringWithCString: get_gui_path(CONFIG_SAVE_PATH)];
1.31 [panel setRequiredFileType: @"dst"];
1.32 int result = [panel runModalForDirectory: path file:@""];
1.33 if( result == NSOKButton ) {
1.34 NSString *filename = [panel filename];
1.35 dreamcast_save_state( [filename UTF8String] );
1.36 - gui_set_configurable_path(CONFIG_SAVE_PATH, [[panel directory] UTF8String]);
1.37 + set_gui_path(CONFIG_SAVE_PATH, [[panel directory] UTF8String]);
1.38 }
1.39 }
1.40 - (void) load_binary_action: (id)sender
1.41 {
1.42 NSOpenPanel *panel = [NSOpenPanel openPanel];
1.43 - NSString *path = [NSString stringWithCString: gui_get_configurable_path(CONFIG_DEFAULT_PATH)];
1.44 + NSString *path = [NSString stringWithCString: get_gui_path(CONFIG_DEFAULT_PATH)];
1.45 int result = [panel runModalForDirectory: path file: nil types: nil];
1.46 if( result == NSOKButton && [[panel filenames] count] > 0 ) {
1.47 NSString *filename = [[panel filenames] objectAtIndex: 0];
1.48 file_load_magic( [filename UTF8String] );
1.49 - gui_set_configurable_path(CONFIG_DEFAULT_PATH, [[panel directory] UTF8String]);
1.50 + set_gui_path(CONFIG_DEFAULT_PATH, [[panel directory] UTF8String]);
1.51 }
1.52 }
1.53 - (void) mount_action: (id)sender
1.54 {
1.55 NSOpenPanel *panel = [NSOpenPanel openPanel];
1.56 - NSString *path = [NSString stringWithCString: gui_get_configurable_path(CONFIG_DEFAULT_PATH)];
1.57 + NSString *path = [NSString stringWithCString: get_gui_path(CONFIG_DEFAULT_PATH)];
1.58 int result = [panel runModalForDirectory: path file: nil types: nil];
1.59 if( result == NSOKButton && [[panel filenames] count] > 0 ) {
1.60 NSString *filename = [[panel filenames] objectAtIndex: 0];
1.61 gdrom_mount_image( [filename UTF8String] );
1.62 - gui_set_configurable_path(CONFIG_DEFAULT_PATH, [[panel directory] UTF8String]);
1.63 + set_gui_path(CONFIG_DEFAULT_PATH, [[panel directory] UTF8String]);
1.64 }
1.65 }
1.66 - (void) pause_action: (id)sender
.