1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-02-03 03:30:06 +00:00

Introjucer module updater fix.

This commit is contained in:
jules 2013-06-13 16:35:23 +01:00
parent 9772fde950
commit 2ca1f2e704
3 changed files with 15 additions and 1 deletions

View file

@ -486,7 +486,7 @@ public:
bool runModuleUpdate (const String& message)
{
ModuleList list;
list.rescan (ModuleList::getDefaultModulesFolder (nullptr));
list.rescan (ModuleList::getDefaultModulesFolder (mainWindowList.getFrontmostProject()));
JuceUpdater::show (list, mainWindowList.windows[0], message);
ModuleList::setLocalModulesFolder (list.getModulesFolder());

View file

@ -528,3 +528,15 @@ void MainWindowList::sendLookAndFeelChange()
for (int i = windows.size(); --i >= 0;)
windows.getUnchecked(i)->sendLookAndFeelChange();
}
Project* MainWindowList::getFrontmostProject()
{
Desktop& desktop = Desktop::getInstance();
for (int i = 0; i < desktop.getNumComponents(); ++i)
if (MainWindow* const mw = dynamic_cast <MainWindow*> (desktop.getComponent(i)))
if (Project* p = mw->getProject())
return p;
return nullptr;
}

View file

@ -102,6 +102,8 @@ public:
MainWindow* getOrCreateFrontmostWindow();
MainWindow* getOrCreateEmptyWindow();
Project* getFrontmostProject();
void reopenLastProjects();
void saveCurrentlyOpenProjectList();