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.
This commit is contained in:
Colomban Wendling 2014-11-09 22:14:12 +01:00
parent 1dc09597b2
commit 67cc8faf4b

View File

@ -3358,12 +3358,23 @@ static void on_monitor_resave_missing_file_response(GtkWidget *bar,
gint response_id, gint response_id,
GeanyDocument *doc) GeanyDocument *doc)
{ {
gboolean close = TRUE;
unprotect_document(doc); unprotect_document(doc);
if (response_id == RESPONSE_DOCUMENT_SAVE) 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);
}
} }