Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

flash upgrade: disable opendialog when flashing

  • Loading branch information...
commit c12d6e2bfc1125beafe3e27055e2141a2dcda308 1 parent f201a79
Xiangfu Liu authored
Showing with 16 additions and 15 deletions.
  1. +16 −15 src/flash.c
View
31 src/flash.c
@@ -40,21 +40,6 @@ static int appid;
static struct filedialog *file_dlg;
static int current_file_to_choose;
-static void flash_filedialog_ok_callback()
-{
- char filepath[384];
-
- get_filedialog_selection(file_dlg, filepath, sizeof(filepath));
- mtk_cmdf(appid, "e%d.set(-text \"%s\")", current_file_to_choose, filepath);
- close_filedialog(file_dlg);
-}
-
-static void opendialog_callback(mtk_event *e, void *arg)
-{
- current_file_to_choose = (int)arg;
- open_filedialog(file_dlg);
-}
-
enum {
FLASH_STATE_READY = 0,
FLASH_STATE_STARTING,
@@ -368,6 +353,22 @@ static void close_callback(mtk_event *e, void *arg)
w_open = 0;
}
+static void flash_filedialog_ok_callback()
+{
+ char filepath[384];
+
+ get_filedialog_selection(file_dlg, filepath, sizeof(filepath));
+ mtk_cmdf(appid, "e%d.set(-text \"%s\")", current_file_to_choose, filepath);
+ close_filedialog(file_dlg);
+}
+
+static void opendialog_callback(mtk_event *e, void *arg)
+{
+ if(flash_busy()) return;
+ current_file_to_choose = (int)arg;
+ open_filedialog(file_dlg);
+}
+
void init_flash()
{
appid = mtk_init_app("Flash");
Please sign in to comment.
Something went wrong with that request. Please try again.