mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-10 23:44:24 +00:00
Projucer: Only close window if one was opened when creating a project from clipboard contents
This commit is contained in:
parent
7f4b6e3288
commit
3536cf969f
1 changed files with 14 additions and 3 deletions
|
|
@ -1154,12 +1154,23 @@ void ProjucerApplication::createNewProjectFromClipboard()
|
|||
tempFile.create();
|
||||
tempFile.appendText (SystemClipboard::getTextFromClipboard());
|
||||
|
||||
if (! mainWindowList.openFile (tempFile))
|
||||
String errorString;
|
||||
|
||||
if (! isPIPFile (tempFile))
|
||||
{
|
||||
AlertWindow::showMessageBoxAsync (AlertWindow::WarningIcon, "Error", "Couldn't create project from clipboard contents.");
|
||||
tempFile.deleteFile();
|
||||
errorString = "Clipboard does not contain a valid PIP.";
|
||||
}
|
||||
else if (! mainWindowList.openFile (tempFile))
|
||||
{
|
||||
errorString = "Couldn't create project from clipboard contents.";
|
||||
mainWindowList.closeWindow (mainWindowList.windows.getLast());
|
||||
}
|
||||
|
||||
if (errorString.isNotEmpty())
|
||||
{
|
||||
AlertWindow::showMessageBoxAsync (AlertWindow::WarningIcon, "Error", errorString);
|
||||
tempFile.deleteFile();
|
||||
}
|
||||
}
|
||||
|
||||
void ProjucerApplication::createNewPIP()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue