From: Soeren Apel Date: Thu, 8 Jun 2017 14:02:04 +0000 (+0200) Subject: Settings: Add decoder settings page X-Git-Tag: pulseview-0.4.0~19 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=669686c18ca6f1ee0697ae7804bfddf4fc6bd1e1;p=pulseview.git Settings: Add decoder settings page --- diff --git a/pv/dialogs/settings.cpp b/pv/dialogs/settings.cpp index f2f9e269..8a3aef9c 100644 --- a/pv/dialogs/settings.cpp +++ b/pv/dialogs/settings.cpp @@ -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) { diff --git a/pv/dialogs/settings.hpp b/pv/dialogs/settings.hpp index 0bda0f76..40b2a56a 100644 --- a/pv/dialogs/settings.hpp +++ b/pv/dialogs/settings.hpp @@ -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();