[gitg] Allow calling show_infobar from threads



commit a60b91f08db307f87f7dda40d1361fecd6ea146f
Author: Jesse van den Kieboom <jessevdk gnome org>
Date:   Thu Aug 13 08:11:19 2015 +0200

    Allow calling show_infobar from threads

 gitg/gitg-window.vala |   15 +++++++++------
 1 files changed, 9 insertions(+), 6 deletions(-)
---
diff --git a/gitg/gitg-window.vala b/gitg/gitg-window.vala
index a51d716..c6c902b 100644
--- a/gitg/gitg-window.vala
+++ b/gitg/gitg-window.vala
@@ -842,14 +842,17 @@ public class Window : Gtk.ApplicationWindow, GitgExt.Application, Initable
                                 string          message,
                                 Gtk.MessageType type)
        {
-               var primary = "<b>%s</b>".printf(Markup.escape_text(title));
-               var secondary = "<small>%s</small>".printf(Markup.escape_text(message));
+               Idle.add(() => {
+                       var primary = "<b>%s</b>".printf(Markup.escape_text(title));
+                       var secondary = "<small>%s</small>".printf(Markup.escape_text(message));
 
-               d_infobar_primary_label.set_label(primary);
-               d_infobar_secondary_label.set_label(secondary);
-               d_infobar.message_type = type;
+                       d_infobar_primary_label.set_label(primary);
+                       d_infobar_secondary_label.set_label(secondary);
+                       d_infobar.message_type = type;
 
-               d_infobar.show();
+                       d_infobar.show();
+                       return false;
+               });
        }
 
        public async Gtk.ResponseType user_query_async(GitgExt.UserQuery query)


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]