From 9eb0525dab04aa8c41e71db1290daf3e5048746b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Mr=C3=A1zek?= Date: Mon, 18 Dec 2017 01:19:43 +0100 Subject: NOISSUE preserve log page checkbox state when the instance window is closed Only for a single session, not between sessions. --- api/logic/launch/LogModel.cpp | 18 ++++++++++++++++++ api/logic/launch/LogModel.h | 6 ++++++ 2 files changed, 24 insertions(+) (limited to 'api/logic/launch') diff --git a/api/logic/launch/LogModel.cpp b/api/logic/launch/LogModel.cpp index 042feeab..72b076e9 100644 --- a/api/logic/launch/LogModel.cpp +++ b/api/logic/launch/LogModel.cpp @@ -69,6 +69,11 @@ void LogModel::suspend(bool suspend) m_suspended = suspend; } +bool LogModel::suspended() +{ + return m_suspended; +} + void LogModel::clear() { beginResetModel(); @@ -147,3 +152,16 @@ void LogModel::setOverflowMessage(const QString& overflowMessage) { m_overflowMessage = overflowMessage; } + +void LogModel::setLineWrap(bool state) +{ + if(m_lineWrap != state) + { + m_lineWrap = state; + } +} + +bool LogModel::wrapLines() const +{ + return m_lineWrap; +} diff --git a/api/logic/launch/LogModel.h b/api/logic/launch/LogModel.h index 57cd23b0..e6deac89 100644 --- a/api/logic/launch/LogModel.h +++ b/api/logic/launch/LogModel.h @@ -17,7 +17,9 @@ public: void append(MessageLevel::Enum, QString line); void clear(); + void suspend(bool suspend); + bool suspended(); QString toPlainText(); @@ -26,6 +28,9 @@ public: void setStopOnOverflow(bool stop); void setOverflowMessage(const QString & overflowMessage); + void setLineWrap(bool state); + bool wrapLines() const; + enum Roles { LevelRole = Qt::UserRole @@ -48,6 +53,7 @@ private: /* data */ bool m_stopOnOverflow = false; QString m_overflowMessage = "OVERFLOW"; bool m_suspended = false; + bool m_lineWrap = true; private: Q_DISABLE_COPY(LogModel) -- cgit v1.2.3