X-Git-Url: http://git.code-monkey.de/?a=blobdiff_plain;f=pv%2Fglobalsettings.cpp;h=088a6e27bda0701771e75c8a33c41debc89ed7f2;hb=d13d95b3eaee713cc4eabbc0682ca545b4c31800;hp=1a589fe9cf0459b986d88f2b5dfaa3398a1ba710;hpb=d0c0573b3ee694827a747727f862c5f91736ca05;p=pulseview.git diff --git a/pv/globalsettings.cpp b/pv/globalsettings.cpp index 1a589fe..088a6e2 100644 --- a/pv/globalsettings.cpp +++ b/pv/globalsettings.cpp @@ -20,6 +20,7 @@ #include "globalsettings.hpp" #include +#include #include #include @@ -39,6 +40,8 @@ const QString GlobalSettings::Key_View_ConversionThresholdDispMode = "View_Conve const QString GlobalSettings::Key_View_DefaultDivHeight = "View_DefaultDivHeight"; const QString GlobalSettings::Key_View_DefaultLogicHeight = "View_DefaultLogicHeight"; const QString GlobalSettings::Key_Dec_InitialStateConfigurable = "Dec_InitialStateConfigurable"; +const QString GlobalSettings::Key_Log_BufferSize = "Log_BufferSize"; +const QString GlobalSettings::Key_Log_NotifyOfStacktrace = "Log_NotifyOfStacktrace"; vector GlobalSettings::callbacks_; bool GlobalSettings::tracking_ = false; @@ -71,6 +74,14 @@ void GlobalSettings::set_defaults_where_needed() if (!contains(Key_View_DefaultLogicHeight)) setValue(Key_View_DefaultLogicHeight, 2 * QFontMetrics(QApplication::font()).height()); + + // Default to 500 lines of backlog + if (!contains(Key_Log_BufferSize)) + setValue(Key_Log_BufferSize, 500); + + // Notify user of existing stack trace by default + if (!contains(Key_Log_NotifyOfStacktrace)) + setValue(Key_Log_NotifyOfStacktrace, true); } void GlobalSettings::add_change_handler(GlobalSettingsInterface *cb) @@ -96,6 +107,8 @@ void GlobalSettings::setValue(const QString &key, const QVariant &value) QSettings::setValue(key, value); + qDebug().noquote() << "Setting" << key << "changed to" << value; + // Call all registered callbacks for (GlobalSettingsInterface *cb : callbacks_) cb->on_setting_changed(key, value);