X-Git-Url: https://sigrok.org/gitweb/?p=pulseview.git;a=blobdiff_plain;f=pv%2Fdialogs%2Fsettings.cpp;h=1ac8a4c35f8b4203761cd36e2d877d6f1a6deb08;hp=3507c47203ec1cb92c865d628883d451cce62109;hb=39e047cffdbfdb6dd10f3367e600887553a89d74;hpb=b804a6da858bd130a54a8c7ccafd085302a2b3e8 diff --git a/pv/dialogs/settings.cpp b/pv/dialogs/settings.cpp index 3507c472..1ac8a4c3 100644 --- a/pv/dialogs/settings.cpp +++ b/pv/dialogs/settings.cpp @@ -268,9 +268,10 @@ QWidget *Settings::get_view_settings_form(QWidget *parent) const return form; } -QWidget *Settings::get_decoder_settings_form(QWidget *parent) const +QWidget *Settings::get_decoder_settings_form(QWidget *parent) { #ifdef ENABLE_DECODE + GlobalSettings settings; QCheckBox *cb; QWidget *form = new QWidget(parent); @@ -287,6 +288,20 @@ QWidget *Settings::get_decoder_settings_form(QWidget *parent) const SLOT(on_dec_initialStateConfigurable_changed(int))); decoder_layout->addRow(tr("Allow configuration of &initial signal state"), cb); + // Annotation export settings + ann_export_format_ = new QLineEdit(); + ann_export_format_->setText( + settings.value(GlobalSettings::Key_Dec_ExportFormat).toString()); + 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")); + description_1->setAlignment(Qt::AlignRight); + decoder_layout->addRow(description_1); + QLabel *description_2 = new QLabel(tr("%1: longest annotation text; %a: all annotation texts")); + description_2->setAlignment(Qt::AlignRight); + decoder_layout->addRow(description_2); + return form; #else (void)parent; @@ -329,19 +344,13 @@ QWidget *Settings::get_about_page(QWidget *parent) const s.append(""); - /* Application info */ + /* Version, library, and feature info */ s.append(""); + tr("Versions, libraries and features:") + ""); s.append(QString("") .arg(QApplication::applicationName(), QApplication::applicationVersion())); - - /* Library info */ - s.append(""); - s.append(""); - s.append(QString("") .arg(QString("Qt"), qVersion())); s.append(QString("") @@ -471,10 +480,14 @@ QWidget *Settings::get_about_page(QWidget *parent) const QTextBrowser *support_list = new QTextBrowser(); support_list->setDocument(supported_doc); - QGridLayout *layout = new QGridLayout(); - layout->addWidget(icon, 0, 0, 1, 1); - layout->addWidget(gpl_home_info, 0, 1, 1, 1); - layout->addWidget(support_list, 1, 1, 1, 1); + QHBoxLayout *h_layout = new QHBoxLayout(); + h_layout->setAlignment(Qt::AlignLeft); + h_layout->addWidget(icon); + h_layout->addWidget(gpl_home_info); + + QVBoxLayout *layout = new QVBoxLayout(); + layout->addLayout(h_layout); + layout->addWidget(support_list); QWidget *page = new QWidget(parent); page->setLayout(layout); @@ -631,12 +644,20 @@ void Settings::on_view_defaultLogicHeight_changed(int value) settings.setValue(GlobalSettings::Key_View_DefaultLogicHeight, value); } +#ifdef ENABLE_DECODE void Settings::on_dec_initialStateConfigurable_changed(int state) { GlobalSettings settings; settings.setValue(GlobalSettings::Key_Dec_InitialStateConfigurable, state ? true : false); } +void Settings::on_dec_exportFormat_changed(const QString &text) +{ + GlobalSettings settings; + settings.setValue(GlobalSettings::Key_Dec_ExportFormat, text); +} +#endif + void Settings::on_log_logLevel_changed(int value) { logging.set_log_level(value);
" + - tr("Application:") + "
%1%2
" + - tr("Libraries and features:") + "
%1%2
%1%2