]> sigrok.org Git - pulseview.git/commitdiff
Settings: Add decoder settings page
authorSoeren Apel <redacted>
Thu, 8 Jun 2017 14:02:04 +0000 (16:02 +0200)
committerSoeren Apel <redacted>
Thu, 8 Jun 2017 14:02:04 +0000 (16:02 +0200)
pv/dialogs/settings.cpp
pv/dialogs/settings.hpp

index f2f9e2692a753624b2750a5771405a7bce038660..8a3aef9c00a2103c86380f92a7c42df36d21cd3b 100644 (file)
@@ -101,6 +101,17 @@ void Settings::create_pages()
        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));
 
@@ -153,6 +164,27 @@ QWidget *Settings::get_view_settings_form(QWidget *parent) const
        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);
+
+       return form;
+#else
+       (void)parent;
+#endif
+}
+
 #ifdef ENABLE_DECODE
 static gint sort_pds(gconstpointer a, gconstpointer b)
 {
index 0bda0f76d20434cf7b2b8ee233b4f47bd071e0c6..40b2a56a3e1231f3eed689e2873350ef012f71b2 100644 (file)
@@ -40,6 +40,7 @@ public:
        void create_pages();
 
        QWidget *get_view_settings_form(QWidget *parent) const;
+       QWidget *get_decoder_settings_form(QWidget *parent) const;
        QWidget *get_about_page(QWidget *parent) const;
 
        void accept();