discomfitor pushed a commit to branch master.

http://git.enlightenment.org/apps/empc.git/commit/?id=912accae99b8c60640eeb1a5c64bf587f874b67d

commit 912accae99b8c60640eeb1a5c64bf587f874b67d
Author: Mike Blumenkrantz <zm...@osg.samsung.com>
Date:   Fri Nov 6 17:26:17 2015 -0500

    add ctrl+Delete keybind on player view to delete current album
---
 README         |  1 +
 src/bin/empc.c | 22 ++++++++++++++++++++--
 2 files changed, 21 insertions(+), 2 deletions(-)

diff --git a/README b/README
index 39a5340..43af936 100644
--- a/README
+++ b/README
@@ -53,6 +53,7 @@ Controls:
 
                Ctrl+v -> paste image url/data to use as background
                Delete -> delete currently playing song from queue
+               Ctrl+Delete -> delete currently playing album from queue
                Enter/Return -> activate (play) first selected item in playlist
 
        Playlist view:
diff --git a/src/bin/empc.c b/src/bin/empc.c
index 9bcec4d..a9df3b8 100644
--- a/src/bin/empc.c
+++ b/src/bin/empc.c
@@ -3164,7 +3164,8 @@ key_down(void *data EINA_UNUSED, int t EINA_UNUSED, 
Ecore_Event_Key *ev)
      }
    if ((!strcmp(ev->key, "q")) && (ev->modifiers & ECORE_EVENT_MODIFIER_CTRL))
      ecore_main_loop_quit();
-   else if ((!ctxpopup) && (!queue_list_state) && (!filesystem_state) && 
(!strcmp(ev->key, "Delete")))
+   else if ((!(ev->modifiers & ECORE_EVENT_MODIFIER_CTRL)) && (!ctxpopup) &&
+            (!queue_list_state) && (!filesystem_state) && (!strcmp(ev->key, 
"Delete")))
      {
         if (empd_song_item)
           {
@@ -3236,7 +3237,24 @@ key_down(void *data EINA_UNUSED, int t EINA_UNUSED, 
Ecore_Event_Key *ev)
    if (login_visible) return ECORE_CALLBACK_RENEW;
    while (ev->modifiers & ECORE_EVENT_MODIFIER_CTRL)
      {
-        if ((!strcmp(ev->key, "Return")) || (!strcmp(ev->key, "KP_Enter")))
+        if ((!ctxpopup) && empd_song_item &&
+            (!queue_list_state) && (!filesystem_state) && (!strcmp(ev->key, 
"Delete")))
+          {
+             Elm_Object_Item *it;
+             Empd_Empdd_Song *so;
+             Eina_List *l = NULL;
+
+             it = elm_genlist_item_parent_get(empd_song_item);
+             so = elm_object_item_data_get(it);
+             it = eina_hash_find(empd_current_queue, &so->songid);
+             do
+               {
+                  l = eina_list_append(l, it);
+                  it = elm_genlist_item_next_get(it);
+               } while (elm_genlist_item_parent_get(it));
+             queue_list_delete_list(l);
+          }
+        else if ((!strcmp(ev->key, "Return")) || (!strcmp(ev->key, 
"KP_Enter")))
           {
              if (filesystem_state && 
evas_object_visible_get(filesystem_entry)) return ECORE_CALLBACK_RENEW;
              if (filesystem_state)

-- 


Reply via email to