Index: apps/screens.c
===================================================================
--- apps/screens.c	(revision 13287)
+++ apps/screens.c	(working copy)
@@ -1104,7 +1104,7 @@
         switch(button)
         {
             case ACTION_STD_CANCEL:
-                sys_poweroff();
+                sys_poweroff(false);
                 break;
 
             /* do nothing here, because ACTION_UNKNOWN might be caused
Index: apps/lang/english.lang
===================================================================
--- apps/lang/english.lang	(revision 13287)
+++ apps/lang/english.lang	(working copy)
@@ -10772,3 +10772,31 @@
     *: "Playlist Viewer Settings"
   </voice>
 </phrase>
+<phrase>
+  id: LANG_POWER
+  desc: in root menu
+  user:
+  <source>
+    *: "Power"
+  </source>
+  <dest>
+    *: "Power"
+  </dest>
+  <voice>
+    *: "Power"
+  </voice>
+</phrase>
+<phrase>
+  id: LANG_REBOOT
+  desc: in power menu
+  user:
+  <source>
+    *: "Reboot"
+  </source>
+  <dest>
+    *: "Reboot"
+  </dest>
+  <voice>
+    *: "Reboot"
+  </voice>
+</phrase>
Index: apps/menus/power_menu.c
===================================================================
--- apps/menus/power_menu.c	(revision 0)
+++ apps/menus/power_menu.c	(revision 0)
@@ -0,0 +1,102 @@
+
+/***************************************************************************
+ *             __________               __   ___.
+ *   Open      \______   \ ____   ____ |  | _\_ |__   _______  ___
+ *   Source     |       _//  _ \_/ ___\|  |/ /| __ \ /  _ \  \/  /
+ *   Jukebox    |    |   (  <_> )  \___|    < | \_\ (  <_> > <  <
+ *   Firmware   |____|_  /\____/ \___  >__|_ \|___  /\____/__/\_ \
+ *                     \/            \/     \/    \/            \/
+ * $Id: $
+ *
+ * Copyright (C) 2007 Jonathan Gordon
+ *
+ * All files in this archive are subject to the GNU General Public License.
+ * See the file COPYING in the source tree root for full license agreement.
+ *
+ * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
+ * KIND, either express or implied.
+ *
+ ****************************************************************************/
+
+#include <stdbool.h>
+#include <stddef.h>
+#include <limits.h>
+#include <string.h>
+#include "sprintf.h"
+#include "config.h"
+#include "lang.h"
+#include "action.h"
+#include "settings.h"
+#include "menu.h"
+#include "exported_menus.h"
+#include "screens.h"
+#include "powermgmt.h"
+#include "power.h"
+#include "talk.h"
+
+static void sleep_timer_formatter(char* buffer, int buffer_size, int value,
+                                  const char* unit)
+{
+    int minutes, hours;
+
+    (void) unit;
+
+    if (value) {
+        hours = value / 60;
+        minutes = value - (hours * 60);
+        snprintf(buffer, buffer_size, "%d:%02d", hours, minutes);
+   } else {
+        snprintf(buffer, buffer_size, "%s", str(LANG_OFF));
+    }
+}
+
+static void sleep_timer_set(int minutes)
+{
+    set_sleep_timer(minutes * 60);
+}
+
+static int sleep_timer(void)
+{
+    int minutes = (get_sleep_timer() + 59) / 60; /* round up */
+    return (int)set_int(str(LANG_SLEEP_TIMER), "", UNIT_MIN, &minutes,
+                   &sleep_timer_set, -5, 300, 0, sleep_timer_formatter);
+}
+
+static int do_shutdown(void)
+{
+#if CONFIG_CHARGING
+    if (charger_inserted())
+        charging_splash();
+    else
+#endif
+    sys_poweroff(false);
+    return 0;
+}
+
+static int do_reboot(void)
+{
+#if CONFIG_CHARGING
+    if (charger_inserted())
+        charging_splash();
+    else
+#endif
+    sys_poweroff(true);
+    return 0;
+}
+
+MENUITEM_FUNCTION(sleep_timer_call, 0, ID2P(LANG_SLEEP_TIMER), sleep_timer,
+                    NULL, NULL, Icon_Menu_setting); /* make it look like a
+                                                                setting to the user */
+MENUITEM_FUNCTION(do_reboot_item, 0, ID2P(LANG_REBOOT),
+                  do_reboot, NULL, NULL, Icon_NOICON);
+
+MENUITEM_FUNCTION(do_shutdown_item, 0, ID2P(LANG_SHUTDOWN),
+                  do_shutdown, NULL, NULL, Icon_NOICON);
+
+MAKE_MENU(power_options, ID2P(LANG_POWER), 0, Icon_NOICON,
+          &sleep_timer_call, &do_reboot_item, &do_shutdown_item);
+
+bool power_menu(void)
+{
+    return do_menu(&power_options, NULL);
+}
Index: apps/menus/exported_menus.h
===================================================================
--- apps/menus/exported_menus.h	(revision 13287)
+++ apps/menus/exported_menus.h	(working copy)
@@ -34,8 +34,9 @@
         settings_menu_item,         /* settings_menu.c  */
         playlist_settings,          /* playlist_menu.c  */
         playlist_options,           /* playlist_menu.c  */
-        equalizer_menu,                /* eq_menu.c        */
-        info_menu;                  /* info_menu.c      */
+        equalizer_menu,             /* eq_menu.c        */
+        info_menu,                  /* info_menu.c      */
+        power_options;                 /* power_menu.c     */
 
 #ifdef HAVE_WM8758
 extern const struct menu_item_ex hw_eq_menu; /* eq_menu.c        */
Index: apps/menus/main_menu.c
===================================================================
--- apps/menus/main_menu.c	(revision 13287)
+++ apps/menus/main_menu.c	(working copy)
@@ -349,39 +349,6 @@
 MENUITEM_FUNCTION(show_info_item, 0, ID2P(LANG_INFO_MENU),
                    (menu_function)show_info, NULL, NULL, Icon_NOICON);
 
-
-/* sleep Menu */
-static void sleep_timer_formatter(char* buffer, int buffer_size, int value,
-                                  const char* unit)
-{
-    int minutes, hours;
-
-    (void) unit;
-
-    if (value) {
-        hours = value / 60;
-        minutes = value - (hours * 60);
-        snprintf(buffer, buffer_size, "%d:%02d", hours, minutes);
-   } else {
-        snprintf(buffer, buffer_size, "%s", str(LANG_OFF));
-    }
-}
-
-static void sleep_timer_set(int minutes)
-{
-    set_sleep_timer(minutes * 60);
-}
-
-static int sleep_timer(void)
-{
-    int minutes = (get_sleep_timer() + 59) / 60; /* round up */
-    return (int)set_int(str(LANG_SLEEP_TIMER), "", UNIT_MIN, &minutes,
-                   &sleep_timer_set, -5, 300, 0, sleep_timer_formatter);
-}
-
-MENUITEM_FUNCTION(sleep_timer_call, 0, ID2P(LANG_SLEEP_TIMER), sleep_timer,
-                    NULL, NULL, Icon_Menu_setting); /* make it look like a 
-                                                                setting to the user */
 MENUITEM_FUNCTION(show_credits_item, 0, ID2P(LANG_VERSION),
                    (menu_function)show_credits, NULL, NULL, Icon_NOICON);
 MENUITEM_FUNCTION(show_runtime_item, 0, ID2P(LANG_RUNNING_TIME),
@@ -395,7 +362,7 @@
 
 MAKE_MENU(info_menu, ID2P(LANG_INFO), 0, Icon_Questionmark,
           &show_info_item, &show_credits_item, &show_runtime_item, 
-          &sleep_timer_call, &debug_menu_item
+          &debug_menu_item
 #ifdef SIMULATOR
         ,&simulate_usb_item
 #endif
Index: apps/SOURCES
===================================================================
--- apps/SOURCES	(revision 13287)
+++ apps/SOURCES	(working copy)
@@ -22,6 +22,7 @@
 #endif
 menus/settings_menu.c
 menus/sound_menu.c
+menus/power_menu.c
 misc.c
 onplay.c
 playlist.c
Index: apps/root_menu.c
===================================================================
--- apps/root_menu.c	(revision 13287)
+++ apps/root_menu.c	(working copy)
@@ -25,13 +25,11 @@
 #include "root_menu.h"
 #include "lang.h"
 #include "settings.h"
-#include "screens.h"
 #include "kernel.h"
 #include "debug.h"
 #include "misc.h"
 #include "rolo.h"
 #include "powermgmt.h"
-#include "power.h"
 #include "talk.h"
 #include "audio.h"
 
@@ -320,20 +318,7 @@
 MENUITEM_RETURNVALUE(bookmarks, ID2P(LANG_BOOKMARK_MENU_RECENT_BOOKMARKS),
                         GO_TO_RECENTBMARKS,  item_callback, 
                         Icon_Bookmark);
-#ifdef HAVE_LCD_CHARCELLS
-static int do_shutdown(void)
-{
-#if CONFIG_CHARGING
-    if (charger_inserted())
-        charging_splash();
-    else
-#endif
-        sys_poweroff();
-    return 0;
-}
-MENUITEM_FUNCTION(do_shutdown_item, 0, ID2P(LANG_SHUTDOWN),
-                  do_shutdown, NULL, NULL, Icon_NOICON);
-#endif
+
 MAKE_MENU(root_menu_, ID2P(LANG_ROCKBOX_TITLE),
             NULL, Icon_Rockbox,
             &bookmarks, &file_browser, 
@@ -347,11 +332,7 @@
 #if CONFIG_TUNER
             &fm,
 #endif
-            &playlist_options, &rocks_browser,  &info_menu
-
-#ifdef HAVE_LCD_CHARCELLS
-            ,&do_shutdown_item
-#endif
+            &playlist_options, &rocks_browser, &info_menu, &power_options
         );
 
 int item_callback(int action, const struct menu_item_ex *this_item) 
Index: apps/misc.c
===================================================================
--- apps/misc.c	(revision 13287)
+++ apps/misc.c	(working copy)
@@ -594,11 +594,10 @@
     tree_restore();
 }
 
-static bool clean_shutdown(void (*callback)(void *), void *parameter)
+static bool clean_shutdown(bool reboot)
 {
 #ifdef SIMULATOR
-    (void)callback;
-    (void)parameter;
+    (void)reboot;
     call_ata_idle_notifys(true);
     exit(0);
 #else
@@ -658,9 +657,6 @@
         while (audio_status())
             sleep(1);
         
-        if (callback != NULL)
-            callback(parameter);
-
         if (!batt_crit) /* do not save on critical battery */
             system_flush();
 #ifdef HAVE_EEPROM_SETTINGS
@@ -671,7 +667,7 @@
             eeprom_settings_store();
         }
 #endif
-        shutdown_hw();
+        shutdown_hw(reboot);
     }
 #endif
     return false;
@@ -836,9 +832,13 @@
             }
             return SYS_USB_CONNECTED;
         case SYS_POWEROFF:
-            if (!clean_shutdown(callback, parameter))
+            if (clean_shutdown(false))
                 return SYS_POWEROFF;
             break;
+        case SYS_REBOOT:
+            if (clean_shutdown(true))
+                return SYS_REBOOT;
+            break;
 #if CONFIG_CHARGING
         case SYS_CHARGER_CONNECTED:
             car_adapter_mode_processing(true);
Index: firmware/export/kernel.h
===================================================================
--- firmware/export/kernel.h	(revision 13287)
+++ firmware/export/kernel.h	(working copy)
@@ -44,11 +44,12 @@
 #define SYS_MMC_INSERTED          ((SYS_EVENT | ((long)6 << 27)))
 #define SYS_MMC_EXTRACTED         ((SYS_EVENT | ((long)7 << 27)))
 #define SYS_POWEROFF              ((SYS_EVENT | ((long)8 << 27)))
-#define SYS_FS_CHANGED            ((SYS_EVENT | ((long)9 << 27)))
-#define SYS_CHARGER_CONNECTED     ((SYS_EVENT | ((long)10 << 27)))
-#define SYS_CHARGER_DISCONNECTED  ((SYS_EVENT | ((long)11 << 27)))
-#define SYS_PHONE_PLUGGED         ((SYS_EVENT | ((long)12 << 27)))
-#define SYS_PHONE_UNPLUGGED       ((SYS_EVENT | ((long)13 << 27)))
+#define SYS_REBOOT                ((SYS_EVENT | ((long)9 << 27)))
+#define SYS_FS_CHANGED            ((SYS_EVENT | ((long)10 << 27)))
+#define SYS_CHARGER_CONNECTED     ((SYS_EVENT | ((long)11 << 27)))
+#define SYS_CHARGER_DISCONNECTED  ((SYS_EVENT | ((long)12 << 27)))
+#define SYS_PHONE_PLUGGED         ((SYS_EVENT | ((long)13 << 27)))
+#define SYS_PHONE_UNPLUGGED       ((SYS_EVENT | ((long)14 << 27)))
 
 struct event
 {
Index: firmware/export/powermgmt.h
===================================================================
--- firmware/export/powermgmt.h	(revision 13287)
+++ firmware/export/powermgmt.h	(working copy)
@@ -155,7 +155,7 @@
 void set_car_adapter_mode(bool setting);
 void reset_poweroff_timer(void);
 void cancel_shutdown(void);
-void shutdown_hw(void);
-void sys_poweroff(void);
+void shutdown_hw(bool reboot);
+void sys_poweroff(bool reboot);
 
 #endif
Index: firmware/target/coldfire/iaudio/pcf50606-iaudio.c
===================================================================
--- firmware/target/coldfire/iaudio/pcf50606-iaudio.c	(revision 13287)
+++ firmware/target/coldfire/iaudio/pcf50606-iaudio.c	(working copy)
@@ -115,7 +115,7 @@
     {
         /* ONKEY1S */
         if (GPIO_READ & 0x02000000)
-            sys_poweroff();             /* main ONKEY */
+            sys_poweroff(false);             /* main ONKEY */
         else
             pcf50606_reset_timeout();   /* remote ONKEY */
     }
Index: firmware/powermgmt.c
===================================================================
--- firmware/powermgmt.c	(revision 13287)
+++ firmware/powermgmt.c	(working copy)
@@ -634,7 +634,7 @@
     if(battery_centivolts < battery_level_shutoff[battery_type]) {
         if(!shutdown_timeout) {
             backlight_on();
-            sys_poweroff();
+            sys_poweroff(false);
         }
     }
 #endif
@@ -651,7 +651,7 @@
         if(TIME_AFTER(current_tick, last_event_tick    + timeout) &&
            TIME_AFTER(current_tick, last_disk_activity + timeout))
         {
-            sys_poweroff();
+            sys_poweroff(false);
         }
     }
     else
