X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=pv%2Fdialogs%2Fsettings.cpp;h=1730e7ba2ebb78c8625c97073662fc68d0ed3398;hb=85a702806a15852f3684645dffdc38cb30274481;hp=2c2ccfee4504ef5ccb93aeac80e9e089e261dbe8;hpb=daa54986010a11879da11e30aafd3a2739ab7a15;p=pulseview.git diff --git a/pv/dialogs/settings.cpp b/pv/dialogs/settings.cpp index 2c2ccfee..1730e7ba 100644 --- a/pv/dialogs/settings.cpp +++ b/pv/dialogs/settings.cpp @@ -23,6 +23,7 @@ #include #include +#include #include #include #include @@ -169,7 +170,17 @@ QWidget *Settings::get_view_settings_form(QWidget *parent) const cb = create_checkbox(GlobalSettings::Key_View_ShowAnalogMinorGrid, SLOT(on_view_showAnalogMinorGrid_changed(int))); - trace_view_layout->addRow(tr("Show analog minor grid in addition to vdiv grid"), cb); + trace_view_layout->addRow(tr("Show analog minor grid in addition to div grid"), cb); + + QComboBox *thr_disp_mode_cb = new QComboBox(); + thr_disp_mode_cb->addItem(tr("None"), GlobalSettings::ConvThrDispMode_None); + thr_disp_mode_cb->addItem(tr("Background"), GlobalSettings::ConvThrDispMode_Background); + thr_disp_mode_cb->addItem(tr("Dots"), GlobalSettings::ConvThrDispMode_Dots); + thr_disp_mode_cb->setCurrentIndex( + settings.value(GlobalSettings::Key_View_ConversionThresholdDispMode).toInt()); + connect(thr_disp_mode_cb, SIGNAL(currentIndexChanged(int)), + this, SLOT(on_view_conversionThresholdDispMode_changed(int))); + trace_view_layout->addRow(tr("Conversion threshold display mode (analog traces only)"), thr_disp_mode_cb); QSpinBox *default_div_height_sb = new QSpinBox(); default_div_height_sb->setRange(20, 1000); @@ -180,6 +191,15 @@ QWidget *Settings::get_view_settings_form(QWidget *parent) const SLOT(on_view_defaultDivHeight_changed(int))); trace_view_layout->addRow(tr("Default analog trace div height"), default_div_height_sb); + QSpinBox *default_logic_height_sb = new QSpinBox(); + default_logic_height_sb->setRange(5, 1000); + default_logic_height_sb->setSuffix(tr(" pixels")); + default_logic_height_sb->setValue( + settings.value(GlobalSettings::Key_View_DefaultLogicHeight).toInt()); + connect(default_logic_height_sb, SIGNAL(valueChanged(int)), this, + SLOT(on_view_defaultLogicHeight_changed(int))); + trace_view_layout->addRow(tr("Default logic trace height"), default_logic_height_sb); + return form; } @@ -205,6 +225,7 @@ QWidget *Settings::get_decoder_settings_form(QWidget *parent) const return form; #else (void)parent; + return nullptr; #endif } @@ -427,12 +448,24 @@ void Settings::on_view_showAnalogMinorGrid_changed(int state) settings.setValue(GlobalSettings::Key_View_ShowAnalogMinorGrid, state ? true : false); } +void Settings::on_view_conversionThresholdDispMode_changed(int state) +{ + GlobalSettings settings; + settings.setValue(GlobalSettings::Key_View_ConversionThresholdDispMode, state); +} + void Settings::on_view_defaultDivHeight_changed(int value) { GlobalSettings settings; settings.setValue(GlobalSettings::Key_View_DefaultDivHeight, value); } +void Settings::on_view_defaultLogicHeight_changed(int value) +{ + GlobalSettings settings; + settings.setValue(GlobalSettings::Key_View_DefaultLogicHeight, value); +} + void Settings::on_dec_initialStateConfigurable_changed(int state) { GlobalSettings settings;