Browse Source

FileBasedDocument: Show correct error text in alert window if loadDocument fails

v6.1.6
reuk 3 years ago
parent
commit
210cbdca66
No known key found for this signature in database GPG Key ID: 9ADCD339CFC98A11
1 changed files with 3 additions and 5 deletions
  1. +3
    -5
      modules/juce_gui_extra/documents/juce_FileBasedDocument.cpp

+ 3
- 5
modules/juce_gui_extra/documents/juce_FileBasedDocument.cpp View File

@@ -326,7 +326,7 @@ private:
auto oldFile = documentFile;
documentFile = newFile;
auto tidyUp = [parent, newFile, oldFile, showMessageOnFailure, showWaitCursor, completed]
auto tidyUp = [parent, newFile, oldFile, showMessageOnFailure, showWaitCursor, completed] (Result result)
{
if (parent.shouldExitAsyncCallback())
return;
@@ -336,8 +336,6 @@ private:
if (showWaitCursor)
MouseCursor::hideWaitCursor();
auto result = Result::fail (TRANS ("The file doesn't exist"));
if (showMessageOnFailure)
AlertWindow::showMessageBoxAsync (MessageBoxIconType::WarningIcon,
TRANS ("Failed to open file..."),
@@ -373,7 +371,7 @@ private:
return;
}
tidyUp();
tidyUp (result);
};
doLoadDocument (newFile, std::move (afterLoading));
@@ -381,7 +379,7 @@ private:
return;
}
tidyUp();
tidyUp (Result::fail (TRANS ("The file doesn't exist")));
}
//==============================================================================


Loading…
Cancel
Save