Only in rhythmbox-0.8.8.orig/help/C: authors.xml
Only in rhythmbox-0.8.8.orig/help/ja: authors.xml
Only in rhythmbox-0.8.8.orig/metadata/monkey-media: monkey-media-marshal.c
Only in rhythmbox-0.8.8.orig/metadata/monkey-media: monkey-media-marshal.h
Only in rhythmbox-0.8.8.orig: rhythmbox.spec
diff -ur rhythmbox-0.8.8.orig/shell/rb-source-header.c rhythmbox-0.8.8/shell/rb-source-header.c
--- rhythmbox-0.8.8.orig/shell/rb-source-header.c	2004-04-19 01:15:54.000000000 +0300
+++ rhythmbox-0.8.8/shell/rb-source-header.c	2005-06-19 13:39:48.000000000 +0300
@@ -369,6 +369,10 @@
 	rb_search_entry_set_text (RB_SEARCH_ENTRY (header->priv->search),
 				  searchtext);
 
+    /* Reset filters before searching to get a always-global search */
+    if (header->priv->selected_source)
+        rb_source_reset_filters (header->priv->selected_source);
+
 	rb_source_search (header->priv->selected_source, searchtext);
 
 	g_free (searchtext);
diff -ur rhythmbox-0.8.8.orig/sources/rb-library-source.c rhythmbox-0.8.8/sources/rb-library-source.c
--- rhythmbox-0.8.8.orig/sources/rb-library-source.c	2004-05-08 01:26:30.000000000 +0300
+++ rhythmbox-0.8.8/sources/rb-library-source.c	2005-06-19 13:39:52.000000000 +0300
@@ -136,6 +136,7 @@
 						 RBLibrarySource *source);
 static GPtrArray * construct_query_from_selection (RBLibrarySource *source);
 
+static void append_to_search_history (const gchar *search_text);
 
 #define LIBRARY_SOURCE_SONGS_POPUP_PATH "/popups/LibrarySongsList"
 #define LIBRARY_SOURCE_POPUP_PATH "/popups/LibrarySourceList"
@@ -147,6 +148,7 @@
 #define CONF_STATE_PANED_POSITION CONF_PREFIX "/state/library/paned_position"
 #define CONF_STATE_SHOW_BROWSER   CONF_PREFIX "/state/library/show_browser"
 #define CONF_STATE_SEARCH_TEXT   CONF_PREFIX "/state/library/search_text"
+#define CONF_STATE_SEARCH_HISTORY   CONF_PREFIX "/state/library/search_history"
 
 struct RBLibrarySourcePrivate
 {
@@ -787,11 +789,49 @@
 	rhythmdb_query_free (query);
 }
 
+static void append_to_search_history (const gchar *search_text)
+{
+  GSList *list;
+  GSList *ilist;
+  gboolean skip;
+  
+  list = eel_gconf_get_string_list (CONF_STATE_SEARCH_HISTORY);
+  
+  if (search_text != NULL)
+  {
+    skip = FALSE;
+    for (ilist = list; ilist; ilist = ilist->next)
+    {
+      if (g_utf8_collate (search_text, (const gchar *) ilist->data) == 0)
+      {
+        skip = TRUE;
+        break;
+      }
+    }
+    if (!skip)
+      list = g_slist_append (list, (gpointer) search_text);
+  }
+  
+  eel_gconf_set_string_list (CONF_STATE_SEARCH_HISTORY, NULL);
+  eel_gconf_set_string_list (CONF_STATE_SEARCH_HISTORY, list);
+  
+}
+
 static void
 genres_selected_cb (RBPropertyView *propview, GList *genres,
 		   RBLibrarySource *libsource)
 {
 	rb_debug ("genre selected"); 
+  
+  /* Append old search to history, if search_text is NULL, it just
+   * refreshes the list (we do want this)
+   */
+  append_to_search_history (libsource->priv->search_text);
+  
+  /* Reset the search text to de-filterize the views */
+  g_free (libsource->priv->search_text);
+  libsource->priv->search_text = NULL;
+    
 	rb_library_source_handle_genre_selection (libsource, genres);
 }
 
@@ -822,7 +862,19 @@
 artists_selected_cb (RBPropertyView *propview, GList *artists, 
 		     RBLibrarySource *libsource)
 {
+	rb_debug ("artist selected"); 
+  
+  /* Append old search to history, if search_text is NULL, it just
+   * refreshes the list (we do want this)
+   */
+  append_to_search_history (libsource->priv->search_text);
+  
+  /* Reset the search text to de-filterize the views */
+  g_free (libsource->priv->search_text);
+  libsource->priv->search_text = NULL;
+  
 	rb_library_source_handle_artist_selection (libsource, artists);
+  
 }
 
 static void
@@ -855,6 +907,16 @@
 		    RBLibrarySource *libsource)
 {
 	rb_debug ("album selected"); 
+    
+  /* Append old search to history, if search_text is NULL, it just
+   * refreshes the list (we do want this)
+   */
+  append_to_search_history (libsource->priv->search_text);
+  
+  /* Reset the search text to de-filterize the views */
+  g_free (libsource->priv->search_text);
+  libsource->priv->search_text = NULL;
+  
 	rb_library_source_handle_album_selection (libsource, albums);
 }
 
