From 742960bf4c47fb5a4926db46949d5e541f338fc1 Mon Sep 17 00:00:00 2001 From: Thomas Perl Date: Mon, 15 Feb 2010 16:13:32 -0800 Subject: [PATCH] Fix bug when closing the new/open dialogs Thanks to Mustai Dalal for the bug report. --- src/ui/callbacks.c | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/src/ui/callbacks.c b/src/ui/callbacks.c index 432ea29..da4bb4e 100644 --- a/src/ui/callbacks.c +++ b/src/ui/callbacks.c @@ -2243,12 +2243,14 @@ void callback_file_new(GtkAction * action, gpointer data) gchar *filename = NULL; - if (closefile(mainview) == FALSE) - return; - filename = interface_file_chooser(mainview, GTK_FILE_CHOOSER_ACTION_SAVE, "memos", "db"); - if (filename == NULL) - return; + if (filename == NULL) { + return; + } + + if (closefile(mainview) == FALSE) { + return; + } new_file(mainview); @@ -2382,17 +2384,15 @@ void callback_file_open(GtkAction * action, gpointer data) MainView *mainview = (MainView *) data; g_assert(mainview != NULL && mainview->data != NULL); - if (closefile(mainview) == FALSE) - return; - - /* - * open new file - */ filename = interface_file_chooser(mainview, GTK_FILE_CHOOSER_ACTION_OPEN, NULL, NULL); + if (filename == NULL) { + return; + } + + if (closefile(mainview) == FALSE) { + return; + } - /* - * if we got a file name from chooser -> open file - */ open_file(filename, mainview); g_free(filename); } -- 2.11.4.GIT