fixed the settings action context, time/eq/colour chooser/dbug screens

should all work correctly again


git-svn-id: svn://svn.rockbox.org/rockbox/trunk@10670 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Jonathan Gordon 2006-08-21 07:03:15 +00:00
parent c8e69dfb71
commit d12f81ddd4
12 changed files with 140 additions and 76 deletions

View file

@ -46,13 +46,25 @@ enum {
CONTEXT_ID3DB = 5, CONTEXT_ID3DB = 5,
/* Add new contexts here, no need to explicitly define a value for them */ /* Add new contexts here, no need to explicitly define a value for them */
CONTEXT_LIST, CONTEXT_LIST,
CONTEXT_SETTINGS, /* options style settings, like from menus */ CONTEXT_SETTINGS, /* regular setting screens (and debug screens) */
CONTEXT_SETTINGSGRAPHICAL, /* screens like eq config and colour chooser */ /* bellow are setting screens which may need to redefine the standard
setting screen keys, targets should return the CONTEXT_SETTINGS
keymap unless they are not adequate for the screen
NOTE: uses ACTION_STD_[NEXT|PREV] so make sure they are there also
and (possibly) ACTION_SETTINGS_[INC|DEC] */
CONTEXT_SETTINGS_EQ,
CONTEXT_SETTINGS_COLOURCHOOSER,
CONTEXT_SETTINGS_TIME,
CONTEXT_YESNOSCREEN, /*NOTE: make sure your target has this and ACTION_YESNO_ACCEPT */ /* The following contexts should use ACTION_STD_[NEXT|PREV]
CONTEXT_BOOKMARKSCREEN, /*NOTE: requires the action_setting_* mappings also */ and (possibly) ACTION_SETTINGS_[INC|DEC]
Also add any extra actions they need */
CONTEXT_BOOKMARKSCREEN, /* uses ACTION_BMS_ defines */
CONTEXT_ALARMSCREEN, /* uses ACTION_AS_ defines */
CONTEXT_QUICKSCREEN, /* uses ACTION_QS_ defines below */ CONTEXT_QUICKSCREEN, /* uses ACTION_QS_ defines below */
CONTEXT_PITCHSCREEN, /* uses ACTION_PS_ defines below */ CONTEXT_PITCHSCREEN, /* uses ACTION_PS_ defines below */
CONTEXT_YESNOSCREEN, /*NOTE: make sure your target has this and ACTION_YESNO_ACCEPT */
CONTEXT_RECSCREEN, CONTEXT_RECSCREEN,
}; };
@ -127,14 +139,18 @@ enum {
/* settings */ /* settings */
ACTION_SETTINGS_INC, ACTION_SETTINGS_INC,
ACTION_SETTINGS_INCREPEAT, ACTION_SETTINGS_INCREPEAT,
ACTION_SETTINGS_INCBIGSTEP,
ACTION_SETTINGS_DEC, ACTION_SETTINGS_DEC,
ACTION_SETTINGS_DECREPEAT, ACTION_SETTINGS_DECREPEAT,
ACTION_SETTINGS_DECBIGSTEP,
/* yesno screen */ ACTION_SETTINGS_RESET,
ACTION_YESNO_ACCEPT,
/* bookmark screen */ /* bookmark screen */
ACTION_BMARK_DELETE, ACTION_BMS_SELECT,
ACTION_BMS_DELETE,
ACTION_BMS_EXIT,
/* alarm menu screen */
/* quickscreen */ /* quickscreen */
ACTION_QS_LEFT, ACTION_QS_LEFT,
@ -155,6 +171,9 @@ enum {
ACTION_PS_RESET, ACTION_PS_RESET,
ACTION_PS_EXIT, /* _STD_* isnt going to work here */ ACTION_PS_EXIT, /* _STD_* isnt going to work here */
/* yesno screen */
ACTION_YESNO_ACCEPT,
}; };

View file

