diff options
Diffstat (limited to 'apps/plugins/keyremap.c')
-rw-r--r-- | apps/plugins/keyremap.c | 29 |
1 files changed, 20 insertions, 9 deletions
diff --git a/apps/plugins/keyremap.c b/apps/plugins/keyremap.c index f0b36a735e..202d5fcfa4 100644 --- a/apps/plugins/keyremap.c +++ b/apps/plugins/keyremap.c | |||
@@ -1422,6 +1422,17 @@ static int list_voice_cb(int list_index, void* data) | |||
1422 | else | 1422 | else |
1423 | rb->talk_spell(name, true); | 1423 | rb->talk_spell(name, true); |
1424 | } | 1424 | } |
1425 | else if(data == MENU_ID(M_SETKEYS)) | ||
1426 | { | ||
1427 | char buf[MAX_MENU_NAME]; | ||
1428 | int selcol = printcell_get_column_selected(); | ||
1429 | const char* name = printcell_get_column_text(selcol, buf, sizeof(buf)); | ||
1430 | long id = P2ID((const unsigned char *)name); | ||
1431 | if(id>=0) | ||
1432 | rb->talk_id(id, true); | ||
1433 | else | ||
1434 | rb->talk_spell(name, true); | ||
1435 | } | ||
1425 | else | 1436 | else |
1426 | { | 1437 | { |
1427 | char buf[MAX_MENU_NAME]; | 1438 | char buf[MAX_MENU_NAME]; |
@@ -1606,14 +1617,14 @@ int menu_action_setkeys(int *action, int selected_item, bool* exit, struct gui_s | |||
1606 | } | 1617 | } |
1607 | else | 1618 | else |
1608 | { | 1619 | { |
1609 | keyset.view_lastcol = printcell_increment_column(lists, 1, true); | 1620 | keyset.view_lastcol = printcell_increment_column(1, true); |
1610 | *action = ACTION_NONE; | 1621 | *action = ACTION_NONE; |
1611 | } | 1622 | } |
1612 | } | 1623 | } |
1613 | } | 1624 | } |
1614 | else if (*action == ACTION_STD_CANCEL) | 1625 | else if (*action == ACTION_STD_CANCEL) |
1615 | { | 1626 | { |
1616 | keyset.view_lastcol = printcell_increment_column(lists, -1, true); | 1627 | keyset.view_lastcol = printcell_increment_column(-1, true); |
1617 | if (keyset.view_lastcol != keyset.view_columns - 1) | 1628 | if (keyset.view_lastcol != keyset.view_columns - 1) |
1618 | { | 1629 | { |
1619 | *action = ACTION_NONE; | 1630 | *action = ACTION_NONE; |
@@ -2038,7 +2049,7 @@ static void synclist_set(int id, int selected_item, int items, int sel_size) | |||
2038 | rb->gui_synclist_set_voice_callback(&lists, list_voice_cb); | 2049 | rb->gui_synclist_set_voice_callback(&lists, list_voice_cb); |
2039 | rb->gui_synclist_set_nb_items(&lists,items); | 2050 | rb->gui_synclist_set_nb_items(&lists,items); |
2040 | rb->gui_synclist_select_item(&lists, selected_item); | 2051 | rb->gui_synclist_select_item(&lists, selected_item); |
2041 | printcell_enable(&lists, false, false); | 2052 | printcell_enable(false); |
2042 | 2053 | ||
2043 | if (menu_id == MENU_ID(M_ROOT)) | 2054 | if (menu_id == MENU_ID(M_ROOT)) |
2044 | { | 2055 | { |
@@ -2047,15 +2058,16 @@ static void synclist_set(int id, int selected_item, int items, int sel_size) | |||
2047 | } | 2058 | } |
2048 | else if (menu_id == MENU_ID(M_SETKEYS)) | 2059 | else if (menu_id == MENU_ID(M_SETKEYS)) |
2049 | { | 2060 | { |
2050 | printcell_enable(&lists, true, true); | 2061 | keyset.view_columns = printcell_set_columns(&lists, NULL, |
2051 | keyset.view_columns = printcell_set_columns(&lists, ACTVIEW_HEADER, Icon_Rockbox); | 2062 | ACTVIEW_HEADER, Icon_Rockbox); |
2052 | int curcol = printcell_increment_column(&lists, 0, true); | 2063 | printcell_enable(true); |
2064 | int curcol = printcell_get_column_selected(); | ||
2053 | if (keyset.view_lastcol >= keyset.view_columns) | 2065 | if (keyset.view_lastcol >= keyset.view_columns) |
2054 | keyset.view_lastcol = -1; | 2066 | keyset.view_lastcol = -1; |
2055 | /* restore column position */ | 2067 | /* restore column position */ |
2056 | while (keyset.view_lastcol > -1 && curcol != keyset.view_lastcol) | 2068 | while (keyset.view_lastcol > -1 && curcol != keyset.view_lastcol) |
2057 | { | 2069 | { |
2058 | curcol = printcell_increment_column(&lists, 1, true); | 2070 | curcol = printcell_increment_column(1, true); |
2059 | } | 2071 | } |
2060 | keyset.view_lastcol = curcol; | 2072 | keyset.view_lastcol = curcol; |
2061 | } | 2073 | } |
@@ -2065,9 +2077,8 @@ static void synclist_set(int id, int selected_item, int items, int sel_size) | |||
2065 | PEEK_MENU_ID(id); | 2077 | PEEK_MENU_ID(id); |
2066 | lang_strlcpy(menu_title, mainitem(id)->name, sizeof(menu_title)); | 2078 | lang_strlcpy(menu_title, mainitem(id)->name, sizeof(menu_title)); |
2067 | rb->gui_synclist_set_title(&lists, menu_title, Icon_Submenu_Entered); | 2079 | rb->gui_synclist_set_title(&lists, menu_title, Icon_Submenu_Entered); |
2068 | /* if (menu_title[0] == '$'){ printcell_enable(&lists, true, true); } */ | 2080 | /* if (menu_title[0] == '$'){ printcell_enable(true); } */ |
2069 | } | 2081 | } |
2070 | |||
2071 | } | 2082 | } |
2072 | 2083 | ||
2073 | static void keyremap_set_buffer(void* buffer, size_t buf_size) | 2084 | static void keyremap_set_buffer(void* buffer, size_t buf_size) |