From 152d476f20d06dff6aecca057c3d01776f3ac975 Mon Sep 17 00:00:00 2001 From: Jamie Mansfield Date: Thu, 11 Feb 2021 00:19:49 +0000 Subject: NOISSUE Add search to ATLauncher --- application/pages/modplatform/atlauncher/AtlPage.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'application/pages/modplatform/atlauncher/AtlPage.cpp') diff --git a/application/pages/modplatform/atlauncher/AtlPage.cpp b/application/pages/modplatform/atlauncher/AtlPage.cpp index 4518248d..f90d734c 100644 --- a/application/pages/modplatform/atlauncher/AtlPage.cpp +++ b/application/pages/modplatform/atlauncher/AtlPage.cpp @@ -25,6 +25,8 @@ AtlPage::AtlPage(NewInstanceDialog* dialog, QWidget *parent) } ui->sortByBox->setCurrentText(filterModel->translateCurrentSorting()); + connect(ui->searchEdit, &QLineEdit::textChanged, this, &AtlPage::triggerSearch); + connect(ui->resetButton, &QPushButton::clicked, this, &AtlPage::resetSearch); connect(ui->sortByBox, &QComboBox::currentTextChanged, this, &AtlPage::onSortingSelectionChanged); connect(ui->packView->selectionModel(), &QItemSelectionModel::currentChanged, this, &AtlPage::onSelectionChanged); connect(ui->versionSelectionBox, &QComboBox::currentTextChanged, this, &AtlPage::onVersionSelectionChanged); @@ -59,6 +61,16 @@ void AtlPage::suggestCurrent() }); } +void AtlPage::triggerSearch() +{ + filterModel->setSearchTerm(ui->searchEdit->text()); +} + +void AtlPage::resetSearch() +{ + ui->searchEdit->setText(""); +} + void AtlPage::onSortingSelectionChanged(QString data) { auto toSet = filterModel->getAvailableSortings().value(data); -- cgit