@ -571,7 +571,7 @@ static char* select_bookmark(const char* bookmark_file_name)
#endif #endif
bookmark_count = get_bookmark_count(bookmark_file_name); bookmark_count = get_bookmark_count(bookmark_file_name);
action_signalscreenchange();
while(true) while(true)
{ {
if(bookmark_id < 0) if(bookmark_id < 0)
@ -612,7 +612,7 @@ static char* select_bookmark(const char* bookmark_file_name)
key = get_action(CONTEXT_BOOKMARKSCREEN,TIMEOUT_BLOCK); key = get_action(CONTEXT_BOOKMARKSCREEN,TIMEOUT_BLOCK);
switch(key) switch(key)
{ {
case ACTION_STD_OK: case ACTION_BMS_SELECT:
/* User wants to use this bookmark */ /* User wants to use this bookmark */
#ifdef HAVE_LCD_BITMAP #ifdef HAVE_LCD_BITMAP
if (global_settings.statusbar) if (global_settings.statusbar)
@ -629,7 +629,7 @@ static char* select_bookmark(const char* bookmark_file_name)
action_signalscreenchange(); action_signalscreenchange();
return bookmark; return bookmark;
case ACTION_BMARK_DELETE: case ACTION_BMS_DELETE:
/* User wants to delete this bookmark */ /* User wants to delete this bookmark */
delete_bookmark(bookmark_file_name, bookmark_id); delete_bookmark(bookmark_file_name, bookmark_id);
bookmark_id_prev=-2; bookmark_id_prev=-2;
@ -638,15 +638,17 @@ static char* select_bookmark(const char* bookmark_file_name)
bookmark_id = bookmark_count -1; bookmark_id = bookmark_count -1;
break; break;
case ACTION_SETTINGS_DEC: case ACTION_STD_PREV:
case ACTION_STD_PREVREPEAT:
bookmark_id--; bookmark_id--;
break; break;
case ACTION_SETTINGS_INC: case ACTION_STD_NEXT:
case ACTION_STD_NEXTREPEAT:
bookmark_id++; bookmark_id++;
break; break;
case ACTION_STD_CANCEL: case ACTION_BMS_EXIT:
#ifdef HAVE_LCD_BITMAP #ifdef HAVE_LCD_BITMAP
FOR_NB_SCREENS(i) FOR_NB_SCREENS(i)
screens[i].setmargins(x, y); screens[i].setmargins(x, y);

View file

@ -619,7 +619,7 @@ bool eq_menu_graphical(void)
screens[i].update(); screens[i].update();
} }
button = get_action(CONTEXT_SETTINGSGRAPHICAL,TIMEOUT_BLOCK); button = get_action(CONTEXT_SETTINGS_EQ,TIMEOUT_BLOCK);
switch (button) { switch (button) {
case ACTION_SETTINGS_DEC: case ACTION_SETTINGS_DEC:
@ -638,23 +638,19 @@ bool eq_menu_graphical(void)
*(setting) = max; *(setting) = max;
break; break;
#ifdef EQ_BTN_MODIFIER case ACTION_SETTINGS_INCBIGSTEP:
case EQ_BTN_MODIFIER | EQ_BTN_INCREMENT:
case EQ_BTN_MODIFIER | EQ_BTN_INCREMENT | BUTTON_REPEAT:
*(setting) += fast_step; *(setting) += fast_step;
has_changed = true; has_changed = true;
if (*(setting) > max) if (*(setting) > max)
*(setting) = max; *(setting) = max;
break; break;
case EQ_BTN_MODIFIER | EQ_BTN_DECREMENT: case ACTION_SETTINGS_DECBIGSTEP:
case EQ_BTN_MODIFIER | EQ_BTN_DECREMENT | BUTTON_REPEAT:
*(setting) -= fast_step; *(setting) -= fast_step;
has_changed = true; has_changed = true;
if (*(setting) < min) if (*(setting) < min)
*(setting) = min; *(setting) = min;
break; break;
#endif
case ACTION_STD_PREV: case ACTION_STD_PREV:
case ACTION_STD_PREVREPEAT: case ACTION_STD_PREVREPEAT:

View file

@ -184,14 +184,16 @@ bool set_color(struct screen *display,char *title, int* color, int banned_color)
draw_screen(&screens[i], title, rgb_val, newcolor, slider); draw_screen(&screens[i], title, rgb_val, newcolor, slider);
} }
button = get_action(CONTEXT_SETTINGSGRAPHICAL,TIMEOUT_BLOCK); button = get_action(CONTEXT_SETTINGS_COLOURCHOOSER,TIMEOUT_BLOCK);
switch (button) switch (button)
{ {
case ACTION_STD_PREV: case ACTION_STD_PREV:
case ACTION_STD_PREVREPEAT:
slider = (slider+2)%3; slider = (slider+2)%3;
break; break;
case ACTION_STD_NEXT: case ACTION_STD_NEXT:
case ACTION_STD_NEXTREPEAT:
slider = (slider+1)%3; slider = (slider+1)%3;
break; break;

View file

@ -100,7 +100,7 @@ const struct button_mapping button_context_tree_scroll_lr[] = {
{ ACTION_STD_OK, BUTTON_RIGHT|BUTTON_REL, BUTTON_RIGHT }, { ACTION_STD_OK, BUTTON_RIGHT|BUTTON_REL, BUTTON_RIGHT },
{ ACTION_TREE_PGRIGHT, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_RIGHT }, { ACTION_TREE_PGRIGHT, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_RIGHT },
{ ACTION_TREE_PGRIGHT, BUTTON_RIGHT|BUTTON_REL, BUTTON_RIGHT|BUTTON_REPEAT }, { ACTION_TREE_PGRIGHT, BUTTON_RIGHT|BUTTON_REL, BUTTON_RIGHT|BUTTON_REPEAT },
LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_CUSTOM|1), LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_CUSTOM|CONTEXT_TREE),
}; /* button_context_tree_scroll_lr */ }; /* button_context_tree_scroll_lr */
const struct button_mapping button_context_yesno[] = { const struct button_mapping button_context_yesno[] = {
@ -122,7 +122,7 @@ const struct button_mapping button_context_quickscreen[] = {
LAST_ITEM_IN_LIST LAST_ITEM_IN_LIST
}; /* button_context_quickscreen */ }; /* button_context_quickscreen */
const struct button_mapping button_context_settingsgraphical[] = { const struct button_mapping button_context_settings_r_is_inc[] = {
{ ACTION_SETTINGS_INC, BUTTON_RIGHT, BUTTON_NONE }, { ACTION_SETTINGS_INC, BUTTON_RIGHT, BUTTON_NONE },
{ ACTION_SETTINGS_INCREPEAT, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE }, { ACTION_SETTINGS_INCREPEAT, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE },
{ ACTION_SETTINGS_DEC, BUTTON_LEFT, BUTTON_NONE }, { ACTION_SETTINGS_DEC, BUTTON_LEFT, BUTTON_NONE },
@ -135,7 +135,7 @@ const struct button_mapping button_context_settingsgraphical[] = {
{ ACTION_STD_CANCEL, BUTTON_POWER, BUTTON_NONE }, { ACTION_STD_CANCEL, BUTTON_POWER, BUTTON_NONE },
LAST_ITEM_IN_LIST LAST_ITEM_IN_LIST
}; /* button_context_settingsgraphical */ }; /* button_context_settings_r_is_inc */
const struct button_mapping button_context_pitchscreen[] = { const struct button_mapping button_context_pitchscreen[] = {
{ ACTION_PS_INC_SMALL, BUTTON_SCROLL_UP, BUTTON_NONE }, { ACTION_PS_INC_SMALL, BUTTON_SCROLL_UP, BUTTON_NONE },
@ -165,8 +165,11 @@ const struct button_mapping* get_context_mapping(int context)
case CONTEXT_WPS: case CONTEXT_WPS:
return button_context_wps; return button_context_wps;
case CONTEXT_SETTINGSGRAPHICAL: case CONTEXT_SETTINGS_EQ:
return button_context_settingsgraphical; case CONTEXT_SETTINGS_TIME:
case CONTEXT_SETTINGS_COLOURCHOOSER:
case CONTEXT_CUSTOM|CONTEXT_SETTINGS:
return button_context_settings_r_is_inc;
case CONTEXT_SETTINGS: case CONTEXT_SETTINGS:
return button_context_settings; return button_context_settings;
@ -177,7 +180,7 @@ const struct button_mapping* get_context_mapping(int context)
if (global_settings.hold_lr_for_scroll_in_list) if (global_settings.hold_lr_for_scroll_in_list)
return button_context_tree_scroll_lr; return button_context_tree_scroll_lr;
/* else fall through to CUSTOM|1 */ /* else fall through to CUSTOM|1 */
case CONTEXT_CUSTOM|1: case CONTEXT_CUSTOM|CONTEXT_TREE:
return button_context_tree; return button_context_tree;
case CONTEXT_QUICKSCREEN: case CONTEXT_QUICKSCREEN:
return button_context_quickscreen; return button_context_quickscreen;

View file

@ -38,7 +38,9 @@
/* CONTEXT_CUSTOM's used in this file... /* CONTEXT_CUSTOM's used in this file...
CONTEXT_CUSTOM|CONTEXT_TREE = the standard list/tree defines (without directions) CONTEXT_CUSTOM|CONTEXT_TREE = the standard list/tree defines (without directions)
CONTEXT_CUSTOM|CONTEXT_SETTINGS = the direction keys for the eq/col picker screens
i.e where up/down is inc/dec
CONTEXT_SETTINGS = up/down is prev/next, l/r is inc/dec
*/ */
@ -51,12 +53,14 @@ const struct button_mapping button_context_standard[] = {
{ ACTION_STD_CANCEL, BUTTON_LEFT, BUTTON_NONE }, { ACTION_STD_CANCEL, BUTTON_LEFT, BUTTON_NONE },
{ ACTION_STD_CANCEL, BUTTON_OFF, BUTTON_NONE }, { ACTION_STD_CANCEL, BUTTON_OFF, BUTTON_NONE },
{ ACTION_STD_CONTEXT, BUTTON_SELECT|BUTTON_REPEAT,BUTTON_SELECT }, { ACTION_STD_CONTEXT, BUTTON_SELECT|BUTTON_REPEAT,BUTTON_SELECT },
{ ACTION_STD_QUICKSCREEN, BUTTON_MODE|BUTTON_REPEAT, BUTTON_MODE }, { ACTION_STD_QUICKSCREEN, BUTTON_MODE|BUTTON_REPEAT, BUTTON_MODE },
{ ACTION_STD_MENU, BUTTON_MODE|BUTTON_REL, BUTTON_MODE }, { ACTION_STD_MENU, BUTTON_MODE|BUTTON_REL, BUTTON_MODE },
{ ACTION_STD_OK, BUTTON_SELECT|BUTTON_REL, BUTTON_SELECT }, { ACTION_STD_OK, BUTTON_SELECT|BUTTON_REL, BUTTON_SELECT },
{ ACTION_STD_OK, BUTTON_RIGHT, BUTTON_NONE }, { ACTION_STD_OK, BUTTON_RIGHT, BUTTON_NONE },
{ ACTION_STD_OK, BUTTON_ON|BUTTON_REL, BUTTON_NONE },
LAST_ITEM_IN_LIST LAST_ITEM_IN_LIST
}; /* button_context_standard */ }; /* button_context_standard */
@ -138,13 +142,16 @@ const struct button_mapping button_context_settings[] = {
{ ACTION_SETTINGS_INCREPEAT, BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE }, { ACTION_SETTINGS_INCREPEAT, BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE },
{ ACTION_SETTINGS_DEC, BUTTON_DOWN, BUTTON_NONE }, { ACTION_SETTINGS_DEC, BUTTON_DOWN, BUTTON_NONE },
{ ACTION_SETTINGS_DECREPEAT, BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE }, { ACTION_SETTINGS_DECREPEAT, BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE },
{ ACTION_NONE, BUTTON_LEFT, BUTTON_NONE }, { ACTION_STD_PREV, BUTTON_LEFT, BUTTON_NONE },
{ ACTION_NONE, BUTTON_RIGHT, BUTTON_NONE }, { ACTION_STD_PREVREPEAT, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE },
{ ACTION_STD_NEXT, BUTTON_RIGHT, BUTTON_NONE },
{ ACTION_STD_NEXTREPEAT, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE },
{ ACTION_SETTINGS_RESET, BUTTON_ON, BUTTON_NONE },
LAST_ITEM_IN_LIST LAST_ITEM_IN_LIST
}; /* button_context_settings */ }; /* button_context_settings */
const struct button_mapping button_context_settingsgraphical[] = { const struct button_mapping button_context_settings_right_is_inc[] = {
{ ACTION_SETTINGS_INC, BUTTON_RIGHT, BUTTON_NONE }, { ACTION_SETTINGS_INC, BUTTON_RIGHT, BUTTON_NONE },
{ ACTION_SETTINGS_INCREPEAT, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE }, { ACTION_SETTINGS_INCREPEAT, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE },
{ ACTION_SETTINGS_DEC, BUTTON_LEFT, BUTTON_NONE }, { ACTION_SETTINGS_DEC, BUTTON_LEFT, BUTTON_NONE },
@ -153,6 +160,7 @@ const struct button_mapping button_context_settingsgraphical[] = {
{ ACTION_STD_PREVREPEAT, BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE }, { ACTION_STD_PREVREPEAT, BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE },
{ ACTION_STD_NEXT, BUTTON_DOWN, BUTTON_NONE }, { ACTION_STD_NEXT, BUTTON_DOWN, BUTTON_NONE },
{ ACTION_STD_NEXTREPEAT, BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE }, { ACTION_STD_NEXTREPEAT, BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE },
{ ACTION_SETTINGS_RESET, BUTTON_ON, BUTTON_NONE },
LAST_ITEM_IN_LIST LAST_ITEM_IN_LIST
}; /* button_context_settingsgraphical */ }; /* button_context_settingsgraphical */
@ -162,10 +170,26 @@ const struct button_mapping button_context_yesno[] = {
LAST_ITEM_IN_LIST LAST_ITEM_IN_LIST
}; /* button_context_settings_yesno */ }; /* button_context_settings_yesno */
const struct button_mapping button_context_colorchooser[] = {
{ ACTION_STD_OK, BUTTON_ON|BUTTON_REL, BUTTON_NONE },
LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_CUSTOM|CONTEXT_SETTINGS),
}; /* button_context_settings_bmark */
const struct button_mapping button_context_eq[] = {
{ ACTION_STD_OK, BUTTON_SELECT|BUTTON_REL, BUTTON_NONE },
LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_CUSTOM|CONTEXT_SETTINGS),
}; /* button_context_settings_bmark */
const struct button_mapping button_context_bmark[] = { const struct button_mapping button_context_bmark[] = {
{ ACTION_BMARK_DELETE, BUTTON_REC, BUTTON_NONE }, { ACTION_BMS_DELETE, BUTTON_REC, BUTTON_NONE },
{ ACTION_STD_OK, BUTTON_SELECT, BUTTON_NONE }, { ACTION_STD_OK, BUTTON_SELECT, BUTTON_NONE },
LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_SETTINGSGRAPHICAL), LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_CUSTOM|CONTEXT_SETTINGS),
}; /* button_context_settings_bmark */
const struct button_mapping button_context_time[] = {
{ ACTION_STD_CANCEL, BUTTON_OFF, BUTTON_NONE },
{ ACTION_STD_OK, BUTTON_ON, BUTTON_NONE },
LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_SETTINGS),
}; /* button_context_settings_bmark */ }; /* button_context_settings_bmark */
const struct button_mapping button_context_quickscreen[] = { const struct button_mapping button_context_quickscreen[] = {
@ -419,15 +443,15 @@ const struct button_mapping *button_context_yesno_h300lcdremote =
button_context_yesno_h100remote; button_context_yesno_h100remote;
const struct button_mapping button_context_bmark_h100remote[] = { const struct button_mapping button_context_bmark_h100remote[] = {
{ ACTION_BMARK_DELETE, BUTTON_RC_REC, BUTTON_NONE }, { ACTION_BMS_DELETE, BUTTON_RC_REC, BUTTON_NONE },
{ ACTION_STD_OK, BUTTON_RC_ON, BUTTON_NONE }, { ACTION_STD_OK, BUTTON_RC_ON, BUTTON_NONE },
LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_SETTINGSGRAPHICAL|CONTEXT_REMOTE), LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_SETTINGS|CONTEXT_REMOTE),
}; /* button_context_settings_bmark */ }; /* button_context_settings_bmark */
const struct button_mapping button_context_bmark_h300lcdremote[] = { const struct button_mapping button_context_bmark_h300lcdremote[] = {
{ ACTION_BMARK_DELETE, BUTTON_RC_REC, BUTTON_NONE }, { ACTION_BMS_DELETE, BUTTON_RC_REC, BUTTON_NONE },
{ ACTION_STD_OK, BUTTON_RC_MENU, BUTTON_NONE }, { ACTION_STD_OK, BUTTON_RC_MENU, BUTTON_NONE },
LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_SETTINGSGRAPHICAL|CONTEXT_REMOTE), LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_SETTINGS|CONTEXT_REMOTE),
}; };
const struct button_mapping button_context_quickscreen_h100remote[] = { const struct button_mapping button_context_quickscreen_h100remote[] = {
@ -670,9 +694,6 @@ const struct button_mapping* get_context_mapping_remote(int context)
case CONTEXT_CUSTOM|CONTEXT_TREE: case CONTEXT_CUSTOM|CONTEXT_TREE:
return remote_btn_ctxt_tree; return remote_btn_ctxt_tree;
case CONTEXT_SETTINGSGRAPHICAL:
return remote_btn_ctxt_settingsgrph;
case CONTEXT_SETTINGS: case CONTEXT_SETTINGS:
return remote_btn_ctxt_settings; return remote_btn_ctxt_settings;
@ -714,15 +735,21 @@ const struct button_mapping* get_context_mapping(int context)
case CONTEXT_CUSTOM|CONTEXT_TREE: case CONTEXT_CUSTOM|CONTEXT_TREE:
return button_context_tree; return button_context_tree;
case CONTEXT_SETTINGSGRAPHICAL:
return button_context_settingsgraphical;
case CONTEXT_SETTINGS: case CONTEXT_SETTINGS:
return button_context_settings; return button_context_settings;
case CONTEXT_CUSTOM|CONTEXT_SETTINGS:
return button_context_settings_right_is_inc;
case CONTEXT_SETTINGS_COLOURCHOOSER:
return button_context_colorchooser;
case CONTEXT_SETTINGS_EQ:
return button_context_eq;
case CONTEXT_SETTINGS_TIME:
return button_context_time;
case CONTEXT_YESNOSCREEN: case CONTEXT_YESNOSCREEN:
return button_context_yesno; return button_context_yesno;
case CONTEXT_BOOKMARKSCREEN: case CONTEXT_BOOKMARKSCREEN:
return button_context_bmark; return button_context_bmark;
case CONTEXT_QUICKSCREEN: case CONTEXT_QUICKSCREEN:

View file

@ -82,7 +82,7 @@ const struct button_mapping button_context_settings[] = {
LAST_ITEM_IN_LIST LAST_ITEM_IN_LIST
}; /* button_context_settings */ }; /* button_context_settings */
const struct button_mapping button_context_settingsgraphical[] = { const struct button_mapping button_context_settings_r_is_inc[] = {
{ ACTION_SETTINGS_INC, BUTTON_RIGHT, BUTTON_NONE }, { ACTION_SETTINGS_INC, BUTTON_RIGHT, BUTTON_NONE },
{ ACTION_SETTINGS_INCREPEAT, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE }, { ACTION_SETTINGS_INCREPEAT, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE },
{ ACTION_SETTINGS_DEC, BUTTON_LEFT, BUTTON_NONE }, { ACTION_SETTINGS_DEC, BUTTON_LEFT, BUTTON_NONE },
@ -101,9 +101,9 @@ const struct button_mapping button_context_yesno[] = {
}; /* button_context_settings_yesno */ }; /* button_context_settings_yesno */
const struct button_mapping button_context_bmark[] = { const struct button_mapping button_context_bmark[] = {
{ ACTION_BMARK_DELETE, BUTTON_MODE, BUTTON_NONE }, { ACTION_BMS_DELETE, BUTTON_MODE, BUTTON_NONE },
{ ACTION_STD_OK, BUTTON_SELECT, BUTTON_NONE }, { ACTION_STD_OK, BUTTON_SELECT, BUTTON_NONE },
LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_SETTINGSGRAPHICAL), LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_CUSTOM|CONTEXT_SETTINGS),
}; /* button_context_settings_bmark */ }; /* button_context_settings_bmark */
const struct button_mapping button_context_quickscreen[] = { const struct button_mapping button_context_quickscreen[] = {
@ -143,8 +143,11 @@ const struct button_mapping* get_context_mapping(int context)
return button_context_standard; return button_context_standard;
case CONTEXT_WPS: case CONTEXT_WPS:
return button_context_wps; return button_context_wps;
case CONTEXT_SETTINGSGRAPHICAL: case CONTEXT_CUSTOM|CONTEXT_SETTINGS:
return button_context_settingsgraphical; case CONTEXT_SETTINGS_EQ:
case CONTEXT_SETTINGS_COLOURCHOOSER:
case CONTEXT_SETTINGS_TIME:
return button_context_settings_r_is_inc;
case CONTEXT_SETTINGS: case CONTEXT_SETTINGS:
return button_context_settings; return button_context_settings;
case CONTEXT_YESNOSCREEN: case CONTEXT_YESNOSCREEN:

View file

@ -32,7 +32,7 @@
/* CONTEXT_CUSTOM's used in this file... /* CONTEXT_CUSTOM's used in this file...
CONTEXT_CUSTOM|1 = the standard list/tree defines (without directions) CONTEXT_CUSTOM|CONTEXT_TREE = the standard list/tree defines (without directions)
*/ */
@ -45,11 +45,11 @@ const struct button_mapping button_context_standard[] = {
{ ACTION_STD_CANCEL, BUTTON_LEFT, BUTTON_NONE }, { ACTION_STD_CANCEL, BUTTON_LEFT, BUTTON_NONE },
{ ACTION_STD_OK, BUTTON_RIGHT, BUTTON_NONE }, { ACTION_STD_OK, BUTTON_RIGHT, BUTTON_NONE },
{ ACTION_STD_OK, BUTTON_SELECT|BUTTON_REL, BUTTON_SELECT }, { ACTION_STD_OK, BUTTON_SELECT|BUTTON_REL, BUTTON_NONE },
{ ACTION_STD_MENU, BUTTON_MENU|BUTTON_REL, BUTTON_MENU }, { ACTION_STD_MENU, BUTTON_MENU|BUTTON_REL, BUTTON_MENU },
{ ACTION_STD_QUICKSCREEN, BUTTON_MENU|BUTTON_REPEAT, BUTTON_MENU }, { ACTION_STD_QUICKSCREEN, BUTTON_MENU|BUTTON_REPEAT, BUTTON_MENU },
{ ACTION_STD_CONTEXT, BUTTON_SELECT|BUTTON_REPEAT, BUTTON_SELECT }, { ACTION_STD_CONTEXT, BUTTON_SELECT|BUTTON_REPEAT, BUTTON_NONE },
{ ACTION_STD_CANCEL, BUTTON_PLAY|BUTTON_REPEAT, BUTTON_PLAY }, { ACTION_STD_CANCEL, BUTTON_PLAY|BUTTON_REPEAT, BUTTON_NONE },
LAST_ITEM_IN_LIST LAST_ITEM_IN_LIST
}; /* button_context_standard */ }; /* button_context_standard */
@ -69,7 +69,7 @@ const struct button_mapping button_context_tree_scroll_lr[] = {
{ ACTION_STD_OK, BUTTON_RIGHT|BUTTON_REL, BUTTON_RIGHT }, { ACTION_STD_OK, BUTTON_RIGHT|BUTTON_REL, BUTTON_RIGHT },
{ ACTION_TREE_PGRIGHT, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE }, { ACTION_TREE_PGRIGHT, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE },
{ ACTION_TREE_PGRIGHT, BUTTON_RIGHT|BUTTON_REL, BUTTON_RIGHT|BUTTON_REPEAT }, { ACTION_TREE_PGRIGHT, BUTTON_RIGHT|BUTTON_REL, BUTTON_RIGHT|BUTTON_REPEAT },
LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_CUSTOM|1), LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_CUSTOM|CONTEXT_TREE),
}; };
const struct button_mapping button_context_wps[] = { const struct button_mapping button_context_wps[] = {
@ -102,7 +102,8 @@ const struct button_mapping button_context_settings[] = {
{ ACTION_STD_PREVREPEAT, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE }, { ACTION_STD_PREVREPEAT, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE },
{ ACTION_STD_NEXT, BUTTON_RIGHT, BUTTON_NONE }, { ACTION_STD_NEXT, BUTTON_RIGHT, BUTTON_NONE },
{ ACTION_STD_NEXTREPEAT, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE }, { ACTION_STD_NEXTREPEAT, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE },
{ ACTION_STD_CANCEL, BUTTON_MENU|BUTTON_REL, BUTTON_MENU }, /* rel so bmark screen works */ { ACTION_STD_OK, BUTTON_SELECT|BUTTON_REL, BUTTON_NONE },
{ ACTION_STD_CANCEL, BUTTON_MENU|BUTTON_REL, BUTTON_MENU },
LAST_ITEM_IN_LIST LAST_ITEM_IN_LIST
}; /* button_context_settings */ }; /* button_context_settings */
@ -113,7 +114,7 @@ const struct button_mapping button_context_yesno[] = {
}; /* button_context_settings_yesno */ }; /* button_context_settings_yesno */
const struct button_mapping button_context_bmark[] = { const struct button_mapping button_context_bmark[] = {
{ ACTION_BMARK_DELETE, BUTTON_MENU|BUTTON_REPEAT, BUTTON_MENU }, { ACTION_BMS_DELETE, BUTTON_MENU|BUTTON_REPEAT, BUTTON_MENU },
LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_SETTINGS), LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_SETTINGS),
}; /* button_context_settings_bmark */ }; /* button_context_settings_bmark */
@ -157,15 +158,17 @@ const struct button_mapping* get_context_mapping(int context)
case CONTEXT_TREE: case CONTEXT_TREE:
if (global_settings.hold_lr_for_scroll_in_list) if (global_settings.hold_lr_for_scroll_in_list)
return button_context_tree_scroll_lr; return button_context_tree_scroll_lr;
/* else fall through to CUSTOM|1 */ /* else fall through to CUSTOM|CONTEXT_TREE */
case CONTEXT_CUSTOM|1: case CONTEXT_CUSTOM|CONTEXT_TREE:
return button_context_tree; return button_context_tree;
case CONTEXT_LIST: case CONTEXT_LIST:
case CONTEXT_MAINMENU: case CONTEXT_MAINMENU:
break; break;
case CONTEXT_SETTINGS_EQ:
case CONTEXT_SETTINGS_COLOURCHOOSER:
case CONTEXT_SETTINGS_TIME:
case CONTEXT_SETTINGS: case CONTEXT_SETTINGS:
case CONTEXT_SETTINGSGRAPHICAL:
return button_context_settings; return button_context_settings;
case CONTEXT_YESNOSCREEN: case CONTEXT_YESNOSCREEN:
return button_context_yesno; return button_context_yesno;

