| 49 | |
| 50 | |
| 51 | ModPage::ModPage(ModDownloadDialog* dialog, BaseInstance* instance, ModAPI* api) |
| 52 | : QWidget(dialog) |
| 53 | , m_instance(instance) |
| 54 | , ui(new Ui::ModPage) |
| 55 | , dialog(dialog) |
| 56 | , m_fetch_progress(this, false) |
| 57 | , api(api) |
| 58 | { |
| 59 | ui->setupUi(this); |
| 60 | |
| 61 | connect(ui->searchButton, &QPushButton::clicked, this, &ModPage::triggerSearch); |
| 62 | connect(ui->modFilterButton, &QPushButton::clicked, this, &ModPage::filterMods); |
| 63 | connect(ui->packView, &QListView::doubleClicked, this, &ModPage::onModSelected); |
| 64 | |
| 65 | m_search_timer.setTimerType(Qt::TimerType::CoarseTimer); |
| 66 | m_search_timer.setSingleShot(true); |
| 67 | |
| 68 | connect(&m_search_timer, &QTimer::timeout, this, &ModPage::triggerSearch); |
| 69 | |
| 70 | ui->searchEdit->installEventFilter(this); |
| 71 | |
| 72 | ui->versionSelectionBox->view()->setVerticalScrollBarPolicy(Qt::ScrollBarAsNeeded); |
| 73 | ui->versionSelectionBox->view()->parentWidget()->setMaximumHeight(300); |
| 74 | |
| 75 | m_fetch_progress.hideIfInactive(true); |
| 76 | m_fetch_progress.setFixedHeight(24); |
| 77 | m_fetch_progress.progressFormat(""); |
| 78 | |
| 79 | ui->gridLayout_3->addWidget(&m_fetch_progress, 0, 0, 1, ui->gridLayout_3->columnCount()); |
| 80 | |
| 81 | ui->packView->setItemDelegate(new ProjectItemDelegate(this)); |
| 82 | ui->packView->installEventFilter(this); |
| 83 | } |
| 84 | |
| 85 | ModPage::~ModPage() |
| 86 | { |
nothing calls this directly
no test coverage detected