banshee r4671 - in trunk/banshee: . src/Core/Banshee.ThickClient/Banshee.Gui.TrackEditor src/Libraries/Hyena.Gui/Hyena.Widgets



Author: abock
Date: Wed Oct  8 22:39:58 2008
New Revision: 4671
URL: http://svn.gnome.org/viewvc/banshee?rev=4671&view=rev

Log:
* banshee/src/Core/Banshee.ThickClient/Banshee.Gui.TrackEditor/TrackEditorDialog.cs:
  Only click sync buttons when they are sensitive

* banshee/src/Core/Banshee.ThickClient/Banshee.Gui.TrackEditor/BasicTrackDetailsPage.cs:
  Save the field slot for the track artist and pass it to the album
  artist field

* banshee/src/Libraries/Hyena.Gui/Hyena.Widgets/PulsingButton.cs: Stop
  pulsing when the widget goes to the insensitive state

* banshee/src/Core/Banshee.ThickClient/Banshee.Gui.TrackEditor/FieldPage.cs:
  Return the FieldSlot when adding a field

* banshee/src/Core/Banshee.ThickClient/Banshee.Gui.TrackEditor/AlbumArtistEntry.cs:
  When the compilation button is checked, disable the sync button for
  the track artist; that is, if a selection sets album
  artist/compilation, track artist will no longer sync, since that
  would suck

Modified:
   trunk/banshee/ChangeLog
   trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Gui.TrackEditor/AlbumArtistEntry.cs
   trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Gui.TrackEditor/BasicTrackDetailsPage.cs
   trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Gui.TrackEditor/FieldPage.cs
   trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Gui.TrackEditor/TrackEditorDialog.cs
   trunk/banshee/src/Libraries/Hyena.Gui/Hyena.Widgets/PulsingButton.cs

Modified: trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Gui.TrackEditor/AlbumArtistEntry.cs
==============================================================================
--- trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Gui.TrackEditor/AlbumArtistEntry.cs	(original)
+++ trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Gui.TrackEditor/AlbumArtistEntry.cs	Wed Oct  8 22:39:58 2008
@@ -41,9 +41,12 @@
         private CheckButton enable_compilation = new CheckButton ();
         private TextEntry entry = new TextEntry ("CoreAlbums", "ArtistName");
         private object tooltip_host = Hyena.Gui.TooltipSetter.CreateHost ();
+        private Button track_artist_sync_button;
         
-        public AlbumArtistEntry () : base ()
+        public AlbumArtistEntry (Button trackArtistSyncButton) : base ()
         {
+            track_artist_sync_button = trackArtistSyncButton;
+        
             enable_compilation.Label = Catalog.GetString ("Compilation Album Artist:");
 
             Hyena.Gui.TooltipSetter.Set (tooltip_host, enable_compilation,
@@ -89,6 +92,7 @@
         private void UpdateSensitivities ()
         {
             entry.Sensitive = IsCompilation;
+            track_artist_sync_button.Sensitive = !IsCompilation;
         }
     }
 }

Modified: trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Gui.TrackEditor/BasicTrackDetailsPage.cs
==============================================================================
--- trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Gui.TrackEditor/BasicTrackDetailsPage.cs	(original)
+++ trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Gui.TrackEditor/BasicTrackDetailsPage.cs	Wed Oct  8 22:39:58 2008
@@ -72,14 +72,14 @@
                 FieldOptions.NoSync
             );
             
