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
+14 -3
View File
@@ -4,6 +4,7 @@
#include "utility/logging/LogMessage.h"
#include "utility/logging/logging.h"
#include "utility/messaging/type/MessageStatus.h"
#include "utility/Version.h"
std::shared_ptr<LogManager> LogManager::createInstance()
@@ -31,11 +32,21 @@ LogManager::~LogManager()
void LogManager::setLoggingEnabled(bool enabled)
{
m_loggingEnabled = enabled;
if (m_loggingEnabled)
if (m_loggingEnabled != enabled)
{
LOG_INFO("Enabled logging for Coati " + Version::getApplicationVersion().toDisplayString());
if (enabled)
{
LOG_INFO("Enabled logging for Coati " + Version::getApplicationVersion().toDisplayString());
MessageStatus("Enabled console and file logging.").dispatch();
}
else
{
LOG_INFO("Disabled logging");
MessageStatus("Disabled console and file logging.").dispatch();
}
}
m_loggingEnabled = enabled;
}
void LogManager::addLogger(std::shared_ptr<Logger> logger)
@@ -3,13 +3,14 @@
#include "utility/messaging/Message.h"
class MessageRefresh: public Message<MessageRefresh>
class MessageRefresh
: public Message<MessageRefresh>
{
public:
MessageRefresh()
: uiOnly(false)
, all(false)
, reloadSettings(true)
, loadStyle(true)
{
}
@@ -30,9 +31,9 @@ public:
return *this;
}
MessageRefresh& keepSettings()
MessageRefresh& noReloadStyle()
{
reloadSettings = false;
loadStyle = false;
return *this;
}
@@ -50,7 +51,8 @@ public:
bool uiOnly;
bool all;
bool reloadSettings;
bool loadStyle;
};
#endif // MESSAGE_REFRESH_H
@@ -2,13 +2,14 @@
#define MESSAGE_STATUS_H
#include "utility/messaging/Message.h"
#include "utility/utilityString.h"
class MessageStatus
: public Message<MessageStatus>
{
public:
MessageStatus(const std::string& status, bool isError = false, bool showLoader = false)
: status(status)
: status(utility::replace(status, "\n", " "))
, isError(isError)
, showLoader(showLoader)
{