From 7e1c5d439a2ef6ce1346a3581776f58508a22afe Mon Sep 17 00:00:00 2001 From: Janrupf Date: Sat, 7 Apr 2018 16:15:58 +0200 Subject: #2228, #2229 - Auto import pack icons and fixed to big version selection - Closes #2228, Closes #2229 --- application/pages/modplatform/FTBPage.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'application/pages/modplatform/FTBPage.cpp') diff --git a/application/pages/modplatform/FTBPage.cpp b/application/pages/modplatform/FTBPage.cpp index 7f8ee54e..f438fce7 100644 --- a/application/pages/modplatform/FTBPage.cpp +++ b/application/pages/modplatform/FTBPage.cpp @@ -50,6 +50,9 @@ FTBPage::FTBPage(NewInstanceDialog* dialog, QWidget *parent) thirdPartyFilterModel->setSorting(publicFilterModel->getCurrentSorting()); } + ui->packVersionSelection->view()->setVerticalScrollBarPolicy(Qt::ScrollBarAsNeeded); + ui->packVersionSelection->view()->parentWidget()->setMaximumHeight(300); + connect(ui->sortByBox, &QComboBox::currentTextChanged, this, &FTBPage::onSortingSelectionChanged); connect(ui->packVersionSelection, &QComboBox::currentTextChanged, this, &FTBPage::onVersionSelectionItemChanged); @@ -96,6 +99,15 @@ void FTBPage::suggestCurrent() if(!selected.broken) { dialog->setSuggestedPack(selected.name, new FtbPackInstallTask(selected, selectedVersion)); + if(selected.type == FtbPackType::Public) { + publicListModel->getLogo(selected.logo, [this](QString logo){ + dialog->setSuggestedIconFromFile(logo, "ftb_" + selected.name); + }); + } else if (selected.type == FtbPackType::ThirdParty) { + thirdPartyModel->getLogo(selected.logo, [this](QString logo){ + dialog->setSuggestedIconFromFile(logo, "ftb_" + selected.name); + }); + } } else { -- cgit v1.2.3