diff --git a/extras/Projucer/Source/Utility/jucer_StoredSettings.cpp b/extras/Projucer/Source/Utility/jucer_StoredSettings.cpp index 9d5c651d67..e323498719 100644 --- a/extras/Projucer/Source/Utility/jucer_StoredSettings.cpp +++ b/extras/Projucer/Source/Utility/jucer_StoredSettings.cpp @@ -89,6 +89,7 @@ void StoredSettings::updateGlobalPreferences() { // update 'invisible' global settings updateRecentFiles(); + updateLastWizardFolder(); updateKeyMappings(); } @@ -97,6 +98,11 @@ void StoredSettings::updateRecentFiles() getGlobalProperties().setValue ("recentFiles", recentFiles.toString()); } +void StoredSettings::updateLastWizardFolder() +{ + getGlobalProperties().setValue ("lastWizardFolder", lastWizardFolder.getFullPathName()); +} + void StoredSettings::updateKeyMappings() { getGlobalProperties().removeValue ("keyMappings"); @@ -136,6 +142,8 @@ void StoredSettings::reload() recentFiles.restoreFromString (getGlobalProperties().getValue ("recentFiles")); recentFiles.removeNonExistentFiles(); + lastWizardFolder = getGlobalProperties().getValue ("lastWizardFolder"); + loadSwatchColours(); } diff --git a/extras/Projucer/Source/Utility/jucer_StoredSettings.h b/extras/Projucer/Source/Utility/jucer_StoredSettings.h index 183b7f7483..3462672c4c 100644 --- a/extras/Projucer/Source/Utility/jucer_StoredSettings.h +++ b/extras/Projucer/Source/Utility/jucer_StoredSettings.h @@ -63,6 +63,7 @@ public: //============================================================================== AppearanceSettings appearance; StringArray monospacedFontNames; + File lastWizardFolder; //============================================================================== Value getStoredPath (const Identifier& key); @@ -87,6 +88,7 @@ private: void updateGlobalPreferences(); void updateRecentFiles(); + void updateLastWizardFolder(); void updateKeyMappings(); void loadSwatchColours(); diff --git a/extras/Projucer/Source/Wizards/jucer_NewProjectWizard.h b/extras/Projucer/Source/Wizards/jucer_NewProjectWizard.h index ab7b26e2c9..9674c1ab42 100644 --- a/extras/Projucer/Source/Wizards/jucer_NewProjectWizard.h +++ b/extras/Projucer/Source/Wizards/jucer_NewProjectWizard.h @@ -42,13 +42,16 @@ static Project::Item createSourceGroup (Project& project) static File& getLastWizardFolder() { + if (getAppSettings().lastWizardFolder.isDirectory()) + return getAppSettings().lastWizardFolder; + #if JUCE_WINDOWS - static File lastFolder (File::getSpecialLocation (File::userDocumentsDirectory)); + static File lastFolderFallback (File::getSpecialLocation (File::userDocumentsDirectory)); #else - static File lastFolder (File::getSpecialLocation (File::userHomeDirectory)); + static File lastFolderFallback (File::getSpecialLocation (File::userHomeDirectory)); #endif - return lastFolder; + return lastFolderFallback; } //============================================================================== diff --git a/extras/Projucer/Source/Wizards/jucer_NewProjectWizardComponent.h b/extras/Projucer/Source/Wizards/jucer_NewProjectWizardComponent.h index e97756b15f..3c92be5599 100644 --- a/extras/Projucer/Source/Wizards/jucer_NewProjectWizardComponent.h +++ b/extras/Projucer/Source/Wizards/jucer_NewProjectWizardComponent.h @@ -446,10 +446,15 @@ public: getAppSettings().getStoredPath (Ids::defaultJuceModulePath).setValue (wizard->modulesFolder.getFullPathName()); } + auto projectDir = fileBrowser.getSelectedFile (0); + if (ScopedPointer project = wizard->runWizard (*this, projectName.getText(), - fileBrowser.getSelectedFile (0), + projectDir, modulesPathBox.isUsingGlobalPaths)) + { mw->setProject (project.release()); + getAppSettings().lastWizardFolder = projectDir.getParentDirectory(); + } } }