aboutsummaryrefslogtreecommitdiff
path: root/launcher/ui/pages/modplatform
diff options
context:
space:
mode:
authorflow <flowlnlnln@gmail.com>2022-07-15 11:20:08 -0300
committerflow <flowlnlnln@gmail.com>2022-08-01 07:33:29 -0300
commit5936c7b65ceef28fb569e966f2bcbe3aed3fa999 (patch)
tree5ebb9db5a4bbb96b3c592a0dcee7a338a8623c0e /launcher/ui/pages/modplatform
parenta8bcd85c93ad1e5af277652862f773413c255c47 (diff)
downloadPrismLauncher-5936c7b65ceef28fb569e966f2bcbe3aed3fa999.tar.gz
PrismLauncher-5936c7b65ceef28fb569e966f2bcbe3aed3fa999.tar.bz2
PrismLauncher-5936c7b65ceef28fb569e966f2bcbe3aed3fa999.zip
change: preserve search term across different mod providers
Signed-off-by: flow <flowlnlnln@gmail.com>
Diffstat (limited to 'launcher/ui/pages/modplatform')
-rw-r--r--launcher/ui/pages/modplatform/ModPage.cpp11
-rw-r--r--launcher/ui/pages/modplatform/ModPage.h5
2 files changed, 15 insertions, 1 deletions
diff --git a/launcher/ui/pages/modplatform/ModPage.cpp b/launcher/ui/pages/modplatform/ModPage.cpp
index c355f069..e052b655 100644
--- a/launcher/ui/pages/modplatform/ModPage.cpp
+++ b/launcher/ui/pages/modplatform/ModPage.cpp
@@ -138,7 +138,16 @@ void ModPage::triggerSearch()
updateSelectionButton();
}
- listModel->searchWithTerm(ui->searchEdit->text(), ui->sortByBox->currentIndex(), changed);
+ listModel->searchWithTerm(getSearchTerm(), ui->sortByBox->currentIndex(), changed);
+}
+
+QString ModPage::getSearchTerm() const
+{
+ return ui->searchEdit->text();
+}
+void ModPage::setSearchTerm(QString term)
+{
+ ui->searchEdit->setText(term);
}
void ModPage::onSelectionChanged(QModelIndex first, QModelIndex second)
diff --git a/launcher/ui/pages/modplatform/ModPage.h b/launcher/ui/pages/modplatform/ModPage.h
index cf00e16e..4990c1c0 100644
--- a/launcher/ui/pages/modplatform/ModPage.h
+++ b/launcher/ui/pages/modplatform/ModPage.h
@@ -45,6 +45,11 @@ class ModPage : public QWidget, public BasePage {
auto getFilter() const -> const std::shared_ptr<ModFilterWidget::Filter> { return m_filter; }
auto getDialog() const -> const ModDownloadDialog* { return dialog; }
+ /** Get the current term in the search bar. */
+ auto getSearchTerm() const -> QString;
+ /** Programatically set the term in the search bar. */
+ void setSearchTerm(QString);
+
auto getCurrent() -> ModPlatform::IndexedPack& { return current; }
void updateModVersions(int prev_count = -1);