[geany/geany] 19e24f: infobars: Dismiss the info bar when reloading via toolbar button/keybinding.
Thomas Martitz
git-noreply at xxxxx
Sat May 24 17:42:46 UTC 2014
Branch: refs/heads/master
Author: Thomas Martitz <kugel at rockbox.org>
Committer: Thomas Martitz <kugel at rockbox.org>
Date: Sat, 24 May 2014 17:42:46 UTC
Commit: 19e24fb5ee53cb70de02669fc2d1dc0cdbd82c11
https://github.com/geany/geany/commit/19e24fb5ee53cb70de02669fc2d1dc0cdbd82c11
Log Message:
-----------
infobars: Dismiss the info bar when reloading via toolbar button/keybinding.
Modified Paths:
--------------
src/document.c
Modified: src/document.c
7 lines changed, 5 insertions(+), 2 deletions(-)
===================================================================
@@ -1372,6 +1372,10 @@ gboolean document_reload_file(GeanyDocument *doc, const gchar *forced_enc)
g_return_val_if_fail(doc != NULL, FALSE);
+ /* Use cancel because the response handler would call this recursively */
+ if (doc->priv->info_bars[MSG_TYPE_RELOAD] != NULL)
+ gtk_info_bar_response(GTK_INFO_BAR(doc->priv->info_bars[MSG_TYPE_RELOAD]), GTK_RESPONSE_CANCEL);
+
/* try to set the cursor to the position before reloading */
pos = sci_get_current_position(doc->editor->sci);
new_doc = document_open_file_full(doc, NULL, pos, doc->readonly, doc->file_type, forced_enc);
@@ -3148,11 +3152,10 @@ static GtkWidget* document_show_message(GeanyDocument *doc, GtkMessageType msgty
static void on_monitor_reload_file_response(GtkWidget *bar, gint response_id, GeanyDocument *doc)
{
unprotect_document(doc);
+ doc->priv->info_bars[MSG_TYPE_RELOAD] = NULL;
if (response_id == GTK_RESPONSE_ACCEPT)
document_reload_file(doc, doc->encoding);
-
- doc->priv->info_bars[MSG_TYPE_RELOAD] = NULL;
}
static gboolean on_sci_key(GtkWidget *w, GdkEventKey *event, gpointer data)
--------------
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