From ed5b06b04c9abbedc5f3c326f057af5f38917151 Mon Sep 17 00:00:00 2001 From: Jens Arnold Date: Sun, 8 May 2005 21:25:16 +0000 Subject: (1) Don't print on invisible lines. (2) Proper message for aborted filename input. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@6443 a1c6a512-1295-4272-9138-f99709370657 --- apps/plugins/databox/databox.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'apps/plugins/databox/databox.c') diff --git a/apps/plugins/databox/databox.c b/apps/plugins/databox/databox.c index 86761cf149..243fd1fdc6 100644 --- a/apps/plugins/databox/databox.c +++ b/apps/plugins/databox/databox.c @@ -68,6 +68,10 @@ void print(char *word, int invert) { printing.position=0; newpos=printing.position+strlen+1; } + /* Fixme: the display code needs to keep the current item visible instead of + * just displaying the first items. */ + if (printing.font_h*printing.line >= LCD_HEIGHT) + return; rb->lcd_putsxy(printing.font_w*printing.position,printing.font_h*printing.line,word); if(invert) rb->lcd_invertrect(printing.font_w*printing.position,printing.font_h*printing.line,printing.font_w*strlen,printing.font_h); @@ -84,7 +88,11 @@ void print(char *word, int invert) { printing.line++; printing.position = 0; newpos = printing.position + strlen + (invert ? 3 : 1); - } + } + /* Fixme: the display code needs to keep the current item visible instead of + * just displaying the first items. */ + if (printing.line >= 2) + return; if (invert) { rb->lcd_putc(printing.position, printing.line, MARKER_LEFT); rb->lcd_puts(printing.position + 1, printing.line, word); @@ -226,8 +234,8 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter) databox_init(); filename[0] = '\0'; if(rb->kbd_input(filename, sizeof filename)) { - rb->splash(HZ*2, true, "Something went wrong with the filename.. exiting.."); - return PLUGIN_ERROR; + rb->splash(HZ*2, true, "Cancelled..."); + return PLUGIN_OK; } /* add / in front if omitted */ if(filename[0]!='/') { @@ -278,7 +286,7 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter) break; case BUTTON_RIGHT: -#ifdef BUTTON_DOWN +#ifdef BUTTON_UP case BUTTON_UP: #endif if (editing.selecting) -- cgit v1.2.3