banshee r4420 - in branches/banshee/abock: . src/Core/Banshee.Services/Banshee.Sources src/Core/Banshee.ThickClient src/Core/Banshee.ThickClient/Banshee.Collection.Gui src/Core/Banshee.ThickClient/Banshee.Gui.TrackEditor



Author: abock
Date: Sat Aug 23 00:01:40 2008
New Revision: 4420
URL: http://svn.gnome.org/viewvc/banshee?rev=4420&view=rev

Log:
2008-08-22  Aaron Bockover  <abock gnome org>

    * src/Core/Banshee.ThickClient/Banshee.Collection.Gui/ColumnCellDuration.cs:
    Use the DurationStatusFormatters.ConfusingPreciseFormatter to display dur

    * src/Core/Banshee.Services/Banshee.Sources/DurationStatusFormatters.cs:
    Do not display minutes as {0:00} if hours < 1

    * src/Core/Banshee.ThickClient/Banshee.ThickClient.addin.xml: Added stats
    * src/Core/Banshee.ThickClient/Banshee.Gui.TrackEditor/ExtraTrackDetailsPage.cs:
    Fix bug, name the tab Extra

    * src/Core/Banshee.ThickClient/Banshee.Gui.TrackEditor/GenreEntry.cs:
    Implemented the genre combo box entry

    * src/Core/Banshee.ThickClient/Banshee.Gui.TrackEditor/StatisticsPage.cs:
    Implemented an awesome new stats page to show detailed file info

    * src/Core/Banshee.ThickClient/Banshee.Gui.TrackEditor/EditorTrackInfo.cs:
    Implement the TagLib file property

    * src/Core/Banshee.ThickClient/Banshee.Gui.TrackEditor/TrackEditorDialog.cs:
    Make the sync all button nicer

    * src/Core/Banshee.ThickClient/Banshee.Gui.TrackEditor/TextViewEntry.cs:
    Restrict the comments field two two lines of text

    * src/Core/Banshee.ThickClient/Banshee.Gui.TrackEditor/BasicTrackDetailsPage.cs:
    Use the new genre entry



Added:
   branches/banshee/abock/src/Core/Banshee.ThickClient/Banshee.Gui.TrackEditor/GenreEntry.cs
   branches/banshee/abock/src/Core/Banshee.ThickClient/Banshee.Gui.TrackEditor/StatisticsPage.cs
Modified:
   branches/banshee/abock/ChangeLog
   branches/banshee/abock/src/Core/Banshee.Services/Banshee.Sources/DurationStatusFormatters.cs
   branches/banshee/abock/src/Core/Banshee.ThickClient/Banshee.Collection.Gui/ColumnCellDuration.cs
   branches/banshee/abock/src/Core/Banshee.ThickClient/Banshee.Gui.TrackEditor/BasicTrackDetailsPage.cs
   branches/banshee/abock/src/Core/Banshee.ThickClient/Banshee.Gui.TrackEditor/EditorTrackInfo.cs
   branches/banshee/abock/src/Core/Banshee.ThickClient/Banshee.Gui.TrackEditor/ExtraTrackDetailsPage.cs
   branches/banshee/abock/src/Core/Banshee.ThickClient/Banshee.Gui.TrackEditor/TextViewEntry.cs
   branches/banshee/abock/src/Core/Banshee.ThickClient/Banshee.Gui.TrackEditor/TrackEditorDialog.cs
   branches/banshee/abock/src/Core/Banshee.ThickClient/Banshee.ThickClient.addin.xml
   branches/banshee/abock/src/Core/Banshee.ThickClient/Banshee.ThickClient.mdp
   branches/banshee/abock/src/Core/Banshee.ThickClient/Makefile.am

