X-Git-Url: http://git.code-monkey.de/?a=blobdiff_plain;f=pv%2Fdialogs%2Fsettings.cpp;h=1730e7ba2ebb78c8625c97073662fc68d0ed3398;hb=90ee1ed9a90bc0651f86ee4af07e0958572f86da;hp=d3ed1f4eb086e639096bacd896c25f889b92ea95;hpb=28ceff251c776bcf99eafae691e70a521af15957;p=pulseview.git diff --git a/pv/dialogs/settings.cpp b/pv/dialogs/settings.cpp index d3ed1f4..1730e7b 100644 --- a/pv/dialogs/settings.cpp +++ b/pv/dialogs/settings.cpp @@ -23,11 +23,13 @@ #include #include +#include #include #include #include #include #include +#include #include #include #include @@ -133,6 +135,7 @@ QCheckBox *Settings::create_checkbox(const QString& key, const char* slot) const QWidget *Settings::get_view_settings_form(QWidget *parent) const { + GlobalSettings settings; QCheckBox *cb; QWidget *form = new QWidget(parent); @@ -149,9 +152,9 @@ QWidget *Settings::get_view_settings_form(QWidget *parent) const SLOT(on_view_colouredBG_changed(int))); trace_view_layout->addRow(tr("Use coloured trace &background"), cb); - cb = create_checkbox(GlobalSettings::Key_View_AlwaysZoomToFit, - SLOT(on_view_alwaysZoomToFit_changed(int))); - trace_view_layout->addRow(tr("Constantly perform &zoom-to-fit during capture"), cb); + cb = create_checkbox(GlobalSettings::Key_View_ZoomToFitDuringAcq, + SLOT(on_view_zoomToFitDuringAcq_changed(int))); + trace_view_layout->addRow(tr("Constantly perform &zoom-to-fit during acquisition"), cb); cb = create_checkbox(GlobalSettings::Key_View_ZoomToFitAfterAcq, SLOT(on_view_zoomToFitAfterAcq_changed(int))); @@ -167,7 +170,35 @@ 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); + default_div_height_sb->setSuffix(tr(" pixels")); + default_div_height_sb->setValue( + settings.value(GlobalSettings::Key_View_DefaultDivHeight).toInt()); + connect(default_div_height_sb, SIGNAL(valueChanged(int)), this, + 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; } @@ -194,6 +225,7 @@ QWidget *Settings::get_decoder_settings_form(QWidget *parent) const return form; #else (void)parent; + return nullptr; #endif } @@ -380,10 +412,10 @@ void Settings::on_page_changed(QListWidgetItem *current, QListWidgetItem *previo pages->setCurrentIndex(page_list->row(current)); } -void Settings::on_view_alwaysZoomToFit_changed(int state) +void Settings::on_view_zoomToFitDuringAcq_changed(int state) { GlobalSettings settings; - settings.setValue(GlobalSettings::Key_View_AlwaysZoomToFit, state ? true : false); + settings.setValue(GlobalSettings::Key_View_ZoomToFitDuringAcq, state ? true : false); } void Settings::on_view_zoomToFitAfterAcq_changed(int state) @@ -416,6 +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;