restore backup opens the backup dir
This commit is contained in:
parent
02450b8683
commit
8c55076177
Binary file not shown.
|
@ -50,9 +50,7 @@ void FurnaceGUI::doAction(int what) {
|
|||
if (modified) {
|
||||
showWarning("Unsaved changes! Save changes before opening backup?",GUI_WARN_OPEN_BACKUP);
|
||||
} else {
|
||||
if (load(backupPath)>0) {
|
||||
showError("No backup available! (or unable to open it)");
|
||||
}
|
||||
openFileDialog(GUI_FILE_OPEN_BACKUP);
|
||||
}
|
||||
break;
|
||||
case GUI_ACTION_SAVE:
|
||||
|
|
|
@ -1474,6 +1474,19 @@ void FurnaceGUI::openFileDialog(FurnaceGUIFileDialogs type) {
|
|||
dpiScale
|
||||
);
|
||||
break;
|
||||
case GUI_FILE_OPEN_BACKUP:
|
||||
if (!dirExists(backupPath)) {
|
||||
showError("no backups made yet!");
|
||||
break;
|
||||
}
|
||||
hasOpened=fileDialog->openLoad(
|
||||
"Restore Backup",
|
||||
{"Furnace song", "*.fur"},
|
||||
"Furnace song{.fur}",
|
||||
backupPath,
|
||||
dpiScale
|
||||
);
|
||||
break;
|
||||
case GUI_FILE_SAVE:
|
||||
if (!dirExists(workingDirSong)) workingDirSong=getHomeDir();
|
||||
hasOpened=fileDialog->openSave(
|
||||
|
@ -4375,6 +4388,8 @@ bool FurnaceGUI::loop() {
|
|||
case GUI_FILE_TEST_SAVE:
|
||||
workingDirTest=fileDialog->getPath()+DIR_SEPARATOR_STR;
|
||||
break;
|
||||
case GUI_FILE_OPEN_BACKUP:
|
||||
break;
|
||||
}
|
||||
if (fileDialog->isError()) {
|
||||
#if defined(_WIN32) || defined(__APPLE__)
|
||||
|
@ -4451,6 +4466,7 @@ bool FurnaceGUI::loop() {
|
|||
String copyOfName=fileName;
|
||||
switch (curFileDialog) {
|
||||
case GUI_FILE_OPEN:
|
||||
case GUI_FILE_OPEN_BACKUP:
|
||||
if (load(copyOfName)>0) {
|
||||
showError(fmt::sprintf("Error while loading file! (%s)",lastError));
|
||||
}
|
||||
|
@ -4479,9 +4495,7 @@ bool FurnaceGUI::loop() {
|
|||
nextFile="";
|
||||
break;
|
||||
case GUI_WARN_OPEN_BACKUP:
|
||||
if (load(backupPath)>0) {
|
||||
showError("No backup available! (or unable to open it)");
|
||||
}
|
||||
openFileDialog(GUI_FILE_OPEN_BACKUP);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
@ -5027,18 +5041,14 @@ bool FurnaceGUI::loop() {
|
|||
if (save(curFileName,e->song.isDMF?e->song.version:0)>0) {
|
||||
showError(fmt::sprintf("Error while saving file! (%s)",lastError));
|
||||
} else {
|
||||
if (load(backupPath)>0) {
|
||||
showError("No backup available! (or unable to open it)");
|
||||
}
|
||||
openFileDialog(GUI_FILE_OPEN_BACKUP);
|
||||
}
|
||||
}
|
||||
}
|
||||
ImGui::SameLine();
|
||||
if (ImGui::Button("No")) {
|
||||
ImGui::CloseCurrentPopup();
|
||||
if (load(backupPath)>0) {
|
||||
showError("No backup available! (or unable to open it)");
|
||||
}
|
||||
openFileDialog(GUI_FILE_OPEN_BACKUP);
|
||||
}
|
||||
ImGui::SameLine();
|
||||
if (ImGui::Button("Cancel")) {
|
||||
|
|
|
@ -346,6 +346,7 @@ enum FurnaceGUIMobileScenes {
|
|||
|
||||
enum FurnaceGUIFileDialogs {
|
||||
GUI_FILE_OPEN,
|
||||
GUI_FILE_OPEN_BACKUP,
|
||||
GUI_FILE_SAVE,
|
||||
GUI_FILE_SAVE_DMF,
|
||||
GUI_FILE_SAVE_DMF_LEGACY,
|
||||
|
|
Loading…
Reference in New Issue