If a filter is specified for the filebox, don't show the last

opened file in the selection box.


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@3148 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
Dave Peticolas 2000-11-14 23:17:20 +00:00
parent 5063dbb5cc
commit 0ec498fe1c
3 changed files with 8 additions and 12 deletions

View File

@ -379,19 +379,15 @@ gncFileOpen (void)
if (!gncFileQuerySave ()) if (!gncFileQuerySave ())
return; return;
newfile = fileBox(_("Open"), "*.gnc"); newfile = fileBox(_("Open"), NULL);
gncPostFileOpen (newfile); gncPostFileOpen (newfile);
/* This dialogue can show up early in the startup process. /* This dialogue can show up early in the startup process. If the
* If the user fails to pick a file (by e.g. hitting the cancel * user fails to pick a file (by e.g. hitting the cancel button), we
* button), we might be left with a null topgroup, which leads * might be left with a null topgroup, which leads to nastiness when
* to nastiness when user goes to create their very first account. * user goes to create their very first account. So create one. */
* Don't leave their ass in a sling, give them what they need. if (topgroup == NULL)
*/
if (NULL == topgroup)
{
topgroup = xaccMallocAccountGroup(); topgroup = xaccMallocAccountGroup();
}
} }
void void

View File

@ -83,7 +83,7 @@ fileBox(const char * title, const char * filter)
fb_info.file_name = NULL; fb_info.file_name = NULL;
last_file = gnc_history_get_last(); last_file = gnc_history_get_last();
if (last_file != NULL) if (last_file && !filter)
gtk_file_selection_set_filename(fb_info.file_box, last_file); gtk_file_selection_set_filename(fb_info.file_box, last_file);
/* hack alert - this was filtering directory names as well as file /* hack alert - this was filtering directory names as well as file

View File

@ -99,7 +99,7 @@
(list "Extensions" "") (list "Extensions" "")
(lambda () (lambda ()
(let ((file-name (gnc:file-selection-dialog (let ((file-name (gnc:file-selection-dialog
"Select file to save strings in" ""))) "Select file to save strings in" ".txt")))
(if file-name (gnc:save-translatable-strings file-name)))))) (if file-name (gnc:save-translatable-strings file-name))))))
(gnc:add-extension menu) (gnc:add-extension menu)