mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-26 02:14:22 +00:00
FileBasedDocument: Show correct error text in alert window if loadDocument fails
This commit is contained in:
parent
cccb3d360a
commit
210cbdca66
1 changed files with 3 additions and 5 deletions
|
|
@ -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…
Add table
Add a link
Reference in a new issue