diff options
author | Trial97 <alexandru.tripon97@gmail.com> | 2023-06-25 12:26:54 +0300 |
---|---|---|
committer | Trial97 <alexandru.tripon97@gmail.com> | 2023-06-25 12:26:54 +0300 |
commit | ef0752972ae64002a02e66e430165f3e93c09c53 (patch) | |
tree | bb4337a52c9fe3b0c063cb3b3af5e411826a8d90 /launcher/ui/dialogs/ReviewMessageBox.cpp | |
parent | 3c9c39cb890252f94d0c50caa00de5439881d7f6 (diff) | |
parent | bcf45c74a1b0b3389c05927637bf8aa95b8e43cf (diff) | |
download | PrismLauncher-ef0752972ae64002a02e66e430165f3e93c09c53.tar.gz PrismLauncher-ef0752972ae64002a02e66e430165f3e93c09c53.tar.bz2 PrismLauncher-ef0752972ae64002a02e66e430165f3e93c09c53.zip |
Merge branch 'develop' of https://github.com/PrismLauncher/PrismLauncher into export
Diffstat (limited to 'launcher/ui/dialogs/ReviewMessageBox.cpp')
-rw-r--r-- | launcher/ui/dialogs/ReviewMessageBox.cpp | 29 |
1 files changed, 27 insertions, 2 deletions
diff --git a/launcher/ui/dialogs/ReviewMessageBox.cpp b/launcher/ui/dialogs/ReviewMessageBox.cpp index 7b2df278..7b33765f 100644 --- a/launcher/ui/dialogs/ReviewMessageBox.cpp +++ b/launcher/ui/dialogs/ReviewMessageBox.cpp @@ -40,7 +40,8 @@ void ReviewMessageBox::appendResource(ResourceInformation&& info) auto filenameItem = new QTreeWidgetItem(itemTop); filenameItem->setText(0, tr("Filename: %1").arg(info.filename)); - itemTop->insertChildren(0, { filenameItem }); + auto childIndx = 0; + itemTop->insertChildren(childIndx++, { filenameItem }); if (!info.custom_file_path.isEmpty()) { auto customPathItem = new QTreeWidgetItem(itemTop); @@ -49,7 +50,31 @@ void ReviewMessageBox::appendResource(ResourceInformation&& info) itemTop->insertChildren(1, { customPathItem }); itemTop->setIcon(1, QIcon(APPLICATION->getThemedIcon("status-yellow"))); - itemTop->setToolTip(1, tr("This file will be downloaded to a folder location different from the default, possibly due to its loader requiring it.")); + itemTop->setToolTip( + childIndx++, + tr("This file will be downloaded to a folder location different from the default, possibly due to its loader requiring it.")); + } + + auto providerItem = new QTreeWidgetItem(itemTop); + providerItem->setText(0, tr("Provider: %1").arg(info.provider)); + + itemTop->insertChildren(childIndx++, { providerItem }); + + if (!info.required_by.isEmpty()) { + auto requiredByItem = new QTreeWidgetItem(itemTop); + if (info.required_by.length() == 1) { + requiredByItem->setText(0, tr("Required by: %1").arg(info.required_by.back())); + } else { + requiredByItem->setText(0, tr("Required by:")); + auto i = 0; + for (auto req : info.required_by) { + auto reqItem = new QTreeWidgetItem(requiredByItem); + reqItem->setText(0, req); + reqItem->insertChildren(i++, { reqItem }); + } + } + + itemTop->insertChildren(childIndx++, { requiredByItem }); } ui->modTreeWidget->addTopLevelItem(itemTop); |