Search
lxdream.org :: lxdream/src/gui/path_dlg.c :: diff
lxdream 0.9.1
released Jun 29
Download Now
filename src/gui/path_dlg.c
changeset 461:63d4de8dcec6
prev455:3080881d00d4
next481:3b2d6c5a19ad
author nkeynes
date Tue Oct 23 10:48:24 2007 +0000 (13 years ago)
permissions -rw-r--r--
last change Reload BIOS/flash when changed in configuration.
Fix mem_load_rom to deal with repeat loads and dodgy files
file annotate diff log raw
1.1 --- a/src/gui/path_dlg.c Sun Oct 21 05:21:35 2007 +0000
1.2 +++ b/src/gui/path_dlg.c Tue Oct 23 10:48:24 2007 +0000
1.3 @@ -1,5 +1,5 @@
1.4 /**
1.5 - * $Id: path_dlg.c,v 1.2 2007-10-21 05:21:35 nkeynes Exp $
1.6 + * $Id: path_dlg.c,v 1.3 2007-10-23 10:48:24 nkeynes Exp $
1.7 *
1.8 * Define the main (emu) GTK window, along with its menubars,
1.9 * toolbars, etc.
1.10 @@ -94,6 +94,7 @@
1.11 gtk_table_attach( GTK_TABLE(table), gtk_label_new(path_label[i]), 0, 1, i, i+1,
1.12 GTK_SHRINK, GTK_SHRINK, 0, 0);
1.13 gtk_entry_set_text( GTK_ENTRY(text), lxdream_get_config_value(path_id[i]) );
1.14 + gtk_entry_set_width_chars( GTK_ENTRY(text), 48 );
1.15 gtk_table_attach_defaults( GTK_TABLE(table), text, 1, 2, i, i+1 );
1.16 gtk_table_attach( GTK_TABLE(table), button, 2, 3, i, i+1, GTK_SHRINK, GTK_SHRINK, 0, 0 );
1.17 if( path_action[i] == GTK_FILE_CHOOSER_ACTION_OPEN ) {
1.18 @@ -110,32 +111,21 @@
1.19
1.20 }
1.21
1.22 -void path_panel_commit_changes()
1.23 +void path_panel_done( GtkWidget *panel, gboolean isOK )
1.24 {
1.25 - int i;
1.26 - for(i=0; i<5; i++ ) {
1.27 - const char *filename = gtk_entry_get_text( GTK_ENTRY(path_entry[i]) );
1.28 - lxdream_set_config_value( path_id[i], filename );
1.29 + if( isOK ) {
1.30 + int i;
1.31 + for(i=0; i<5; i++ ) {
1.32 + const char *filename = gtk_entry_get_text( GTK_ENTRY(path_entry[i]) );
1.33 + lxdream_set_global_config_value( path_id[i], filename );
1.34 + }
1.35 +
1.36 + lxdream_save_config();
1.37 + dreamcast_config_changed();
1.38 }
1.39 -
1.40 - lxdream_save_config();
1.41 }
1.42
1.43 void path_dialog_run( void )
1.44 {
1.45 - GtkWidget *dialog =
1.46 - gtk_dialog_new_with_buttons("Path Settings", NULL,
1.47 - GTK_DIALOG_MODAL|GTK_DIALOG_DESTROY_WITH_PARENT,
1.48 - GTK_STOCK_OK, GTK_RESPONSE_ACCEPT,
1.49 - GTK_STOCK_CANCEL, GTK_RESPONSE_REJECT,
1.50 - NULL);
1.51 - gint result;
1.52 - GtkWidget *panel = path_panel_new();
1.53 - gtk_widget_show_all(panel);
1.54 - gtk_container_add( GTK_CONTAINER(GTK_DIALOG(dialog)->vbox), panel );
1.55 - result = gtk_dialog_run( GTK_DIALOG(dialog) );
1.56 - if( result == GTK_RESPONSE_ACCEPT ) {
1.57 - path_panel_commit_changes();
1.58 - }
1.59 - gtk_widget_destroy( dialog );
1.60 + gtk_gui_run_property_dialog( "Path Settings", path_panel_new(), path_panel_done );
1.61 }
.