[banshee] [PlayQueue] Fix Play After for HIG compliance



commit f6f2b9b369814e380851c6f745cd3efac17bc673
Author: Alex Launi <alex launi gmail com>
Date:   Thu Oct 21 23:34:09 2010 -0400

    [PlayQueue] Fix Play After for HIG compliance
    
    Fix label casing, and make the visibility/sensitivity more sensable.

 .../Banshee.PlayQueue/PlayQueueActions.cs          |   30 ++++++++++++++++----
 .../Banshee.PlayQueue/Resources/GlobalUI.xml       |    4 +-
 2 files changed, 26 insertions(+), 8 deletions(-)
---
diff --git a/src/Extensions/Banshee.PlayQueue/Banshee.PlayQueue/PlayQueueActions.cs b/src/Extensions/Banshee.PlayQueue/Banshee.PlayQueue/PlayQueueActions.cs
index 8a97fdf..b5a126b 100644
--- a/src/Extensions/Banshee.PlayQueue/Banshee.PlayQueue/PlayQueueActions.cs
+++ b/src/Extensions/Banshee.PlayQueue/Banshee.PlayQueue/PlayQueueActions.cs
@@ -53,22 +53,22 @@ namespace Banshee.PlayQueue
                     OnAddToPlayQueue),
 
                 new ActionEntry ("AddToPlayQueueAfterAction", null,
-                    Catalog.GetString ("Add after"), null,
+                    Catalog.GetString ("Play After"), null,
                     Catalog.GetString ("Add selected songs after the currently playing track, album, or artist"),
                     null),
 
                 new ActionEntry ("AddToPlayQueueAfterCurrentTrackAction", null,
-                    Catalog.GetString ("Current track"), null,
+                    Catalog.GetString ("Current Track"), null,
                     Catalog.GetString ("Add selected songs to the play queue after the currently playing song"),
                     OnAddToPlayQueueAfterCurrentTrack),
 
-                new ActionEntry ("AddToPlayQueueAfterCurrentTrackAlbum", null,
-                    Catalog.GetString ("Current album"), null,
+                new ActionEntry ("AddToPlayQueueAfterCurrentAlbumAction", null,
+                    Catalog.GetString ("Current Album"), null,
                     Catalog.GetString ("Add selected songs to the play queue after the currently playing album"),
                     OnAddToPlayQueueAfterCurrentAlbum),
 
-                new ActionEntry ("AddToPlayQueueAfterCurrentTrackArtist", null,
-                    Catalog.GetString ("Current artist"), null,
+                new ActionEntry ("AddToPlayQueueAfterCurrentArtistAction", null,
+                    Catalog.GetString ("Current Artist"), null,
                     Catalog.GetString ("Add selected songs to the play queue after the currently playing artist"),
                     OnAddToPlayQueueAfterCurrentArtist)
             });
@@ -109,6 +109,7 @@ namespace Banshee.PlayQueue
             playqueue.Updated += OnUpdated;
             ServiceManager.SourceManager.ActiveSourceChanged += OnSourceUpdated;
             ServiceManager.PlayerEngine.ConnectEvent (OnPlayerEvent, PlayerEvent.StateChange);
+            ServiceManager.PlaybackController.SourceChanged += OnPlaybackSourceChanged;
 
             OnUpdated (null, null);
 
@@ -129,6 +130,17 @@ namespace Banshee.PlayQueue
             this["AddToPlayQueueAfterAction"].Sensitive = ServiceManager.PlayerEngine.IsPlaying ();
         }
 
+        private void OnPlaybackSourceChanged (object sender, EventArgs e)
+        {
+            if (ServiceManager.PlaybackController.Source is PlayQueueSource) {
+                this["AddToPlayQueueAfterCurrentAlbumAction"].Sensitive = true;
+                this["AddToPlayQueueAfterCurrentArtistAction"].Sensitive = true;
+            } else {
+                this["AddToPlayQueueAfterCurrentAlbumAction"].Sensitive = false;
+                this["AddToPlayQueueAfterCurrentArtistAction"].Sensitive = false;
+            }
+        }
+
         private void OnAddToPlayQueue (object o, EventArgs args)
         {
             AddSelectedToPlayQueue (QueueMode.Normal);
@@ -184,6 +196,12 @@ namespace Banshee.PlayQueue
 
         private void OnSourceUpdated (SourceEventArgs args)
         {
+            if (ServiceManager.SourceManager.ActiveSource is PlayQueueSource) {
+                this["AddToPlayQueueAfterAction"].Visible = false;
+            } else {
+                this["AddToPlayQueueAfterAction"].Visible = true;
+            }
+            
             OnUpdated (null, null);
         }
 
diff --git a/src/Extensions/Banshee.PlayQueue/Resources/GlobalUI.xml b/src/Extensions/Banshee.PlayQueue/Resources/GlobalUI.xml
index cabea01..2740bc8 100644
--- a/src/Extensions/Banshee.PlayQueue/Resources/GlobalUI.xml
+++ b/src/Extensions/Banshee.PlayQueue/Resources/GlobalUI.xml
@@ -12,8 +12,8 @@
             <menuitem name="AddToPlayQueue" action="AddToPlayQueueAction"></menuitem>
             <menu name="AddToPlayQueueAfterMenu" action="AddToPlayQueueAfterAction">
             	<menuitem name="AddToPlayQueueAfterCurrentTrack" action="AddToPlayQueueAfterCurrentTrackAction"></menuitem>
-            	<menuitem name="AddToPlayQueueAfterCurrentAlbum" action="AddToPlayQueueAfterCurrentTrackAlbum"></menuitem>
-            	<menuitem name="AddToPlayQueueAfterCurrentArtist" action="AddToPlayQueueAfterCurrentTrackArtist"></menuitem>
+            	<menuitem name="AddToPlayQueueAfterCurrentAlbum" action="AddToPlayQueueAfterCurrentAlbumAction"></menuitem>
+            	<menuitem name="AddToPlayQueueAfterCurrentArtist" action="AddToPlayQueueAfterCurrentArtistAction"></menuitem>
             </menu>
         </placeholder>
     </popup>



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