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


Loading…
Cancel
Save