-            AddField (left, new TextEntry ("CoreArtists", "Name"), 
+            FieldPage.FieldSlot track_artist_slot = AddField (left, new TextEntry ("CoreArtists", "Name"), 
                 Catalog.GetString ("Set all track artists to this value"),
                 delegate { return Catalog.GetString ("Track Artist:"); },
                 delegate (EditorTrackInfo track, Widget widget) { ((TextEntry)widget).Text = track.ArtistName; },
                 delegate (EditorTrackInfo track, Widget widget) { track.ArtistName = ((TextEntry)widget).Text; }
             );
 
-            AlbumArtistEntry album_artist_entry = new AlbumArtistEntry ();
+            AlbumArtistEntry album_artist_entry = new AlbumArtistEntry (track_artist_slot.SyncButton);
             AddField (left, null, album_artist_entry,
                 Catalog.GetString ("Set all compilation album artists to these values"), null,
                 delegate (EditorTrackInfo track, Widget widget) {

Modified: trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Gui.TrackEditor/FieldPage.cs
==============================================================================
--- trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Gui.TrackEditor/FieldPage.cs	(original)
+++ trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Gui.TrackEditor/FieldPage.cs	Wed Oct  8 22:39:58 2008
@@ -53,7 +53,7 @@
             get { return current_track; }
         }
         
-        private struct FieldSlot
+        public struct FieldSlot
         {
             public Widget Label;
             public Widget Field;
@@ -112,27 +112,27 @@
             get { return PageType.Edit; }
         }
     
-        public void AddField (Box parent, Widget field, string syncTooltip, FieldLabelClosure labelClosure, 
+        public FieldSlot AddField (Box parent, Widget field, string syncTooltip, FieldLabelClosure labelClosure, 
             FieldValueClosure readClosure, FieldValueClosure writeClosure)
         {
-            AddField (parent, EditorUtilities.CreateLabel (String.Empty), field, syncTooltip,
+            return AddField (parent, EditorUtilities.CreateLabel (String.Empty), field, syncTooltip,
                 labelClosure, readClosure, writeClosure, FieldOptions.None);
         }
         
-        public void AddField (Box parent, Widget field, string syncTooltip, FieldLabelClosure labelClosure, 
+        public FieldSlot AddField (Box parent, Widget field, string syncTooltip, FieldLabelClosure labelClosure, 
             FieldValueClosure readClosure, FieldValueClosure writeClosure, FieldOptions options)
         {
-            AddField (parent, EditorUtilities.CreateLabel (String.Empty), field, syncTooltip,
+            return AddField (parent, EditorUtilities.CreateLabel (String.Empty), field, syncTooltip,
                 labelClosure, readClosure, writeClosure, options);
         }
         
-        public void AddField (Box parent, Widget label, Widget field, string syncTooltip, 
+        public FieldSlot AddField (Box parent, Widget label, Widget field, string syncTooltip, 
             FieldLabelClosure labelClosure, FieldValueClosure readClosure, FieldValueClosure writeClosure)
         {
-            AddField (parent, label, field, syncTooltip, labelClosure, readClosure, writeClosure, FieldOptions.None);
+            return AddField (parent, label, field, syncTooltip, labelClosure, readClosure, writeClosure, FieldOptions.None);
         }
         
-        public void AddField (Box parent, Widget label, Widget field, string syncTooltip, FieldLabelClosure labelClosure, 
+        public FieldSlot AddField (Box parent, Widget label, Widget field, string syncTooltip, FieldLabelClosure labelClosure, 
             FieldValueClosure readClosure, FieldValueClosure writeClosure, FieldOptions options)
         {
             FieldSlot slot = new FieldSlot ();
@@ -195,6 +195,8 @@
                 shrink.PackStart (table, false, false, 0);
                 parent.PackStart (shrink, false, false, 0);
             }
+            
+            return slot;
         }
         
         public virtual void LoadTrack (EditorTrackInfo track)

Modified: trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Gui.TrackEditor/TrackEditorDialog.cs
==============================================================================
--- trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Gui.TrackEditor/TrackEditorDialog.cs	(original)
+++ trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Gui.TrackEditor/TrackEditorDialog.cs	Wed Oct  8 22:39:58 2008
@@ -326,7 +326,9 @@
         private void InvokeFieldSync ()
         {
             ForeachWidget<SyncButton> (delegate (SyncButton button) {
-                button.Click ();
+                if (button.Sensitive) {
+                    button.Click ();
+                }
             });
         }
         

Modified: trunk/banshee/src/Libraries/Hyena.Gui/Hyena.Widgets/PulsingButton.cs
==============================================================================
--- trunk/banshee/src/Libraries/Hyena.Gui/Hyena.Widgets/PulsingButton.cs	(original)
+++ trunk/banshee/src/Libraries/Hyena.Gui/Hyena.Widgets/PulsingButton.cs	Wed Oct  8 22:39:58 2008
@@ -123,5 +123,13 @@
         {
             pulsator.StopPulsing ();
         }
+        
+        protected override void OnStateChanged (StateType previous_state)
+        {
+            base.OnStateChanged (previous_state);
+            if (State == StateType.Insensitive) {
+                StopPulsing ();
+            }
+        }
     }
 }



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