Browse Source

Add "Save a copy" to File menu.

tags/v2.0.6
Andrew Belt 2 years ago
parent
commit
6ef77b1b88
3 changed files with 9 additions and 3 deletions
  1. +1
    -1
      include/patch.hpp
  2. +4
    -0
      src/app/MenuBar.cpp
  3. +4
    -2
      src/patch.cpp

+ 1
- 1
include/patch.hpp View File

@@ -33,7 +33,7 @@ struct Manager {
/** Saves the patch and nothing else. */
void save(std::string path);
void saveDialog();
void saveAsDialog();
void saveAsDialog(bool setPath = true);
void saveTemplateDialog();
void saveAutosave();
void cleanAutosave();


+ 4
- 0
src/app/MenuBar.cpp View File

@@ -97,6 +97,10 @@ struct FileButton : MenuButton {
APP->patch->saveAsDialog();
}));

menu->addChild(createMenuItem("Save a copy", "", []() {
APP->patch->saveAsDialog(false);
}));

menu->addChild(createMenuItem("Save template", "", []() {
APP->patch->saveTemplateDialog();
}));


+ 4
- 2
src/patch.cpp View File

@@ -126,7 +126,7 @@ void Manager::saveDialog() {
}


void Manager::saveAsDialog() {
void Manager::saveAsDialog(bool setPath) {
std::string dir;
std::string filename;
if (this->path == "") {
@@ -156,7 +156,9 @@ void Manager::saveAsDialog() {
}

APP->history->setSaved();
this->path = path;
if (setPath) {
this->path = path;
}

try {
save(path);


Loading…
Cancel
Save