forked from len0rd/rockbox
gee, i thought i committed this o.o.
Proper aborting editing for databox... git-svn-id: svn://svn.rockbox.org/rockbox/trunk@6453 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
97599d3e47
commit
09d82dbed8
1 changed files with 6 additions and 3 deletions
|
@ -214,7 +214,7 @@ int writetstream(char *filename,struct token *token) {
|
||||||
/* this is the plugin entry point */
|
/* this is the plugin entry point */
|
||||||
enum plugin_status plugin_start(struct plugin_api* api, void* parameter)
|
enum plugin_status plugin_start(struct plugin_api* api, void* parameter)
|
||||||
{
|
{
|
||||||
int button,done=0;
|
int button,done=0,abort=0;
|
||||||
char filename[100],buf[100];
|
char filename[100],buf[100];
|
||||||
/* this macro should be called as the first thing you do in the plugin.
|
/* this macro should be called as the first thing you do in the plugin.
|
||||||
it test that the api version and model the plugin was compiled for
|
it test that the api version and model the plugin was compiled for
|
||||||
|
@ -332,7 +332,7 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter)
|
||||||
editing.selecting=0;
|
editing.selecting=0;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
done=1;
|
abort=1;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
@ -344,10 +344,13 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter)
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
} while (!done);
|
} while (!done&&!abort);
|
||||||
#ifdef HAVE_LCD_BITMAP
|
#ifdef HAVE_LCD_BITMAP
|
||||||
rb->lcd_setfont(FONT_UI);
|
rb->lcd_setfont(FONT_UI);
|
||||||
#endif
|
#endif
|
||||||
|
if(abort)
|
||||||
|
return PLUGIN_OK;
|
||||||
|
|
||||||
if(editor.valid&&editor.tokencount>0) {
|
if(editor.valid&&editor.tokencount>0) {
|
||||||
if(writetstream(filename,editor.token)) {
|
if(writetstream(filename,editor.token)) {
|
||||||
rb->splash(HZ*2,true,"Wrote file succesfully ^.^");
|
rb->splash(HZ*2,true,"Wrote file succesfully ^.^");
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue