banshee r4550 - in trunk/banshee: . src/Core/Banshee.ThickClient/Banshee.Gui src/Core/Banshee.ThickClient/Banshee.Gui.TrackEditor



Author: abock
Date: Mon Sep 15 22:11:52 2008
New Revision: 4550
URL: http://svn.gnome.org/viewvc/banshee?rev=4550&view=rev

Log:
2008-09-15  Aaron Bockover  <abock gnome org>

    * src/Core/Banshee.ThickClient/Banshee.Gui/TrackActions.cs: Use the
    new editor, even though I still haven't finished implementing save

    * src/Core/Banshee.ThickClient/Banshee.Gui.TrackEditor/FieldPage.cs:
    Support setting a tooltip on the sync buttons

    * src/Core/Banshee.ThickClient/Banshee.Gui.TrackEditor/StatisticsPage.cs:
    Fix a crasher/NRE

    * src/Core/Banshee.ThickClient/Banshee.Gui.TrackEditor/TrackEditorDialog.cs:
    * src/Core/Banshee.ThickClient/Banshee.Gui.TrackEditor/BasicTrackDetailsPage.cs:
    * src/Core/Banshee.ThickClient/Banshee.Gui.TrackEditor/ExtraTrackDetailsPage.cs:
    Add tooltips



Modified:
   trunk/banshee/ChangeLog
   trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Gui.TrackEditor/BasicTrackDetailsPage.cs
   trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Gui.TrackEditor/ExtraTrackDetailsPage.cs
   trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Gui.TrackEditor/FieldPage.cs
   trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Gui.TrackEditor/StatisticsPage.cs
   trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Gui.TrackEditor/TrackEditorDialog.cs
   trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Gui/TrackActions.cs

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	Mon Sep 15 22:11:52 2008
@@ -68,7 +68,7 @@
             
             // Left
             
-            AddField (left, new TitleEntry (Dialog), 
+            AddField (left, new TitleEntry (Dialog), null,
                 delegate { return Catalog.GetString ("Track Title:"); },
                 delegate (EditorTrackInfo track, Widget widget) { ((TitleEntry)widget).Text = track.TrackTitle; },
                 delegate (EditorTrackInfo track, Widget widget) { track.TrackTitle = ((TitleEntry)widget).Text; },
@@ -76,13 +76,14 @@
             );
             
             AddField (left, new TextEntry (), 
+                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; }
             );
             
             enable_compilation.Toggled += OnEnableCompilationToggled;
