Store autoclocking interval in settings
MODIFY
src/processortab.cpp
src/processortab.cpp
@@ -223,9 +223,11 @@ void ProcessorTab::setupSimulatorActions(QToolBar* controlToolbar) {
m_autoClockInterval->setRange(1, 10000);
m_autoClockInterval->setSuffix(" ms");
m_autoClockInterval->setToolTip("Auto clock interval");
- connect(m_autoClockInterval, qOverload<int>(&QSpinBox::valueChanged),
- [timer](int msec) { timer->setInterval(msec); });
- m_autoClockInterval->setValue(100);
+ connect(m_autoClockInterval, qOverload<int>(&QSpinBox::valueChanged), [timer](int msec) {
+ RipesSettings::setValue(RIPES_SETTING_AUTOCLOCK_INTERVAL, msec);
+ timer->setInterval(msec);
+ });
+ m_autoClockInterval->setValue(RipesSettings::value(RIPES_SETTING_AUTOCLOCK_INTERVAL).toInt());
controlToolbar->addWidget(m_autoClockInterval);
const QIcon runIcon = QIcon(":/icons/run.svg");

MODIFY
src/ripessettings.cpp
src/ripessettings.cpp
@@ -37,7 +37,8 @@ const std::map<QString, QVariant> s_defaultSettings = {
{RIPES_SETTING_FOLLOW_EXEC, "true"},
{RIPES_SETTING_SOURCECODE, ""},
{RIPES_SETTING_DARKMODE, false},
- {RIPES_SETTING_INPUT_TYPE, static_cast<unsigned>(SourceType::Assembly)}};
+ {RIPES_SETTING_INPUT_TYPE, static_cast<unsigned>(SourceType::Assembly)},
+ {RIPES_SETTING_AUTOCLOCK_INTERVAL, 100}};
void SettingObserver::setValue(const QVariant& v) {
QSettings settings;

MODIFY
src/ripessettings.h
src/ripessettings.h
@@ -40,6 +40,7 @@ namespace Ripes {
#define RIPES_SETTING_INPUT_TYPE ("input_type")
#define RIPES_SETTING_SOURCECODE ("sourcecode")
#define RIPES_SETTING_DARKMODE ("darkmode")
+#define RIPES_SETTING_AUTOCLOCK_INTERVAL ("autoclock_interval")
// ============= Definitions of all default settings within Ripes ==============
const extern std::map<QString, QVariant> s_defaultSettings;

Store autoclocking interval in settings