View file

@ -27,7 +27,7 @@
/* CONTEXT_CUSTOM's used in this file... /* CONTEXT_CUSTOM's used in this file...
CONTEXT_CUSTOM|1 = the standard list/tree defines (without directions) CONTEXT_CUSTOM|CONTEXT_TREE = the standard list/tree defines (without directions)
*/ */
@ -95,7 +95,7 @@ const struct button_mapping button_context_tree_scroll_lr[] = {
{ ACTION_TREE_PGRIGHT, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE }, { ACTION_TREE_PGRIGHT, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE },
{ ACTION_TREE_PGRIGHT, BUTTON_RIGHT|BUTTON_REL, BUTTON_RIGHT|BUTTON_REPEAT }, { ACTION_TREE_PGRIGHT, BUTTON_RIGHT|BUTTON_REL, BUTTON_RIGHT|BUTTON_REPEAT },
LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_CUSTOM|1), LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_CUSTOM|CONTEXT_TREE),
}; };
const struct button_mapping button_context_yesno[] = { const struct button_mapping button_context_yesno[] = {
@ -106,7 +106,7 @@ const struct button_mapping button_context_yesno[] = {
struct button_mapping button_context_bmark[] = { struct button_mapping button_context_bmark[] = {
{ ACTION_NONE, BUTTON_LEFT, BUTTON_NONE }, { ACTION_NONE, BUTTON_LEFT, BUTTON_NONE },
{ ACTION_BMARK_DELETE, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_LEFT }, { ACTION_BMS_DELETE, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_LEFT },
{ ACTION_STD_CANCEL, BUTTON_LEFT|BUTTON_REL, BUTTON_LEFT }, { ACTION_STD_CANCEL, BUTTON_LEFT|BUTTON_REL, BUTTON_LEFT },
LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_SETTINGS), LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_SETTINGS),
@ -160,8 +160,8 @@ const struct button_mapping* get_context_mapping( int context )
case CONTEXT_TREE: case CONTEXT_TREE:
if (global_settings.hold_lr_for_scroll_in_list) if (global_settings.hold_lr_for_scroll_in_list)
return button_context_tree_scroll_lr; return button_context_tree_scroll_lr;
/* else fall through to CUSTOM|1 */ /* else fall through to CUSTOM|CONTEXT_TREE */
case CONTEXT_CUSTOM|1: case CONTEXT_CUSTOM|CONTEXT_TREE:
return button_context_tree; return button_context_tree;
case CONTEXT_RECSCREEN: case CONTEXT_RECSCREEN:
return button_context_recscreen; return button_context_recscreen;

View file

@ -86,6 +86,10 @@ static const struct button_mapping button_context_settings[] = {
{ ACTION_SETTINGS_INCREPEAT, BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE }, { ACTION_SETTINGS_INCREPEAT, BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE },
{ ACTION_SETTINGS_DEC, BUTTON_DOWN, BUTTON_NONE }, { ACTION_SETTINGS_DEC, BUTTON_DOWN, BUTTON_NONE },
{ ACTION_SETTINGS_DECREPEAT, BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE }, { ACTION_SETTINGS_DECREPEAT, BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE },
{ ACTION_STD_PREV, BUTTON_LEFT, BUTTON_NONE },
{ ACTION_STD_PREVREPEAT, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE },
{ ACTION_STD_NEXT, BUTTON_RIGHT, BUTTON_NONE },
{ ACTION_STD_NEXTREPEAT, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE },
LAST_ITEM_IN_LIST LAST_ITEM_IN_LIST
}; };
@ -204,7 +208,7 @@ const struct button_mapping* get_context_mapping( int context )
{ {
case CONTEXT_WPS: case CONTEXT_WPS:
return button_context_wps; return button_context_wps;
case CONTEXT_SETTINGS_TIME:
case CONTEXT_SETTINGS: case CONTEXT_SETTINGS:
return button_context_settings; return button_context_settings;

View file

@ -29,7 +29,7 @@
/* CONTEXT_CUSTOM's used in this file... /* CONTEXT_CUSTOM's used in this file...
CONTEXT_CUSTOM|1 = the standard list/tree defines (without directions) CONTEXT_CUSTOM|CONTEXT_TREE = the standard list/tree defines (without directions)
*/ */
@ -104,7 +104,7 @@ const struct button_mapping button_context_tree_scroll_lr[] = {
{ ACTION_STD_OK, BUTTON_RIGHT|BUTTON_REL, BUTTON_RIGHT }, { ACTION_STD_OK, BUTTON_RIGHT|BUTTON_REL, BUTTON_RIGHT },
{ ACTION_TREE_PGRIGHT, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE }, { ACTION_TREE_PGRIGHT, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE },
{ ACTION_TREE_PGRIGHT, BUTTON_RIGHT|BUTTON_REL, BUTTON_RIGHT|BUTTON_REPEAT }, { ACTION_TREE_PGRIGHT, BUTTON_RIGHT|BUTTON_REL, BUTTON_RIGHT|BUTTON_REPEAT },
LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_CUSTOM|1), LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_CUSTOM|CONTEXT_TREE),
}; };
const struct button_mapping button_context_yesno[] = { const struct button_mapping button_context_yesno[] = {
@ -126,7 +126,7 @@ const struct button_mapping button_context_quickscreen[] = {
LAST_ITEM_IN_LIST LAST_ITEM_IN_LIST
}; /* button_context_quickscreen */ }; /* button_context_quickscreen */
const struct button_mapping button_context_settingsgraphical[] = { const struct button_mapping button_context_settings_r_is_inc[] = {
{ ACTION_SETTINGS_INC, BUTTON_RIGHT, BUTTON_NONE }, { ACTION_SETTINGS_INC, BUTTON_RIGHT, BUTTON_NONE },
{ ACTION_SETTINGS_INCREPEAT, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE }, { ACTION_SETTINGS_INCREPEAT, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE },
{ ACTION_SETTINGS_DEC, BUTTON_LEFT, BUTTON_NONE }, { ACTION_SETTINGS_DEC, BUTTON_LEFT, BUTTON_NONE },
@ -246,8 +246,10 @@ const struct button_mapping* get_context_mapping( int context )
case CONTEXT_WPS: case CONTEXT_WPS:
return button_context_wps; return button_context_wps;
case CONTEXT_SETTINGSGRAPHICAL: case CONTEXT_SETTINGS_EQ:
return button_context_settingsgraphical; case CONTEXT_SETTINGS_COLOURCHOOSER:
case CONTEXT_SETTINGS_TIME:
return button_context_settings_r_is_inc;
case CONTEXT_SETTINGS: case CONTEXT_SETTINGS:
return button_context_settings; return button_context_settings;
@ -259,7 +261,8 @@ const struct button_mapping* get_context_mapping( int context )
if (global_settings.hold_lr_for_scroll_in_list) if (global_settings.hold_lr_for_scroll_in_list)
return button_context_tree_scroll_lr; return button_context_tree_scroll_lr;
/* else fall through to CUSTOM|1 */ /* else fall through to CUSTOM|1 */
case CONTEXT_CUSTOM|1: case CONTEXT_CUSTOM|CONTEXT_TREE
:
return button_context_tree; return button_context_tree;
case CONTEXT_QUICKSCREEN: case CONTEXT_QUICKSCREEN:
return button_context_quickscreen; return button_context_quickscreen;

View file

@ -916,7 +916,7 @@ bool set_time_screen(const char* string, struct tm *tm)
say_time(cursorpos, tm); say_time(cursorpos, tm);
} }
button = get_action(CONTEXT_SETTINGS,HZ/2); button = get_action(CONTEXT_SETTINGS_TIME,HZ/2);
switch ( button ) { switch ( button ) {
case ACTION_STD_PREV: case ACTION_STD_PREV:
cursorpos = (cursorpos + 6 - 1) % 6; cursorpos = (cursorpos + 6 - 1) % 6;
@ -925,6 +925,7 @@ bool set_time_screen(const char* string, struct tm *tm)
cursorpos = (cursorpos + 6 + 1) % 6; cursorpos = (cursorpos + 6 + 1) % 6;
break; break;
case ACTION_SETTINGS_INC: case ACTION_SETTINGS_INC:
case ACTION_SETTINGS_INCREPEAT:
*valptr = (*valptr + steps - min + 1) % *valptr = (*valptr + steps - min + 1) %
steps + min; steps + min;
if(*valptr == 0) if(*valptr == 0)
@ -932,6 +933,7 @@ bool set_time_screen(const char* string, struct tm *tm)
say_time(cursorpos, tm); say_time(cursorpos, tm);
break; break;
case ACTION_SETTINGS_DEC: case ACTION_SETTINGS_DEC:
case ACTION_SETTINGS_DECREPEAT:
*valptr = (*valptr + steps - min - 1) % *valptr = (*valptr + steps - min - 1) %
steps + min; steps + min;
if(*valptr == 0) if(*valptr == 0)