-            AddField (left, enable_compilation, new TextEntry (),
+            AddField (left, enable_compilation, new TextEntry (), null,
                 delegate (EditorTrackInfo track, Widget widget) { 
                     ((CheckButton)widget).Label = Catalog.GetString ("Album Artist (part of a compilation):"); 
                     return null; 
@@ -92,12 +93,14 @@
             );
             
             AddField (left, new TextEntry (), 
+                Catalog.GetString ("Set all album titles to this value"),
                 delegate { return Catalog.GetString ("Album Title:"); },
                 delegate (EditorTrackInfo track, Widget widget) { ((TextEntry)widget).Text = track.AlbumTitle; },
                 delegate (EditorTrackInfo track, Widget widget) { track.AlbumTitle = ((TextEntry)widget).Text; }
             );
             
             AddField (left, new GenreEntry (), 
+                Catalog.GetString ("Set all genres to this value"),
                 delegate { return Catalog.GetString ("Genre:"); },
                 delegate (EditorTrackInfo track, Widget widget) { ((GenreEntry)widget).Value = track.Genre; },
                 delegate (EditorTrackInfo track, Widget widget) { track.Genre = ((GenreEntry)widget).Value; }
@@ -106,6 +109,7 @@
             // Right
             
             AddField (right, new RangeEntry (Catalog.GetString ("of")), 
+                Catalog.GetString ("Automatically set track number and count"),
                 delegate { return Catalog.GetString ("Track Number:"); },
                 delegate (EditorTrackInfo track, Widget widget) {
                     RangeEntry entry = (RangeEntry)widget;
@@ -121,6 +125,7 @@
             );
             
             AddField (right, new RangeEntry (Catalog.GetString ("of")), 
+                Catalog.GetString ("Automatically set disc number and count"),
                 delegate { return Catalog.GetString ("Disc Number:"); },
                 delegate (EditorTrackInfo track, Widget widget) {
                     RangeEntry entry = (RangeEntry)widget;
@@ -137,7 +142,8 @@
             
             Label year_label = EditorUtilities.CreateLabel (null);
             enable_compilation.SizeAllocated += delegate { year_label.HeightRequest = enable_compilation.Allocation.Height; };
-            AddField (right, year_label, new SpinButtonEntry (1000, 3000, 1),
+            AddField (right, year_label, new SpinButtonEntry (1000, 3000, 1), 
+                Catalog.GetString ("Set all years to this value"),
                 delegate { return Catalog.GetString ("Year:"); },
                 delegate (EditorTrackInfo track, Widget widget) { ((SpinButtonEntry)widget).Value = track.Year; },
                 delegate (EditorTrackInfo track, Widget widget) { track.Year = (int)((SpinButtonEntry)widget).Value; },
@@ -145,6 +151,7 @@
             );
             
             AddField (right, new RatingEntry (), 
+                Catalog.GetString ("Set all ratings to this value"),
                 delegate { return Catalog.GetString ("Rating:"); },
                 delegate (EditorTrackInfo track, Widget widget) { ((RatingEntry)widget).Value = track.Rating; },
                 delegate (EditorTrackInfo track, Widget widget) { track.Rating = ((RatingEntry)widget).Value; },

Modified: trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Gui.TrackEditor/ExtraTrackDetailsPage.cs
==============================================================================
--- trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Gui.TrackEditor/ExtraTrackDetailsPage.cs	(original)
+++ trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Gui.TrackEditor/ExtraTrackDetailsPage.cs	Mon Sep 15 22:11:52 2008
@@ -47,12 +47,14 @@
         protected override void AddFields ()
         {
             AddField (this, new TextEntry (), 
+                Catalog.GetString ("Set all composers to this value"),
                 delegate { return Catalog.GetString ("Composer:"); },
                 delegate (EditorTrackInfo track, Widget widget) { ((TextEntry)widget).Text = track.Composer; },
                 delegate (EditorTrackInfo track, Widget widget) {  track.Composer = ((TextEntry)widget).Text; }
             );
             
             AddField (this, new TextEntry (), 
+                Catalog.GetString ("Set all conductors to this value"),
                 delegate { return Catalog.GetString ("Conductor:"); },
                 delegate (EditorTrackInfo track, Widget widget) { ((TextEntry)widget).Text = track.Conductor; },
                 delegate (EditorTrackInfo track, Widget widget) { track.Conductor = ((TextEntry)widget).Text; }
@@ -64,12 +66,14 @@
             PackStart (box, false, false, 0);
             
             AddField (box, new TextEntry (), 
+                Catalog.GetString ("Set all groupings to this value"),
                 delegate { return Catalog.GetString ("Grouping:"); },
                 delegate (EditorTrackInfo track, Widget widget) { ((TextEntry)widget).Text = track.Grouping; },
                 delegate (EditorTrackInfo track, Widget widget) { track.Grouping = ((TextEntry)widget).Text; }
             );
             
             AddField (box, new SpinButtonEntry (0, 500, 1), 
+                Catalog.GetString ("Set all beats per minute to this value"),
                 delegate { return Catalog.GetString ("Beats Per Minute:"); },
                 delegate (EditorTrackInfo track, Widget widget) { ((SpinButtonEntry)widget).Value = track.Bpm; },
                 delegate (EditorTrackInfo track, Widget widget) { track.Bpm = (int)((SpinButtonEntry)widget).Value; },
@@ -77,12 +81,14 @@
             );
             
             AddField (this, new TextEntry (), 
+                Catalog.GetString ("Set all copyrights to this value"),
                 delegate { return Catalog.GetString ("Copyright:"); },
                 delegate (EditorTrackInfo track, Widget widget) { ((TextEntry)widget).Text = track.Copyright; },
                 delegate (EditorTrackInfo track, Widget widget) { track.Copyright = ((TextEntry)widget).Text; }
             );
             
             AddField (this, new TextViewEntry (), 
+                Catalog.GetString ("Set all comments to this value"),
                 delegate { return Catalog.GetString ("Comment:"); },
                 delegate (EditorTrackInfo track, Widget widget) { ((TextViewEntry)widget).Text = track.Comment; },
                 delegate (EditorTrackInfo track, Widget widget) { track.Comment = ((TextViewEntry)widget).Text; }

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	Mon Sep 15 22:11:52 2008
@@ -30,6 +30,7 @@
 using System.Collections.Generic;
 
 using Gtk;
+using Hyena.Gui;
 
 using Banshee.Collection;
 
@@ -61,10 +62,12 @@
         }
         
         private List<FieldSlot> field_slots = new List<FieldSlot> ();
+        private object tooltip_host;
         
         public FieldPage ()
         {
             Spacing = EditorUtilities.RowSpacing;
+            tooltip_host = TooltipSetter.CreateHost ();
         }
         
         public void Initialize (TrackEditorDialog dialog)
@@ -93,27 +96,27 @@
             get { return PageType.Edit; }
         }
     
-        public void AddField (Box parent, Widget field, FieldLabelClosure labelClosure, 
+        public void AddField (Box parent, Widget field, string syncTooltip, FieldLabelClosure labelClosure, 
             FieldValueClosure readClosure, FieldValueClosure writeClosure)
         {
-            AddField (parent, EditorUtilities.CreateLabel (String.Empty), field, 
+            AddField (parent, EditorUtilities.CreateLabel (String.Empty), field, syncTooltip,
                 labelClosure, readClosure, writeClosure, FieldOptions.None);
         }
         
-        public void AddField (Box parent, Widget field, FieldLabelClosure labelClosure, 
+        public void AddField (Box parent, Widget field, string syncTooltip, FieldLabelClosure labelClosure, 
             FieldValueClosure readClosure, FieldValueClosure writeClosure, FieldOptions options)
         {
-            AddField (parent, EditorUtilities.CreateLabel (String.Empty), field, 
+            AddField (parent, EditorUtilities.CreateLabel (String.Empty), field, syncTooltip,
                 labelClosure, readClosure, writeClosure, options);
         }
         
-        public void AddField (Box parent, Widget label, Widget field, FieldLabelClosure labelClosure, 
-            FieldValueClosure readClosure, FieldValueClosure writeClosure)
+        public void AddField (Box parent, Widget label, Widget field, string syncTooltip, 
+            FieldLabelClosure labelClosure, FieldValueClosure readClosure, FieldValueClosure writeClosure)
         {
-            AddField (parent, label, field, labelClosure, readClosure, writeClosure, FieldOptions.None);
+            AddField (parent, label, field, syncTooltip, labelClosure, readClosure, writeClosure, FieldOptions.None);
         }
         
-        public void AddField (Box parent, Widget label, Widget field, FieldLabelClosure labelClosure, 
+        public void AddField (Box parent, Widget label, Widget field, string syncTooltip, FieldLabelClosure labelClosure, 
             FieldValueClosure readClosure, FieldValueClosure writeClosure, FieldOptions options)
         {
             FieldSlot slot = new FieldSlot ();
@@ -125,6 +128,9 @@
             slot.WriteClosure = writeClosure;
             if (MultipleTracks && (options & FieldOptions.NoSync) == 0) {
                 slot.SyncButton = new SyncButton ();
+                if (syncTooltip != null) {
+                    TooltipSetter.Set (tooltip_host, slot.SyncButton, syncTooltip);
+                }
                 slot.SyncButton.Clicked += delegate {
                     dialog.ForeachNonCurrentTrack (delegate (EditorTrackInfo track) {
                         slot.WriteClosure (track, slot.Field);

Modified: trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Gui.TrackEditor/StatisticsPage.cs
==============================================================================
--- trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Gui.TrackEditor/StatisticsPage.cs	(original)
+++ trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Gui.TrackEditor/StatisticsPage.cs	Mon Sep 15 22:11:52 2008
@@ -124,8 +124,10 @@
                 }
                 
                 foreach (TagLib.ICodec codec in file.Properties.Codecs) {
-                    AddItem (String.Format (Catalog.GetString ("{0} Codec:"), 
-                        codec.MediaTypes.ToString ()), codec.Description);
+                    if (codec != null) {
+                        AddItem (String.Format (Catalog.GetString ("{0} Codec:"), 
+                            codec.MediaTypes.ToString ()), codec.Description);
+                    }
                 }
                 
                 AddItem ("Container Formats:", file.TagTypes.ToString ());

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	Mon Sep 15 22:11:52 2008
@@ -33,6 +33,8 @@
 using Mono.Addins;
 using Gtk;
 
+using Hyena.Gui;
+
 using Banshee.Collection;
 using Banshee.Collection.Database;
 using Banshee.ServiceStack;
@@ -74,6 +76,7 @@
         private Label header_artist_label;
         private Label header_album_label;
         private Label edit_notif_label;
+        private object tooltip_host;
         
         private Notebook notebook;
         public Notebook Notebook {
@@ -107,6 +110,8 @@
                 SetSizeRequest (400, 500);
             }
             
+            tooltip_host = TooltipSetter.CreateHost ();
+            
             AddNavigationButtons ();
             
             main_vbox = new VBox ();
@@ -134,11 +139,13 @@
             nav_backward_button.UseStock = true;
             nav_backward_button.Clicked += delegate { NavigateBackward (); };
             nav_backward_button.Show ();
+            TooltipSetter.Set (tooltip_host, nav_backward_button, Catalog.GetString ("Show the previous track"));
             
             nav_forward_button = new Button (Stock.GoForward);
             nav_forward_button.UseStock = true;
             nav_forward_button.Clicked += delegate { NavigateForward (); };
             nav_forward_button.Show ();
+            TooltipSetter.Set (tooltip_host, nav_forward_button, Catalog.GetString ("Show the next track"));
             
             ActionArea.PackStart (nav_backward_button, false, false, 0);
             ActionArea.PackStart (nav_forward_button, false, false, 0);
@@ -242,6 +249,9 @@
                 alignment.Add (box);
                 sync_all_button.Add (alignment);
                 
+                TooltipSetter.Set (tooltip_host, sync_all_button, Catalog.GetString (
+                    "Apply the values of all common fields set for this track to all of the tracks selected in this editor"));
+                    
                 button_box.PackStart (sync_all_button, false, false, 0);
                 
                 foreach (Widget child in ActionArea.Children) {

Modified: trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Gui/TrackActions.cs
==============================================================================
--- trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Gui/TrackActions.cs	(original)
+++ trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Gui/TrackActions.cs	Mon Sep 15 22:11:52 2008
@@ -287,8 +287,8 @@
                 if (handler != null) {
                     handler ();
                 } else {  
-                    new Banshee.Gui.Dialogs.TrackEditor (current_source.TrackModel.SelectedItems);
-                    // Banshee.Gui.TrackEditor.TrackEditorDialog.RunEdit (current_source.TrackModel);
+                    // new Banshee.Gui.Dialogs.TrackEditor (current_source.TrackModel.SelectedItems);
+                    Banshee.Gui.TrackEditor.TrackEditorDialog.RunEdit (current_source.TrackModel);
                 }
             }
         }



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