summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTeruaki Kawashima <teru@rockbox.org>2009-07-11 13:35:08 +0000
committerTeruaki Kawashima <teru@rockbox.org>2009-07-11 13:35:08 +0000
commite976c51df8801a40a111c2c3d7fd0a30a0402b71 (patch)
tree843784dd9fb19152df2ffa81ee97eca7943c9b3d
parent74d79cb92b5916eaedb7284b1b4ff47b06ffa08a (diff)
downloadrockbox-e976c51df8801a40a111c2c3d7fd0a30a0402b71.tar.gz
rockbox-e976c51df8801a40a111c2c3d7fd0a30a0402b71.tar.bz2
rockbox-e976c51df8801a40a111c2c3d7fd0a30a0402b71.zip
Correct return value when quit sudoku from the menu.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21771 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--apps/plugins/sudoku/sudoku.c10
-rw-r--r--apps/plugins/sudoku/sudoku.h12
2 files changed, 12 insertions, 10 deletions
diff --git a/apps/plugins/sudoku/sudoku.c b/apps/plugins/sudoku/sudoku.c
index da41a6986b..f8a438592d 100644
--- a/apps/plugins/sudoku/sudoku.c
+++ b/apps/plugins/sudoku/sudoku.c
@@ -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;
}
}
}
diff --git a/apps/plugins/sudoku/sudoku.h b/apps/plugins/sudoku/sudoku.h
index 54e04f12b2..75ceb1d3f2 100644
--- a/apps/plugins/sudoku/sudoku.h
+++ b/apps/plugins/sudoku/sudoku.h
@@ -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)