mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
Use the last opened file as the file dialog default.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@2808 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
parent
25b38b6db2
commit
4ecaf2fb3c
@ -28,6 +28,6 @@
|
|||||||
#include "config.h"
|
#include "config.h"
|
||||||
|
|
||||||
/** PROTOTYPES ******************************************************/
|
/** PROTOTYPES ******************************************************/
|
||||||
char *fileBox( const char * title, const char * filter );
|
const char *fileBox( const char * title, const char * filter );
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -27,6 +27,6 @@
|
|||||||
|
|
||||||
void gnc_history_add_file(char *);
|
void gnc_history_add_file(char *);
|
||||||
void gnc_history_update_menu();
|
void gnc_history_update_menu();
|
||||||
char * gnc_history_get_last();
|
const char * gnc_history_get_last();
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -27,6 +27,7 @@
|
|||||||
#include <gnome.h>
|
#include <gnome.h>
|
||||||
|
|
||||||
#include "FileBox.h"
|
#include "FileBox.h"
|
||||||
|
#include "file-history.h"
|
||||||
#include "messages.h"
|
#include "messages.h"
|
||||||
#include "util.h"
|
#include "util.h"
|
||||||
|
|
||||||
@ -61,11 +62,13 @@ static gboolean gnc_file_box_delete_cb(GtkWidget *widget, GdkEvent *event,
|
|||||||
* *
|
* *
|
||||||
* Args: title - the title of the window *
|
* Args: title - the title of the window *
|
||||||
* filter - the file filter to use *
|
* filter - the file filter to use *
|
||||||
* Return: char * containing the name of the file the user selected *
|
* Return: containing the name of the file the user selected *
|
||||||
\********************************************************************/
|
\********************************************************************/
|
||||||
char *
|
const char *
|
||||||
fileBox(const char * title, const char * filter)
|
fileBox(const char * title, const char * filter)
|
||||||
{
|
{
|
||||||
|
const char *last_file;
|
||||||
|
|
||||||
ENTER("\n");
|
ENTER("\n");
|
||||||
|
|
||||||
/* Set a default title if nothing was passed in */
|
/* Set a default title if nothing was passed in */
|
||||||
@ -78,6 +81,10 @@ fileBox(const char * title, const char * filter)
|
|||||||
fb_info.file_box = GTK_FILE_SELECTION(gtk_file_selection_new(title));
|
fb_info.file_box = GTK_FILE_SELECTION(gtk_file_selection_new(title));
|
||||||
fb_info.file_name = NULL;
|
fb_info.file_name = NULL;
|
||||||
|
|
||||||
|
last_file = gnc_history_get_last();
|
||||||
|
if (last_file != NULL)
|
||||||
|
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
|
||||||
* names, so I think we should not do this by default (rgmerk) */
|
* names, so I think we should not do this by default (rgmerk) */
|
||||||
#if 0
|
#if 0
|
||||||
|
@ -143,7 +143,7 @@ gnc_history_add_file(char *newfile)
|
|||||||
__gnc_history_config_write();
|
__gnc_history_config_write();
|
||||||
}
|
}
|
||||||
|
|
||||||
char *
|
const char *
|
||||||
gnc_history_get_last()
|
gnc_history_get_last()
|
||||||
{
|
{
|
||||||
if(history_list == NULL)
|
if(history_list == NULL)
|
||||||
|
Loading…
Reference in New Issue
Block a user