Modified: branches/banshee/abock/src/Core/Banshee.Services/Banshee.Sources/DurationStatusFormatters.cs
==============================================================================
--- branches/banshee/abock/src/Core/Banshee.Services/Banshee.Sources/DurationStatusFormatters.cs	(original)
+++ branches/banshee/abock/src/Core/Banshee.Services/Banshee.Sources/DurationStatusFormatters.cs	Sat Aug 23 00:01:40 2008
@@ -88,7 +88,11 @@
                 builder.AppendFormat ("{0}:", span.Hours);
             }
             
-            builder.AppendFormat ("{0:00}:{1:00}", span.Minutes, span.Seconds);
+            if (span.TotalHours < 1 || span.TotalMinutes < 1) {
+                builder.AppendFormat ("{0}:{1:00}", span.Minutes, span.Seconds);
+            } else {
+                builder.AppendFormat ("{0:00}:{1:00}", span.Minutes, span.Seconds);
+            }
         }
     }
 }

Modified: branches/banshee/abock/src/Core/Banshee.ThickClient/Banshee.Collection.Gui/ColumnCellDuration.cs
==============================================================================
--- branches/banshee/abock/src/Core/Banshee.ThickClient/Banshee.Collection.Gui/ColumnCellDuration.cs	(original)
+++ branches/banshee/abock/src/Core/Banshee.ThickClient/Banshee.Collection.Gui/ColumnCellDuration.cs	Sat Aug 23 00:01:40 2008
@@ -34,6 +34,8 @@
 {
     public class ColumnCellDuration : ColumnCellText
     {
+        private System.Text.StringBuilder builder = new System.Text.StringBuilder ();
+    
         public ColumnCellDuration (string property, bool expand) : base (property, expand)
         {
             Alignment = Pango.Alignment.Right;
@@ -50,12 +52,13 @@
                 //int seconds = (int)Math.Round(((TimeSpan)BoundObject).TotalSeconds);
                 int seconds = (int) ((TimeSpan)BoundObject).TotalSeconds;
                 
-                if (seconds == 0)
+                if (seconds == 0) {
                     return String.Empty;
+                }
                 
-                return seconds >= 3600 ? 
-                    String.Format ("{0}:{1:00}:{2:00}", seconds / 3600, (seconds / 60) % 60, seconds % 60) :
-                    String.Format ("{0}:{1:00}", seconds / 60, seconds % 60);
+                builder.Remove (0, builder.Length);
+                Banshee.Sources.DurationStatusFormatters.ConfusingPreciseFormatter (builder, TimeSpan.FromSeconds (seconds));
+                return builder.ToString ();
             }
         }
     }

Modified: branches/banshee/abock/src/Core/Banshee.ThickClient/Banshee.Gui.TrackEditor/BasicTrackDetailsPage.cs
==============================================================================
--- branches/banshee/abock/src/Core/Banshee.ThickClient/Banshee.Gui.TrackEditor/BasicTrackDetailsPage.cs	(original)
+++ branches/banshee/abock/src/Core/Banshee.ThickClient/Banshee.Gui.TrackEditor/BasicTrackDetailsPage.cs	Sat Aug 23 00:01:40 2008
@@ -43,7 +43,7 @@
         }
                                     
         public string Title {
-            get { return Catalog.GetString ("Track Details"); }
+            get { return Catalog.GetString ("Basic Details"); }
         }
         
         public override void LoadTrack (EditorTrackInfo track)
@@ -97,10 +97,10 @@
                 delegate (EditorTrackInfo track, Widget widget) { track.AlbumTitle = ((TextEntry)widget).Text; }
             );
             
