Index: apps/action.h =================================================================== --- apps/action.h (revision 19800) +++ apps/action.h (working copy) @@ -119,6 +119,9 @@ ACTION_WPS_QUICKSCREEN,/* optional */ ACTION_WPS_MENU, /*this should be the same as ACTION_STD_MENU */ ACTION_WPS_REC, + ACTION_WPS_SHUTDOWN, /*power down player from wps via long power*/ + /*already supposed to do this, but doesn't do very well*/ + ACTION_WPS_SHOWCLOCK, /*show clock from wps via long play*/ #if 0 ACTION_WPSAB_SINGLE, /* This needs to be #defined in the config-.h to one of the ACTION_WPS_ actions Index: apps/lang/english.lang =================================================================== --- apps/lang/english.lang (revision 19800) +++ apps/lang/english.lang (working copy) @@ -1887,6 +1887,34 @@ + id: LANG_SHUT_DOWN + desc: in root_menu.c + user: + + *: "Shut Down" + + + *: "Shut Down" + + + *: "Shut Down" + + + + id: LANG_SHOW_CLOCK + desc: in root_menu.c + user: + + *: "Show Clock" + + + *: "Show Clock" + + + *: "Show Clock" + + + id: LANG_REPLAYGAIN_ENABLE desc: in replaygain user: Index: apps/plugins/clock/clock_settings.c =================================================================== --- apps/plugins/clock/clock_settings.c (revision 19800) +++ apps/plugins/clock/clock_settings.c (working copy) @@ -157,8 +157,8 @@ FOR_NB_SCREENS(i){ display=rb->screens[i]; display->clear_display(); - draw_logo(display); - draw_message(display, MESSAGE_LOADING, 1); + /* draw_logo(display);*/ + /* draw_message(display, MESSAGE_LOADING, 1); */ display->update(); } @@ -174,7 +174,7 @@ display->update(); } rb->storage_sleep(); - rb->sleep(HZ); + /* rb->sleep(HZ); remove delay*/ } void save_settings(void){ @@ -186,9 +186,9 @@ FOR_NB_SCREENS(i){ display=rb->screens[i]; display->clear_display(); - draw_logo(display); + /* draw_logo(display); */ - draw_message(display, MESSAGE_SAVING, 1); + /* draw_message(display, MESSAGE_SAVING, 1);*/ display->update(); } @@ -204,7 +204,7 @@ draw_message(display, MESSAGE_ERRSAVE, 1); display->update(); } - rb->sleep(HZ); + /* rb->sleep(HZ);*/ } void save_settings_wo_gui(void){ Index: apps/plugins/clock/clock.c =================================================================== --- apps/plugins/clock/clock.c (revision 19800) +++ apps/plugins/clock/clock.c (working copy) @@ -47,6 +47,7 @@ #define ACTION_COUNTER_RESET PLA_FIRE_REPEAT #define ACTION_MENU PLA_MENU #define ACTION_EXIT PLA_QUIT +#define ACTION_EXIT2 PLA_START #define ACTION_MODE_NEXT PLA_RIGHT #define ACTION_MODE_NEXT_REPEAT PLA_RIGHT_REPEAT #define ACTION_MODE_PREV PLA_LEFT @@ -176,7 +177,7 @@ clock_draw_restore_colors(); exit_clock=main_menu(); break; - + case ACTION_EXIT2: /*press play alternate way to exit*/ case ACTION_EXIT: exit_clock=true; break; Index: apps/gui/gwps.c =================================================================== --- apps/gui/gwps.c (revision 19800) +++ apps/gui/gwps.c (working copy) @@ -60,6 +60,9 @@ #include "root_menu.h" #include "backdrop.h" #include "quickscreen.h" +#include "plugin.h" +#include "power.h" +#include "powermgmt.h" #include "pitchscreen.h" #include "appevents.h" #include "viewport.h" @@ -71,6 +74,7 @@ /* initial setup of wps_data */ static void wps_state_init(void); +static int do_shutdown(void); static void prev_track(unsigned skip_thresh) { @@ -296,6 +300,23 @@ return GO_TO_PREVIOUS_BROWSER; break; + /*shut down (power down) from wps screen by holding down power*/ + case ACTION_WPS_SHUTDOWN: + do_shutdown(); + break; + + /*show clock from wps screen by holding down play button*/ + case ACTION_WPS_SHOWCLOCK: + if (plugin_load(PLUGIN_APPS_DIR "/clock.rock",NULL) != PLUGIN_OK) + { + get_action(CONTEXT_STD, TIMEOUT_BLOCK); + } + else + { + return GO_TO_WPS; + } + break; + /* play/pause */ case ACTION_WPS_PLAY: if (global_settings.party_mode) @@ -801,3 +822,14 @@ return false; } #endif +static int do_shutdown(void) +{ +#if CONFIG_CHARGING + if (charger_inserted()) + charging_splash(); + else +#endif + + sys_poweroff(); + return 0; +} Index: apps/root_menu.c =================================================================== --- apps/root_menu.c (revision 19800) +++ apps/root_menu.c (working copy) @@ -40,6 +40,8 @@ #include "hotswap.h" #include "backdrop.h" +#include "plugin.h" + /* gui api */ #include "list.h" #include "statusbar.h" @@ -387,7 +389,18 @@ MENUITEM_RETURNVALUE(bookmarks, ID2P(LANG_BOOKMARK_MENU_RECENT_BOOKMARKS), GO_TO_RECENTBMARKS, item_callback, Icon_Bookmark); -#ifdef HAVE_LCD_CHARCELLS + +static int do_clock(void) +{ + if (plugin_load(PLUGIN_APPS_DIR "/clock.rock",NULL) != PLUGIN_OK) + { + get_action(CONTEXT_STD, TIMEOUT_BLOCK); + } + return 0; +} + +/*#ifdef HAVE_LCD_CHARCELLS*/ + static int do_shutdown(void) { #if CONFIG_CHARGING @@ -395,12 +408,17 @@ charging_splash(); else #endif - sys_poweroff(); + + sys_poweroff(); return 0; } -MENUITEM_FUNCTION(do_shutdown_item, 0, ID2P(LANG_SHUTDOWN), +MENUITEM_FUNCTION(do_shutdown_item, 0, /*was ID2P(LANG_SHUTDOWN)*/ID2P(LANG_SHUT_DOWN), do_shutdown, NULL, NULL, Icon_NOICON); -#endif +/*#endif*/ + +MENUITEM_FUNCTION(do_clock_item, 0, /*"Show Clock"*/ ID2P(LANG_SHOW_CLOCK), do_clock, NULL, NULL, Icon_NOICON); + + MAKE_MENU(root_menu_, ID2P(LANG_ROCKBOX_TITLE), item_callback, Icon_Rockbox, &bookmarks, &file_browser, @@ -416,9 +434,11 @@ #endif &playlist_options, &rocks_browser, &info_menu -#ifdef HAVE_LCD_CHARCELLS +/*#ifdef HAVE_LCD_CHARCELLS*/ ,&do_shutdown_item -#endif +/*#endif*/ + + ,&do_clock_item ); static int item_callback(int action, const struct menu_item_ex *this_item) Index: apps/keymaps/keymap-e200.c =================================================================== --- apps/keymaps/keymap-e200.c (revision 19800) +++ apps/keymaps/keymap-e200.c (working copy) @@ -85,6 +85,8 @@ { ACTION_WPS_PITCHSCREEN, BUTTON_SELECT|BUTTON_UP, BUTTON_SELECT }, { ACTION_WPS_ID3SCREEN, BUTTON_SELECT|BUTTON_DOWN, BUTTON_SELECT }, + { ACTION_WPS_SHUTDOWN, BUTTON_POWER|BUTTON_REPEAT, BUTTON_NONE }, + { ACTION_WPS_SHOWCLOCK, BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE }, LAST_ITEM_IN_LIST }; /* button_context_wps */