1
0
mirror of https://github.com/RPCS3/rpcs3.git synced 2024-11-22 02:32:36 +01:00

Qt/patches: use show instead of exec

This commit is contained in:
Megamouse 2024-08-14 01:18:58 +02:00
parent 4051988403
commit f64f0b2e33

View File

@ -402,7 +402,7 @@ void patch_manager_dialog::populate_tree()
const auto item = all_title_items[0]; const auto item = all_title_items[0];
ensure(item && all_title_items.size() == 1); ensure(item && all_title_items.size() == 1);
if (const int index = ui->patch_tree->indexOfTopLevelItem(item); index >= 0) if (const int index = ui->patch_tree->indexOfTopLevelItem(item); item && index >= 0)
{ {
const bool all_titles_expanded = item->isExpanded(); const bool all_titles_expanded = item->isExpanded();
const auto all_serials_item = item->child(0); const auto all_serials_item = item->child(0);
@ -1065,9 +1065,9 @@ void patch_manager_dialog::dropEvent(QDropEvent* event)
else else
{ {
QString message = tr("Errors were found in the patch file."); QString message = tr("Errors were found in the patch file.");
QMessageBox mb(QMessageBox::Icon::Critical, tr("Validation failed"), message, QMessageBox::Ok, this); QMessageBox* mb = new QMessageBox(QMessageBox::Icon::Critical, tr("Validation failed"), message, QMessageBox::Ok, this);
mb.setInformativeText(tr("To see the error log, please click \"Show Details\".")); mb->setInformativeText(tr("To see the error log, please click \"Show Details\"."));
mb.setDetailedText(tr("%0").arg(summary)); mb->setDetailedText(tr("%0").arg(summary));
// Smartass hack to make the unresizeable message box wide enough for the changelog // Smartass hack to make the unresizeable message box wide enough for the changelog
const int log_width = QLabel(summary).sizeHint().width(); const int log_width = QLabel(summary).sizeHint().width();
@ -1076,8 +1076,8 @@ void patch_manager_dialog::dropEvent(QDropEvent* event)
message += " "; message += " ";
} }
mb.setText(message); mb->setText(message);
mb.exec(); mb->show();
} }
} }
} }
@ -1277,9 +1277,9 @@ bool patch_manager_dialog::handle_json(const QByteArray& data)
else else
{ {
QString message = tr("Errors were found in the downloaded patch file."); QString message = tr("Errors were found in the downloaded patch file.");
QMessageBox mb(QMessageBox::Icon::Critical, tr("Validation failed"), message, QMessageBox::Ok, this); QMessageBox* mb = new QMessageBox(QMessageBox::Icon::Critical, tr("Validation failed"), message, QMessageBox::Ok, this);
mb.setInformativeText(tr("To see the error log, please click \"Show Details\".")); mb->setInformativeText(tr("To see the error log, please click \"Show Details\"."));
mb.setDetailedText(tr("%0").arg(summary)); mb->setDetailedText(tr("%0").arg(summary));
// Smartass hack to make the unresizeable message box wide enough for the changelog // Smartass hack to make the unresizeable message box wide enough for the changelog
const int log_width = QLabel(message).sizeHint().width(); const int log_width = QLabel(message).sizeHint().width();
@ -1288,8 +1288,8 @@ bool patch_manager_dialog::handle_json(const QByteArray& data)
message += " "; message += " ";
} }
mb.setText(message); mb->setText(message);
mb.exec(); mb->show();
} }
} }