-            AddField (left, new TextEntry (), 
+            AddField (left, new GenreEntry (), 
                 delegate { return Catalog.GetString ("Genre:"); },
-                delegate (EditorTrackInfo track, Widget widget) { ((TextEntry)widget).Text = track.Genre; },
-                delegate (EditorTrackInfo track, Widget widget) { track.Genre = ((TextEntry)widget).Text; }
+                delegate (EditorTrackInfo track, Widget widget) { ((GenreEntry)widget).Value = track.Genre; },
+                delegate (EditorTrackInfo track, Widget widget) { track.Genre = ((GenreEntry)widget).Value; }
             );
             
             // Right

Modified: branches/banshee/abock/src/Core/Banshee.ThickClient/Banshee.Gui.TrackEditor/EditorTrackInfo.cs
==============================================================================
--- branches/banshee/abock/src/Core/Banshee.ThickClient/Banshee.Gui.TrackEditor/EditorTrackInfo.cs	(original)
+++ branches/banshee/abock/src/Core/Banshee.ThickClient/Banshee.Gui.TrackEditor/EditorTrackInfo.cs	Sat Aug 23 00:01:40 2008
@@ -27,13 +27,18 @@
 //
 
 using System;
+using TagLib;
 
+using Banshee.Streaming;
 using Banshee.Collection;
 
 namespace Banshee.Gui.TrackEditor
 {
     public class EditorTrackInfo : TrackInfo
     {
+        private TagLib.File taglib_file;
+        private bool taglib_file_exists = true;
+        
         public EditorTrackInfo (TrackInfo sourceTrack)
         {
             source_track = sourceTrack;
@@ -56,5 +61,27 @@
         public TrackInfo SourceTrack {
             get { return source_track; }
         }
+        
+        public TagLib.File TaglibFile {
+            get {
+                if (taglib_file != null) {
+                    return taglib_file;
+                } else if (!taglib_file_exists) {
+                    return null;
+                }
+                    
+                try {
+                    taglib_file = StreamTagger.ProcessUri (Uri);
+                    if (taglib_file != null) {
+                        return taglib_file;
+                    }
+                } catch (Exception e) {
+                    Hyena.Log.Exception ("Cannot load TagLib file", e);
+                }
+                
+                taglib_file_exists = false;
+                return null;
+            }
+        }
     }
 }

Modified: branches/banshee/abock/src/Core/Banshee.ThickClient/Banshee.Gui.TrackEditor/ExtraTrackDetailsPage.cs
==============================================================================
--- branches/banshee/abock/src/Core/Banshee.ThickClient/Banshee.Gui.TrackEditor/ExtraTrackDetailsPage.cs	(original)
+++ branches/banshee/abock/src/Core/Banshee.ThickClient/Banshee.Gui.TrackEditor/ExtraTrackDetailsPage.cs	Sat Aug 23 00:01:40 2008
@@ -41,7 +41,7 @@
         }
                                     
         public string Title {
-            get { return Catalog.GetString ("More Details"); }
+            get { return Catalog.GetString ("Extra"); }
         }
         
         protected override void AddFields ()
@@ -85,7 +85,7 @@
             AddField (this, new TextViewEntry (), 
                 delegate { return Catalog.GetString ("Comment:"); },
                 delegate (EditorTrackInfo track, Widget widget) { ((TextViewEntry)widget).Text = track.Comment; },
-                delegate (EditorTrackInfo track, Widget widget) { track.Comment = ((TextEntry)widget).Text; }
+                delegate (EditorTrackInfo track, Widget widget) { track.Comment = ((TextViewEntry)widget).Text; }
             );
         }
     }

Added: branches/banshee/abock/src/Core/Banshee.ThickClient/Banshee.Gui.TrackEditor/GenreEntry.cs
==============================================================================
--- (empty file)
+++ branches/banshee/abock/src/Core/Banshee.ThickClient/Banshee.Gui.TrackEditor/GenreEntry.cs	Sat Aug 23 00:01:40 2008
@@ -0,0 +1,65 @@
+//
+// GenreEntry.cs
+//
+// Author:
+//   Aaron Bockover <abockover novell com>
+//
+// Copyright (C) 2008 Novell, Inc.
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using System.Data;
+
+using Gtk;
+
+using Banshee.ServiceStack;
+using Banshee.Collection.Database;
+
+namespace Banshee.Gui.TrackEditor
+{
+    public class GenreEntry : ComboBoxEntry
+    {
+        private ListStore genre_model;
+        
+        public GenreEntry ()
+        {
+            genre_model = new ListStore (typeof (string));
+            Model = genre_model;
+            TextColumn = 0;
+        
+            IDataReader reader = ServiceManager.DbConnection.Query (
+                "SELECT DISTINCT Genre FROM CoreTracks ORDER BY Genre");
+                
+            while (reader != null && reader.Read ()) {
+                string genre = reader[0] as string;
+                if (!String.IsNullOrEmpty (genre)) {
+                    genre_model.AppendValues (genre);
+                }
+            }
+        }
+        
+        public string Value {
+            get { return Entry.Text; }
+            set { Entry.Text = value ?? String.Empty; }
+        }
+    }
+}

