From 07e449a677bcd8623f05f234e6b4e7902b6f3ccf Mon Sep 17 00:00:00 2001 From: John Ralls Date: Tue, 9 Jul 2024 15:41:40 -0700 Subject: [PATCH] Correctly handle uncommitted edits when opening a file from history. By calling gnc_main_window_finish_pending as is done in all other execution paths that close the session. That allows an open edit to be committed or cancelled before the user is prompted to save the file instead of after when it's too late. It also allows the user to cancel closing the session at that point if there's more work to be done on the transaction. --- gnucash/gnome-utils/gnc-plugin-file-history.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/gnucash/gnome-utils/gnc-plugin-file-history.c b/gnucash/gnome-utils/gnc-plugin-file-history.c index 6b2c435af0..88102313b7 100644 --- a/gnucash/gnome-utils/gnc-plugin-file-history.c +++ b/gnucash/gnome-utils/gnc-plugin-file-history.c @@ -684,6 +684,8 @@ gnc_plugin_file_history_cmd_open_file (GSimpleAction *simple, g_return_if_fail (G_IS_SIMPLE_ACTION(simple)); g_return_if_fail (data != NULL); + if (!gnc_main_window_finish_pending(data->window)) + return; // action name will be of the form 'RecentFile1Action' action_name = g_action_get_name (G_ACTION(simple));