X-Git-Url: https://sigrok.org/gitweb/?p=pulseview.git;a=blobdiff_plain;f=pv%2Fglobalsettings.cpp;h=9f20b2694968942a2a0e1da9a38dd920707f4d1a;hp=936082909230676a8326f8f328d92dd5f028459d;hb=f228f00ed2c11ce4c9c36e0b758132a075e251da;hpb=bcb4c327ee9b8d2172d126429ba017884d079d4c diff --git a/pv/globalsettings.cpp b/pv/globalsettings.cpp index 93608290..9f20b269 100644 --- a/pv/globalsettings.cpp +++ b/pv/globalsettings.cpp @@ -20,6 +20,7 @@ #include "globalsettings.hpp" #include +#include #include #include @@ -31,7 +32,7 @@ namespace pv { const QString GlobalSettings::Key_View_ZoomToFitDuringAcq = "View_ZoomToFitDuringAcq"; const QString GlobalSettings::Key_View_ZoomToFitAfterAcq = "View_ZoomToFitAfterAcq"; const QString GlobalSettings::Key_View_TriggerIsZeroTime = "View_TriggerIsZeroTime"; -const QString GlobalSettings::Key_View_ColouredBG = "View_ColouredBG"; +const QString GlobalSettings::Key_View_ColoredBG = "View_ColoredBG"; const QString GlobalSettings::Key_View_StickyScrolling = "View_StickyScrolling"; const QString GlobalSettings::Key_View_ShowSamplingPoints = "View_ShowSamplingPoints"; const QString GlobalSettings::Key_View_ShowAnalogMinorGrid = "View_ShowAnalogMinorGrid"; @@ -40,6 +41,7 @@ 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; @@ -57,9 +59,9 @@ void GlobalSettings::set_defaults_where_needed() if (!contains(Key_View_ZoomToFitAfterAcq)) setValue(Key_View_ZoomToFitAfterAcq, true); - // Enable coloured trace backgrounds by default - if (!contains(Key_View_ColouredBG)) - setValue(Key_View_ColouredBG, true); + // Enable colored trace backgrounds by default + if (!contains(Key_View_ColoredBG)) + setValue(Key_View_ColoredBG, true); // Enable showing sampling points by default if (!contains(Key_View_ShowSamplingPoints)) @@ -76,6 +78,10 @@ void GlobalSettings::set_defaults_where_needed() // 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) @@ -101,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);