From 67cc8faf4be7778cda8c2901785b038319c1f01a Mon Sep 17 00:00:00 2001 From: Colomban Wendling Date: Sun, 9 Nov 2014 22:14:12 +0100 Subject: [PATCH] Fix closing of the "missing file" infobar The issue was introduced in b646424ddb715382a937d233a75bc684c22e18ec as it removed the default handler that used to destroy the infobar. Now, the infobar is properly closed, but only if the action succeeded. Closes #375. --- src/document.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/src/document.c b/src/document.c index ba9663ed4..1b4d94604 100644 --- a/src/document.c +++ b/src/document.c @@ -3358,12 +3358,23 @@ static void on_monitor_resave_missing_file_response(GtkWidget *bar, gint response_id, GeanyDocument *doc) { + gboolean close = TRUE; + unprotect_document(doc); if (response_id == RESPONSE_DOCUMENT_SAVE) - dialogs_show_save_as(); + close = dialogs_show_save_as(); - doc->priv->info_bars[MSG_TYPE_RESAVE] = NULL; + if (close) + { + doc->priv->info_bars[MSG_TYPE_RESAVE] = NULL; + gtk_widget_destroy(bar); + } + else + { + /* protect back the document if save didn't occur */ + protect_document(doc); + } } -- 2.11.4.GIT