From 277c1cae37c28fceb7483dde0bc11e024d515f2f Mon Sep 17 00:00:00 2001 From: philmoz Date: Wed, 28 Dec 2022 11:15:10 +1100 Subject: [PATCH] fix(color): Clear Lua lcd buffer and display 'Loading...' (#2916) * Clear LCD buffer before use for standalone Lua scripts. * Fix rebase merge issues. * Add translation. * Add translation. * Add translations. * Add translation/ Co-authored-by: Phil Mitchell --- radio/src/gui/colorlcd/standalone_lua.cpp | 2 ++ radio/src/translations.cpp | 1 + radio/src/translations.h | 1 + radio/src/translations/cn.h | 1 + radio/src/translations/cz.h | 1 + radio/src/translations/da.h | 1 + radio/src/translations/de.h | 2 +- radio/src/translations/en.h | 1 + radio/src/translations/es.h | 2 +- radio/src/translations/fi.h | 1 + radio/src/translations/fr.h | 1 + radio/src/translations/it.h | 1 + radio/src/translations/jp.h | 1 + radio/src/translations/nl.h | 1 + radio/src/translations/pl.h | 1 + radio/src/translations/pt.h | 1 + radio/src/translations/se.h | 1 + 17 files changed, 18 insertions(+), 2 deletions(-) diff --git a/radio/src/gui/colorlcd/standalone_lua.cpp b/radio/src/gui/colorlcd/standalone_lua.cpp index 793fcec77..5d54816a7 100644 --- a/radio/src/gui/colorlcd/standalone_lua.cpp +++ b/radio/src/gui/colorlcd/standalone_lua.cpp @@ -56,6 +56,8 @@ StandaloneLuaWindow::StandaloneLuaWindow() : lcdBuffer(BMP_RGB565, LCD_W, LCD_H), popup({50, 73, LCD_W - 100, LCD_H - 146}) { + lcdBuffer.clear(); + lcdBuffer.drawText(LCD_W / 2, LCD_H / 2 - 20, STR_LOADING, FONT(L)|COLOR_THEME_PRIMARY2|CENTERED); lv_obj_clear_flag(lvobj, LV_OBJ_FLAG_SCROLLABLE); lv_obj_clear_flag(lvobj, LV_OBJ_FLAG_CLICK_FOCUSABLE); diff --git a/radio/src/translations.cpp b/radio/src/translations.cpp index d3870fab4..c57845cbf 100644 --- a/radio/src/translations.cpp +++ b/radio/src/translations.cpp @@ -815,6 +815,7 @@ const char STR_MODULES_RX_VERSION[] = TR_MODULES_RX_VERSION; const char STR_LEFT_STICK[] = TR_LEFT_STICK; const char STR_SHOW_MIXER_MONITORS[] = TR_SHOW_MIXER_MONITORS; const char STR_MODEL_QUICK_SELECT[] = TR_MODEL_QUICK_SELECT; +const char STR_LOADING[] = TR_LOADING; #endif #if !defined(COLORLCD) diff --git a/radio/src/translations.h b/radio/src/translations.h index 0521b0a65..c22ae3ac4 100644 --- a/radio/src/translations.h +++ b/radio/src/translations.h @@ -724,6 +724,7 @@ extern const char STR_MODULES_RX_VERSION[]; extern const char STR_LEFT_STICK[]; extern const char STR_SHOW_MIXER_MONITORS[]; extern const char STR_MODEL_QUICK_SELECT[]; +extern const char STR_LOADING[]; #endif extern const char STR_EXECUTE_FILE[]; extern const char STR_DELETE_FILE[]; diff --git a/radio/src/translations/cn.h b/radio/src/translations/cn.h index 902a0de16..004b4b753 100644 --- a/radio/src/translations/cn.h +++ b/radio/src/translations/cn.h @@ -761,6 +761,7 @@ #define TR_BAUDRATE "波特率" #define TR_SAMPLE_MODE "采样模式" #define TR_SAMPLE_MODES "标准","OneBit" +#define TR_LOADING "加载中..." #if defined(COLORLCD) #define TR_MODEL_QUICK_SELECT "快速选择模型" diff --git a/radio/src/translations/cz.h b/radio/src/translations/cz.h index 1b3645634..7020c24ae 100644 --- a/radio/src/translations/cz.h +++ b/radio/src/translations/cz.h @@ -779,6 +779,7 @@ #define TR_BAUDRATE "Baudrate" #define TR_SAMPLE_MODE "Sample Mode" #define TR_SAMPLE_MODES "Normal","OneBit" +#define TR_LOADING "Načítání..." #if defined(COLORLCD) #define TR_MODEL_QUICK_SELECT "Rychlý výběr modelu" diff --git a/radio/src/translations/da.h b/radio/src/translations/da.h index 72950c267..1ec4330c6 100644 --- a/radio/src/translations/da.h +++ b/radio/src/translations/da.h @@ -766,6 +766,7 @@ #define TR_BAUDRATE "Baudrate" #define TR_SAMPLE_MODE "Måle tilstand" #define TR_SAMPLE_MODES "Normal","EnBit" +#define TR_LOADING "Indlæser..." #if defined(COLORLCD) #define TR_MODEL_QUICK_SELECT "Hurtigvalg af model" diff --git a/radio/src/translations/de.h b/radio/src/translations/de.h index e553e3888..5126f6d1d 100644 --- a/radio/src/translations/de.h +++ b/radio/src/translations/de.h @@ -760,8 +760,8 @@ #define TR_BAUDRATE "Baudrate" #define TR_MAXBAUDRATE "Max Baud" #define TR_SAMPLE_MODE "Abtastmodus" - #define TR_SAMPLE_MODES "Normal","OneBit" +#define TR_LOADING "Wird geladen..." #if defined(COLORLCD) #define TR_MODEL_QUICK_SELECT "schnelle Modellauswahl" diff --git a/radio/src/translations/en.h b/radio/src/translations/en.h index 70458bbb9..5f0c98d2d 100644 --- a/radio/src/translations/en.h +++ b/radio/src/translations/en.h @@ -761,6 +761,7 @@ #define TR_BAUDRATE "Baudrate" #define TR_SAMPLE_MODE "Sample Mode" #define TR_SAMPLE_MODES "Normal","OneBit" +#define TR_LOADING "Loading..." #if defined(COLORLCD) #define TR_MODEL_QUICK_SELECT "Model quick select" diff --git a/radio/src/translations/es.h b/radio/src/translations/es.h index e0de6227c..ebb7e6692 100644 --- a/radio/src/translations/es.h +++ b/radio/src/translations/es.h @@ -760,9 +760,9 @@ #define TR_TIME "Hora" #define TR_MAXBAUDRATE "Máx bauds" #define TR_BAUDRATE "Baudrate" - #define TR_SAMPLE_MODE "Modo de muestra" #define TR_SAMPLE_MODES "Normal","OneBit" +#define TR_LOADING "Loading..." #if defined(COLORLCD) #define TR_MODEL_QUICK_SELECT "Model quick select" diff --git a/radio/src/translations/fi.h b/radio/src/translations/fi.h index dbe1447cc..77375cc6f 100644 --- a/radio/src/translations/fi.h +++ b/radio/src/translations/fi.h @@ -788,6 +788,7 @@ #define TR_BAUDRATE "Baudrate" #define TR_SAMPLE_MODE "Sample Mode" #define TR_SAMPLE_MODES "Normal","OneBit" +#define TR_LOADING "Loading..." #if defined(COLORLCD) #define TR_MODEL_QUICK_SELECT "Mallin pikavalinta" diff --git a/radio/src/translations/fr.h b/radio/src/translations/fr.h index 4fbedca28..853a2342b 100644 --- a/radio/src/translations/fr.h +++ b/radio/src/translations/fr.h @@ -782,6 +782,7 @@ #define TR_BAUDRATE "Baudrate" #define TR_SAMPLE_MODE "Sample Mode" #define TR_SAMPLE_MODES "Normal""OneBit" +#define TR_LOADING "Loading..." #if defined(COLORLCD) #define TR_MODEL_QUICK_SELECT "Model quick select" diff --git a/radio/src/translations/it.h b/radio/src/translations/it.h index a2479cc0d..f62fb7c24 100644 --- a/radio/src/translations/it.h +++ b/radio/src/translations/it.h @@ -762,6 +762,7 @@ #define TR_BAUDRATE "Baudrate" #define TR_SAMPLE_MODE "Modo Semplice" #define TR_SAMPLE_MODES "Normale","OneBit" +#define TR_LOADING "Caricamento..." #if defined(COLORLCD) #define TR_MODEL_QUICK_SELECT "Selezione veloce modello" diff --git a/radio/src/translations/jp.h b/radio/src/translations/jp.h index c5a208a36..9bda975f3 100644 --- a/radio/src/translations/jp.h +++ b/radio/src/translations/jp.h @@ -761,6 +761,7 @@ #define TR_BAUDRATE "ボーレート" #define TR_SAMPLE_MODE "サンプルモード" #define TR_SAMPLE_MODES "標準","OneBit" +#define TR_LOADING "読み込み中..." #if defined(COLORLCD) #define TR_MODEL_QUICK_SELECT "モデル クイックセレクト" diff --git a/radio/src/translations/nl.h b/radio/src/translations/nl.h index c9ef045c3..bfaa30646 100644 --- a/radio/src/translations/nl.h +++ b/radio/src/translations/nl.h @@ -767,6 +767,7 @@ #define TR_BAUDRATE "Baudrate" #define TR_SAMPLE_MODE "Sample Mode" #define TR_SAMPLE_MODES "Normal""OneBit" +#define TR_LOADING "Loading..." #if defined(COLORLCD) #define TR_MODEL_QUICK_SELECT "Model quick select" diff --git a/radio/src/translations/pl.h b/radio/src/translations/pl.h index 19eb63608..fbae86230 100644 --- a/radio/src/translations/pl.h +++ b/radio/src/translations/pl.h @@ -758,6 +758,7 @@ #define TR_BAUDRATE "Baudrate" #define TR_SAMPLE_MODE "Sample Mode" #define TR_SAMPLE_MODES "Normal","OneBit" +#define TR_LOADING "Ładowanie..." #if defined(COLORLCD) #define TR_MODEL_QUICK_SELECT "Szybki wybór modelu" diff --git a/radio/src/translations/pt.h b/radio/src/translations/pt.h index 20c2774aa..054cec671 100644 --- a/radio/src/translations/pt.h +++ b/radio/src/translations/pt.h @@ -764,6 +764,7 @@ #define TR_BAUDRATE "Baudrate" #define TR_SAMPLE_MODE "Sample Mode" #define TR_SAMPLE_MODES "Normal","OneBit" +#define TR_LOADING "Loading..." #if defined(COLORLCD) #define TR_MODEL_QUICK_SELECT "Model quick select" diff --git a/radio/src/translations/se.h b/radio/src/translations/se.h index 8afb612ce..ed7515c47 100644 --- a/radio/src/translations/se.h +++ b/radio/src/translations/se.h @@ -802,6 +802,7 @@ #define TR_MAXBAUDRATE "Max bauds" #define TR_SAMPLE_MODE TR("Sample mod.", "Sample Mode") #define TR_SAMPLE_MODES "Normal","OneBit" +#define TR_LOADING "Laddar..." #if defined(COLORLCD) #define TR_MODEL_QUICK_SELECT "Snabbval av modell"