From 189793e1bb205e0921c10dc21f4a23b17cc8997a Mon Sep 17 00:00:00 2001 From: dreamsourcelabTAI Date: Mon, 5 Jun 2023 17:05:25 +0800 Subject: [PATCH] fix: On decoder options dialog, to translate the label, click cancel, the decoder be created --- DSView/pv/dialogs/decoderoptionsdlg.cpp | 19 ++++++++++++++++--- DSView/pv/view/decodetrace.cpp | 6 +++++- 2 files changed, 21 insertions(+), 4 deletions(-) diff --git a/DSView/pv/dialogs/decoderoptionsdlg.cpp b/DSView/pv/dialogs/decoderoptionsdlg.cpp index e195d445..d529eecb 100644 --- a/DSView/pv/dialogs/decoderoptionsdlg.cpp +++ b/DSView/pv/dialogs/decoderoptionsdlg.cpp @@ -171,13 +171,26 @@ void DecoderOptionsDlg::load_options_view() bool bLang = AppConfig::Instance()._appOptions.transDecoderDlg; if (LangResource::Instance()->is_lang_en() == false){ + QWidget *sp1 = new QWidget(); + sp1->setFixedHeight(5); + form->addRow(sp1); QString trans_lable(L_S(STR_PAGE_DLG, S_ID(IDS_DLG_DECODER_IF_TRANS), "Translate param names")); QCheckBox *ck_trans = new QCheckBox(); + ck_trans->setFixedSize(20,20); ck_trans->setChecked(bLang); connect(ck_trans, SIGNAL(released()), this, SLOT(on_trans_pramas())); - ck_trans->setStyleSheet("margin-left:60px"); - form->addRow(ck_trans, new QLabel(trans_lable)); - h_ex2 = 30; + ck_trans->setStyleSheet("margin-top:5px"); + QLabel *trans_lb = new QLabel(trans_lable); + + QHBoxLayout *trans_lay = new QHBoxLayout(); + QWidget *trans_wid = new QWidget(); + trans_wid->setLayout(trans_lay); + trans_lay->setSpacing(0); + trans_lay->setContentsMargins(10,0,0,0); + trans_lay->addWidget(ck_trans); + trans_lay->addWidget(trans_lb); + form->addRow("", trans_wid); + h_ex2 = 40; } //tr diff --git a/DSView/pv/view/decodetrace.cpp b/DSView/pv/view/decodetrace.cpp index bb26dc25..18cf3699 100644 --- a/DSView/pv/view/decodetrace.cpp +++ b/DSView/pv/view/decodetrace.cpp @@ -689,7 +689,11 @@ bool DecodeTrace::create_popup(bool isnew) } dlg.get_cursor_range(_decode_cursor1, _decode_cursor2); - } + } + + if (dlg.is_reload_form()){ + ret = false; + } if (QDialog::Rejected == dlg_ret || dlg.is_reload_form() == false){ break;