locig: refresh after edit project

* implemented saving project settings force-refreshes the project if something has changed.
* when nothing has changed while editing the project settings, the project is not refreshed anymore.
* new project window is cleared now before it is displayed.
This commit is contained in:
malte_langkabel
2016-01-18 10:59:32 +01:00
parent 3852bb7e5c
commit 743f91e882
11 changed files with 78 additions and 45 deletions
+6 -6
View File
@@ -42,7 +42,7 @@ std::shared_ptr<Application> Application::create(
std::string startupProjectFilePath = ApplicationSettings::getInstance()->getStartupProjectFilePath();
if (startupProjectFilePath.size())
{
MessageLoadProject(startupProjectFilePath).dispatch();
MessageLoadProject(startupProjectFilePath, false).dispatch();
ptr->m_mainView->hideStartScreen();
}
@@ -73,7 +73,7 @@ Application::~Application()
m_mainView->saveLayout();
}
void Application::loadProject(const FilePath& projectSettingsFilePath)
void Application::loadProject(const FilePath& projectSettingsFilePath, bool forceRefresh)
{
MessageStatus("Loading Project: " + projectSettingsFilePath.str()).dispatch();
@@ -88,7 +88,7 @@ void Application::loadProject(const FilePath& projectSettingsFilePath)
m_componentManager->refreshViews();
m_project = Project::create(m_storageCache.get());
m_project->loadProject(projectSettingsFilePath);
m_project->load(projectSettingsFilePath, forceRefresh);
m_mainView->updateRecentProjectMenu();
m_mainView->hideStartScreen();
@@ -101,12 +101,12 @@ void Application::refreshProject()
m_storageCache->clear();
m_componentManager->refreshViews();
m_project->reloadProject();
m_project->reload();
}
void Application::saveProject(const FilePath& projectSettingsFilePath)
{
if (!m_project->saveProject(projectSettingsFilePath))
if (!m_project->save(projectSettingsFilePath))
{
LOG_ERROR("No Project Settings File defined");
}
@@ -138,7 +138,7 @@ void Application::handleMessage(MessageFinishedParsing* message)
void Application::handleMessage(MessageLoadProject* message)
{
loadProject(message->projectSettingsFilePath);
loadProject(message->projectSettingsFilePath, message->forceRefresh);
}
void Application::handleMessage(MessageRefresh* message)