1
0
Fork 0
forked from len0rd/rockbox

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:
Teruaki Kawashima 2009-07-11 13:35:08 +00:00
parent 74d79cb92b
commit e976c51df8
2 changed files with 12 additions and 10 deletions

View file

@ -1164,7 +1164,7 @@ enum {
SM_QUIT, SM_QUIT,
}; };
bool sudoku_menu(struct sudoku_state_t* state) int sudoku_menu(struct sudoku_state_t* state)
{ {
int result; int result;
@ -1224,14 +1224,13 @@ bool sudoku_menu(struct sudoku_state_t* state)
case SM_QUIT: case SM_QUIT:
save_sudoku(state); save_sudoku(state);
return true;
break; break;
default: default:
break; break;
} }
return (result==MENU_ATTACHED_USB); return result;
} }
/* Menu used when user is in edit mode - i.e. creating a new game manually */ /* 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; exit = true;
} }
} else { } else {
if (sudoku_menu(&state)) { res = sudoku_menu(&state);
if (res == MENU_ATTACHED_USB) {
rc = PLUGIN_USB_CONNECTED; rc = PLUGIN_USB_CONNECTED;
exit = true; exit = true;
} else if (res == SM_QUIT) {
exit = true;
} }
} }
} }

View file

@ -135,13 +135,13 @@
#define SUDOKU_BUTTON_POSSIBLE BUTTON_REC #define SUDOKU_BUTTON_POSSIBLE BUTTON_REC
#elif (CONFIG_KEYPAD == SANSA_FUZE_PAD) #elif (CONFIG_KEYPAD == SANSA_FUZE_PAD)
#define SUDOKU_BUTTON_QUIT (BUTTON_HOME|BUTTON_REPEAT) #define SUDOKU_BUTTON_QUIT (BUTTON_HOME|BUTTON_REPEAT)
#define SUDOKU_BUTTON_UP BUTTON_UP #define SUDOKU_BUTTON_UP BUTTON_UP
#define SUDOKU_BUTTON_DOWN BUTTON_DOWN #define SUDOKU_BUTTON_DOWN BUTTON_DOWN
#define SUDOKU_BUTTON_LEFT BUTTON_LEFT #define SUDOKU_BUTTON_LEFT BUTTON_LEFT
#define SUDOKU_BUTTON_RIGHT BUTTON_RIGHT #define SUDOKU_BUTTON_RIGHT BUTTON_RIGHT
#define SUDOKU_BUTTON_TOGGLEBACK BUTTON_SCROLL_BACK #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_MENU (BUTTON_HOME | BUTTON_REL)
#define SUDOKU_BUTTON_POSSIBLE (BUTTON_SELECT | BUTTON_UP) #define SUDOKU_BUTTON_POSSIBLE (BUTTON_SELECT | BUTTON_UP)