banshee r4380 - in trunk/banshee: . src/Clients/Nereid/Nereid



Author: gburt
Date: Fri Aug 15 18:08:36 2008
New Revision: 4380
URL: http://svn.gnome.org/viewvc/banshee?rev=4380&view=rev

Log:
2008-08-15  Gabriel Burt  <gabriel burt gmail com>

	* src/Clients/Nereid/Nereid/PlayerInterface.cs: Fix bug with sometimes doing
	GTK/UI work not in the main thread.


Modified:
   trunk/banshee/ChangeLog
   trunk/banshee/src/Clients/Nereid/Nereid/PlayerInterface.cs

Modified: trunk/banshee/src/Clients/Nereid/Nereid/PlayerInterface.cs
==============================================================================
--- trunk/banshee/src/Clients/Nereid/Nereid/PlayerInterface.cs	(original)
+++ trunk/banshee/src/Clients/Nereid/Nereid/PlayerInterface.cs	Fri Aug 15 18:08:36 2008
@@ -284,48 +284,50 @@
         private TrackListModel previous_track_model = null;
         private void OnActiveSourceChanged (SourceEventArgs args)
         {
-            Source source = ServiceManager.SourceManager.ActiveSource;
-
-            view_container.SearchSensitive = source != null && source.CanSearch;
-            
-            if (source == null) {
-                return;
-            }
-            
-            view_container.Title = source.Name;
-            view_container.SearchEntry.Ready = false;
-            view_container.SearchEntry.CancelSearch ();
-
-            if (source.FilterQuery != null) {
-                view_container.SearchEntry.Query = source.FilterQuery;
-                view_container.SearchEntry.ActivateFilter ((int)source.FilterType);
-            }
-
-            if (view_container.Content != null) {
-                view_container.Content.ResetSource ();
-            }
-
-            if (previous_track_model != null) {
-                previous_track_model.Reloaded -= HandleTrackModelReloaded;
-                previous_track_model = null;
-            }
-
-            if (source is ITrackModelSource) {
-                previous_track_model = (source as ITrackModelSource).TrackModel;
-                previous_track_model.Reloaded += HandleTrackModelReloaded;
-            }
-            
-            if (previous_source != null) {
-                previous_source.Properties.PropertyChanged -= OnSourcePropertyChanged;
-            }
-            
-            previous_source = source;
-            previous_source.Properties.PropertyChanged += OnSourcePropertyChanged;
-            
-            UpdateSourceContents (source);
-            
-            UpdateSourceInformation ();
-            view_container.SearchEntry.Ready = true;
+            Banshee.Base.ThreadAssist.ProxyToMain (delegate {
+                Source source = ServiceManager.SourceManager.ActiveSource;
+    
+                view_container.SearchSensitive = source != null && source.CanSearch;
+                
+                if (source == null) {
+                    return;
+                }
+                
+                view_container.Title = source.Name;
+                view_container.SearchEntry.Ready = false;
+                view_container.SearchEntry.CancelSearch ();
+    
+                if (source.FilterQuery != null) {
+                    view_container.SearchEntry.Query = source.FilterQuery;
+                    view_container.SearchEntry.ActivateFilter ((int)source.FilterType);
+                }
+    
+                if (view_container.Content != null) {
+                    view_container.Content.ResetSource ();
+                }
+    
+                if (previous_track_model != null) {
+                    previous_track_model.Reloaded -= HandleTrackModelReloaded;
+                    previous_track_model = null;
+                }
+    
+                if (source is ITrackModelSource) {
+                    previous_track_model = (source as ITrackModelSource).TrackModel;
+                    previous_track_model.Reloaded += HandleTrackModelReloaded;
+                }
+                
+                if (previous_source != null) {
+                    previous_source.Properties.PropertyChanged -= OnSourcePropertyChanged;
+                }
+                
+                previous_source = source;
+                previous_source.Properties.PropertyChanged += OnSourcePropertyChanged;
+                
+                UpdateSourceContents (source);
+                
+                UpdateSourceInformation ();
+                view_container.SearchEntry.Ready = true;
+            });
         }
         
         private void OnSourcePropertyChanged (object o, PropertyChangeEventArgs args)



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