From 6364cab316c906a1d7d0bcce16f6a88a0e10c81f Mon Sep 17 00:00:00 2001 From: Andrew Belt Date: Wed, 29 Jun 2022 23:33:57 -0400 Subject: [PATCH] Rename "template" module preset in menu items to "default". Hide template preset in preset list. --- src/app/ModuleWidget.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/app/ModuleWidget.cpp b/src/app/ModuleWidget.cpp index 533732d5..58e4b645 100644 --- a/src/app/ModuleWidget.cpp +++ b/src/app/ModuleWidget.cpp @@ -680,7 +680,7 @@ void ModuleWidget::saveTemplate() { void ModuleWidget::saveTemplateDialog() { if (hasTemplate()) { - std::string message = string::f("Overwrite template preset for %s?", model->getFullName().c_str()); + std::string message = string::f("Overwrite default preset for %s?", model->getFullName().c_str()); if (!osdialog_message(OSDIALOG_INFO, OSDIALOG_OK_CANCEL, message.c_str())) return; } @@ -700,7 +700,7 @@ void ModuleWidget::clearTemplate() { } void ModuleWidget::clearTemplateDialog() { - std::string message = string::f("Delete template preset for %s?", model->getFullName().c_str()); + std::string message = string::f("Delete default preset for %s?", model->getFullName().c_str()); if (!osdialog_message(OSDIALOG_INFO, OSDIALOG_OK_CANCEL, message.c_str())) return; clearTemplate(); @@ -929,8 +929,8 @@ void ModuleWidget::removeAction() { // Create ModulePresetPathItems for each patch in a directory. static void appendPresetItems(ui::Menu* menu, WeakPtr moduleWidget, std::string presetDir) { bool hasPresets = false; - // Note: This is not cached, so opening this menu each time might have a bit of latency. if (system::isDirectory(presetDir)) { + // Note: This is not cached, so opening this menu each time might have a bit of latency. std::vector entries = system::getEntries(presetDir); std::sort(entries.begin(), entries.end()); for (std::string path : entries) { @@ -948,7 +948,7 @@ static void appendPresetItems(ui::Menu* menu, WeakPtr moduleWidget appendPresetItems(menu, moduleWidget, path); })); } - else if (system::getExtension(path) == ".vcvm") { + else if (system::getExtension(path) == ".vcvm" && name != "template") { hasPresets = true; menu->addChild(createMenuItem(name, "", [=]() { @@ -1011,13 +1011,13 @@ void ModuleWidget::createContextMenu() { weakThis->saveDialog(); })); - menu->addChild(createMenuItem("Save template", "", [=]() { + menu->addChild(createMenuItem("Save default", "", [=]() { if (!weakThis) return; weakThis->saveTemplateDialog(); })); - menu->addChild(createMenuItem("Clear template", "", [=]() { + menu->addChild(createMenuItem("Clear default", "", [=]() { if (!weakThis) return; weakThis->clearTemplateDialog();