Handle example/demo patches as templates
Closes #270 Signed-off-by: falkTX <falktx@falktx.com>
This commit is contained in:
parent
0de51ecba8
commit
a37016969d
3 changed files with 10 additions and 4 deletions
|
@ -151,11 +151,17 @@ void loadDialog()
|
|||
#endif
|
||||
}
|
||||
|
||||
void loadPathDialog(const std::string& path)
|
||||
void loadPathDialog(const std::string& path, const bool asTemplate)
|
||||
{
|
||||
#ifndef HEADLESS
|
||||
promptClear("The current patch is unsaved. Clear it and open the new patch?", [path]() {
|
||||
promptClear("The current patch is unsaved. Clear it and open the new patch?", [path, asTemplate]() {
|
||||
APP->patch->loadAction(path);
|
||||
|
||||
if (asTemplate)
|
||||
{
|
||||
APP->patch->path = "";
|
||||
APP->history->setSaved();
|
||||
}
|
||||
});
|
||||
#endif
|
||||
}
|
||||
|
|
|
@ -58,7 +58,7 @@ std::string getSpecialPath(SpecialPath type);
|
|||
namespace patchUtils {
|
||||
|
||||
void loadDialog();
|
||||
void loadPathDialog(const std::string& path);
|
||||
void loadPathDialog(const std::string& path, bool asTemplate = false);
|
||||
void loadSelectionDialog();
|
||||
void loadTemplateDialog();
|
||||
void revertDialog();
|
||||
|
|
|
@ -176,7 +176,7 @@ struct FileButton : MenuButton {
|
|||
}
|
||||
|
||||
menu->addChild(createMenuItem(label, "", [path]() {
|
||||
patchUtils::loadPathDialog(path);
|
||||
patchUtils::loadPathDialog(path, true);
|
||||
}));
|
||||
}
|
||||
}));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue