Browse Source

Projucer: Remember the directory of a previously created project

tags/2021-05-28
tpoole 8 years ago
parent
commit
f7bc550f58
4 changed files with 22 additions and 4 deletions
  1. +8
    -0
      extras/Projucer/Source/Utility/jucer_StoredSettings.cpp
  2. +2
    -0
      extras/Projucer/Source/Utility/jucer_StoredSettings.h
  3. +6
    -3
      extras/Projucer/Source/Wizards/jucer_NewProjectWizard.h
  4. +6
    -1
      extras/Projucer/Source/Wizards/jucer_NewProjectWizardComponent.h

+ 8
- 0
extras/Projucer/Source/Utility/jucer_StoredSettings.cpp 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();
}


+ 2
- 0
extras/Projucer/Source/Utility/jucer_StoredSettings.h 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();


+ 6
- 3
extras/Projucer/Source/Wizards/jucer_NewProjectWizard.h 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;
}
//==============================================================================


+ 6
- 1
extras/Projucer/Source/Wizards/jucer_NewProjectWizardComponent.h 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();
}
}
}


Loading…
Cancel
Save