summaryrefslogtreecommitdiffstats
path: root/apps/plugins/keybox.c
diff options
context:
space:
mode:
authorTeruaki Kawashima <teru@rockbox.org>2009-08-05 14:29:29 +0000
committerTeruaki Kawashima <teru@rockbox.org>2009-08-05 14:29:29 +0000
commite2e7ecf350a4d085f6f58052f55ba29e8fe77718 (patch)
treed5abd6a205b9d32cb11e1c2d0ea08602812248d4 /apps/plugins/keybox.c
parenteac0a5b840571a11b181fdfd463be61aca466976 (diff)
downloadrockbox-e2e7ecf350a4d085f6f58052f55ba29e8fe77718.tar.gz
rockbox-e2e7ecf350a4d085f6f58052f55ba29e8fe77718.tar.bz2
rockbox-e2e7ecf350a4d085f6f58052f55ba29e8fe77718.zip
add playback control to more menu of plugins.
although it doesn't make much sense for some plugins like dice as the menu is only shown when you start that plugin. change star plugin to go back to menu when exit game instead of closing plugin so that above change makes useful. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@22171 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/plugins/keybox.c')
-rw-r--r--apps/plugins/keybox.c25
1 files changed, 17 insertions, 8 deletions
diff --git a/apps/plugins/keybox.c b/apps/plugins/keybox.c
index 73fd138f09..448050938f 100644
--- a/apps/plugins/keybox.c
+++ b/apps/plugins/keybox.c
@@ -19,6 +19,7 @@
*
****************************************************************************/
#include "plugin.h"
+#include "lib/playback_control.h"
#include "lib/md5.h"
PLUGIN_HEADER
@@ -29,7 +30,6 @@ PLUGIN_HEADER
/* The header begins with the unencrypted salt (4 bytes) padded with 4 bytes of
zeroes. After that comes the encrypted hash of the master password (16 bytes) */
-
#define HEADER_LEN 24
@@ -106,9 +106,10 @@ static void decrypt(uint32_t* v, uint32_t* k)
static int context_item_cb(int action, const struct menu_item_ex *this_item)
{
+ int i = (intptr_t)this_item;
if (action == ACTION_REQUEST_MENUITEM
&& pw_list.num_entries == 0
- && ((intptr_t)this_item) != 0)
+ && (i != 0 && i != 5))
{
return ACTION_EXIT_MENUITEM;
}
@@ -117,8 +118,9 @@ static int context_item_cb(int action, const struct menu_item_ex *this_item)
MENUITEM_STRINGLIST(context_m, "Context menu", context_item_cb,
"Add entry",
- "Edit title", "Edit user name", "Edit password",
- "Delete entry")
+ "Edit title", "Edit user name", "Edit password",
+ "Delete entry",
+ "Playback Control");
static char * kb_list_cb(int selected_item, void *data,
char *buffer, size_t buffer_len)
@@ -133,7 +135,7 @@ static char * kb_list_cb(int selected_item, void *data,
}
if (!entry)
return NULL;
-
+
rb->snprintf(buffer, buffer_len, "%s", entry->title);
return buffer;
@@ -161,7 +163,7 @@ static void delete_entry(int selected_item)
entry2 = entry->next;
if (!entry2)
return;
-
+
entry->next = entry2->next;
entry2->used = false;
@@ -289,6 +291,9 @@ static void context_menu(int selected_item)
case 4:
delete_entry(selected_item);
return;
+ case 5:
+ playback_control(NULL);
+ return;
default:
exit = true;
break;
@@ -610,8 +615,9 @@ static int main_menu(void)
int selection, result, ret;
bool exit = false;
- MENUITEM_STRINGLIST(menu,"Keybox", NULL, "Enter Keybox",
- "Reset Keybox", "Exit");
+ MENUITEM_STRINGLIST(menu, "Keybox", NULL,
+ "Enter Keybox", "Reset Keybox",
+ "Playback Control", "Exit");
do {
result = rb->do_menu(&menu, &selection, NULL, false);
@@ -625,6 +631,9 @@ static int main_menu(void)
reset();
break;
case 2:
+ playback_control(NULL);
+ break;
+ case 3:
exit = true;
break;
}