gtk: check if a "last opened" directory exists before setting directory to defaut in lua open dialog

This commit is contained in:
punkrockguy318 2013-07-08 23:06:26 +00:00
parent ae7c5ffc78
commit 5342a761a6
1 changed files with 3 additions and 1 deletions

View File

@ -1521,7 +1521,9 @@ void loadLua ()
const char* last_file;
g_config->getOption("SDL.LastLoadLua", &last_file);
gtk_file_chooser_set_filename(GTK_FILE_CHOOSER(fileChooser), last_file);
gtk_file_chooser_set_current_folder(GTK_FILE_CHOOSER(fileChooser), "/usr/share/fceux/luaScripts");
if(strcmp(last_file, "") == 0)
gtk_file_chooser_set_current_folder(GTK_FILE_CHOOSER(fileChooser), "/usr/share/fceux/luaScripts");
if (gtk_dialog_run (GTK_DIALOG (fileChooser)) ==GTK_RESPONSE_ACCEPT)
{