diff options
author | Michiel Van Der Kolk <not.valid@email.address> | 2005-05-08 15:53:19 +0000 |
---|---|---|
committer | Michiel Van Der Kolk <not.valid@email.address> | 2005-05-08 15:53:19 +0000 |
commit | 3176a665d85de39715ee096a1989f4daedc4635a (patch) | |
tree | a72d8cedb597139968ca05dd507743624f1133e4 /apps/plugins | |
parent | 517eb7efa21635e97241200c5c9d4e46aaa9028e (diff) | |
download | rockbox-3176a665d85de39715ee096a1989f4daedc4635a.tar.gz rockbox-3176a665d85de39715ee096a1989f4daedc4635a.zip |
Ladida fix.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@6435 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/plugins')
-rw-r--r-- | apps/plugins/databox/databox.c | 32 |
1 files changed, 24 insertions, 8 deletions
diff --git a/apps/plugins/databox/databox.c b/apps/plugins/databox/databox.c index fe4886f513..51ba86f421 100644 --- a/apps/plugins/databox/databox.c +++ b/apps/plugins/databox/databox.c | |||
@@ -217,7 +217,14 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter) | |||
217 | rb->lcd_update(); | 217 | rb->lcd_update(); |
218 | editor.currentindex=editor.tokencount=readtstream(filename,editor.token,200); | 218 | editor.currentindex=editor.tokencount=readtstream(filename,editor.token,200); |
219 | editing.currentselection=0; | 219 | editing.currentselection=0; |
220 | editing.selecting=editor.currentindex==0 ? 1 : 0; | 220 | editing.selecting=0; |
221 | if(editor.currentindex==0) { | ||
222 | editor.valid=check_tokenstream(editor.token,editor.editingmode); | ||
223 | check_accepted(editor.token,editor.currentindex); | ||
224 | editing.selecting=1; | ||
225 | buildchoices(acceptedmask); | ||
226 | rb->memset(&editing.old_token,0,sizeof(struct token)); | ||
227 | } | ||
221 | do { | 228 | do { |
222 | rb->lcd_clear_display(); | 229 | rb->lcd_clear_display(); |
223 | rb->lcd_update(); | 230 | rb->lcd_update(); |
@@ -285,14 +292,17 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter) | |||
285 | editor.currentindex=(editor.currentindex + | 292 | editor.currentindex=(editor.currentindex + |
286 | editor.tokencount) % (editor.tokencount+1); | 293 | editor.tokencount) % (editor.tokencount+1); |
287 | } | 294 | } |
288 | if(button&BUTTON_RIGHT | 295 | else if(button&BUTTON_RIGHT |
289 | #if CONFIG_KEYPAD == IRIVER_H100_PAD | 296 | #if CONFIG_KEYPAD == IRIVER_H100_PAD |
290 | ||button&BUTTON_UP | 297 | ||button&BUTTON_UP |
291 | #endif | 298 | #endif |
292 | ) { | 299 | ) { |
293 | editor.currentindex=(editor.currentindex+1) % (editor.tokencount+1); | 300 | editor.currentindex=(editor.currentindex+1) % (editor.tokencount+1); |
294 | } | 301 | } |
295 | if(button&BUTTON_SELECT) { | 302 | else if(button&BUTTON_OFF) { |
303 | done=1; | ||
304 | } | ||
305 | else if(button&BUTTON_SELECT) { | ||
296 | editing.selecting=1; | 306 | editing.selecting=1; |
297 | editing.currentselection=0; | 307 | editing.currentselection=0; |
298 | buildchoices(acceptedmask); | 308 | buildchoices(acceptedmask); |
@@ -300,12 +310,18 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter) | |||
300 | } | 310 | } |
301 | } | 311 | } |
302 | } while (!done); | 312 | } while (!done); |
303 | if(writetstream(filename,editor.token)) { | 313 | if(editor.valid&&editor.tokencount>0) { |
304 | rb->splash(HZ*2,true,"Wrote file succesfully ^.^"); | 314 | if(writetstream(filename,editor.token)) { |
305 | return PLUGIN_OK; | 315 | rb->splash(HZ*2,true,"Wrote file succesfully ^.^"); |
316 | return PLUGIN_OK; | ||
317 | } | ||
318 | else { | ||
319 | rb->splash(HZ*2,true,"Error while writing file :("); | ||
320 | return PLUGIN_ERROR; | ||
321 | } | ||
306 | } | 322 | } |
307 | else { | 323 | else { |
308 | rb->splash(HZ*2,true,"Error while writing rsp :("); | 324 | rb->splash(HZ*2,true,"Search query invalid, not saving."); |
309 | return PLUGIN_ERROR; | 325 | return PLUGIN_OK; |
310 | } | 326 | } |
311 | } | 327 | } |