fix: B&W needs to know about spaces as well!
Finishes #645 as model notes with `_` and `0x20` (space) are tested for model notes filename also.
This commit is contained in:
committed by
Peter Feerick
parent
c088d1d2f9
commit
7800a6de42
@@ -65,7 +65,7 @@ void onModelSelectMenu(const char * result)
|
||||
}
|
||||
else if (result == STR_DELETE_MODEL) {
|
||||
char * nametmp = reusableBuffer.modelsel.mainname;
|
||||
strcat_modelname (nametmp, sub);
|
||||
strcat_modelname (nametmp, sub, 0);
|
||||
POPUP_CONFIRMATION(STR_DELETEMODEL, nullptr);
|
||||
SET_WARNING_INFO(nametmp, sizeof(g_model.header.name), 0);
|
||||
}
|
||||
@@ -115,7 +115,7 @@ void menuModelSelect(event_t event)
|
||||
case EVT_KEY_LONG(KEY_EXIT):
|
||||
if (s_copyMode && s_copyTgtOfs == 0 && g_eeGeneral.currModel != sub && modelExists(sub)) {
|
||||
char * nametmp = reusableBuffer.modelsel.mainname;
|
||||
strcat_modelname (nametmp, sub);
|
||||
strcat_modelname (nametmp, sub, 0);
|
||||
POPUP_CONFIRMATION(STR_DELETEMODEL, nullptr);
|
||||
SET_WARNING_INFO(nametmp, sizeof(g_model.header.name), 0);
|
||||
killEvents(event);
|
||||
|
||||
@@ -25,8 +25,14 @@ void menuModelNotes(event_t event)
|
||||
{
|
||||
if (event == EVT_ENTRY) {
|
||||
strcpy(reusableBuffer.viewText.filename, MODELS_PATH "/");
|
||||
char *buf = strcat_currentmodelname(&reusableBuffer.viewText.filename[sizeof(MODELS_PATH)], 0);
|
||||
char *buf = strcat_currentmodelname(
|
||||
&reusableBuffer.viewText.filename[sizeof(MODELS_PATH)], ' ');
|
||||
strcpy(buf, TEXT_EXT);
|
||||
if (!isFileAvailable(reusableBuffer.viewText.filename)) {
|
||||
buf = strcat_currentmodelname(
|
||||
&reusableBuffer.viewText.filename[sizeof(MODELS_PATH)], 0);
|
||||
strcpy(buf, TEXT_EXT);
|
||||
}
|
||||
}
|
||||
|
||||
menuTextView(event);
|
||||
|
||||
+4
-4
@@ -1072,12 +1072,12 @@ char * strcat_zchar(char *dest, const char *name, uint8_t size, const char space
|
||||
|
||||
#if !defined(STORAGE_MODELSLIST)
|
||||
|
||||
#define strcat_modelname(dest, idx) \
|
||||
strcat_zchar(dest, modelHeaders[idx].name, LEN_MODEL_NAME, 0, STR_MODEL, \
|
||||
#define strcat_modelname(dest, idx, spaceSym) \
|
||||
strcat_zchar(dest, modelHeaders[idx].name, LEN_MODEL_NAME, spaceSym, STR_MODEL, \
|
||||
PSIZE(TR_MODEL), idx + 1)
|
||||
|
||||
#define strcat_currentmodelname(dest, foo) \
|
||||
strcat_modelname(dest, g_eeGeneral.currModel)
|
||||
#define strcat_currentmodelname(dest, spaceSym) \
|
||||
strcat_modelname(dest, g_eeGeneral.currModel, spaceSym)
|
||||
|
||||
#else
|
||||
|
||||
|
||||
@@ -450,7 +450,7 @@ const char * eeBackupModel(uint8_t i_fileSrc)
|
||||
}
|
||||
|
||||
buf[sizeof(MODELS_PATH)-1] = '/';
|
||||
strcpy(strcat_modelname(&buf[sizeof(MODELS_PATH)], i_fileSrc), STR_MODELS_EXT);
|
||||
strcpy(strcat_modelname(&buf[sizeof(MODELS_PATH)], i_fileSrc, 0), STR_MODELS_EXT);
|
||||
|
||||
FRESULT result = f_open(&archiveFile, buf, FA_CREATE_ALWAYS | FA_WRITE);
|
||||
if (result != FR_OK) {
|
||||
|
||||
Reference in New Issue
Block a user