X-Git-Url: http://winboard.nl/cgi-bin?a=blobdiff_plain;f=gtk%2Fxoptions.c;h=b6b38b6fdb79139018c8ecf706c880ba2b7b1eb1;hb=24659044481fa42b3846cb9e801fd06abe0a102e;hp=f64a2d5170e0edfcbdda20ec6fb6e7fd3e4dab2a;hpb=3adea301fad06305f222330b37a5c83e0d3cf359;p=xboard.git diff --git a/gtk/xoptions.c b/gtk/xoptions.c index f64a2d5..b6b38b6 100644 --- a/gtk/xoptions.c +++ b/gtk/xoptions.c @@ -1097,8 +1097,12 @@ void GenericCallback(GtkWidget *widget, gpointer gdata) if(currentCps) { name = gtk_button_get_label (GTK_BUTTON(widget)); if(currentOption[data].type == SaveButton) GenericReadout(currentOption, -1); - snprintf(buf, MSG_SIZ, "option %s\n", name); - SendToProgram(buf, currentCps); + if(data == 0) { // XBoard save button + SaveEngineSettings(currentCps == &second); PopDown(dlg); + } else { + snprintf(buf, MSG_SIZ, "option %s\n", name); + SendToProgram(buf, currentCps); + } } else ((ButtonCallback*) currentOption[data].target)(data); shells[dlg] = oldSh; // in case of multiple instances, restore previous (as this one could be popped down now) @@ -1126,7 +1130,7 @@ void BrowseGTK(GtkWidget *widget, gpointer gdata) GtkFileFilter *gtkfilter_all; int n, opt_i = (intptr_t) gdata; GtkFileChooserAction fc_action; - char buf[MSG_SIZ]; + char buf[MSG_SIZ], *p; gtkfilter = gtk_file_filter_new(); gtkfilter_all = gtk_file_filter_new(); @@ -1150,6 +1154,8 @@ void BrowseGTK(GtkWidget *widget, gpointer gdata) GTK_STOCK_OPEN, GTK_RESPONSE_ACCEPT, NULL); + if(*chessDir && (!(p = strstr(chessDir, "/home/")) || strchr(p+6, '/'))) + gtk_file_chooser_add_shortcut_folder(GTK_FILE_CHOOSER(dialog), chessDir, NULL); gtk_file_chooser_add_shortcut_folder(GTK_FILE_CHOOSER(dialog), dataDir, NULL); snprintf(buf, MSG_SIZ, "%s/themes", dataDir); gtk_file_chooser_add_shortcut_folder(GTK_FILE_CHOOSER(dialog), buf, NULL); @@ -1183,7 +1189,7 @@ void BrowseGTK(GtkWidget *widget, gpointer gdata) n = (int)(intptr_t) currentOption[opt_i].choice; if (n && !currentCps) { g_signal_connect (GTK_DIALOG (dialog), "selection-changed", G_CALLBACK(BrowseCallback), (gpointer)(intptr_t) opt_i); - gtk_window_set_title(GTK_WINDOW(dialog), _("*** Preview of selection in board window ***")); + gtk_window_set_title(GTK_WINDOW(dialog), _("*** Board window shows preview of selection ***")); } if (gtk_dialog_run (GTK_DIALOG (dialog)) == GTK_RESPONSE_ACCEPT)