mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-11 09:18:40 +12:00
Qt: Use detailed text for install message
This commit is contained in:
parent
c30c9b2168
commit
050b8fa7df
1 changed files with 23 additions and 6 deletions
|
@ -780,16 +780,33 @@ bool main_window::InstallPackages(QStringList file_paths, bool from_boot)
|
||||||
|
|
||||||
if (!info.changelog.isEmpty())
|
if (!info.changelog.isEmpty())
|
||||||
{
|
{
|
||||||
info.changelog = tr("\n\nChangelog:\n%0", "Block for Changelog").arg(info.changelog);
|
info.changelog = tr("Changelog:\n%0", "Block for Changelog").arg(info.changelog);
|
||||||
}
|
}
|
||||||
|
|
||||||
const QString info_string = QStringLiteral("%0\n\n%1%2%3%4%5").arg(file_info.fileName()).arg(info.title).arg(info.local_cat)
|
const QString info_string = QStringLiteral("%0\n\n%1%2%3%4").arg(file_info.fileName()).arg(info.title).arg(info.local_cat).arg(info.title_id).arg(info.version);
|
||||||
.arg(info.title_id).arg(info.version).arg(info.changelog);
|
QString message = tr("Do you want to install this package?\n\n%0").arg(info_string);
|
||||||
|
|
||||||
if (QMessageBox::question(this, tr("PKG Decrypter / Installer"), tr("Do you want to install this package?\n\n%0").arg(info_string),
|
QMessageBox mb(QMessageBox::Icon::Question, tr("PKG Decrypter / Installer"), message, QMessageBox::Yes | QMessageBox::No, this);
|
||||||
QMessageBox::Yes | QMessageBox::No, QMessageBox::No) != QMessageBox::Yes)
|
mb.setDefaultButton(QMessageBox::No);
|
||||||
|
|
||||||
|
if (!info.changelog.isEmpty())
|
||||||
{
|
{
|
||||||
gui_log.notice("PKG: Cancelled installation from drop.\n%s", info_string);
|
mb.setInformativeText(tr("To see the changelog, please click \"Show Details\"."));
|
||||||
|
mb.setDetailedText(tr("%0").arg(info.changelog));
|
||||||
|
|
||||||
|
// Smartass hack to make the unresizeable message box wide enough for the changelog
|
||||||
|
const int log_width = QLabel(info.changelog).sizeHint().width();
|
||||||
|
while (QLabel(message).sizeHint().width() < log_width)
|
||||||
|
{
|
||||||
|
message += " ";
|
||||||
|
}
|
||||||
|
|
||||||
|
mb.setText(message);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (mb.exec() != QMessageBox::Yes)
|
||||||
|
{
|
||||||
|
gui_log.notice("PKG: Cancelled installation from drop.\n%s\n%s", info_string, info.changelog);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue