From: Hugo Villeneuve Date: Sun, 8 Sep 2013 02:03:08 +0000 (-0400) Subject: Use current working directory for initial file selection dialog X-Git-Tag: v2.0.0~174 X-Git-Url: http://gitweb.hugovil.com/?a=commitdiff_plain;h=a689c767988e598344ba249cde5709c4b24f3e00;p=emu8051.git Use current working directory for initial file selection dialog --- diff --git a/src/filemenu.c b/src/filemenu.c index c3f13e0..560f4d9 100644 --- a/src/filemenu.c +++ b/src/filemenu.c @@ -38,6 +38,7 @@ void FileOpenEvent(GtkObject *object, gpointer data) { GtkWidget *file_dialog; + char *cwd; #if defined(DEBUG) g_print("FileOpenEvent()\n"); @@ -49,6 +50,11 @@ FileOpenEvent(GtkObject *object, gpointer data) GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, GTK_STOCK_OPEN, GTK_RESPONSE_ACCEPT, NULL); + /* Opening file chooser to current working directory. */ + cwd = g_get_current_dir(); + gtk_file_chooser_set_current_folder(GTK_FILE_CHOOSER(file_dialog), cwd); + g_free (cwd); + if (gtk_dialog_run(GTK_DIALOG(file_dialog)) == GTK_RESPONSE_ACCEPT) { char *selected_file;