From deded4680616a6f52540dd479cf8cd9b6b59fc3a Mon Sep 17 00:00:00 2001 From: Christopher Lam Date: Fri, 25 Jul 2025 10:03:42 +0800 Subject: [PATCH] [gnc-plugin-page-report] confirm before overwriting saved report --- gnucash/gnome/gnc-plugin-page-report.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/gnucash/gnome/gnc-plugin-page-report.cpp b/gnucash/gnome/gnc-plugin-page-report.cpp index 3e21c1f195..6f2743b4c5 100644 --- a/gnucash/gnome/gnc-plugin-page-report.cpp +++ b/gnucash/gnome/gnc-plugin-page-report.cpp @@ -1722,6 +1722,13 @@ gnc_plugin_page_report_save_cb (GSimpleAction *simple, check_func = scm_c_eval_string("gnc:is-custom-report-type"); if (scm_is_true (scm_call_1 (check_func, priv->cur_report))) { + auto report_name_str{priv->cur_odb->lookup_string_option("General", "Report name")}; + auto window{GTK_WINDOW(gnc_plugin_page_get_window (GNC_PLUGIN_PAGE(report)))}; + + if (!gnc_action_dialog (window, _("_Overwrite"), false, _("This will update and \ +overwrite the existing saved report named \"%s\"."), report_name_str.c_str())) + return; + /* The current report is already based on a custom report. * Replace the existing one instead of adding a new one */