changeset 4116:5853d43e539a

remember filter entry in jtf dialog is extremely useful when jtf deals with large playlist. now this feature is configurable.
author Yoshiki Yazawa <yaz@cc.rim.or.jp>
date Tue, 25 Dec 2007 19:15:44 +0900
parents e99284bb7936
children a5779105e6d2
files src/audacious/main.c src/audacious/main.h src/audacious/ui_jumptotrack.c
diffstat 3 files changed, 26 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/audacious/main.c	Tue Dec 25 01:53:55 2007 -0600
+++ b/src/audacious/main.c	Tue Dec 25 19:15:44 2007 +0900
@@ -227,6 +227,7 @@
     FALSE,          /* use software volume control */
     .warn_about_broken_gtk_engines = TRUE,           /* warn about broken gtk themes */
     FALSE,          /* disable inline themes */
+    TRUE,           /* remember jtf text entry */
 };
 
 typedef struct bmp_cfg_boolent_t {
@@ -337,6 +338,7 @@
     {"software_volume_control", &cfg.software_volume_control, TRUE},
     {"warn_about_broken_gtk_engines", &cfg.warn_about_broken_gtk_engines, TRUE},
     {"disable_inline_gtk", &cfg.disable_inline_gtk, TRUE},
+    {"remember_jtf_entry", &cfg.remember_jtf_entry, TRUE},
 };
 
 static gint ncfgbent = G_N_ELEMENTS(bmp_boolents);
--- a/src/audacious/main.h	Tue Dec 25 01:53:55 2007 -0600
+++ b/src/audacious/main.h	Tue Dec 25 19:15:44 2007 +0900
@@ -140,6 +140,7 @@
     gboolean software_volume_control;
     gboolean warn_about_broken_gtk_engines;
     gboolean disable_inline_gtk;
+    gboolean remember_jtf_entry;
 };
 
 typedef struct _BmpConfig BmpConfig;
--- a/src/audacious/ui_jumptotrack.c	Tue Dec 25 01:53:55 2007 -0600
+++ b/src/audacious/ui_jumptotrack.c	Tue Dec 25 19:15:44 2007 +0900
@@ -129,6 +129,13 @@
 }
 
 static void
+ui_jump_to_track_toggle2_cb(GtkWidget * toggle)
+{
+    cfg.remember_jtf_entry =
+        gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(toggle));
+}
+
+static void
 ui_jump_to_track_jump_cb(GtkTreeView * treeview,
                              gpointer data)
 {
@@ -270,7 +277,7 @@
 
     /* clear edit widget */
     if(edit){
-        gtk_entry_set_text(edit, "\0");
+        gtk_entry_set_text(edit, "");
     }
 
     store = gtk_tree_view_get_model(tree);
@@ -508,7 +515,7 @@
 {
     GtkWidget *scrollwin;
     GtkWidget *vbox, *bbox, *sep;
-    GtkWidget *toggle;
+    GtkWidget *toggle, *toggle2;
     GtkWidget *jump, *queue, *close;
     GtkWidget *rescan;
     GtkWidget *search_label, *hbox;
@@ -524,8 +531,12 @@
 
     if (jump_to_track_win) {
         gtk_window_present(GTK_WINDOW(jump_to_track_win));
-        gtk_entry_set_text(edit, "");
+
+        if(!cfg.remember_jtf_entry)
+            gtk_entry_set_text(GTK_ENTRY(edit), "");
+
         gtk_widget_grab_focus(edit);
+        gtk_editable_select_region(GTK_EDITABLE(edit), 0, -1);
         return;
     }
 
@@ -623,6 +634,15 @@
                      G_CALLBACK(ui_jump_to_track_toggle_cb),
                      toggle);
 
+    /* remember text entry */
+    toggle2 = gtk_check_button_new_with_label(_("Remember Entry"));
+    gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(toggle2),
+                                 cfg.remember_jtf_entry ? TRUE : FALSE);
+    gtk_box_pack_start(GTK_BOX(bbox), toggle2, FALSE, FALSE, 0);
+    g_signal_connect(toggle2, "clicked",
+                     G_CALLBACK(ui_jump_to_track_toggle2_cb),
+                     toggle2);
+
 
     queue = gtk_button_new_with_mnemonic(_("_Queue"));
     gtk_box_pack_start(GTK_BOX(bbox), queue, FALSE, FALSE, 0);