summaryrefslogtreecommitdiff
path: root/plugins/gtkui
diff options
context:
space:
mode:
authorGravatar Alexey Yakovenko <wakeroid@gmail.com>2009-12-31 13:55:37 +0100
committerGravatar Alexey Yakovenko <wakeroid@gmail.com>2009-12-31 13:55:37 +0100
commit4ee6790c26f5b64138e534115c132c41e016e591 (patch)
tree1c81de5ac855053176ad9655608991570760fcdd /plugins/gtkui
parent36ee36a693e3265f1e1ea61f541f98a174ced0aa (diff)
implemented Remove from playlist context menu
Diffstat (limited to 'plugins/gtkui')
-rw-r--r--plugins/gtkui/callbacks.c10
-rw-r--r--plugins/gtkui/gtkplaylist.h3
2 files changed, 12 insertions, 1 deletions
diff --git a/plugins/gtkui/callbacks.c b/plugins/gtkui/callbacks.c
index f66aabe5..4482e8c8 100644
--- a/plugins/gtkui/callbacks.c
+++ b/plugins/gtkui/callbacks.c
@@ -258,7 +258,6 @@ on_playlist_button_press_event (GtkWidget *widget,
gtk_widget_set_sensitive (separator8, FALSE);
properties1 = gtk_menu_item_new_with_mnemonic ("Properties");
- gtk_widget_set_sensitive (properties1, FALSE);
gtk_widget_show (properties1);
gtk_container_add (GTK_CONTAINER (playlist_menu), properties1);
gtk_object_set_data (GTK_OBJECT (properties1), "ps", ps);
@@ -2266,6 +2265,15 @@ void
on_remove2_activate (GtkMenuItem *menuitem,
gpointer user_data)
{
+ GtkWidget *widget = GTK_WIDGET (menuitem);
+ GTKPL_PROLOGUE;
+ int cursor = deadbeef->pl_delete_selected ();
+ if (cursor >= ps->get_count ()) {
+ cursor = ps->get_count ()-1;
+ }
+ main_refresh ();
+ search_refresh ();
+ gtkpl_set_cursor (ps->iterator, cursor);
}
diff --git a/plugins/gtkui/gtkplaylist.h b/plugins/gtkui/gtkplaylist.h
index 33998824..4e1542db 100644
--- a/plugins/gtkui/gtkplaylist.h
+++ b/plugins/gtkui/gtkplaylist.h
@@ -259,4 +259,7 @@ gtkpl_set_cursor (int iter, int cursor);
gtkpl_column_t*
gtkpl_get_column_for_click (gtkplaylist_t *pl, int click_x);
+void
+main_refresh (void);
+
#endif // __GTKPLAYLIST_H