@@ -20,7 +20,6 @@ DialogMsgParser::DialogMsgParser(DataDisplayMode mode, QWidget *parent)
2020 Qt::WindowTitleHint);
2121
2222 ui->info ->setShowTimestamp (false );
23- ui->buttonBox ->button (QDialogButtonBox::Ok)->setText (tr (" Parse" ));
2423 ui->hexView ->setCheckState (mode == DataDisplayMode::Hex ? Qt::Checked : Qt::Unchecked);
2524
2625 auto dispatcher = QAbstractEventDispatcher::instance ();
@@ -36,13 +35,27 @@ DialogMsgParser::~DialogMsgParser()
3635 if (_mm) delete _mm;
3736}
3837
38+ // /
39+ // / \brief DialogMsgParser::changeEvent
40+ // / \param event
41+ // /
42+ void DialogMsgParser::changeEvent (QEvent* event)
43+ {
44+ if (event->type () == QEvent::LanguageChange)
45+ {
46+ ui->retranslateUi (this );
47+ }
48+
49+ QDialog::changeEvent (event);
50+ }
51+
3952// /
4053// / \brief DialogMsgParser::on_awake
4154// /
4255void DialogMsgParser::on_awake ()
4356{
4457 ui->deviceIdIncluded ->setVisible (ui->buttonPdu ->isChecked ());
45- ui->buttonBox -> button (QDialogButtonBox::Ok) ->setEnabled (!ui->bytesData ->isEmpty ());
58+ ui->pushButtonParse ->setEnabled (!ui->bytesData ->isEmpty ());
4659}
4760
4861// /
@@ -75,9 +88,9 @@ void DialogMsgParser::on_bytesData_valueChanged(const QByteArray& value)
7588}
7689
7790// /
78- // / \brief DialogMsgParser::accept
91+ // / \brief DialogMsgParser::on_pushButtonParse_clicked
7992// /
80- void DialogMsgParser::accept ()
93+ void DialogMsgParser::on_pushButtonParse_clicked ()
8194{
8295 auto data = ui->bytesData ->value ();
8396 if (data.isEmpty ()) return ;
0 commit comments