src: Added more status messages and some fixes

* Elide status bar messages to avoid window resize window
* Fixed status view clearing when switching projects
* Refactored app setting loading
* Replace newline characters with spaces in status view
This commit is contained in:
Eberhard Graether
2016-12-13 01:41:06 +01:00
parent 790afcf572
commit 48ece50eca
17 changed files with 100 additions and 48 deletions
+11 -7
View File
@@ -70,6 +70,8 @@ void Application::destroyInstance()
void Application::loadSettings()
{
MessageStatus("Load settings: " + UserPaths::getAppSettingsPath()).dispatch();
std::shared_ptr<ApplicationSettings> settings = ApplicationSettings::getInstance();
settings->load(FilePath(UserPaths::getAppSettingsPath()));
@@ -162,13 +164,13 @@ void Application::createAndLoadProject(const FilePath& projectSettingsFilePath)
else
{
LOG_ERROR_STREAM(<< "Failed to load project.");
MessageStatus("Failed to load project.", true).dispatch();
MessageStatus("Failed to load project: " + projectSettingsFilePath.str(), true).dispatch();
}
}
catch (...)
{
LOG_ERROR_STREAM(<< "Failed to load project.");
MessageStatus("Failed to load project.", true).dispatch();
MessageStatus("Failed to load project: " + projectSettingsFilePath.str(), true).dispatch();
}
}
@@ -198,6 +200,8 @@ void Application::handleMessage(MessageActivateWindow* message)
void Application::handleMessage(MessageEnteredLicense* message)
{
MessageStatus("Found valid license key, unlocked application.").dispatch();
m_isInTrial = false;
}
@@ -215,8 +219,6 @@ void Application::handleMessage(MessageLoadProject* message)
{
TRACE("app load project");
loadSettings();
FilePath projectSettingsFilePath(message->projectSettingsFilePath);
if (projectSettingsFilePath.empty())
{
@@ -241,9 +243,9 @@ void Application::handleMessage(MessageRefresh* message)
{
TRACE("app refresh");
if (message->reloadSettings)
if (message->loadStyle)
{
loadSettings();
loadStyle(ApplicationSettings::getInstance()->getColorSchemePath());
}
if (m_hasGUI)
@@ -259,8 +261,10 @@ void Application::handleMessage(MessageRefresh* message)
void Application::handleMessage(MessageSwitchColorScheme* message)
{
MessageStatus("Switch color scheme: " + message->colorSchemePath.str()).dispatch();
loadStyle(message->colorSchemePath);
MessageRefresh().refreshUiOnly().keepSettings().dispatch();
MessageRefresh().refreshUiOnly().noReloadStyle().dispatch();
}
void Application::startMessagingAndScheduling()