utility: loading project via commanlineargument

loading a project via commanline with --project or -p argument
This commit is contained in:
Andreas Stallinger
2016-01-12 13:24:04 +01:00
parent b8faa5506d
commit 46a629358c
7 changed files with 110 additions and 2 deletions
+1
View File
@@ -91,6 +91,7 @@ void Application::loadProject(const FilePath& projectSettingsFilePath)
m_project->loadProject(projectSettingsFilePath);
m_mainView->updateRecentProjectMenu();
m_mainView->hideStartScreen();
}
void Application::refreshProject()
+8 -1
View File
@@ -215,7 +215,7 @@ void ConfigManager::setValues(const std::string& key, const std::vector<bool>& v
setValues(key, stringValues);
}
void ConfigManager::load(const std::shared_ptr<TextAccess> textAccess)
bool ConfigManager::load(const std::shared_ptr<TextAccess> textAccess)
{
std::string text = textAccess->getText();
@@ -225,6 +225,11 @@ void ConfigManager::load(const std::shared_ptr<TextAccess> textAccess)
{
TiXmlHandle docHandle(&doc);
TiXmlNode *rootNode = docHandle.FirstChild("config").ToNode();
if(rootNode == nullptr)
{
LOG_ERROR("No rootelement 'config' in the configfile");
return false;
}
for (TiXmlNode *childNode = rootNode->FirstChild(); childNode; childNode = childNode->NextSibling())
{
parseSubtree(childNode, "");
@@ -233,7 +238,9 @@ void ConfigManager::load(const std::shared_ptr<TextAccess> textAccess)
else
{
LOG_ERROR("Unable to load file.");
return false;
}
return true;
}
void ConfigManager::save(const std::string filepath)
+1 -1
View File
@@ -37,7 +37,7 @@ public:
void setValues(const std::string& key, const std::vector<float>& values);
void setValues(const std::string& key, const std::vector<bool>& values);
void load(const std::shared_ptr<TextAccess> textAccess);
bool load(const std::shared_ptr<TextAccess> textAccess);
void save(const std::string filepath);
std::string toString();