summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJens Arnold <amiconn@rockbox.org>2005-05-06 18:12:16 +0000
committerJens Arnold <amiconn@rockbox.org>2005-05-06 18:12:16 +0000
commitcb28941c8c512dc8cbee0590518b5132f7ddc736 (patch)
tree8f6ee78798fa6f4885aac42c6c871b4a9af3d97c
parentdc405cc03f66c0f9dacbe83a66cf99f325cbaf98 (diff)
downloadrockbox-cb28941c8c512dc8cbee0590518b5132f7ddc736.tar.gz
rockbox-cb28941c8c512dc8cbee0590518b5132f7ddc736.zip
Ondio: Better disk information (multivolume support).
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@6408 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--apps/lang/deutsch.lang14
-rw-r--r--apps/lang/english.lang14
-rw-r--r--apps/main_menu.c55
3 files changed, 71 insertions, 12 deletions
diff --git a/apps/lang/deutsch.lang b/apps/lang/deutsch.lang
index 1c625d15f5..0e718c2f56 100644
--- a/apps/lang/deutsch.lang
+++ b/apps/lang/deutsch.lang
@@ -3080,4 +3080,16 @@ id: LANG_LCD_REMOTE_MENU
3080desc: in the display sub menu 3080desc: in the display sub menu
3081eng: "Remote-LCD Einstellungen" 3081eng: "Remote-LCD Einstellungen"
3082voice: "" 3082voice: ""
3083new: \ No newline at end of file 3083new:
3084
3085id: LANG_DISK_NAME_INTERNAL
3086desc: in info menu; name for internal disk with multivolume (keep short!)
3087eng: "Int:"
3088voice: "Intern"
3089new: "Int:"
3090
3091id: LANG_DISK_NAME_MMC
3092desc: in info menu; name for external disk with multivolume (Ondio; keep short!)
3093eng: "MMC:"
3094voice: "Multimediakarte"
3095new: "MMC:"
diff --git a/apps/lang/english.lang b/apps/lang/english.lang
index bc688a3115..423215c830 100644
--- a/apps/lang/english.lang
+++ b/apps/lang/english.lang
@@ -3074,4 +3074,16 @@ id: LANG_LCD_REMOTE_MENU
3074desc: in the display sub menu 3074desc: in the display sub menu
3075eng: "Remote-LCD Settings" 3075eng: "Remote-LCD Settings"
3076voice: "" 3076voice: ""
3077new: \ No newline at end of file 3077new:
3078
3079id: LANG_DISK_NAME_INTERNAL
3080desc: in info menu; name for internal disk with multivolume (keep short!)
3081eng: "Int:"
3082voice: "Internal"
3083new:
3084
3085id: LANG_DISK_NAME_MMC
3086desc: in info menu; name for external disk with multivolume (Ondio; keep short!)
3087eng: "MMC:"
3088voice: "Multimedia card"
3089new:
diff --git a/apps/main_menu.c b/apps/main_menu.c
index d530f4bd74..e1bf424d36 100644
--- a/apps/main_menu.c
+++ b/apps/main_menu.c
@@ -151,15 +151,27 @@ bool show_credits(void)
151#ifdef SIMULATOR 151#ifdef SIMULATOR
152extern bool simulate_usb(void); 152extern bool simulate_usb(void);
153#endif 153#endif
154
155#ifdef HAVE_LCD_CHARCELLS
156#define SIZE_FMT "%s%s"
157#else
158#define SIZE_FMT "%s %s"
159#endif
160
154bool show_info(void) 161bool show_info(void)
155{ 162{
156 char s[32], s2[32]; 163 char s[32], s1[32];
157 long buflen = ((audiobufend - audiobuf) * 2) / 2097; /* avoid overflow */ 164 long buflen = ((audiobufend - audiobuf) * 2) / 2097; /* avoid overflow */
158 int integer, decimal; 165 int integer, decimal;
159 bool done = false; 166 bool done = false;
160 int key; 167 int key;
161 int state = 1; 168 int state = 1;
162 unsigned long size, free; 169 unsigned long size, free;
170#ifdef HAVE_MULTIVOLUME
171 char s2[32];
172 unsigned long size2 = 0;
173 unsigned long free2 = 0;
174#endif
163 175
164 const unsigned char *kbyte_units[] = { 176 const unsigned char *kbyte_units[] = {
165 ID2P(LANG_KILOBYTE), 177 ID2P(LANG_KILOBYTE),
@@ -168,6 +180,10 @@ bool show_info(void)
168 }; 180 };
169 181
170 fat_size( IF_MV2(0,) &size, &free ); 182 fat_size( IF_MV2(0,) &size, &free );
183#ifdef HAVE_MULTIVOLUME
184 if (fat_ismounted(1))
185 fat_size( 1, &size2, &free2 );
186#endif
171 187
172 if (global_settings.talk_menu) 188 if (global_settings.talk_menu)
173 { /* say whatever is reasonable, no real connection to the screen */ 189 { /* say whatever is reasonable, no real connection to the screen */
@@ -180,7 +196,17 @@ bool show_info(void)
180 } 196 }
181 197
182 talk_id(LANG_DISK_FREE_INFO, enqueue); 198 talk_id(LANG_DISK_FREE_INFO, enqueue);
199#ifdef HAVE_MULTIVOLUME
200 talk_id(LANG_DISK_NAME_INTERNAL, true);
201 output_dyn_value(NULL, 0, free, kbyte_units, true);
202 if (size2)
203 {
204 talk_id(LANG_DISK_NAME_MMC, true);
205 output_dyn_value(NULL, 0, free2, kbyte_units, true);
206 }
207#else
183 output_dyn_value(NULL, 0, free, kbyte_units, true); /* NULL == talk */ 208 output_dyn_value(NULL, 0, free, kbyte_units, true); /* NULL == talk */
209#endif
184 210
185#ifdef HAVE_RTC 211#ifdef HAVE_RTC
186 { 212 {
@@ -217,7 +243,7 @@ bool show_info(void)
217 integer, decimal); 243 integer, decimal);
218#endif 244#endif
219 lcd_puts(0, y++, s); 245 lcd_puts(0, y++, s);
220 246
221#ifdef HAVE_CHARGE_CTRL 247#ifdef HAVE_CHARGE_CTRL
222 if (charge_state == 1) 248 if (charge_state == 1)
223 snprintf(s, sizeof(s), str(LANG_BATTERY_CHARGE)); 249 snprintf(s, sizeof(s), str(LANG_BATTERY_CHARGE));
@@ -236,21 +262,30 @@ bool show_info(void)
236 } 262 }
237 263
238 if (state & 2) { 264 if (state & 2) {
265#ifdef HAVE_MULTIVOLUME
266 output_dyn_value(s1, sizeof s1, free, kbyte_units, true);
239 output_dyn_value(s2, sizeof s2, size, kbyte_units, true); 267 output_dyn_value(s2, sizeof s2, size, kbyte_units, true);
240#ifdef HAVE_LCD_CHARCELLS 268 snprintf(s, sizeof s, "%s %s/%s", str(LANG_DISK_NAME_INTERNAL),
241 snprintf(s, sizeof s, "%s%s", str(LANG_DISK_SIZE_INFO), s2); 269 s1, s2);
242#else 270#else
243 snprintf(s, sizeof s, "%s %s", str(LANG_DISK_SIZE_INFO), s2); 271 output_dyn_value(s1, sizeof s1, size, kbyte_units, true);
272 snprintf(s, sizeof s, SIZE_FMT, str(LANG_DISK_SIZE_INFO), s1);
244#endif 273#endif
245 lcd_puts(0, y++, s); 274 lcd_puts(0, y++, s);
246 275
247 output_dyn_value(s2, sizeof s2, free, kbyte_units, true); 276#ifdef HAVE_MULTIVOLUME
248#ifdef HAVE_LCD_CHARCELLS 277 if (size2) {
249 snprintf(s, sizeof s, "%s%s", str(LANG_DISK_FREE_INFO), s2); 278 output_dyn_value(s1, sizeof s1, free2, kbyte_units, true);
279 output_dyn_value(s2, sizeof s2, size2, kbyte_units, true);
280 snprintf(s, sizeof s, "%s %s/%s", str(LANG_DISK_NAME_MMC),
281 s1, s2);
282 lcd_puts(0, y++, s);
283 }
250#else 284#else
251 snprintf(s, sizeof s, "%s %s", str(LANG_DISK_FREE_INFO), s2); 285 output_dyn_value(s1, sizeof s1, free, kbyte_units, true);
252#endif 286 snprintf(s, sizeof s, SIZE_FMT, str(LANG_DISK_FREE_INFO), s1);
253 lcd_puts(0, y++, s); 287 lcd_puts(0, y++, s);
288#endif
254 } 289 }
255 lcd_update(); 290 lcd_update();
256 291