Added: branches/banshee/abock/src/Core/Banshee.ThickClient/Banshee.Gui.TrackEditor/StatisticsPage.cs
==============================================================================
--- (empty file)
+++ branches/banshee/abock/src/Core/Banshee.ThickClient/Banshee.Gui.TrackEditor/StatisticsPage.cs	Sat Aug 23 00:01:40 2008
@@ -0,0 +1,169 @@
+//
+// StatisticsPage.cs
+//
+// Author:
+//   Aaron Bockover <abockover novell com>
+//
+// Copyright (C) 2008 Novell, Inc.
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using System.Collections.Generic;
+using Mono.Unix;
+using Gtk;
+
+namespace Banshee.Gui.TrackEditor
+{
+    public class StatisticsPage : ScrolledWindow, ITrackEditorPage
+    {
+        private CellRendererText name_renderer;
+        private ListStore model;
+        private TreeView view;
+
+        public StatisticsPage ()
+        {
+            ShadowType = ShadowType.In;
+            VscrollbarPolicy = PolicyType.Automatic;
+            HscrollbarPolicy = PolicyType.Never;
+            
+            view = new TreeView (model);
+            view.HeadersVisible = false;
+            view.RowSeparatorFunc = new TreeViewRowSeparatorFunc (RowSeparatorFunc);
+            
+            name_renderer = new CellRendererText ();
+            name_renderer.Alignment = Pango.Alignment.Right;
+            name_renderer.Weight = (int)Pango.Weight.Bold;
+            name_renderer.Xalign = 1.0f;
+            name_renderer.Scale = Pango.Scale.Small;
+            
+            CellRendererText value_renderer = new CellRendererText ();
+            value_renderer.Ellipsize = Pango.EllipsizeMode.End;
+            value_renderer.Editable = true;
+            value_renderer.Scale = Pango.Scale.Small;
+            
+            view.AppendColumn (Catalog.GetString ("Name"), name_renderer, "text", 0);
+            view.AppendColumn (Catalog.GetString ("Value"), value_renderer, "text", 1);
+            
+            Add (view);
+            ShowAll ();
+        }
+        
+        private bool RowSeparatorFunc (TreeModel model, TreeIter iter)
+        {
+            return (bool)model.GetValue (iter, 2);
+        }
+        
+        protected override void OnStyleSet (Style previous_style)
+        {
+            base.OnStyleSet (previous_style);
+            name_renderer.CellBackgroundGdk = Style.Background (StateType.Normal);
+        }
+
+        public void Initialize (TrackEditorDialog dialog)
+        {
+        }
+        
+        public void LoadTrack (EditorTrackInfo track)
+        {
+            BorderWidth = 2;
+            model = new ListStore (typeof (string), typeof (string), typeof (bool));
+            view.Model = model;
+            
+            TagLib.File file = track.TaglibFile;
+            
+            if (track.Uri.IsLocalPath) {
+                string path = track.Uri.AbsolutePath;
+                AddItem (Catalog.GetString ("File Name:"), System.IO.Path.GetFileName (path));
+                AddItem (Catalog.GetString ("Directory:"), System.IO.Path.GetDirectoryName (path));
+                AddItem (Catalog.GetString ("Full Path:"), path);
+                try {
+                    AddFileSizeItem (Banshee.IO.File.GetSize (track.Uri));
+                } catch {
+                }
+            } else {
+                AddItem (Catalog.GetString ("URI:"), track.Uri.AbsoluteUri);
+                AddFileSizeItem (track.FileSize);
+            }
+            
+            AddSeparator ();
+            
+            if (file != null) {
+                System.Text.StringBuilder builder = new System.Text.StringBuilder ();
+                Banshee.Sources.DurationStatusFormatters.ConfusingPreciseFormatter (builder, file.Properties.Duration);
+                AddItem (Catalog.GetString ("Duration:"), String.Format ("{0} ({1}ms)", builder, file.Properties.Duration.TotalMilliseconds));
+                
+                AddItem (Catalog.GetString ("Audio Bitrate:"), String.Format ("{0} KB/sec", file.Properties.AudioBitrate));
+                AddItem (Catalog.GetString ("Audio Sample Rate:"), String.Format ("{0} Hz", file.Properties.AudioSampleRate)); 
+                AddItem (Catalog.GetString ("Audio Channels:"), file.Properties.AudioChannels);
+                
+                if ((file.Properties.MediaTypes & TagLib.MediaTypes.Video) != 0) {
+                    AddItem (Catalog.GetString ("Video Dimensions:"), String.Format ("{0}x{1}", 
+                        file.Properties.VideoWidth, file.Properties.VideoHeight));
+                }
+                
+                foreach (TagLib.ICodec codec in file.Properties.Codecs) {
+                    AddItem (String.Format (Catalog.GetString ("{0} Codec:"), codec.MediaTypes.ToString ()), codec.Description);
+                }
+                
+                AddItem ("Container Formats:", file.TagTypes.ToString ());
+                AddSeparator ();
+            }
+            
+            AddItem (Catalog.GetString ("Imported On:"), track.DateAdded > DateTime.MinValue ? track.DateAdded.ToString () : Catalog.GetString ("Unknown"));
+            AddItem (Catalog.GetString ("Last Played:"), track.LastPlayed > DateTime.MinValue ? track.LastPlayed.ToString () : Catalog.GetString ("Unknown"));
+            AddItem (Catalog.GetString ("Last Skipped:"), track.LastSkipped > DateTime.MinValue ? track.LastSkipped.ToString () : Catalog.GetString ("Unknown"));
+            AddItem (Catalog.GetString ("Play Count:"), track.PlayCount);
+            AddItem (Catalog.GetString ("Skip Count:"), track.SkipCount);
+        }
+        
+        private void AddFileSizeItem (long bytes)
+        {
+            Hyena.Query.FileSizeQueryValue value = new Hyena.Query.FileSizeQueryValue (bytes);
+            AddItem (Catalog.GetString ("File Size:"), String.Format ("{0} ({1} {2})", 
+                value.ToUserQuery (), bytes, Catalog.GetString ("bytes")));
+        }
+        
+        public void AddItem (string name, object value)
+        {
+            if (name != null && value != null) {
+                model.AppendValues (name, value.ToString (), false);
+            }
+        }
+        
+        public void AddSeparator ()
+        {
+            model.AppendValues (String.Empty, String.Empty, true);
+        }
+        
+        public int Order {
+            get { return 40; }
+        }
+        
+        public string Title {
+            get { return Catalog.GetString ("Statistics"); }
+        }
+        
+        public Gtk.Widget Widget {
+            get { return this; }
+        }
+    }
+}

Modified: branches/banshee/abock/src/Core/Banshee.ThickClient/Banshee.Gui.TrackEditor/TextViewEntry.cs
==============================================================================
--- branches/banshee/abock/src/Core/Banshee.ThickClient/Banshee.Gui.TrackEditor/TextViewEntry.cs	(original)
+++ branches/banshee/abock/src/Core/Banshee.ThickClient/Banshee.Gui.TrackEditor/TextViewEntry.cs	Sat Aug 23 00:01:40 2008
@@ -55,6 +55,16 @@
             entry.AcceptsTab = false;
             entry.Show ();
             entry.Buffer.Changed += OnChanged;
+            
+            entry.SizeRequested += OnTextViewSizeRequested;
+        }
+        
+        private void OnTextViewSizeRequested (object o, SizeRequestedArgs args)
+        {
+            Pango.FontMetrics metrics = PangoContext.GetMetrics (entry.Style.FontDescription, PangoContext.Language);
+            int line_height = ((int)(metrics.Ascent + metrics.Descent) + 512) >> 10; // PANGO_PIXELS(d)
+            metrics.Dispose ();
+            HeightRequest = (line_height + 2) * 2;
         }
                 
         private void OnChanged (object o, EventArgs args)

Modified: branches/banshee/abock/src/Core/Banshee.ThickClient/Banshee.Gui.TrackEditor/TrackEditorDialog.cs
==============================================================================
--- branches/banshee/abock/src/Core/Banshee.ThickClient/Banshee.Gui.TrackEditor/TrackEditorDialog.cs	(original)
+++ branches/banshee/abock/src/Core/Banshee.ThickClient/Banshee.Gui.TrackEditor/TrackEditorDialog.cs	Sat Aug 23 00:01:40 2008
@@ -58,6 +58,7 @@
     
         private Button nav_backward_button;
         private Button nav_forward_button;
