mirror of
https://github.com/RPCS3/rpcs3.git
synced 2024-11-17 08:11:51 +00:00
Patch manager: detailed message box for long logs
This commit is contained in:
parent
4dfb47cdd9
commit
039d19dacf
@ -835,7 +835,29 @@ void patch_manager_dialog::dropEvent(QDropEvent* event)
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
patch_log.error("Errors found in patch file %s", path);
|
patch_log.error("Errors found in patch file %s", path);
|
||||||
QMessageBox::critical(this, tr("Validation failed"), tr("Errors were found in the patch file.\n\nLog:\n%0").arg(QString::fromStdString(log_message.str())));
|
QString summary = QString::fromStdString(log_message.str());
|
||||||
|
|
||||||
|
if (summary.count(QLatin1Char('\n')) < 5)
|
||||||
|
{
|
||||||
|
QMessageBox::critical(this, tr("Validation failed"), tr("Errors were found in the patch file.\n\nLog:\n%0").arg(summary));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
QString message = tr("Errors were found in the patch file.");
|
||||||
|
QMessageBox mb(QMessageBox::Icon::Critical, tr("Validation failed"), message, QMessageBox::Ok, this);
|
||||||
|
mb.setInformativeText(tr("To see the error log, please click \"Show Details\"."));
|
||||||
|
mb.setDetailedText(tr("%0").arg(summary));
|
||||||
|
|
||||||
|
// Smartass hack to make the unresizeable message box wide enough for the changelog
|
||||||
|
const int log_width = QLabel(summary).sizeHint().width();
|
||||||
|
while (QLabel(message).sizeHint().width() < log_width)
|
||||||
|
{
|
||||||
|
message += " ";
|
||||||
|
}
|
||||||
|
|
||||||
|
mb.setText(message);
|
||||||
|
mb.exec();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1025,7 +1047,29 @@ bool patch_manager_dialog::handle_json(const QByteArray& data)
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
patch_log.error("Errors found in downloaded patch file");
|
patch_log.error("Errors found in downloaded patch file");
|
||||||
QMessageBox::critical(this, tr("Validation failed"), tr("Errors were found in the downloaded patch file.\n\nLog:\n%0").arg(QString::fromStdString(log_message.str())));
|
QString summary = QString::fromStdString(log_message.str());
|
||||||
|
|
||||||
|
if (summary.count(QLatin1Char('\n')) < 5)
|
||||||
|
{
|
||||||
|
QMessageBox::critical(this, tr("Validation failed"), tr("Errors were found in the downloaded patch file.\n\nLog:\n%0").arg(summary));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
QString message = tr("Errors were found in the downloaded patch file.");
|
||||||
|
QMessageBox mb(QMessageBox::Icon::Critical, tr("Validation failed"), message, QMessageBox::Ok, this);
|
||||||
|
mb.setInformativeText(tr("To see the error log, please click \"Show Details\"."));
|
||||||
|
mb.setDetailedText(tr("%0").arg(summary));
|
||||||
|
|
||||||
|
// Smartass hack to make the unresizeable message box wide enough for the changelog
|
||||||
|
const int log_width = QLabel(message).sizeHint().width();
|
||||||
|
while (QLabel(message).sizeHint().width() < log_width)
|
||||||
|
{
|
||||||
|
message += " ";
|
||||||
|
}
|
||||||
|
|
||||||
|
mb.setText(message);
|
||||||
|
mb.exec();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
Loading…
Reference in New Issue
Block a user