UI: ProjectSettingsUI
ProjectSettingsUI for creation of new Projects + StartScreen design update
This commit is contained in:
+10
-1
@@ -61,9 +61,18 @@ void Application::loadProject(const std::string& projectSettingsFilePath)
|
||||
m_componentManager->refreshViews();
|
||||
|
||||
m_project = Project::create(m_storageCache.get());
|
||||
|
||||
m_project->loadProjectSettings(projectSettingsFilePath);
|
||||
m_project->parseCode();
|
||||
|
||||
std::vector<std::string> recentProjects = ApplicationSettings::getInstance()->getRecentProjects();
|
||||
recentProjects.erase(std::find(recentProjects.begin(),recentProjects.end(),projectSettingsFilePath));
|
||||
recentProjects.insert(recentProjects.begin(),projectSettingsFilePath);
|
||||
if(recentProjects.size() > 7)
|
||||
{
|
||||
recentProjects.pop_back();
|
||||
}
|
||||
ApplicationSettings::getInstance()->setRecentProjects(recentProjects);
|
||||
ApplicationSettings::getInstance()->save("data/ApplicationSettings.xml");
|
||||
}
|
||||
|
||||
void Application::loadSource(const std::string& sourceDirectoryPath)
|
||||
|
||||
@@ -100,3 +100,12 @@ void ApplicationSettings::setCodeSnippetExpandRange(int range)
|
||||
ApplicationSettings::ApplicationSettings()
|
||||
{
|
||||
}
|
||||
|
||||
std::vector<std::string> ApplicationSettings::getRecentProjects() const {
|
||||
std::vector<std::string> recentProjects;
|
||||
return getValues("recentProjects/projectFilePath", recentProjects);
|
||||
}
|
||||
|
||||
bool ApplicationSettings::setRecentProjects(const std::vector<std::string> &recentProjects) {
|
||||
return setValues("recentProjects/projectFilePath", recentProjects);
|
||||
}
|
||||
|
||||
@@ -29,6 +29,10 @@ public:
|
||||
std::string getColorSchemePath() const;
|
||||
void setColorSchemePath(const std::string& colorSchemePath);
|
||||
|
||||
//recent projects
|
||||
std::vector<std::string> getRecentProjects() const;
|
||||
bool setRecentProjects(const std::vector<std::string>& recentProjects);
|
||||
|
||||
// code
|
||||
int getCodeTabWidth() const;
|
||||
void setCodeTabWidth(int codeTabWidth);
|
||||
|
||||
@@ -78,3 +78,13 @@ std::vector<std::string> ProjectSettings::getSourceExtensions() const
|
||||
defaultValues.push_back(".cpp");
|
||||
return getValues("source/Extensions/SourceExtensions", defaultValues);
|
||||
}
|
||||
|
||||
bool ProjectSettings::setHeaderExtensions(const std::vector<std::string> &headerExtensions)
|
||||
{
|
||||
return setValues("source/Extensions/HeaderExtensions", headerExtensions);
|
||||
}
|
||||
|
||||
bool ProjectSettings::setSourceExtensions(const std::vector<std::string> &sourceExtensions)
|
||||
{
|
||||
return setValues("source/Extensions/SourceExtensions", sourceExtensions);
|
||||
}
|
||||
|
||||
@@ -31,6 +31,9 @@ public:
|
||||
std::vector<std::string> getHeaderExtensions() const;
|
||||
std::vector<std::string> getSourceExtensions() const;
|
||||
|
||||
bool setHeaderExtensions(const std::vector<std::string>& headerExtensions);
|
||||
bool setSourceExtensions(const std::vector<std::string>& sourceExtensions);
|
||||
|
||||
private:
|
||||
ProjectSettings();
|
||||
ProjectSettings(const ProjectSettings&);
|
||||
|
||||
Reference in New Issue
Block a user