[geany/geany] 67cc8f: Fix closing of the "missing file" infobar

Colomban Wendling git-noreply at xxxxx
Sun Nov 9 21:14:12 UTC 2014


Branch:      refs/heads/master
Author:      Colomban Wendling <ban at herbesfolles.org>
Committer:   Colomban Wendling <ban at herbesfolles.org>
Date:        Sun, 09 Nov 2014 21:14:12 UTC
Commit:      67cc8faf4be7778cda8c2901785b038319c1f01a
             https://github.com/geany/geany/commit/67cc8faf4be7778cda8c2901785b038319c1f01a

Log Message:
-----------
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.


Modified Paths:
--------------
    src/document.c

Modified: src/document.c
15 lines changed, 13 insertions(+), 2 deletions(-)
===================================================================
@@ -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);
+	}
 }
 
 



--------------
This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).


More information about the Commits mailing list