#include "globalsettings.hpp"
#include <QApplication>
+#include <QDebug>
#include <QFontMetrics>
#include <QString>
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";
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<GlobalSettingsInterface*> GlobalSettings::callbacks_;
bool GlobalSettings::tracking_ = false;
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))
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)
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);