1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-13 00:04:19 +00:00

Projucer: Remember the directory of a previously created project

This commit is contained in:
tpoole 2017-08-21 14:27:40 +01:00
parent 69868df248
commit f7bc550f58
4 changed files with 22 additions and 4 deletions

View file

@ -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();
}

View file

@ -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();

View file

@ -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;
}
//==============================================================================

View file

@ -446,10 +446,15 @@ public:
getAppSettings().getStoredPath (Ids::defaultJuceModulePath).setValue (wizard->modulesFolder.getFullPathName());
}
auto projectDir = fileBrowser.getSelectedFile (0);
if (ScopedPointer<Project> project = wizard->runWizard (*this, projectName.getText(),
fileBrowser.getSelectedFile (0),
projectDir,
modulesPathBox.isUsingGlobalPaths))
{
mw->setProject (project.release());
getAppSettings().lastWizardFolder = projectDir.getParentDirectory();
}
}
}