The file chooser activated by Browse buttons for filling a File or Path
text edit started in the last directory it visited for that file type.
But for the initial browse after startup it started in the current
directory. Now it starts in the directory derived from the filaname
currently in the text edit, if there is one, and only in the last-
visited directory for the file type if the text-edit was empty.
ASSIGN(*res, newName);
for(p=*res; q=strchr(p, '/');) p = q + 1; *p = NULLCHAR;
}
- if(*curDir) chdir(curDir);
+ }
+ if(*curDir) {
+ chdir(curDir);
*curDir = NULLCHAR;
} else {
getcwd(curDir, MSG_SIZ);
gtkfilter = gtk_file_filter_new();
gtkfilter_all = gtk_file_filter_new();
- char fileext[MSG_SIZ], *filter = currentOption[opt_i].textValue;
+ char fileext[MSG_SIZ], *filter = currentOption[opt_i].textValue, *old;
- StartDir(filter, NULL); // change to start directory for this file type
+ GetWidgetText(¤tOption[opt_i], &old); // start in same directory as current widget contents
+ StartDir(filter, old); // change to start directory for this file type
+ g_free(old);
/* select file or folder depending on option_type */
if (currentOption[opt_i].type == PathName)