summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--apps/menu.c49
-rw-r--r--apps/plugin.c2
-rw-r--r--apps/plugin.h6
3 files changed, 4 insertions, 53 deletions
diff --git a/apps/menu.c b/apps/menu.c
index 88574caa78..523a92ed74 100644
--- a/apps/menu.c
+++ b/apps/menu.c
@@ -253,51 +253,6 @@ int menu_count(int menu)
253} 253}
254 254
255/* 255/*
256 * Allows a menu item at the current cursor position in "menu"
257 * to be moved up the list
258 */
259
260bool menu_moveup(int menu)
261{
262 struct menu_item swap;
263 int selected=menu_cursor(menu);
264 /* can't be the first item ! */
265 if( selected == 0)
266 return false;
267
268 /* use a temporary variable to do the swap */
269 swap = menus[menu].items[selected - 1];
270 menus[menu].items[selected - 1] = menus[menu].items[selected];
271 menus[menu].items[selected] = swap;
272
273 gui_synclist_select_previous(&(menus[menu].synclist));
274 return true;
275}
276
277/*
278 * Allows a menu item at the current cursor position in "menu" to be moved down the list
279 */
280
281bool menu_movedown(int menu)
282{
283 struct menu_item swap;
284 int selected=menu_cursor(menu);
285 int nb_items=gui_synclist_get_nb_items(&(menus[menu].synclist));
286
287 /* can't be the last item ! */
288 if( selected == nb_items - 1)
289 return false;
290
291 /* use a temporary variable to do the swap */
292 swap = menus[menu].items[selected + 1];
293 menus[menu].items[selected + 1] = menus[menu].items[selected];
294 menus[menu].items[selected] = swap;
295
296 gui_synclist_select_next(&(menus[menu].synclist));
297 return true;
298}
299
300/*
301 * Allows to set the cursor position. Doesn't redraw by itself. 256 * Allows to set the cursor position. Doesn't redraw by itself.
302 */ 257 */
303 258
@@ -530,8 +485,8 @@ int do_menu(const struct menu_item_ex *start_menu)
530 else if ((action == ACTION_STD_CANCEL) || 485 else if ((action == ACTION_STD_CANCEL) ||
531 (action == ACTION_STD_MENU)) 486 (action == ACTION_STD_MENU))
532 { 487 {
533 if (in_stringlist) 488 in_stringlist = false;
534 in_stringlist = false; 489
535 if (stack_top > 0) 490 if (stack_top > 0)
536 { 491 {
537 get_menu_callback(menu,&menu_callback); 492 get_menu_callback(menu,&menu_callback);
diff --git a/apps/plugin.c b/apps/plugin.c
index e11fd5cffe..dd82a8da75 100644
--- a/apps/plugin.c
+++ b/apps/plugin.c
@@ -386,8 +386,6 @@ static const struct plugin_api rockbox_api = {
386 menu_description, 386 menu_description,
387 menu_delete, 387 menu_delete,
388 menu_count, 388 menu_count,
389 menu_moveup,
390 menu_movedown,
391 menu_draw, 389 menu_draw,
392 menu_insert, 390 menu_insert,
393 menu_set_cursor, 391 menu_set_cursor,
diff --git a/apps/plugin.h b/apps/plugin.h
index 00c4326663..daab88eda1 100644
--- a/apps/plugin.h
+++ b/apps/plugin.h
@@ -110,12 +110,12 @@
110#define PLUGIN_MAGIC 0x526F634B /* RocK */ 110#define PLUGIN_MAGIC 0x526F634B /* RocK */
111 111
112/* increase this every time the api struct changes */ 112/* increase this every time the api struct changes */
113#define PLUGIN_API_VERSION 43 113#define PLUGIN_API_VERSION 44
114 114
115/* update this to latest version if a change to the api struct breaks 115/* update this to latest version if a change to the api struct breaks
116 backwards compatibility (and please take the opportunity to sort in any 116 backwards compatibility (and please take the opportunity to sort in any
117 new function which are "waiting" at the end of the function table) */ 117 new function which are "waiting" at the end of the function table) */
118#define PLUGIN_MIN_API_VERSION 43 118#define PLUGIN_MIN_API_VERSION 44
119 119
120/* plugin return codes */ 120/* plugin return codes */
121enum plugin_status { 121enum plugin_status {
@@ -484,8 +484,6 @@ struct plugin_api {
484 char* (*menu_description)(int menu, int position); 484 char* (*menu_description)(int menu, int position);
485 void (*menu_delete)(int menu, int position); 485 void (*menu_delete)(int menu, int position);
486 int (*menu_count)(int menu); 486 int (*menu_count)(int menu);
487 bool (*menu_moveup)(int menu);
488 bool (*menu_movedown)(int menu);
489 void (*menu_draw)(int menu); 487 void (*menu_draw)(int menu);
490 void (*menu_insert)(int menu, int position, char *desc, bool (*function) (void)); 488 void (*menu_insert)(int menu, int position, char *desc, bool (*function) (void));
491 void (*menu_set_cursor)(int menu, int position); 489 void (*menu_set_cursor)(int menu, int position);