summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBjörn Stenberg <bjorn@haxx.se>2004-01-14 14:42:31 +0000
committerBjörn Stenberg <bjorn@haxx.se>2004-01-14 14:42:31 +0000
commitfe375a0404694c33c24706fe1513468c89486da4 (patch)
tree4906c7c0ead9e299bcf3f793168d8237d3f0853b
parenta53afc0330b4b5f0a4682d594853bae1cee35676 (diff)
downloadrockbox-fe375a0404694c33c24706fe1513468c89486da4.tar.gz
rockbox-fe375a0404694c33c24706fe1513468c89486da4.zip
Menu reorganization (patch #872810 by Peter Schneider)
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@4231 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--apps/lang/english.lang63
-rw-r--r--apps/main_menu.c88
-rw-r--r--apps/settings_menu.c237
3 files changed, 289 insertions, 99 deletions
diff --git a/apps/lang/english.lang b/apps/lang/english.lang
index 24ac940411..2cf449f789 100644
--- a/apps/lang/english.lang
+++ b/apps/lang/english.lang
@@ -325,7 +325,7 @@ new:
id: LANG_SCROLL_MENU
desc: in display_settings_menu()
-eng: "Scroll"
+eng: "Scrolling"
new:
id: LANG_RESET
@@ -1730,12 +1730,12 @@ new:
id: LANG_CUSTOM_FONT
desc: in setting_menu()
-eng: "Fonts"
+eng: "Browse Fonts"
new:
id: LANG_FIRMWARE
desc: in the main menu
-eng: "Firmware"
+eng: "Browse Firmwares"
new:
id: LANG_LANGUAGE
@@ -1745,17 +1745,17 @@ new:
id: LANG_WHILE_PLAYING
desc: in settings_menu()
-eng: "While Playing Screen"
+eng: "Browse .wps files"
new:
id: LANG_CUSTOM_CFG
desc: in setting_menu()
-eng: "Configurations"
+eng: "Browse .cfg files"
new:
id: LANG_PLUGINS
desc: in main_menu()
-eng: "Plugins"
+eng: "Browse Plugins"
new:
id: LANG_CAR_ADAPTER_MODE
@@ -1979,3 +1979,54 @@ id: LANG_RECORD_PRERECORD_TIME
desc: in recording settings_menu
eng: "Prerecord time"
new:
+
+id: LANG_INFO_MENU
+desc: in the info sub menu
+eng: "Rockbox Info"
+new:
+
+id: LANG_RECORDING_MENU
+desc: in the recording sub menu
+eng: "Start Recording"
+new:
+
+id: LANG_WIND_MENU
+desc: in the playback sub menu
+eng: "FFwd/Rewind"
+new:
+
+id: LANG_LCD_MENU
+desc: in the display sub menu
+eng: "LCD Settings"
+new:
+
+id: LANG_BARS_MENU
+desc: in the display sub menu
+eng: "Status-/Scrollbar"
+new:
+
+id: LANG_BATTERY_MENU
+desc: in the system sub menu
+eng: "Battery"
+new:
+
+id: LANG_DISK_MENU
+desc: in the system sub menu
+eng: "Disk"
+new:
+
+id: LANG_TIME_MENU
+desc: in the system sub menu
+eng: "Time & Date"
+new:
+
+# Limits
+id: LANG_LIMITS_MENU
+desc: in the system sub menu
+eng: "Limits"
+new:
+
+id: LANG_MANAGE_MENU
+desc: in the system sub menu
+eng: "Manage Settings"
+new:
diff --git a/apps/main_menu.c b/apps/main_menu.c
index 53954d2260..23af8d7817 100644
--- a/apps/main_menu.c
+++ b/apps/main_menu.c
@@ -39,7 +39,6 @@
#include "sound_menu.h"
#include "status.h"
#include "fat.h"
-#include "sleeptimer.h"
#include "bookmark.h"
#include "wps.h"
#include "buffer.h"
@@ -55,10 +54,6 @@
#include "recording.h"
#endif
-#ifdef HAVE_ALARM_MOD
-#include "alarm_menu.h"
-#endif
-
#ifdef HAVE_LCD_BITMAP
#include "bmp.h"
#include "icons.h"
@@ -246,11 +241,6 @@ bool show_info(void)
return false;
}
-static bool firmware_browse(void)
-{
- return rockbox_browse(ROCKBOX_DIR, SHOW_MOD);
-}
-
static bool plugin_browse(void)
{
return rockbox_browse(PLUGIN_DIR, SHOW_PLUGINS);
@@ -263,6 +253,50 @@ static bool recording_settings(void)
}
#endif
+#ifdef HAVE_MAS3587F
+bool rec_menu(void)
+{
+ int m;
+ bool result;
+
+ /* recording menu */
+ struct menu_items items[] = {
+ { str(LANG_RECORDING_MENU), recording_screen },
+ { str(LANG_RECORDING_SETTINGS), recording_settings},
+ };
+
+ m=menu_init( items, sizeof items / sizeof(struct menu_items) );
+ result = menu_run(m);
+ menu_exit(m);
+
+ return result;
+}
+#endif
+
+bool info_menu(void)
+{
+ int m;
+ bool result;
+
+ /* info menu */
+ struct menu_items items[] = {
+ { str(LANG_MENU_SHOW_ID3_INFO), browse_id3 },
+ { str(LANG_INFO_MENU), show_info },
+ { str(LANG_VERSION), show_credits },
+#ifndef SIMULATOR
+ { str(LANG_DEBUG), debug_menu },
+#else
+ { str(LANG_USB), simulate_usb },
+#endif
+ };
+
+ m=menu_init( items, sizeof items / sizeof(struct menu_items) );
+ result = menu_run(m);
+ menu_exit(m);
+
+ return result;
+}
+
bool main_menu(void)
{
int m;
@@ -270,7 +304,7 @@ bool main_menu(void)
int i = 0;
/* main menu */
- struct menu_items items[15];
+ struct menu_items items[8];
items[i].desc = str(LANG_BOOKMARK_MENU);
items[i++].function = bookmark_menu;
@@ -290,45 +324,17 @@ bool main_menu(void)
#ifdef HAVE_MAS3587F
items[i].desc = str(LANG_RECORDING);
- items[i++].function = recording_screen;
-
- items[i].desc = str(LANG_RECORDING_SETTINGS);
- items[i++].function = recording_settings;
+ items[i++].function = rec_menu;
#endif
items[i].desc = str(LANG_PLAYLIST_MENU);
items[i++].function = playlist_menu;
- items[i].desc = str(LANG_MENU_SHOW_ID3_INFO);
- items[i++].function = browse_id3;
-
- items[i].desc = str(LANG_SLEEP_TIMER);
- items[i++].function = sleeptimer_screen;
-
-#ifdef HAVE_ALARM_MOD
- items[i].desc = str(LANG_ALARM_MOD_ALARM_MENU);
- items[i++].function = alarm_screen;
-#endif
-
items[i].desc = str(LANG_PLUGINS);
items[i++].function = plugin_browse;
- items[i].desc = str(LANG_FIRMWARE);
- items[i++].function = firmware_browse;
-
items[i].desc = str(LANG_INFO);
- items[i++].function = show_info;
-
- items[i].desc = str(LANG_VERSION);
- items[i++].function = show_credits;
-
-#ifndef SIMULATOR
- items[i].desc = str(LANG_DEBUG);
- items[i++].function = debug_menu;
-#else
- items[i].desc = str(LANG_USB);
- items[i++].function = simulate_usb;
-#endif
+ items[i++].function = info_menu;
m=menu_init( items, i );
#ifdef HAVE_LCD_CHARCELLS
diff --git a/apps/settings_menu.c b/apps/settings_menu.c
index a96c88c681..79edce936d 100644
--- a/apps/settings_menu.c
+++ b/apps/settings_menu.c
@@ -34,6 +34,7 @@
#include "backlight.h"
#include "playlist.h" /* for playlist_shuffle */
#include "fat.h" /* For dotfile settings */
+#include "sleeptimer.h"
#include "powermgmt.h"
#include "rtc.h"
#include "ata.h"
@@ -46,6 +47,9 @@
#ifdef HAVE_MAS3507D
void dac_line_in(bool enable);
#endif
+#ifdef HAVE_ALARM_MOD
+#include "alarm_menu.h"
+#endif
static bool car_adapter_mode(void)
{
@@ -583,13 +587,12 @@ static bool trickle_charge(void)
}
#endif
-#ifdef HAVE_LCD_BITMAP
+#ifdef HAVE_RTC
static bool timedate_set(void)
{
int timedate[7]; /* hour,minute,second,year,month,day,dayofweek */
bool result;
-#ifdef HAVE_RTC
timedate[0] = rtc_read(0x03); /* hour */
timedate[1] = rtc_read(0x02); /* minute */
timedate[2] = rtc_read(0x01); /* second */
@@ -633,11 +636,9 @@ static bool timedate_set(void)
/* day */
timedate[5] = 1;
}
-#endif
result = set_time(str(LANG_TIME),timedate);
-#ifdef HAVE_RTC
if(timedate[0] != -1) {
/* hour */
timedate[0] = ((timedate[0]/10) << 4 | timedate[0]%10) & 0x3f;
@@ -661,7 +662,6 @@ static bool timedate_set(void)
rtc_write(0x04, timedate[6] | (rtc_read(0x04) & 0xf8)); /* dayofweek */
rtc_write(0x00, 0x00); /* 0.1 + 0.01 seconds */
}
-#endif
return result;
}
@@ -768,14 +768,12 @@ static bool language_browse(void)
return rockbox_browse(ROCKBOX_DIR LANG_DIR, SHOW_LNG);
}
-#ifdef HAVE_RECORDER_KEYPAD
+#ifdef HAVE_LCD_BITMAP
static bool font_browse(void)
{
return rockbox_browse(ROCKBOX_DIR FONT_DIR, SHOW_FONT);
}
-#endif
-#ifdef HAVE_LCD_BITMAP
static bool scroll_bar(void)
{
return set_bool( str(LANG_SCROLL_BAR), &global_settings.scrollbar );
@@ -787,6 +785,23 @@ static bool status_bar(void)
}
#endif
+static bool ff_rewind_settings_menu(void)
+{
+ int m;
+ bool result;
+
+ struct menu_items items[] = {
+ { str(LANG_FFRW_STEP), ff_rewind_min_step },
+ { str(LANG_FFRW_ACCEL), ff_rewind_accel },
+ };
+
+ m=menu_init( items, sizeof(items) / sizeof(*items) );
+ result = menu_run(m);
+ menu_exit(m);
+
+ return result;
+}
+
static bool playback_settings_menu(void)
{
int m;
@@ -797,14 +812,13 @@ static bool playback_settings_menu(void)
{ str(LANG_REPEAT), repeat_mode },
{ str(LANG_PLAY_SELECTED), play_selected },
{ str(LANG_RESUME), resume },
- { str(LANG_FFRW_STEP), ff_rewind_min_step },
- { str(LANG_FFRW_ACCEL), ff_rewind_accel },
+ { str(LANG_WIND_MENU), ff_rewind_settings_menu },
{ str(LANG_MP3BUFFER_MARGIN), buffer_margin },
{ str(LANG_FADE_ON_STOP), set_fade_on_stop },
};
bool old_shuffle = global_settings.playlist_shuffle;
-
+
m=menu_init( items, sizeof(items) / sizeof(*items) );
result = menu_run(m);
menu_exit(m);
@@ -868,7 +882,7 @@ static bool reset_settings(void)
done = true;
break;
-#ifdef HAVE_LCD_BITMAP
+#ifdef HAVE_RECORDER_KEYPAD
case BUTTON_OFF:
#else
case BUTTON_STOP:
@@ -899,6 +913,7 @@ static bool fileview_settings_menu(void)
{ str(LANG_CASE_MENU), sort_case },
{ str(LANG_FILTER), dir_filter },
{ str(LANG_FOLLOW), browse_current },
+ { str(LANG_SHOW_ICONS), show_icons },
};
m=menu_init( items, sizeof(items) / sizeof(*items) );
@@ -932,93 +947,211 @@ static bool scroll_settings_menu(void)
return result;
}
-
-
-static bool display_settings_menu(void)
+static bool lcd_settings_menu(void)
{
int m;
bool result;
struct menu_items items[] = {
- { str(LANG_SCROLL_MENU), scroll_settings_menu },
{ str(LANG_BACKLIGHT), backlight_timer },
{ str(LANG_BACKLIGHT_ON_WHEN_CHARGING), backlight_on_when_charging },
- { str(LANG_CONTRAST), contrast },
+ { str(LANG_CAPTION_BACKLIGHT), caption_backlight },
+ { str(LANG_CONTRAST), contrast },
#ifdef HAVE_LCD_BITMAP
- { str(LANG_SCROLL_BAR), scroll_bar },
- { str(LANG_STATUS_BAR), status_bar },
{ str(LANG_INVERT), invert },
- { str(LANG_INVERT_CURSOR), invert_cursor },
{ str(LANG_FLIP_DISPLAY), flip_display },
- { str(LANG_PM_MENU), peak_meter_menu },
- { str(LANG_VOLUME_DISPLAY), volume_type },
- { str(LANG_BATTERY_DISPLAY), battery_type },
+ { str(LANG_INVERT_CURSOR), invert_cursor },
#endif
- { str(LANG_SHOW_ICONS), show_icons },
- { str(LANG_CAPTION_BACKLIGHT), caption_backlight },
};
-
+
m=menu_init( items, sizeof(items) / sizeof(*items) );
result = menu_run(m);
menu_exit(m);
return result;
}
-static bool system_settings_menu(void)
+#ifdef HAVE_LCD_BITMAP
+static bool bars_settings_menu(void)
{
int m;
bool result;
struct menu_items items[] = {
- { str(LANG_SPINDOWN), spindown },
-#ifdef HAVE_MAS3507D
- { str(LANG_LINE_IN), line_in },
+ { str(LANG_SCROLL_BAR), scroll_bar },
+ { str(LANG_STATUS_BAR), status_bar },
+ { str(LANG_VOLUME_DISPLAY), volume_type },
+ { str(LANG_BATTERY_DISPLAY), battery_type },
+ };
+
+ m=menu_init( items, sizeof(items) / sizeof(*items) );
+ result = menu_run(m);
+ menu_exit(m);
+ return result;
+}
#endif
-#ifdef HAVE_ATA_POWER_OFF
- { str(LANG_POWEROFF), poweroff },
+
+
+static bool display_settings_menu(void)
+{
+ int m;
+ bool result;
+
+ struct menu_items items[] = {
+#ifdef HAVE_LCD_BITMAP
+ { str(LANG_CUSTOM_FONT), font_browse },
#endif
- { str(LANG_MAX_FILES_IN_DIR), max_files_in_dir },
- { str(LANG_MAX_FILES_IN_PLAYLIST), max_files_in_playlist },
-#ifndef SIMULATOR
- { str(LANG_BATTERY_CAPACITY), battery_capacity },
+ { str(LANG_WHILE_PLAYING), custom_wps_browse },
+ { str(LANG_LCD_MENU), lcd_settings_menu },
+ { str(LANG_SCROLL_MENU), scroll_settings_menu },
+#ifdef HAVE_LCD_BITMAP
+ { str(LANG_BARS_MENU), bars_settings_menu },
+ { str(LANG_PM_MENU), peak_meter_menu },
#endif
+ };
+
+ m=menu_init( items, sizeof(items) / sizeof(*items) );
+ result = menu_run(m);
+ menu_exit(m);
+ return result;
+}
+
+
+static bool firmware_browse(void)
+{
+ return rockbox_browse(ROCKBOX_DIR, SHOW_MOD);
+}
+
+static bool battery_settings_menu(void)
+{
+ int m;
+ bool result;
+
+ struct menu_items items[] = {
#ifdef HAVE_CHARGE_CTRL
{ str(LANG_DISCHARGE), deep_discharge },
{ str(LANG_TRICKLE_CHARGE), trickle_charge },
#endif
+#ifndef SIMULATOR
+ { str(LANG_BATTERY_CAPACITY), battery_capacity },
+#endif
+ };
+
+ m=menu_init( items, sizeof(items) / sizeof(*items) );
+ result = menu_run(m);
+ menu_exit(m);
+ return result;
+}
+
+static bool disk_settings_menu(void)
+{
+ int m;
+ bool result;
+
+ struct menu_items items[] = {
+ { str(LANG_SPINDOWN), spindown },
+#ifdef HAVE_ATA_POWER_OFF
+ { str(LANG_POWEROFF), poweroff },
+#endif
+ };
+
+ m=menu_init( items, sizeof(items) / sizeof(*items) );
+ result = menu_run(m);
+ menu_exit(m);
+ return result;
+}
+
#ifdef HAVE_LCD_BITMAP
+static bool time_settings_menu(void)
+{
+ int m;
+ bool result;
+
+ struct menu_items items[] = {
{ str(LANG_TIME), timedate_set },
{ str(LANG_TIMEFORMAT), timeformat_set },
+ };
+
+ m=menu_init( items, sizeof(items) / sizeof(*items) );
+ result = menu_run(m);
+ menu_exit(m);
+ return result;
+}
#endif
- { str(LANG_POWEROFF_IDLE), poweroff_idle_timer },
- { str(LANG_CAR_ADAPTER_MODE), car_adapter_mode },
- { str(LANG_RESET), reset_settings },
+
+static bool manage_settings_menu(void)
+{
+ int m;
+ bool result;
+
+ struct menu_items items[] = {
+ { str(LANG_CUSTOM_CFG), custom_cfg_browse },
+ { str(LANG_FIRMWARE), firmware_browse },
+ { str(LANG_RESET), reset_settings },
+ { str(LANG_SAVE_SETTINGS), settings_save_config },
};
-
+
m=menu_init( items, sizeof(items) / sizeof(*items) );
result = menu_run(m);
menu_exit(m);
return result;
}
-bool settings_menu(void)
+static bool limits_settings_menu(void)
{
int m;
bool result;
struct menu_items items[] = {
- { str(LANG_PLAYBACK), playback_settings_menu },
- { str(LANG_CUSTOM_CFG), custom_cfg_browse },
- { str(LANG_WHILE_PLAYING), custom_wps_browse },
- { str(LANG_LANGUAGE), language_browse },
- { str(LANG_FILE), fileview_settings_menu },
- { str(LANG_DISPLAY), display_settings_menu },
-#ifdef HAVE_RECORDER_KEYPAD
- { str(LANG_CUSTOM_FONT), font_browse },
+ { str(LANG_MAX_FILES_IN_DIR), max_files_in_dir },
+ { str(LANG_MAX_FILES_IN_PLAYLIST), max_files_in_playlist },
+ };
+
+ m=menu_init( items, sizeof(items) / sizeof(*items) );
+ result = menu_run(m);
+ menu_exit(m);
+ return result;
+}
+
+
+static bool system_settings_menu(void)
+{
+ int m;
+ bool result;
+
+ struct menu_items items[] = {
+ { str(LANG_BATTERY_MENU), battery_settings_menu },
+ { str(LANG_DISK_MENU), disk_settings_menu },
+#ifdef HAVE_RTC
+ { str(LANG_TIME_MENU), time_settings_menu },
#endif
- { str(LANG_SYSTEM), system_settings_menu },
- { str(LANG_BOOKMARK_SETTINGS),bookmark_settings_menu },
- { str(LANG_SAVE_SETTINGS), settings_save_config },
+ { str(LANG_POWEROFF_IDLE), poweroff_idle_timer },
+ { str(LANG_SLEEP_TIMER), sleeptimer_screen },
+ { str(LANG_LIMITS_MENU), limits_settings_menu },
+#ifdef HAVE_MAS3507D
+ { str(LANG_LINE_IN), line_in },
+#endif
+ { str(LANG_CAR_ADAPTER_MODE), car_adapter_mode },
+ { str(LANG_MANAGE_MENU), manage_settings_menu },
+ };
+
+ m=menu_init( items, sizeof(items) / sizeof(*items) );
+ result = menu_run(m);
+ menu_exit(m);
+ return result;
+}
+
+bool settings_menu(void)
+{
+ int m;
+ bool result;
+
+ struct menu_items items[] = {
+ { str(LANG_PLAYBACK), playback_settings_menu },
+ { str(LANG_FILE), fileview_settings_menu },
+ { str(LANG_DISPLAY), display_settings_menu },
+ { str(LANG_SYSTEM), system_settings_menu },
+ { str(LANG_BOOKMARK_SETTINGS),bookmark_settings_menu },
+ { str(LANG_LANGUAGE), language_browse },
};
m=menu_init( items, sizeof(items) / sizeof(*items) );