Correct return value when quit sudoku from the menu.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21771 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
74d79cb92b
commit
e976c51df8
2 changed files with 12 additions and 10 deletions
|
@ -1164,7 +1164,7 @@ enum {
|
|||
SM_QUIT,
|
||||
};
|
||||
|
||||
bool sudoku_menu(struct sudoku_state_t* state)
|
||||
int sudoku_menu(struct sudoku_state_t* state)
|
||||
{
|
||||
int result;
|
||||
|
||||
|
@ -1224,14 +1224,13 @@ bool sudoku_menu(struct sudoku_state_t* state)
|
|||
|
||||
case SM_QUIT:
|
||||
save_sudoku(state);
|
||||
return true;
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return (result==MENU_ATTACHED_USB);
|
||||
return result;
|
||||
}
|
||||
|
||||
/* Menu used when user is in edit mode - i.e. creating a new game manually */
|
||||
|
@ -1518,9 +1517,12 @@ enum plugin_status plugin_start(const void* parameter)
|
|||
exit = true;
|
||||
}
|
||||
} else {
|
||||
if (sudoku_menu(&state)) {
|
||||
res = sudoku_menu(&state);
|
||||
if (res == MENU_ATTACHED_USB) {
|
||||
rc = PLUGIN_USB_CONNECTED;
|
||||
exit = true;
|
||||
} else if (res == SM_QUIT) {
|
||||
exit = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -135,13 +135,13 @@
|
|||
#define SUDOKU_BUTTON_POSSIBLE BUTTON_REC
|
||||
|
||||
#elif (CONFIG_KEYPAD == SANSA_FUZE_PAD)
|
||||
#define SUDOKU_BUTTON_QUIT (BUTTON_HOME|BUTTON_REPEAT)
|
||||
#define SUDOKU_BUTTON_UP BUTTON_UP
|
||||
#define SUDOKU_BUTTON_DOWN BUTTON_DOWN
|
||||
#define SUDOKU_BUTTON_LEFT BUTTON_LEFT
|
||||
#define SUDOKU_BUTTON_RIGHT BUTTON_RIGHT
|
||||
#define SUDOKU_BUTTON_QUIT (BUTTON_HOME|BUTTON_REPEAT)
|
||||
#define SUDOKU_BUTTON_UP BUTTON_UP
|
||||
#define SUDOKU_BUTTON_DOWN BUTTON_DOWN
|
||||
#define SUDOKU_BUTTON_LEFT BUTTON_LEFT
|
||||
#define SUDOKU_BUTTON_RIGHT BUTTON_RIGHT
|
||||
#define SUDOKU_BUTTON_TOGGLEBACK BUTTON_SCROLL_BACK
|
||||
#define SUDOKU_BUTTON_TOGGLE BUTTON_SCROLL_FWD
|
||||
#define SUDOKU_BUTTON_TOGGLE BUTTON_SCROLL_FWD
|
||||
#define SUDOKU_BUTTON_MENU (BUTTON_HOME | BUTTON_REL)
|
||||
#define SUDOKU_BUTTON_POSSIBLE (BUTTON_SELECT | BUTTON_UP)
|
||||
|
||||
|
|
Loading…
Reference in a new issue