X-Git-Url: http://winboard.nl/cgi-bin?a=blobdiff_plain;f=gtk%2Fxoptions.c;h=fbe1c232b4cc10be5e8cf25c0e15880da90f3541;hb=e449d7412605812532c2d6590c6bda99e27f1885;hp=dedebffa44715fc2fa51246de34d3f38b7c8e2cb;hpb=b2460f297a8444bde94a7e3917ecb7598eb2899e;p=xboard.git diff --git a/gtk/xoptions.c b/gtk/xoptions.c index dedebff..fbe1c23 100644 --- a/gtk/xoptions.c +++ b/gtk/xoptions.c @@ -1110,9 +1110,11 @@ BrowseCallback (GtkFileChooser *chooser, gpointer data) char *name = gtk_file_chooser_get_filename(GTK_FILE_CHOOSER(chooser)); Option *opt = currentOption + (int)(intptr_t) data; int n = (int) (intptr_t) opt->choice; - Preview(n, name); - messedUp = TRUE; - if(name) g_free(name); + if(name) { + Preview(n, name); + messedUp = TRUE; + g_free(name); + } return FALSE; } @@ -1124,7 +1126,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(); @@ -1148,6 +1150,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); @@ -1179,8 +1183,10 @@ void BrowseGTK(GtkWidget *widget, gpointer gdata) messedUp = FALSE; n = (int)(intptr_t) currentOption[opt_i].choice; - if (n && !currentCps) + 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), _("*** Board window shows preview of selection ***")); + } if (gtk_dialog_run (GTK_DIALOG (dialog)) == GTK_RESPONSE_ACCEPT) {