diff -ur rhythmbox-0.8.8.orig/widgets/rb-search-entry.c rhythmbox-0.8.8/widgets/rb-search-entry.c
--- rhythmbox-0.8.8.orig/widgets/rb-search-entry.c	2004-04-15 22:30:20.000000000 +0300
+++ rhythmbox-0.8.8/widgets/rb-search-entry.c	2005-06-19 14:09:53.000000000 +0300
@@ -28,20 +28,35 @@
 #include <string.h>
 
 #include "rb-search-entry.h"
+#include "rb-preferences.h"
+#include "eel-gconf-extensions.h"
+
+#define CONF_STATE_SEARCH_HISTORY   CONF_PREFIX "/state/library/search_history"
 
 static void rb_search_entry_class_init (RBSearchEntryClass *klass);
 static void rb_search_entry_init (RBSearchEntry *entry);
 static void rb_search_entry_finalize (GObject *object);
+static void rb_search_entry_add_history (RBSearchEntry *entry,
+                                            const char *text);
+static void rb_search_entry_clear_history (RBSearchEntry *entry);
+static void rb_search_entry_update_history (RBSearchEntry *entry);
+static void rb_search_entry_clear_no_timeout (RBSearchEntry *entry);
 static gboolean rb_search_entry_timeout_cb (RBSearchEntry *entry);
 static void rb_search_entry_changed_cb (GtkEditable *editable,
 			                RBSearchEntry *entry);
 static gboolean rb_search_entry_focus_out_event_cb (GtkWidget *widget,
 				                    GdkEventFocus *event,
 				                    RBSearchEntry *entry);
+static void rb_search_entry_history_changed_cb (GConfClient *client,
+							  guint cnxn_id,
+							  GConfEntry *entry,
+							  RBSearchEntry *rbentry);
 
 struct RBSearchEntryPrivate
 {
 	GtkWidget *entry;
+  
+  GtkEntryCompletion *completion;
 
 	gboolean clearing;
 
@@ -121,6 +136,16 @@
 
 	entry->priv->entry = gtk_entry_new ();
 
+  entry->priv->completion = gtk_entry_completion_new ();
+  
+  gtk_entry_completion_set_model (entry->priv->completion,
+                                  GTK_TREE_MODEL (gtk_list_store_new (1, G_TYPE_STRING)));
+  
+  gtk_entry_completion_set_text_column (entry->priv->completion, 0);
+  
+  gtk_entry_set_completion (GTK_ENTRY (entry->priv->entry),
+                            entry->priv->completion);
+  
 	gtk_label_set_mnemonic_widget (GTK_LABEL (label),
 				       entry->priv->entry);
 
@@ -134,6 +159,13 @@
 				 "focus_out_event",
 				 G_CALLBACK (rb_search_entry_focus_out_event_cb),
 				 entry, 0);
+  
+  rb_search_entry_update_history (entry);
+  
+  eel_gconf_set_string_list (CONF_STATE_SEARCH_HISTORY, NULL);
+  eel_gconf_notification_add (CONF_STATE_SEARCH_HISTORY,
+                              (GConfClientNotifyFunc) rb_search_entry_history_changed_cb,
+                              entry);
 }
 
 static void
@@ -211,7 +243,7 @@
 	
 	g_signal_emit (G_OBJECT (entry), rb_search_entry_signals[SEARCH], 0,
 		       gtk_entry_get_text (GTK_ENTRY (entry->priv->entry)));
-	entry->priv->timeout = 0;
+  entry->priv->timeout = 0;
 
 	gdk_threads_leave ();
 
@@ -240,3 +272,68 @@
 {
 	return strcmp ("", gtk_entry_get_text (GTK_ENTRY (entry->priv->entry))) != 0;
 }
+
+static void    rb_search_entry_add_history (RBSearchEntry *entry, const char *text)
+{
+  GtkTreeModel *model;
+  GtkTreeIter iter;
+  
+  if (g_utf8_collate (text, "") == 0)
+  {
+    return;
+  }    
+  
+  model = gtk_entry_completion_get_model (entry->priv->completion);
+  
+  gtk_list_store_append (GTK_LIST_STORE (model), &iter);
+	gtk_list_store_set (GTK_LIST_STORE (model), &iter, 0, text, -1);
+  
+}
+
+static void    rb_search_entry_clear_history (RBSearchEntry *entry)
+{
+  GtkTreeModel *model;
+  
+  model = gtk_entry_completion_get_model (entry->priv->completion);
+  gtk_list_store_clear (GTK_LIST_STORE (model));
+  
+}
+
+static void		rb_search_entry_clear_no_timeout    (RBSearchEntry *entry)
+{
+  if (!gtk_widget_is_focus (entry->priv->entry))
+  {
+    entry->priv->clearing = TRUE;
+    
+    gtk_entry_set_text (GTK_ENTRY (entry->priv->entry), "");
+  
+    entry->priv->clearing = FALSE;
+  }    
+}
+
+static void rb_search_entry_history_changed_cb (GConfClient *client,
+							  guint cnxn_id,
+							  GConfEntry *entry,
+							  RBSearchEntry *rbentry)
+{
+  rb_search_entry_clear_history (rbentry);
+  rb_search_entry_clear_no_timeout (rbentry);
+  rb_search_entry_update_history (rbentry);
+  
+}
+
+static void    rb_search_entry_update_history (RBSearchEntry *entry)
+{
+  GSList *list;
+  GSList *ilist;
+  
+  ilist = eel_gconf_get_string_list (CONF_STATE_SEARCH_HISTORY);
+
+  if (ilist == NULL)
+    return;
+  
+  for (list = ilist; list; list = list->next)
+  {
+    rb_search_entry_add_history (entry, (const char*) list->data);
+  }
+}
