banshee r4995 - in trunk/banshee: . src/Core/Banshee.ThickClient/Banshee.Gui.Widgets



Author: gburt
Date: Mon Feb  2 18:16:42 2009
New Revision: 4995
URL: http://svn.gnome.org/viewvc/banshee?rev=4995&view=rev

Log:
2009-02-02  Gabriel Burt  <gabriel burt gmail com>

	* src/Core/Banshee.ThickClient/Banshee.Gui.Widgets/TaskStatusButton.cs:
	Show only background UserJobs in the task status button.

Modified:
   trunk/banshee/ChangeLog
   trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Gui.Widgets/TaskStatusButton.cs

Modified: trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Gui.Widgets/TaskStatusButton.cs
==============================================================================
--- trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Gui.Widgets/TaskStatusButton.cs	(original)
+++ trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Gui.Widgets/TaskStatusButton.cs	Mon Feb  2 18:16:42 2009
@@ -77,7 +77,7 @@
 
         private void Update ()
         {
-            lock (this) {
+            lock (jobs) {
                 if (jobs.Count > 0) {
                     StringBuilder sb = new StringBuilder ();
                     foreach (IUserJob job in jobs) {
@@ -139,42 +139,36 @@
 
         private void AddJob (IUserJob job)
         {                
-            lock (this) {    
-                if (job == null || job.IsFinished) {
+            lock (jobs) {    
+                if (job == null || !job.IsBackground || job.IsFinished) {
                     return;
                 }
                 
-                Banshee.Base.ThreadAssist.AssertInMainThread ();
                 jobs.Add (job);
             }
 
-            Update ();
+            ThreadAssist.ProxyToMain (Update);
         }
         
         private void OnJobAdded (object o, UserJobEventArgs args)
         {
-            ThreadAssist.ProxyToMain (delegate {
-                AddJob (args.Job);
-            });
+            AddJob (args.Job);
         }
         
         private void RemoveJob (IUserJob job)
         {
-            lock (this) {
+            lock (jobs) {
                 if (jobs.Contains (job)) {
-                    Banshee.Base.ThreadAssist.AssertInMainThread ();
                     jobs.Remove (job);
                 }
             }
 
-            Update ();
+            ThreadAssist.ProxyToMain (Update);
         }
         
         private void OnJobRemoved (object o, UserJobEventArgs args)
         {
-            ThreadAssist.ProxyToMain (delegate {
-                RemoveJob (args.Job);
-            });
+            RemoveJob (args.Job);
         }
     }
 }



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