diff options
Diffstat (limited to 'apps/plugins/euroconverter.c')
-rw-r--r-- | apps/plugins/euroconverter.c | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/apps/plugins/euroconverter.c b/apps/plugins/euroconverter.c index ccf37ae7e0..a417015606 100644 --- a/apps/plugins/euroconverter.c +++ b/apps/plugins/euroconverter.c @@ -381,8 +381,10 @@ static int euro_menu(void) /* Call when the program end */ -static void euro_exit(void) +static void euro_exit(void *parameter) { + (void)parameter; + //Restore the old pattern (i don't find another way to do this. An idea?) rb->lcd_unlock_pattern(heuro); rb->lcd_unlock_pattern(hhome); @@ -397,6 +399,7 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter) { bool end, pos; long long e,h,old_e,old_h; + int button; /* 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 @@ -439,7 +442,8 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter) /*Main loop*/ while(end!=true) { - switch (rb->button_get(true)) + button = rb->button_get(true); + switch (button) { case BUTTON_MENU|BUTTON_REL: switch (euro_menu()) @@ -586,10 +590,11 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter) } break; - case SYS_USB_CONNECTED: - rb->usb_screen(); - euro_exit(); - return PLUGIN_USB_CONNECTED; + default: + if (rb->default_event_handler_ex(button, euro_exit, NULL) + == SYS_USB_CONNECTED) + return PLUGIN_USB_CONNECTED; + break; } /*Display*/ if (!pos) /*Euro>home*/ @@ -598,7 +603,7 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter) e=mydiv(h,currency[country]); display(e,h,pos); } - euro_exit(); + euro_exit(NULL); return PLUGIN_OK; } |