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;
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
void on_view_stickyScrolling_changed(int state);
void on_view_showSamplingPoints_changed(int state);
void on_view_showAnalogMinorGrid_changed(int state);
+ void on_dec_initialStateConfigurable_changed(int state);
private:
DeviceManager &device_manager_;
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_Dec_InitialStateConfigurable = "Dec_InitialStateConfigurable";
multimap< QString, function<void(QVariant)> > GlobalSettings::callbacks_;
bool GlobalSettings::tracking_ = false;
static const QString Key_View_StickyScrolling;
static const QString Key_View_ShowSamplingPoints;
static const QString Key_View_ShowAnalogMinorGrid;
+ static const QString Key_Dec_InitialStateConfigurable;
public:
GlobalSettings();
#include "decodetrace.hpp"
+#include <pv/globalsettings.hpp>
#include <pv/data/decode/annotation.hpp>
#include <pv/data/decode/decoder.hpp>
#include <pv/data/decoderstack.hpp>
QFormLayout *form)
{
const GSList *l;
+ GlobalSettings settings;
assert(dec);
const srd_decoder *const decoder = dec->decoder();
hlayout->addWidget(combo);
hlayout->addWidget(combo_initial_pin);
+ if (!settings.value(GlobalSettings::Key_Dec_InitialStateConfigurable).toBool())
+ combo_initial_pin->hide();
+
decoder_form->addRow(tr("<b>%1</b> (%2) *")
.arg(QString::fromUtf8(pdch->name),
QString::fromUtf8(pdch->desc)), hlayout);
hlayout->addWidget(combo);
hlayout->addWidget(combo_initial_pin);
+ if (!settings.value(GlobalSettings::Key_Dec_InitialStateConfigurable).toBool())
+ combo_initial_pin->hide();
+
decoder_form->addRow(tr("<b>%1</b> (%2)")
.arg(QString::fromUtf8(pdch->name),
QString::fromUtf8(pdch->desc)), hlayout);