all repos — mgba @ c32122c1535abf932b346f164d585f87de4509e4

mGBA Game Boy Advance Emulator

Add slot for setting all the log levels at once
Jeffrey Pfau jeffrey@endrift.com
Sat, 18 Oct 2014 01:40:44 -0700
commit

c32122c1535abf932b346f164d585f87de4509e4

parent

093036db76697f59bdb66ea3952d3331d40e1d9e

2 files changed, 13 insertions(+), 1 deletions(-)

jump to
M src/platform/qt/LogView.cppsrc/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.hsrc/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);