Add slot for setting all the log levels at once
Jeffrey Pfau jeffrey@endrift.com
Sat, 18 Oct 2014 01:40:44 -0700
2 files changed,
13 insertions(+),
1 deletions(-)
M
src/platform/qt/LogView.cpp
→
src/platform/qt/LogView.cpp
@@ -39,6 +39,18 @@ m_ui.view->clear();
m_lines = 0; } +void LogView::setLevels(int levels) { + m_logLevel = levels; + + m_ui.levelDebug->setCheckState(levels & GBA_LOG_DEBUG ? Qt::Checked : Qt::Unchecked); + m_ui.levelStub->setCheckState(levels & GBA_LOG_STUB ? Qt::Checked : Qt::Unchecked); + m_ui.levelInfo->setCheckState(levels & GBA_LOG_INFO ? Qt::Checked : Qt::Unchecked); + m_ui.levelWarn->setCheckState(levels & GBA_LOG_WARN ? Qt::Checked : Qt::Unchecked); + m_ui.levelError->setCheckState(levels & GBA_LOG_ERROR ? Qt::Checked : Qt::Unchecked); + m_ui.levelFatal->setCheckState(levels & GBA_LOG_FATAL ? Qt::Checked : Qt::Unchecked); + m_ui.levelGameError->setCheckState(levels & GBA_LOG_GAME_ERROR ? Qt::Checked : Qt::Unchecked); +} + void LogView::setLevelDebug(bool set) { if (set) { setLevel(GBA_LOG_DEBUG);
M
src/platform/qt/LogView.h
→
src/platform/qt/LogView.h
@@ -19,9 +19,9 @@ LogView(QWidget* parent = nullptr);
public slots: void postLog(int level, const QString& log); + void setLevels(int levels); void clear(); -private slots: void setLevelDebug(bool); void setLevelStub(bool); void setLevelInfo(bool);