mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-10 23:44:24 +00:00
Projucer: Open any previous projects in the background
This commit is contained in:
parent
98f37e02ae
commit
33845ba917
2 changed files with 8 additions and 3 deletions
|
|
@ -457,7 +457,7 @@ void MainWindowList::openDocument (OpenDocumentManager::Document* doc, bool grab
|
|||
getFrontmostWindow()->getProjectContentComponent()->showDocument (doc, grabFocus);
|
||||
}
|
||||
|
||||
bool MainWindowList::openFile (const File& file)
|
||||
bool MainWindowList::openFile (const File& file, bool openInBackground)
|
||||
{
|
||||
for (int i = windows.size(); --i >= 0;)
|
||||
{
|
||||
|
|
@ -472,12 +472,17 @@ bool MainWindowList::openFile (const File& file)
|
|||
|
||||
if (file.hasFileExtension (Project::projectFileExtension))
|
||||
{
|
||||
auto previousFrontWindow = getFrontmostWindow();
|
||||
|
||||
MainWindow* const w = getOrCreateEmptyWindow();
|
||||
bool ok = w->openFile (file);
|
||||
|
||||
w->makeVisible();
|
||||
avoidSuperimposedWindows (w);
|
||||
|
||||
if (openInBackground && (previousFrontWindow != nullptr))
|
||||
previousFrontWindow->toFront (true);
|
||||
|
||||
return ok;
|
||||
}
|
||||
|
||||
|
|
@ -581,7 +586,7 @@ void MainWindowList::reopenLastProjects()
|
|||
Array<File> projects (getAppSettings().getLastProjects());
|
||||
|
||||
for (int i = 0; i < projects.size(); ++ i)
|
||||
openFile (projects.getReference(i));
|
||||
openFile (projects.getReference(i), true);
|
||||
}
|
||||
|
||||
void MainWindowList::sendLookAndFeelChange()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue