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



Author: gburt
Date: Mon Oct  6 18:15:06 2008
New Revision: 4657
URL: http://svn.gnome.org/viewvc/banshee?rev=4657&view=rev

Log:
2008-10-06  Gabriel Burt  <gabriel burt gmail com>

	* src/Core/Banshee.ThickClient/Banshee.Gui.TrackEditor/GenreEntry.cs:
	Comment out Gtk+ 2.12 property (EntryCompletion#InlineSelection).

	* src/Core/Banshee.ThickClient/Banshee.Gui.TrackEditor/TextEntry.cs: Add
	another ctor to enable autocomplete.

	* src/Core/Banshee.ThickClient/Banshee.Gui.TrackEditor/BasicTrackDetailsPage.cs:
	* src/Core/Banshee.ThickClient/Banshee.Gui.TrackEditor/AlbumArtistEntry.cs:
	Use new TextEntry ctor to enable autocomplete for artist, album, and album
	artist.



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/GenreEntry.cs
   trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Gui.TrackEditor/TextEntry.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	Mon Oct  6 18:15:06 2008
@@ -39,7 +39,7 @@
         public event EventHandler Changed;
 
         private CheckButton enable_compilation = new CheckButton ();
-        private TextEntry entry = new TextEntry ();
+        private TextEntry entry = new TextEntry ("CoreAlbums", "ArtistName");
         private object tooltip_host = Hyena.Gui.TooltipSetter.CreateHost ();
         
         public AlbumArtistEntry () : base ()

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 Oct  6 18:15:06 2008
@@ -72,7 +72,7 @@
                 FieldOptions.NoSync
             );
             
-            AddField (left, new TextEntry (), 
+            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; },
@@ -94,7 +94,7 @@
                 }
             );
             
-            AddField (left, new TextEntry (), 
+            AddField (left, new TextEntry ("CoreAlbums", "Title"), 
                 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; },

Modified: trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Gui.TrackEditor/GenreEntry.cs
==============================================================================
--- trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Gui.TrackEditor/GenreEntry.cs	(original)
+++ trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Gui.TrackEditor/GenreEntry.cs	Mon Oct  6 18:15:06 2008
@@ -52,7 +52,7 @@
             c.TextColumn = TextColumn;
             c.PopupCompletion = true;
             c.InlineCompletion = true;
-            c.InlineSelection = true;
+            //c.InlineSelection = true; // requires 2.12
             c.PopupSingleMatch = false;
             Entry.Completion = c;
         

Modified: trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Gui.TrackEditor/TextEntry.cs
==============================================================================
--- trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Gui.TrackEditor/TextEntry.cs	(original)
+++ trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Gui.TrackEditor/TextEntry.cs	Mon Oct  6 18:15:06 2008
@@ -29,11 +29,36 @@
 using System;
 using Gtk;
 
+using Banshee.ServiceStack;
+
 namespace Banshee.Gui.TrackEditor
 {
     public class TextEntry : Entry, IEditorField, ICanUndo
     {
         private EditorEntryUndoAdapter undo_adapter = new EditorEntryUndoAdapter ();
+
+        public TextEntry () : base ()
+        {
+        }
+
+        public TextEntry (string completion_table, string completion_column) : this ()
+        {
+            ListStore completion_model = new ListStore (typeof (string));
+            foreach (string val in ServiceManager.DbConnection.QueryEnumerable<string> (String.Format (
+                "SELECT DISTINCT {1} FROM {0} ORDER BY {1}", completion_table, completion_column))) {
+                if (!String.IsNullOrEmpty (val)) {
+                    completion_model.AppendValues (val);
+                }
+            }
+
+            Completion = new EntryCompletion ();
+            Completion.Model = completion_model;
+            Completion.TextColumn = 0;
+            Completion.PopupCompletion = true;
+            Completion.InlineCompletion = true;
+            //Completion.InlineSelection = true; // requires 2.12
+            Completion.PopupSingleMatch = false;
+        }
         
         public void DisconnectUndo ()
         {



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