filename | src/cocoaui/cocoaui.m |
changeset | 1036:af7b0c5905dd |
prev | 1028:f99eeaf084c2 |
next | 1040:9e3e41eab2db |
author | nkeynes |
date | Wed Jun 24 06:06:40 2009 +0000 (13 years ago) |
permissions | -rw-r--r-- |
last change | Support shell substitutions in config paths Keep track of last folder in file dialogs Fix out-of-dateness in GTK path dialog |
file | annotate | diff | log | raw |
1.1 --- a/src/cocoaui/cocoaui.m Sun Jun 14 11:44:19 2009 +00001.2 +++ b/src/cocoaui/cocoaui.m Wed Jun 24 06:06:40 2009 +00001.3 @@ -220,47 +220,47 @@1.4 - (void) load_action: (id)sender1.5 {1.6 NSOpenPanel *panel = [NSOpenPanel openPanel];1.7 - const gchar *dir = lxdream_get_config_value(CONFIG_SAVE_PATH);1.8 - NSString *path = (dir == NULL ? NSHomeDirectory() : [NSString stringWithCString: dir]);1.9 + NSString *path = [NSString stringWithCString: gui_get_configurable_path(CONFIG_SAVE_PATH)];1.10 NSArray *fileTypes = [NSArray arrayWithObject: @"dst"];1.11 int result = [panel runModalForDirectory: path file: nil types: fileTypes];1.12 if( result == NSOKButton && [[panel filenames] count] > 0 ) {1.13 NSString *filename = [[panel filenames] objectAtIndex: 0];1.14 dreamcast_load_state( [filename UTF8String] );1.15 + gui_set_configurable_path(CONFIG_SAVE_PATH, [[panel directory] UTF8String]);1.16 }1.17 }1.18 - (void) save_action: (id)sender1.19 {1.20 NSSavePanel *panel = [NSSavePanel savePanel];1.21 - const gchar *dir = lxdream_get_config_value(CONFIG_SAVE_PATH);1.22 - NSString *path = (dir == NULL ? NSHomeDirectory() : [NSString stringWithCString: dir]);1.23 + NSString *path = [NSString stringWithCString: gui_get_configurable_path(CONFIG_SAVE_PATH)];1.24 [panel setRequiredFileType: @"dst"];1.25 int result = [panel runModalForDirectory: path file:@""];1.26 if( result == NSOKButton ) {1.27 NSString *filename = [panel filename];1.28 dreamcast_save_state( [filename UTF8String] );1.29 + gui_set_configurable_path(CONFIG_SAVE_PATH, [[panel directory] UTF8String]);1.30 }1.31 }1.32 - (void) load_binary_action: (id)sender1.33 {1.34 NSOpenPanel *panel = [NSOpenPanel openPanel];1.35 - const gchar *dir = lxdream_get_config_value(CONFIG_DEFAULT_PATH);1.36 - NSString *path = (dir == NULL ? NSHomeDirectory() : [NSString stringWithCString: dir]);1.37 + NSString *path = [NSString stringWithCString: gui_get_configurable_path(CONFIG_DEFAULT_PATH)];1.38 int result = [panel runModalForDirectory: path file: nil types: nil];1.39 if( result == NSOKButton && [[panel filenames] count] > 0 ) {1.40 NSString *filename = [[panel filenames] objectAtIndex: 0];1.41 file_load_magic( [filename UTF8String] );1.42 + gui_set_configurable_path(CONFIG_DEFAULT_PATH, [[panel directory] UTF8String]);1.43 }1.44 }1.45 - (void) mount_action: (id)sender1.46 {1.47 NSOpenPanel *panel = [NSOpenPanel openPanel];1.48 - const gchar *dir = lxdream_get_config_value(CONFIG_DEFAULT_PATH);1.49 - NSString *path = (dir == NULL ? NSHomeDirectory() : [NSString stringWithCString: dir]);1.50 + NSString *path = [NSString stringWithCString: gui_get_configurable_path(CONFIG_DEFAULT_PATH)];1.51 int result = [panel runModalForDirectory: path file: nil types: nil];1.52 if( result == NSOKButton && [[panel filenames] count] > 0 ) {1.53 NSString *filename = [[panel filenames] objectAtIndex: 0];1.54 gdrom_mount_image( [filename UTF8String] );1.55 + gui_set_configurable_path(CONFIG_DEFAULT_PATH, [[panel directory] UTF8String]);1.56 }1.57 }1.58 - (void) pause_action: (id)sender
.