[banshee] DapActions: fix ConfirmUserAction() to display in the main thread



commit db41872f127a656afeed336d9b06ac2d6bb90513
Author: Andres G. Aragoneses <knocte gmail com>
Date:   Sat Sep 22 17:09:28 2012 +0100

    DapActions: fix ConfirmUserAction() to display in the main thread
    
    This dialog implemented as a bugfix for bgo#504492 was not being
    launched in the gui thread.
    
    Doh! It was actually me who implemented this 2 years ago...
    The offending call as printed by the gui-thread-check module was:
    
    *** GTK CALL NOT IN GUI THREAD: Widget.gtk_widget_show
       Widget.Show
       HigMessageDialog..ctor
       DapActions.ConfirmUserAction
       DapSync.RateLimitedSync
       RateLimiter.InnerExecute
       RateLimiter.Execute
       DapSync.<Sync>m__13
       Thread.StartInternal

 src/Dap/Banshee.Dap/Banshee.Dap.Gui/DapActions.cs |   17 +++++++++--------
 1 files changed, 9 insertions(+), 8 deletions(-)
---
diff --git a/src/Dap/Banshee.Dap/Banshee.Dap.Gui/DapActions.cs b/src/Dap/Banshee.Dap/Banshee.Dap.Gui/DapActions.cs
index 91112ac..facf99f 100644
--- a/src/Dap/Banshee.Dap/Banshee.Dap.Gui/DapActions.cs
+++ b/src/Dap/Banshee.Dap/Banshee.Dap.Gui/DapActions.cs
@@ -109,16 +109,17 @@ namespace Banshee.Dap.Gui
                 tracks_to_remove);
             string message = Catalog.GetString ("Are you sure you want to continue?");
 
-            var md = new HigMessageDialog (
-                ServiceManager.Get<GtkElementsService> ().PrimaryWindow,
-                DialogFlags.DestroyWithParent, MessageType.Warning,
-                ButtonsType.None, header, message
-            );
-            md.AddButton ("gtk-cancel", ResponseType.No, true);
-            md.AddButton (Catalog.GetString ("Remove tracks"), ResponseType.Yes, false);
-
             bool remove_tracks = false;
             ThreadAssist.BlockingProxyToMain (() => {
+
+                var md = new HigMessageDialog (
+                    ServiceManager.Get<GtkElementsService> ().PrimaryWindow,
+                    DialogFlags.DestroyWithParent, MessageType.Warning,
+                    ButtonsType.None, header, message
+                );
+                md.AddButton ("gtk-cancel", ResponseType.No, true);
+                md.AddButton (Catalog.GetString ("Remove tracks"), ResponseType.Yes, false);
+
                 try {
                     if (md.Run () == (int) ResponseType.Yes) {
                         remove_tracks = true;



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