]> sigrok.org Git - pulseview.git/blobdiff - pv/dialogs/settings.cpp
Rework decoder infrastructure
[pulseview.git] / pv / dialogs / settings.cpp
index 1cd7d23c8bf83068e97a91a1e6d518feb528d34b..9854af4fe67a8b2a2e5712154435fb19a17f48cc 100644 (file)
@@ -240,7 +240,7 @@ QWidget *Settings::get_general_settings_form(QWidget *parent) const
        if (current_style.isEmpty())
                style_cb->setCurrentIndex(0);
        else
-               style_cb->setCurrentIndex(style_cb->findText(current_style, 0));
+               style_cb->setCurrentIndex(style_cb->findText(current_style, nullptr));
 
        connect(style_cb, SIGNAL(currentIndexChanged(int)),
                this, SLOT(on_general_style_changed(int)));
@@ -382,6 +382,10 @@ QWidget *Settings::get_decoder_settings_form(QWidget *parent)
                SLOT(on_dec_initialStateConfigurable_changed(int)));
        decoder_layout->addRow(tr("Allow configuration of &initial signal state"), cb);
 
+       cb = create_checkbox(GlobalSettings::Key_Dec_AlwaysShowAllRows,
+               SLOT(on_dec_alwaysshowallrows_changed(int)));
+       decoder_layout->addRow(tr("Always show all &rows, even if no annotation is visible"), cb);
+
        // Annotation export settings
        ann_export_format_ = new QLineEdit();
        ann_export_format_->setText(
@@ -389,7 +393,7 @@ QWidget *Settings::get_decoder_settings_form(QWidget *parent)
        connect(ann_export_format_, SIGNAL(textChanged(const QString&)),
                this, SLOT(on_dec_exportFormat_changed(const QString&)));
        decoder_layout->addRow(tr("Annotation export format"), ann_export_format_);
-       QLabel *description_1 = new QLabel(tr("%s = sample range; %d: decoder name; %c: row name; %q: use quotations marks"));
+       QLabel *description_1 = new QLabel(tr("%s = sample range; %d: decoder name; %r: row name; %q: use quotation marks"));
        description_1->setAlignment(Qt::AlignRight);
        decoder_layout->addRow(description_1);
        QLabel *description_2 = new QLabel(tr("%1: longest annotation text; %a: all annotation texts"));
@@ -725,6 +729,12 @@ void Settings::on_dec_exportFormat_changed(const QString &text)
        GlobalSettings settings;
        settings.setValue(GlobalSettings::Key_Dec_ExportFormat, text);
 }
+
+void Settings::on_dec_alwaysshowallrows_changed(int state)
+{
+       GlobalSettings settings;
+       settings.setValue(GlobalSettings::Key_Dec_AlwaysShowAllRows, state ? true : false);
+}
 #endif
 
 void Settings::on_log_logLevel_changed(int value)