pollymc/launcher/ui/dialogs/ReviewMessageBox.cpp
Ezekiel Smith c560d06b8d
Merge pull request #270 from flowln/dialog
Make a better "Mod download confirmation dialog"
2022-03-22 20:11:15 +01:00

32 lines
850 B
C++

#include "ReviewMessageBox.h"
#include "ui_ReviewMessageBox.h"
ReviewMessageBox::ReviewMessageBox(QWidget* parent, QString const& title, QString const& icon)
: QDialog(parent), ui(new Ui::ReviewMessageBox)
{
ui->setupUi(this);
}
ReviewMessageBox::~ReviewMessageBox()
{
delete ui;
}
auto ReviewMessageBox::create(QWidget* parent, QString&& title, QString&& icon) -> ReviewMessageBox*
{
return new ReviewMessageBox(parent, title, icon);
}
void ReviewMessageBox::appendMod(const QString& name, const QString& filename)
{
auto itemTop = new QTreeWidgetItem(ui->modTreeWidget);
itemTop->setText(0, name);
auto filenameItem = new QTreeWidgetItem(itemTop);
filenameItem->setText(0, tr("Filename: %1").arg(filename));
itemTop->insertChildren(0, { filenameItem });
ui->modTreeWidget->addTopLevelItem(itemTop);
}