scrobbler / log viewer allow cancel button long press to exit plugin

some devices will shutdown before the button repeat even occurs so unfortunately
it still might not work on some devices (sansa clip series)

Change-Id: I1c5eda6c5a97887f69e1fbd0ada39cce01db352b
This commit is contained in:
William Wilgus 2025-12-05 11:05:52 -05:00
parent 9d7af45122
commit 7b7d9a384a

View file

@ -850,8 +850,8 @@ static void cleanup(void *parameter)
static void menu_action_printcell(int *action, int selected_item, bool* exit, struct gui_synclist *lists)
{
(void) exit;
struct printcell_data_t *pc_data = (struct printcell_data_t*) lists->data;
static int last_action = ACTION_NONE;
if (*action == ACTION_STD_OK)
{
if (selected_item < lists->nb_items)
@ -860,6 +860,11 @@ static void menu_action_printcell(int *action, int selected_item, bool* exit, st
*action = ACTION_NONE;
}
}
else if (*action == ACTION_STD_CANCEL && last_action == ACTION_STD_CANCEL)
{
/* allow user to hold cancel to quit */
*exit = true;
}
else if (*action == ACTION_STD_CANCEL)
{
pc_data->view_lastcol = printcell_increment_column(-1, true);
@ -874,6 +879,7 @@ static void menu_action_printcell(int *action, int selected_item, bool* exit, st
if (ctxret == QUIT_CONTEXT_MENU)
*exit = true;
}
last_action = *action;
}
int menu_action_cb(int *action, int selected_item, bool* exit, struct gui_synclist *lists)