@@ -674,7 +674,7 @@
 #endif
                 {
                     DEBUGF("Sleep timer timeout. Shutting off...\n");
-                    sys_poweroff();
+                    sys_poweroff(false);
                 }
             }
         }
@@ -864,7 +864,7 @@
     (CONFIG_BATTERY!=BATT_1AA)
             if (!shutdown_timeout &&
                 (battery_centivolts < battery_level_shutoff[battery_type]))
-                sys_poweroff();
+                sys_poweroff(false);
             else
 #endif
                 avgbat += battery_centivolts * 10000
@@ -1257,7 +1257,7 @@
 
 #endif /* SIMULATOR */
 
-void sys_poweroff(void)
+void sys_poweroff(bool reboot)
 {
     logf("sys_poweroff()");
     /* If the main thread fails to shut down the system, we will force a
@@ -1274,7 +1274,10 @@
         shutdown_timeout += HZ*20;
     }
 
-    queue_post(&button_queue, SYS_POWEROFF, 0);
+    if (reboot)
+        queue_post(&button_queue, SYS_REBOOT, 0);
+    else
+        queue_post(&button_queue, SYS_POWEROFF, 0);
 }
 
 void cancel_shutdown(void)
@@ -1291,9 +1294,11 @@
 }
 
 /* Various hardware housekeeping tasks relating to shutting down the jukebox */
-void shutdown_hw(void)
+void shutdown_hw(bool reboot)
 {
-#ifndef SIMULATOR
+#ifdef SIMULATOR
+(void)reboot;
+#else
 #if defined(DEBUG_FILE) && (CONFIG_CHARGING == CHARGING_CONTROL)
     if(fd >= 0) {
         close(fd);
@@ -1347,6 +1352,9 @@
        eeprom chips are quite slow and might be still writing the last
        byte. */
     sleep(HZ/4);
-    power_off();
-#endif /* #ifndef SIMULATOR */
+    if (reboot)
+        system_reboot();
+    else
+        power_off();
+#endif /* #ifdef SIMULATOR */
 }
Index: firmware/drivers/button.c
===================================================================
--- firmware/drivers/button.c	(revision 13287)
+++ firmware/drivers/button.c	(working copy)
@@ -180,7 +180,7 @@
                         {
                             /* Tell the main thread that it's time to
                                power off */
-                            sys_poweroff();
+                            sys_poweroff(false);
 
                             /* Safety net for players without hardware
                                poweroff */
