banshee r3593 - in trunk/banshee: . src/Clients/Nereid/Nereid src/Core/Banshee.ThickClient/Banshee.Gui src/Core/Banshee.ThickClient/Banshee.Gui.Widgets src/Extensions/Banshee.AudioCd/Banshee.AudioCd



Author: abock
Date: Sun Mar 30 00:31:14 2008
New Revision: 3593
URL: http://svn.gnome.org/viewvc/banshee?rev=3593&view=rev

Log:
2008-03-29  Aaron Bockover  <abock gnome org>

    * src/Core/Banshee.ThickClient/Banshee.Gui.Widgets/TrackInfoDisplay.cs:
    Queue a timeout when the engine goes to idle; if when the timeout handler
    runs the engine is still idle, then fade the display out; the timeout is
    necessary to avoid a fade when we are really just transitioning tracks

    * src/Core/Banshee.ThickClient/Banshee.Gui/BansheeActionGroup.cs: Set
    action.StockId if the <Action>IconName property is set

    * src/Extensions/Banshee.AudioCd/Banshee.AudioCd/AudioCdSource.cs: Set
    the unmap icon to eject and do not allow renaming of the source

    * src/Clients/Nereid/Nereid/PlayerInterface.cs: Update the source title
    in the view container when the active source is updated



Modified:
   trunk/banshee/ChangeLog
   trunk/banshee/src/Clients/Nereid/Nereid/PlayerInterface.cs
   trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Gui.Widgets/TrackInfoDisplay.cs
   trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Gui/BansheeActionGroup.cs
   trunk/banshee/src/Extensions/Banshee.AudioCd/Banshee.AudioCd/AudioCdSource.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	Sun Mar 30 00:31:14 2008
@@ -336,6 +336,7 @@
         {
             if (args.Source == ServiceManager.SourceManager.ActiveSource) {
                 UpdateStatusBar ();
+                view_container.Title = args.Source.Name;
             }
         }
         

Modified: trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Gui.Widgets/TrackInfoDisplay.cs
==============================================================================
--- trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Gui.Widgets/TrackInfoDisplay.cs	(original)
+++ trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Gui.Widgets/TrackInfoDisplay.cs	Sun Mar 30 00:31:14 2008
@@ -65,6 +65,7 @@
         
         private ArtworkPopup popup;
         private uint popup_timeout_id;
+        private uint idle_timeout_id;
         private bool in_popup;
         private bool in_thumbnail_region;
         
@@ -81,12 +82,21 @@
             }
             
             ServiceManager.PlayerEngine.EventChanged += OnPlayerEngineEventChanged;
+            ServiceManager.PlayerEngine.StateChanged += OnPlayerEngineStateChanged;
         }
         
         public override void Dispose ()
         {
+            if (idle_timeout_id > 0) {
+                GLib.Source.Remove (idle_timeout_id);
+            }
+            
             ServiceManager.PlayerEngine.EventChanged -= OnPlayerEngineEventChanged;
+            ServiceManager.PlayerEngine.StateChanged -= OnPlayerEngineStateChanged;
+            
             stage.Iteration -= OnStageIteration;
+            stage = null;
+            
             HidePopup ();
             
             base.Dispose ();
@@ -418,6 +428,33 @@
             }
         }
         
+        private void OnPlayerEngineStateChanged (object o, PlayerEngineStateArgs args)
+        {
+            if (args.State == PlayerEngineState.Idle && (incoming_track != null || incoming_pixbuf != null)) {
+                if (idle_timeout_id > 0) {
+                    GLib.Source.Remove (idle_timeout_id);
+                } else {
+                    GLib.Timeout.Add (100, IdleTimeout);
+                }
+            }
+        }
+        
+        private bool IdleTimeout ()
+        {
+            if (ServiceManager.PlayerEngine.CurrentTrack == null || 
+                ServiceManager.PlayerEngine.CurrentState == PlayerEngineState.Idle) {
+                incoming_track = null;
+                incoming_pixbuf = null;
+                
+                if (stage != null && stage.Actor == null) {
+                    stage.Reset ();
+                }
+            }
+            
+            idle_timeout_id = 0;
+            return false;
+        }
+        
         private void LoadCurrentTrack ()
         {
             TrackInfo track = ServiceManager.PlayerEngine.CurrentTrack;

Modified: trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Gui/BansheeActionGroup.cs
==============================================================================
--- trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Gui/BansheeActionGroup.cs	(original)
+++ trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Gui/BansheeActionGroup.cs	Sun Mar 30 00:31:14 2008
@@ -83,7 +83,11 @@
                     //Console.WriteLine ("action label {0} for {1} just not saved", action.Label, action_name);
                 }
                 string label = source.Properties.GetString (String.Format ("{0}Label", action_name));
-                action.Label = (label == null || label == String.Empty) ? labels[action_name] : label;
+                string icon = source.Properties.GetString (String.Format ("{0}IconName", action_name));
+                action.Label = String.IsNullOrEmpty (label) ? labels[action_name] : label;
+                if (!String.IsNullOrEmpty (icon)) {
+                    action.StockId = icon;
+                }
                 //Console.WriteLine ("for source {0} and action {1} got label {2}, so set action.Label = {3}", source.Name, action_name, label, action.Label);
             }
         }

Modified: trunk/banshee/src/Extensions/Banshee.AudioCd/Banshee.AudioCd/AudioCdSource.cs
==============================================================================
--- trunk/banshee/src/Extensions/Banshee.AudioCd/Banshee.AudioCd/AudioCdSource.cs	(original)
+++ trunk/banshee/src/Extensions/Banshee.AudioCd/Banshee.AudioCd/AudioCdSource.cs	Sun Mar 30 00:31:14 2008
@@ -56,6 +56,7 @@
             
             Properties.SetStringList ("Icon.Name", "media-cdrom", "gnome-dev-cdrom-audio", "source-cd-audio");
             Properties.SetString ("UnmapSourceActionLabel", Catalog.GetString ("Eject Disc"));
+            Properties.SetString ("UnmapSourceActionIconName", "media-eject");
         }
         
         public TimeSpan Duration {
@@ -141,6 +142,10 @@
         public override int Count {
             get { return disc_model.Count; }
         }
+        
+        public override bool CanRename {
+            get { return false; }
+        }
 
 #endregion
         



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