+        private Button sync_all_button;
         
         private List<ITrackEditorPage> pages = new List<ITrackEditorPage> ();
         
@@ -82,6 +83,7 @@
             
             BuildHeader ();
             BuildNotebook ();
+            BuildFooter ();
             
             LoadTrackToEditor ();
         }
@@ -183,10 +185,8 @@
         {
             HBox box = new HBox ();
             box.Spacing = 2;
-            Image image = new Image (Stock.Help, IconSize.Menu);
-            Label label = new Label (Catalog.GetString ("Help"));
-            box.PackStart (image, false, false, 0);
-            box.PackStart (label, true, true, 0);
+            box.PackStart (new Image (Stock.Help, IconSize.Menu), false, false, 0);
+            box.PackStart (new Label (Catalog.GetString ("Help")), true, true, 0);
             box.ShowAll ();
             
             Image help = new Image ();
@@ -196,6 +196,45 @@
             
             notebook.SetTabLabelPacking (help, false, false, PackType.End);
         }
+        
+        private void BuildFooter ()
+        {
+            HBox button_box = new HBox ();
+            button_box.Spacing = 6;
+                       
+            if (TrackCount > 1) {
+                sync_all_button = new Button ();
+                Alignment alignment = new Alignment (0.5f, 0.5f, 0.0f, 0.0f);
+                HBox box = new HBox ();
+                box.Spacing = 2;
+                box.PackStart (new Image (Stock.Copy, IconSize.Button), false, false, 0);
+                box.PackStart (new Label (Catalog.GetString ("Sync all field values")), false, false, 0);
+                alignment.Add (box);
+                sync_all_button.Add (alignment);
+                
+                button_box.PackStart (sync_all_button, false, false, 0);
+                
+                foreach (Widget child in ActionArea.Children) {
+                    child.SizeAllocated += OnActionAreaChildSizeAllocated;
+                }
+            }
+            
+            main_vbox.PackStart (button_box, false, false, 0);
+            button_box.ShowAll ();
+        }
+        
+        private int action_area_children_allocated = 0;
+        
+        private void OnActionAreaChildSizeAllocated (object o, SizeAllocatedArgs args)
+        {
+            Widget [] children = ActionArea.Children;
+            if (++action_area_children_allocated != children.Length) {
+                return;
+            }
+            
+            sync_all_button.WidthRequest = (children[1].Allocation.X + 
+                children[1].Allocation.Width) - children[0].Allocation.X - 1;
+        }
 
 #endregion
         
@@ -219,7 +258,7 @@
             }
         }
         
