From: Soeren Apel Date: Thu, 27 Dec 2018 20:22:15 +0000 (+0100) Subject: Don't use QMessageBox::setInformativeText() X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=970fca0d353f5c6d05c763bf7bdd12aac6f5ea0b;p=pulseview.git Don't use QMessageBox::setInformativeText() When using it, the extended error message text is not reliably appended to the dialog text. --- diff --git a/pv/dialogs/settings.cpp b/pv/dialogs/settings.cpp index 2bbab122..780a6665 100644 --- a/pv/dialogs/settings.cpp +++ b/pv/dialogs/settings.cpp @@ -744,8 +744,7 @@ void Settings::on_log_saveToFile_clicked(bool checked) if (out_stream.status() == QTextStream::Ok) { QMessageBox msg(this); - msg.setText(tr("Success")); - msg.setInformativeText(tr("Log saved to %1.").arg(file_name)); + msg.setText(tr("Success") + "\n\n" + tr("Log saved to %1.").arg(file_name)); msg.setStandardButtons(QMessageBox::Ok); msg.setIcon(QMessageBox::Information); msg.exec(); @@ -755,8 +754,7 @@ void Settings::on_log_saveToFile_clicked(bool checked) } QMessageBox msg(this); - msg.setText(tr("Error")); - msg.setInformativeText(tr("File %1 could not be written to.").arg(file_name)); + msg.setText(tr("Error") + "\n\n" + tr("File %1 could not be written to.").arg(file_name)); msg.setStandardButtons(QMessageBox::Ok); msg.setIcon(QMessageBox::Warning); msg.exec(); diff --git a/pv/dialogs/storeprogress.cpp b/pv/dialogs/storeprogress.cpp index 9f4279ce..2bca3476 100644 --- a/pv/dialogs/storeprogress.cpp +++ b/pv/dialogs/storeprogress.cpp @@ -82,8 +82,7 @@ void StoreProgress::show_error() qDebug() << "Error trying to save:" << session_.error(); QMessageBox msg(parentWidget()); - msg.setText(tr("Failed to save session.")); - msg.setInformativeText(session_.error()); + msg.setText(tr("Failed to save session.") + "\n\n" + session_.error()); msg.setStandardButtons(QMessageBox::Ok); msg.setIcon(QMessageBox::Warning); msg.exec(); diff --git a/pv/mainwindow.cpp b/pv/mainwindow.cpp index fd889e9e..960c3897 100644 --- a/pv/mainwindow.cpp +++ b/pv/mainwindow.cpp @@ -95,8 +95,7 @@ void MainWindow::show_session_error(const QString text, const QString info_text) qDebug() << "Notifying user of session error:" << info_text; QMessageBox msg; - msg.setText(text); - msg.setInformativeText(info_text); + msg.setText(text + "\n\n" + info_text); msg.setStandardButtons(QMessageBox::Ok); msg.setIcon(QMessageBox::Warning); msg.exec(); diff --git a/pv/toolbars/mainbar.cpp b/pv/toolbars/mainbar.cpp index e6beb2b3..df1363db 100644 --- a/pv/toolbars/mainbar.cpp +++ b/pv/toolbars/mainbar.cpp @@ -556,8 +556,7 @@ void MainBar::commit_sample_count() void MainBar::show_session_error(const QString text, const QString info_text) { QMessageBox msg(this); - msg.setText(text); - msg.setInformativeText(info_text); + msg.setText(text + "\n\n" + info_text); msg.setStandardButtons(QMessageBox::Ok); msg.setIcon(QMessageBox::Warning); msg.exec(); diff --git a/pv/views/trace/decodetrace.cpp b/pv/views/trace/decodetrace.cpp index 9c7196bf..65a2bf6c 100644 --- a/pv/views/trace/decodetrace.cpp +++ b/pv/views/trace/decodetrace.cpp @@ -1036,8 +1036,7 @@ void DecodeTrace::export_annotations(vector *annotations) const } QMessageBox msg(owner_->view()); - msg.setText(tr("Error")); - msg.setInformativeText(tr("File %1 could not be written to.").arg(file_name)); + msg.setText(tr("Error") + "\n\n" + tr("File %1 could not be written to.").arg(file_name)); msg.setStandardButtons(QMessageBox::Ok); msg.setIcon(QMessageBox::Warning); msg.exec();