From c9fb35f42f28d2d158be9ff646248b16fc671d31 Mon Sep 17 00:00:00 2001 Message-Id: From: Mark Wooding Date: Wed, 11 Jun 2008 12:35:53 +0100 Subject: [PATCH] Restore scratching from popup menu. Organization: Straylight/Edgeware From: Richard Kettlewell --- disobedience/queue-menu.c | 10 ++++++++-- disobedience/queue.c | 2 +- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/disobedience/queue-menu.c b/disobedience/queue-menu.c index a8cd691..c8a224a 100644 --- a/disobedience/queue-menu.c +++ b/disobedience/queue-menu.c @@ -72,12 +72,18 @@ void ql_properties_activate(GtkMenuItem attribute((unused)) *menuitem, /* Scratch */ int ql_scratch_sensitive(struct queuelike attribute((unused)) *ql) { - return !!playing_track; + return !!(last_state & DISORDER_PLAYING) + && right_scratchable(last_rights, config->username, playing_track); +} + +static void scratch_completed(void attribute((unused)) *v, const char *error) { + if(error) + popup_protocol_error(0, error); } void ql_scratch_activate(GtkMenuItem attribute((unused)) *menuitem, gpointer attribute((unused)) user_data) { - /* TODO */ + disorder_eclient_scratch_playing(client, scratch_completed, 0); } /* Remove */ diff --git a/disobedience/queue.c b/disobedience/queue.c index 9c0dcc4..3a481a2 100644 --- a/disobedience/queue.c +++ b/disobedience/queue.c @@ -137,7 +137,7 @@ static struct queue_menuitem queue_menuitems[] = { { "Track properties", ql_properties_activate, ql_properties_sensitive, 0, 0 }, { "Select all tracks", ql_selectall_activate, ql_selectall_sensitive, 0, 0 }, { "Deselect all tracks", ql_selectnone_activate, ql_selectnone_sensitive, 0, 0 }, - { "Scratch track", ql_scratch_activate, ql_scratch_sensitive, 0, 0 }, + { "Scratch playing track", ql_scratch_activate, ql_scratch_sensitive, 0, 0 }, { "Remove track from queue", ql_remove_activate, ql_remove_sensitive, 0, 0 }, }; -- [mdw]