ui: load project via MenuBar

This change adds a MenuBar to QtMainWindow and adds an action for opening a different project settings XML file. The
message MessageLoadProject is thereon used to load a new project in the Application and clearing the Storage.
This commit is contained in:
Eberhard Graether
2014-07-09 15:22:41 +02:00
parent 37f5579649
commit 2009b7526a
13 changed files with 156 additions and 27 deletions
+10 -3
View File
@@ -23,6 +23,8 @@ std::shared_ptr<Application> Application::create(GuiFactory* guiFactory)
ptr->m_componentManager =
ComponentManager::create(guiFactory, ptr->m_mainView.get(), ptr->m_storage, ptr->m_storage);
ptr->m_componentManager->setup();
return ptr;
}
@@ -36,14 +38,19 @@ Application::~Application()
MessageQueue::getInstance()->stopMessageLoop();
}
void Application::loadProject()
void Application::loadProject(const std::string& projectSettingsFilePath)
{
m_componentManager->setup();
m_storage->clear();
m_project = Project::create(m_storage);
m_project->loadProjectSettings("data/ProjectSettings.xml");
m_project->loadProjectSettings(projectSettingsFilePath);
m_project->parseCode();
MessageActivateToken message(1);
message.dispatch();
}
void Application::handleMessage(MessageLoadProject* message)
{
loadProject(message->projectSettingsFilePath);
}