summaryrefslogtreecommitdiff
path: root/search.c
diff options
context:
space:
mode:
authorGravatar waker <wakeroid@gmail.com>2009-08-11 22:06:14 +0200
committerGravatar waker <wakeroid@gmail.com>2009-08-11 22:06:14 +0200
commitb145eb68b80924e74ecb6615f92d4dae661c12a9 (patch)
tree1aa42a85155b0fb1392ca6ba675e624b291f88d5 /search.c
parentb338d34b68b138f05b2f2ef6feef2df9d08d61bd (diff)
play song if user presses enter in search window
Diffstat (limited to 'search.c')
-rw-r--r--search.c53
1 files changed, 13 insertions, 40 deletions
diff --git a/search.c b/search.c
index 824cee62..10ed4bb1 100644
--- a/search.c
+++ b/search.c
@@ -32,6 +32,8 @@
#include "common.h"
#include "search.h"
#include "gtkplaylist.h"
+#include "messagepump.h"
+#include "messages.h"
GtkWidget *searchwin = NULL;
struct playItem_s *search_current = NULL;
@@ -161,19 +163,20 @@ on_searchwin_key_press_event (GtkWidget *widget,
if (event->keyval == GDK_Escape) {
gtk_widget_hide (widget);
}
+ else if (event->keyval == GDK_Return) {
+ extern gtkplaylist_t search_playlist;
+ gtkplaylist_t *ps = &search_playlist;
+ if (search_count > 0) {
+ playItem_t *it = gtkpl_get_for_idx (ps, max (ps->row, 0));
+ if (it) {
+ messagepump_push (M_PLAYSONGNUM, 0, pl_get_idx_of (it), 0);
+ }
+ }
+ }
return FALSE;
}
-gboolean
-on_searchlist_button_press_event (GtkWidget *widget,
- GdkEventButton *event,
- gpointer user_data)
-{
-
- return FALSE;
-}
-
gboolean
on_searchlist_configure_event (GtkWidget *widget,
@@ -184,37 +187,7 @@ on_searchlist_configure_event (GtkWidget *widget,
search_playlist_init (widget);
GTKpl_PROLOGUE;
gtkpl_configure (ps);
-
- return FALSE;
-}
-
-
-gboolean
-on_searchlist_expose_event (GtkWidget *widget,
- GdkEventExpose *event,
- gpointer user_data)
-{
-
- return FALSE;
-}
-
-
-gboolean
-on_searchlist_scroll_event (GtkWidget *widget,
- GdkEvent *event,
- gpointer user_data)
-{
-
- return FALSE;
-}
-
-///////////// searchwin scrollbar handlers
-
-void
-on_searchscroll_value_changed (GtkRange *range,
- gpointer user_data)
-{
-
+ return FALSE;
}