? diff
? pkg.m4
? rhythmbox.patch
? shell/rb-playlist-manager-glue.h
Index: widgets/rb-song-info.c
===================================================================
RCS file: /cvs/gnome/rhythmbox/widgets/rb-song-info.c,v
retrieving revision 1.50
diff -u -b -p -r1.50 rb-song-info.c
--- widgets/rb-song-info.c	13 Feb 2006 10:04:07 -0000	1.50
+++ widgets/rb-song-info.c	14 Feb 2006 11:52:56 -0000
@@ -37,6 +37,7 @@
 #include <libgnomevfs/gnome-vfs-utils.h>
 
 #include "rhythmdb.h"
+#include "rhythmdb-property-model.h"
 #include "rb-song-info.h"
 #include "rb-enums.h"
 #include "rb-glade-helpers.h"
@@ -123,6 +124,10 @@ struct RBSongInfoPrivate
 	GtkWidget   *play_count;
 	GtkWidget   *last_played;
 	GtkWidget   *rating;
+
+	RhythmDBPropertyModel* albums;
+	RhythmDBPropertyModel* artists;
+	RhythmDBPropertyModel* genres;
 };
 
 #define RB_SONG_INFO_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), RB_TYPE_SONG_INFO, RBSongInfoPrivate))
@@ -305,6 +310,7 @@ rb_song_info_constructor (GType type, gu
 	GList *selected_entries;
 	GList *tem;
 	gboolean editable = TRUE;
+	guint i;
 
 	klass = RB_SONG_INFO_CLASS (g_type_class_peek (RB_TYPE_SONG_INFO));
 
@@ -357,6 +363,35 @@ rb_song_info_constructor (GType type, gu
 	song_info->priv->playback_error_label = glade_xml_get_widget (xml, "song_info_error_label");
 	song_info->priv->disc_cur = glade_xml_get_widget (xml, "song_info_disc_cur");
 
+	for(i = 0; i < 3; i++) {
+		GtkWidget* entry;
+		RhythmDBPropertyModel* model;
+		GtkEntryCompletion* completion;
+
+		switch(i) {
+		case 1:
+			entry = song_info->priv->genre;
+			model = song_info->priv->genres;
+			break;
+		case 2:
+			entry = song_info->priv->artist;
+			model = song_info->priv->artists;
+			break;
+		case 3:
+			entry = song_info->priv->album;
+			model = song_info->priv->albums;
+			break;
+		default:
+			continue;
+		};
+
+		completion = gtk_entry_completion_new();
+		gtk_entry_completion_set_model(completion, GTK_TREE_MODEL(model));
+		gtk_entry_completion_set_text_column(completion, RHYTHMDB_PROPERTY_MODEL_COLUMN_TITLE);
+		gtk_entry_set_completion(GTK_ENTRY(entry), completion);
+		g_object_unref(completion);
+	}
+
 	rb_glade_boldify_label (xml, "album_label");
 	rb_glade_boldify_label (xml, "artist_label");
 	rb_glade_boldify_label (xml, "genre_label");
@@ -435,6 +470,10 @@ rb_song_info_finalize (GObject *object)
 					      G_CALLBACK (rb_song_info_query_model_changed_cb),
 					      song_info);
 
+	g_object_unref (song_info->priv->albums);
+	g_object_unref (song_info->priv->artists);
+	g_object_unref (song_info->priv->genres);
+
 	g_object_unref (G_OBJECT (song_info->priv->db));
 	g_object_unref (G_OBJECT (song_info->priv->source));
 	g_object_unref (G_OBJECT (song_info->priv->query_model));
@@ -454,6 +493,8 @@ rb_song_info_set_property (GObject *obje
 	{
 	case PROP_SOURCE:
 	{
+		RhythmDB* old_db = song_info->priv->db;
+
 		song_info->priv->source = g_value_get_object (value);
 		g_object_ref (G_OBJECT (song_info->priv->source));
 		g_object_get (G_OBJECT (song_info->priv->source), 
@@ -465,6 +506,41 @@ rb_song_info_set_property (GObject *obje
 
 		g_object_get (G_OBJECT (song_info->priv->query_model), "db", 
 			      &song_info->priv->db, NULL);
+
+		if(old_db != song_info->priv->db) {
+			if(song_info->priv->albums) {
+				g_object_unref(song_info->priv->albums);
+			}
+			if(song_info->priv->artists) {
+				g_object_unref(song_info->priv->artists);
+			}
+			if(song_info->priv->genres) {
+				g_object_unref(song_info->priv->genres);
+			}
+
+			song_info->priv->albums  = rhythmdb_property_model_new(song_info->priv->db, RHYTHMDB_PROP_ALBUM);
+			song_info->priv->artists = rhythmdb_property_model_new(song_info->priv->db, RHYTHMDB_PROP_ARTIST);
+			song_info->priv->genres  = rhythmdb_property_model_new(song_info->priv->db, RHYTHMDB_PROP_GENRE);
+
+			g_object_set(song_info->priv->albums,  "query-model", song_info->priv->query_model, NULL);
+			g_object_set(song_info->priv->artists, "query-model", song_info->priv->query_model, NULL);
+			g_object_set(song_info->priv->genres,  "query-model", song_info->priv->query_model, NULL);
+
+			if(song_info->priv->album) {
+				GtkEntryCompletion* comp = gtk_entry_get_completion(GTK_ENTRY(song_info->priv->album));
+				gtk_entry_completion_set_model(comp, GTK_TREE_MODEL(song_info->priv->albums));
+			}
+
+			if(song_info->priv->artist) {
+				GtkEntryCompletion* comp = gtk_entry_get_completion(GTK_ENTRY(song_info->priv->artist));
+				gtk_entry_completion_set_model(comp, GTK_TREE_MODEL(song_info->priv->artist));
+			}
+
+			if(song_info->priv->genre) {
+				GtkEntryCompletion* comp = gtk_entry_get_completion(GTK_ENTRY(song_info->priv->genre));
+				gtk_entry_completion_set_model(comp, GTK_TREE_MODEL(song_info->priv->genre));
+			}
+		}
 	}
 	break;
 	case PROP_ENTRY_VIEW:
