fix: Write model name into models.yml when duplicating model (#2224)

* Update model name in the models.yml file (#2214)

* Fix the length of the name.
This commit is contained in:
eshifri
2022-08-26 12:47:53 +10:00
committed by GitHub
parent e97f23a305
commit 4b747caff9
4 changed files with 13 additions and 10 deletions
+2 -2
View File
@@ -554,7 +554,7 @@ class ModelCategoryPageBody : public FormWindow
void createModel()
{
storageCheck(true);
auto model = modelslist.addModel(category, ::createModel(), false);
auto model = modelslist.addModel(category, ::createModel(), nullptr, false);
modelslist.setCurrentModel(model);
new SelectTemplateFolder([=]() {
model->setModelName(g_model.header.name);
@@ -572,7 +572,7 @@ class ModelCategoryPageBody : public FormWindow
MODELS_PATH)) {
sdCopyFile(model->modelFilename, MODELS_PATH, duplicatedFilename,
MODELS_PATH);
auto new_model = modelslist.addModel(category, duplicatedFilename);
auto new_model = modelslist.addModel(category, duplicatedFilename, model->modelName);
addModelButton(new_model);
} else {
POPUP_WARNING("Invalid File"); // TODO: translation