-        private void LoadTrackToEditor ()
+        public void LoadTrackToEditor ()
         {
             TrackInfo current_track = null;
             EditorTrackInfo editor_track = LoadTrack (current_track_index, out current_track);

Modified: branches/banshee/abock/src/Core/Banshee.ThickClient/Banshee.ThickClient.addin.xml
==============================================================================
--- branches/banshee/abock/src/Core/Banshee.ThickClient/Banshee.ThickClient.addin.xml	(original)
+++ branches/banshee/abock/src/Core/Banshee.ThickClient/Banshee.ThickClient.addin.xml	Sat Aug 23 00:01:40 2008
@@ -23,7 +23,8 @@
   <Extension path="/Banshee/Gui/TrackEditor/NotebookPage">
     <TrackEditorPage class="Banshee.Gui.TrackEditor.BasicTrackDetailsPage"/>
     <TrackEditorPage class="Banshee.Gui.TrackEditor.ExtraTrackDetailsPage"/>
-    <TrackEditorPage class="Banshee.Gui.TrackEditor.LyricsPage"/>
+    <!--<TrackEditorPage class="Banshee.Gui.TrackEditor.LyricsPage"/>-->
+    <TrackEditorPage class="Banshee.Gui.TrackEditor.StatisticsPage"/>
   </Extension>
   
   <!-- Exported Extension Points -->

Modified: branches/banshee/abock/src/Core/Banshee.ThickClient/Banshee.ThickClient.mdp
==============================================================================
--- branches/banshee/abock/src/Core/Banshee.ThickClient/Banshee.ThickClient.mdp	(original)
+++ branches/banshee/abock/src/Core/Banshee.ThickClient/Banshee.ThickClient.mdp	Sat Aug 23 00:01:40 2008
@@ -136,6 +136,8 @@
     <File name="Banshee.Gui.TrackEditor/EditorTrackInfo.cs" subtype="Code" buildaction="Compile" />
     <File name="Banshee.Gui.TrackEditor/IEditorField.cs" subtype="Code" buildaction="Compile" />
     <File name="Banshee.Gui.TrackEditor/FieldOptions.cs" subtype="Code" buildaction="Compile" />
+    <File name="Banshee.Gui.TrackEditor/GenreEntry.cs" subtype="Code" buildaction="Compile" />
+    <File name="Banshee.Gui.TrackEditor/StatisticsPage.cs" subtype="Code" buildaction="Compile" />
   </Contents>
   <References>
     <ProjectReference type="Project" localcopy="False" refto="Hyena.Gui" />

Modified: branches/banshee/abock/src/Core/Banshee.ThickClient/Makefile.am
==============================================================================
--- branches/banshee/abock/src/Core/Banshee.ThickClient/Makefile.am	(original)
+++ branches/banshee/abock/src/Core/Banshee.ThickClient/Makefile.am	Sat Aug 23 00:01:40 2008
@@ -53,12 +53,14 @@
 	Banshee.Gui.TrackEditor/ExtraTrackDetailsPage.cs \
 	Banshee.Gui.TrackEditor/FieldOptions.cs \
 	Banshee.Gui.TrackEditor/FieldPage.cs \
+	Banshee.Gui.TrackEditor/GenreEntry.cs \
 	Banshee.Gui.TrackEditor/IEditorField.cs \
 	Banshee.Gui.TrackEditor/ITrackEditorPage.cs \
 	Banshee.Gui.TrackEditor/LyricsPage.cs \
 	Banshee.Gui.TrackEditor/RangeEntry.cs \
 	Banshee.Gui.TrackEditor/RatingEntry.cs \
 	Banshee.Gui.TrackEditor/SpinButtonEntry.cs \
+	Banshee.Gui.TrackEditor/StatisticsPage.cs \
 	Banshee.Gui.TrackEditor/TextEntry.cs \
 	Banshee.Gui.TrackEditor/TextViewEntry.cs \
 	Banshee.Gui.TrackEditor/TitleEntry.cs \



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