Persist show signal values state between program executions
MODIFY
src/processortab.cpp
src/processortab.cpp
@@ -251,8 +251,11 @@ void ProcessorTab::setupSimulatorActions(QToolBar* controlToolbar) {
// Setup processor-tab only actions
m_displayValuesAction = new QAction("Show processor signal values", this);
m_displayValuesAction->setCheckable(true);
- m_displayValuesAction->setChecked(false);
- connect(m_displayValuesAction, &QAction::triggered, m_vsrtlWidget, &vsrtl::VSRTLWidget::setOutputPortValuesVisible);
+ connect(m_displayValuesAction, &QAction::toggled, m_vsrtlWidget, [=](bool checked) {
+ RipesSettings::setValue(RIPES_SETTING_SHOWSIGNALS, QVariant::fromValue(checked));
+ m_vsrtlWidget->setOutputPortValuesVisible(checked);
+ });
+ m_displayValuesAction->setChecked(RipesSettings::value(RIPES_SETTING_SHOWSIGNALS).toBool());
const QIcon tableIcon = QIcon(":/icons/spreadsheet.svg");
m_pipelineDiagramAction = new QAction(tableIcon, "Show pipeline diagram", this);

MODIFY
src/ripessettings.cpp
src/ripessettings.cpp
@@ -52,6 +52,7 @@ const std::map<QString, QVariant> s_defaultSettings = {
{RIPES_SETTING_FOLLOW_EXEC, "true"},
{RIPES_SETTING_SOURCECODE, ""},
{RIPES_SETTING_DARKMODE, false},
+ {RIPES_SETTING_SHOWSIGNALS, false},
{RIPES_SETTING_INPUT_TYPE, static_cast<unsigned>(SourceType::Assembly)},
{RIPES_SETTING_AUTOCLOCK_INTERVAL, 100},

MODIFY
src/ripessettings.h
src/ripessettings.h
@@ -44,6 +44,7 @@ namespace Ripes {
#define RIPES_SETTING_INPUT_TYPE ("input_type")
#define RIPES_SETTING_SOURCECODE ("sourcecode")
#define RIPES_SETTING_DARKMODE ("darkmode")
+#define RIPES_SETTING_SHOWSIGNALS ("show_signals")
#define RIPES_SETTING_AUTOCLOCK_INTERVAL ("autoclock_interval")
#define RIPES_SETTING_EDITORREGS ("editor_regs")

Persist show signal values state between program executions