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:
3djc
2016-12-30 18:20:46 +01:00
committed by Bertrand Songis
parent 1eead1504c
commit 1d3b6721c6
14 changed files with 10 additions and 26 deletions
+10 -13
View File
@@ -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;
}
-1
View File
@@ -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;
-1
View File
@@ -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[];
-1
View File
@@ -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"
-1
View File
@@ -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"
-1
View File
@@ -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"
-1
View File
@@ -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"
-1
View File
@@ -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"
-1
View File
@@ -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"
-1
View File
@@ -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"
-1
View File
@@ -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"
-1
View File
@@ -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"
-1
View File
@@ -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"
-1
View File
@@ -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"