If no WIZARD are present, do not display anything (#4173)
* If no WIZARD are present, do not display anything * Cosmetics * More cosmetics ;) * String cleanup * Bertrand's feedbacks
This commit is contained in:
@@ -107,9 +107,9 @@ void setCurrentCategory(unsigned int index)
|
||||
#define WIZARD_ICON_Y 110
|
||||
#define WIZARD_TEXT_Y 195
|
||||
|
||||
uint8_t getWizardNumber()
|
||||
uint8_t getWizardCount()
|
||||
{
|
||||
uint8_t wizNbr=0;
|
||||
uint8_t wizCnt=0;
|
||||
DIR dir;
|
||||
static FILINFO fno;
|
||||
|
||||
@@ -121,25 +121,26 @@ uint8_t getWizardNumber()
|
||||
break;
|
||||
}
|
||||
if (fno.fattrib & AM_DIR) {
|
||||
wizNbr++;
|
||||
wizCnt++;
|
||||
}
|
||||
}
|
||||
}
|
||||
return wizNbr;
|
||||
return wizCnt;
|
||||
}
|
||||
|
||||
bool menuModelWizard(event_t event)
|
||||
{
|
||||
static uint8_t wizardSelected;
|
||||
static uint8_t wizardNumber;
|
||||
static uint8_t wizardSelected = 0;
|
||||
static uint8_t wizardCnt = getWizardCount();
|
||||
bool executeMe = false;
|
||||
uint8_t first = 0;
|
||||
DIR dir;
|
||||
static FILINFO fno;
|
||||
char wizpath[MAX_WIZARD_NAME_LEN];
|
||||
|
||||
if(wizardNumber == 0) {
|
||||
wizardNumber = getWizardNumber();
|
||||
if (wizardCnt == 0) {
|
||||
chainMenu(menuModelSelect);
|
||||
return false;
|
||||
}
|
||||
|
||||
switch(event) {
|
||||
@@ -156,7 +157,7 @@ bool menuModelWizard(event_t event)
|
||||
break;
|
||||
|
||||
case EVT_ROTARY_RIGHT:
|
||||
if (wizardSelected < wizardNumber-1) {
|
||||
if (wizardSelected < wizardCnt-1) {
|
||||
wizardSelected++;
|
||||
}
|
||||
if (wizardSelected > 3) {
|
||||
@@ -210,10 +211,6 @@ bool menuModelWizard(event_t event)
|
||||
}
|
||||
}
|
||||
f_closedir(&dir);
|
||||
if(wizardNumber == 0) {
|
||||
lcdDrawText(40, LCD_H / 2, STR_SDCARD_NOWIZ);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -502,7 +502,6 @@ const pm_char STR_DELETE_ERROR[] PROGMEM = TR_DELETE_ERROR;
|
||||
const pm_char STR_SDCARD_ERROR[] PROGMEM = TR_SDCARD_ERROR;
|
||||
const pm_char STR_NO_SDCARD[] PROGMEM = TR_NO_SDCARD;
|
||||
const pm_char STR_SDCARD_FULL[] PROGMEM = TR_SDCARD_FULL;
|
||||
const pm_char STR_SDCARD_NOWIZ[] PROGMEM = TR_SDCARD_NOWIZ;
|
||||
const pm_char STR_INCOMPATIBLE[] PROGMEM = TR_INCOMPATIBLE;
|
||||
const pm_char STR_LOGS_PATH[] PROGMEM = LOGS_PATH;
|
||||
const pm_char STR_LOGS_EXT[] PROGMEM = LOGS_EXT;
|
||||
|
||||
@@ -726,7 +726,6 @@ extern const pm_char STR_RESET_BTN[];
|
||||
extern const pm_char STR_SDCARD_ERROR[];
|
||||
extern const pm_char STR_NO_SDCARD[];
|
||||
extern const pm_char STR_SDCARD_FULL[];
|
||||
extern const pm_char STR_SDCARD_NOWIZ[];
|
||||
extern const pm_char STR_INCOMPATIBLE[];
|
||||
extern const pm_char STR_LOGS_PATH[];
|
||||
extern const pm_char STR_LOGS_EXT[];
|
||||
|
||||
@@ -954,7 +954,6 @@
|
||||
#define TR_SDCARD_ERROR "Chyba SD karty"
|
||||
#define TR_NO_SDCARD "Není SD karta"
|
||||
#define TR_SDCARD_FULL "Plná SD karta"
|
||||
#define TR_SDCARD_NOWIZ "No wizard found on SD Card"
|
||||
#define TR_INCOMPATIBLE "Nekompatibilní"
|
||||
#define TR_WARNING "KONTROLA"
|
||||
#define TR_EEPROMWARN "EEPROM"
|
||||
|
||||
@@ -958,7 +958,6 @@
|
||||
#define TR_SDCARD_ERROR "SD-Kartenfehler"
|
||||
#define TR_NO_SDCARD "Keine SD-Karte"
|
||||
#define TR_SDCARD_FULL "SD-Karte voll"
|
||||
#define TR_SDCARD_NOWIZ "No wizard found on SD Card"
|
||||
#define TR_INCOMPATIBLE "Nicht kompatibel"
|
||||
#define TR_WARNING "WARNUNG"
|
||||
#define TR_EEPROMWARN "EEPROM"
|
||||
|
||||
@@ -929,7 +929,6 @@
|
||||
#define TR_SDCARD_ERROR TR("SD error", "SD card error")
|
||||
#define TR_NO_SDCARD "No SD card"
|
||||
#define TR_SDCARD_FULL "SD card full"
|
||||
#define TR_SDCARD_NOWIZ "No wizard found on SD Card"
|
||||
#define TR_INCOMPATIBLE "Incompatible"
|
||||
#define TR_WARNING "WARNING"
|
||||
#define TR_EEPROMWARN "EEPROM"
|
||||
|
||||
@@ -902,7 +902,6 @@
|
||||
#define TR_SDCARD_ERROR "SDCARD Error"
|
||||
#define TR_NO_SDCARD "No SDCARD"
|
||||
#define TR_SDCARD_FULL "SD Card Full"
|
||||
#define TR_SDCARD_NOWIZ "No wizard found on SD Card"
|
||||
#define TR_INCOMPATIBLE "Incompatible"
|
||||
#define TR_WARNING "AVISO"
|
||||
#define TR_EEPROMWARN "EEPROM"
|
||||
|
||||
@@ -902,7 +902,6 @@
|
||||
#define TR_SDCARD_ERROR "SDCARD Error"
|
||||
#define TR_NO_SDCARD "No SDCARD"
|
||||
#define TR_SDCARD_FULL "SD Card Full"
|
||||
#define TR_SDCARD_NOWIZ "No wizard found on SD Card"
|
||||
#define TR_INCOMPATIBLE "Incompatible"
|
||||
#define TR_WARNING "WARNING"
|
||||
#define TR_EEPROMWARN "FINSKA"
|
||||
|
||||
@@ -936,7 +936,6 @@
|
||||
#define TR_SDCARD_ERROR "Erreur carte SD"
|
||||
#define TR_NO_SDCARD "Carte SD indisponible"
|
||||
#define TR_SDCARD_FULL "Carte SD pleine"
|
||||
#define TR_SDCARD_NOWIZ "No wizard found on SD Card"
|
||||
#define TR_INCOMPATIBLE "Incompatible"
|
||||
#define TR_WARNING "ALERTE"
|
||||
#define TR_EEPROMWARN "EEPROM"
|
||||
|
||||
@@ -937,7 +937,6 @@
|
||||
#define TR_SDCARD_ERROR "Errore SD"
|
||||
#define TR_NO_SDCARD "No SDCARD"
|
||||
#define TR_SDCARD_FULL "SD Card Piena"
|
||||
#define TR_SDCARD_NOWIZ "No wizard found on SD Card"
|
||||
#define TR_INCOMPATIBLE "Incompatibile"
|
||||
#define TR_WARNING "AVVISO"
|
||||
#define TR_EEPROMWARN "EEPROM"
|
||||
|
||||
@@ -931,7 +931,6 @@
|
||||
#define TR_SDCARD_ERROR "SD-Kaart fout"
|
||||
#define TR_NO_SDCARD "Geen SD-Kaart"
|
||||
#define TR_SDCARD_FULL "SD-Kaart vol"
|
||||
#define TR_SDCARD_NOWIZ "No wizard found on SD Card"
|
||||
#define TR_INCOMPATIBLE "Niet compatibel"
|
||||
#define TR_WARNING "MELDING"
|
||||
#define TR_EEPROMWARN "EEPROM"
|
||||
|
||||
@@ -939,7 +939,6 @@
|
||||
#define TR_SDCARD_ERROR "Błąd karty SD"
|
||||
#define TR_NO_SDCARD "Brak karty SD"
|
||||
#define TR_SDCARD_FULL "Karta Pełna "
|
||||
#define TR_SDCARD_NOWIZ "No wizard found on SD Card"
|
||||
#define TR_INCOMPATIBLE "Niekompatybilne"
|
||||
#define TR_WARNING "UWAGA"
|
||||
#define TR_EEPROMWARN "EEPROM"
|
||||
|
||||
@@ -897,7 +897,6 @@
|
||||
#define TR_SDCARD_ERROR "SDCARD Erro"
|
||||
#define TR_NO_SDCARD "Sem SDCARD"
|
||||
#define TR_SDCARD_FULL "SD Card Full"
|
||||
#define TR_SDCARD_NOWIZ "No wizard found on SD Card"
|
||||
#define TR_INCOMPATIBLE "Incompativel"
|
||||
#define TR_WARNING "AVISO"
|
||||
#define TR_EEPROMWARN "EEPROM"
|
||||
|
||||
@@ -941,7 +941,6 @@
|
||||
#define TR_SDCARD_ERROR "SDCARD-fel"
|
||||
#define TR_NO_SDCARD "SDCARD saknas"
|
||||
#define TR_SDCARD_FULL "SD-kort Fullt"
|
||||
#define TR_SDCARD_NOWIZ "No wizard found on SD Card"
|
||||
#define TR_INCOMPATIBLE "Inkompatibel"
|
||||
#define TR_WARNING "VARNING"
|
||||
#define TR_EEPROMWARN "EEPROM"
|
||||
|
||||
Reference in New Issue
Block a user