viewButton->setTextAlignment(Qt::AlignHCenter);
viewButton->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled);
+#ifdef ENABLE_DECODE
+ // Decoder page
+ pages->addWidget(get_decoder_settings_form(pages));
+
+ QListWidgetItem *decoderButton = new QListWidgetItem(page_list);
+ decoderButton->setIcon(QIcon(":/icons/add-decoder.svg"));
+ decoderButton->setText(tr("Decoders"));
+ decoderButton->setTextAlignment(Qt::AlignHCenter);
+ decoderButton->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled);
+#endif
+
// About page
pages->addWidget(get_about_page(pages));
return form;
}
+QWidget *Settings::get_decoder_settings_form(QWidget *parent) const
+{
+#ifdef ENABLE_DECODE
+ GlobalSettings settings;
+
+ QWidget *form = new QWidget(parent);
+ QVBoxLayout *form_layout = new QVBoxLayout(form);
+
+ // Decoder settings
+ QGroupBox *decoder_group = new QGroupBox(tr("Decoders"));
+ form_layout->addWidget(decoder_group);
+
+ QFormLayout *decoder_layout = new QFormLayout();
+ decoder_group->setLayout(decoder_layout);
+
+ QCheckBox *initial_state_configurable_cb = new QCheckBox();
+ initial_state_configurable_cb->setChecked(settings.value(GlobalSettings::Key_Dec_InitialStateConfigurable).toBool());
+ connect(initial_state_configurable_cb, SIGNAL(stateChanged(int)), this, SLOT(on_dec_initialStateConfigurable_changed(int)));
+ decoder_layout->addRow(tr("Allow configuration of &initial signal state"), initial_state_configurable_cb);
+
+ return form;
+#else
+ (void)parent;
+#endif
+}
+
#ifdef ENABLE_DECODE
static gint sort_pds(gconstpointer a, gconstpointer b)
{
settings.setValue(GlobalSettings::Key_View_ShowAnalogMinorGrid, state ? true : false);
}
+void Settings::on_dec_initialStateConfigurable_changed(int state)
+{
+ GlobalSettings settings;
+ settings.setValue(GlobalSettings::Key_Dec_InitialStateConfigurable, state ? true : false);
+}
+
} // namespace dialogs
} // namespace pv