diff options
author | Ryan Cao <70191398+ryanccn@users.noreply.github.com> | 2022-11-14 19:26:31 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-11-14 19:26:31 +0800 |
commit | 2c9452efaf33cb22dbc29a4c6117a646f0de943f (patch) | |
tree | c5394f5194066989504b572c5a4aeeeb74d954d9 /launcher/ui/dialogs/ModDownloadDialog.cpp | |
parent | 97a7af855f8a96a0e73181c5e32a15bbd2cb67f2 (diff) | |
parent | 074b53eb6b71f948ff30aca601103672c5c4c812 (diff) | |
download | PrismLauncher-2c9452efaf33cb22dbc29a4c6117a646f0de943f.tar.gz PrismLauncher-2c9452efaf33cb22dbc29a4c6117a646f0de943f.tar.bz2 PrismLauncher-2c9452efaf33cb22dbc29a4c6117a646f0de943f.zip |
Merge branch 'develop' into macos-add-to-path
Diffstat (limited to 'launcher/ui/dialogs/ModDownloadDialog.cpp')
-rw-r--r-- | launcher/ui/dialogs/ModDownloadDialog.cpp | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/launcher/ui/dialogs/ModDownloadDialog.cpp b/launcher/ui/dialogs/ModDownloadDialog.cpp index d740c8cb..24d23ba9 100644 --- a/launcher/ui/dialogs/ModDownloadDialog.cpp +++ b/launcher/ui/dialogs/ModDownloadDialog.cpp @@ -1,7 +1,8 @@ // SPDX-License-Identifier: GPL-3.0-only /* - * PolyMC - Minecraft Launcher + * Prism Launcher - Minecraft Launcher * Copyright (C) 2022 Sefa Eyeoglu <contact@scrumplex.net> + * Copyright (C) 2022 TheKodeToad <TheKodeToad@proton.me> * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -131,6 +132,8 @@ QList<BasePage*> ModDownloadDialog::getPages() if (APPLICATION->capabilities() & Application::SupportsFlame) pages.append(FlameModPage::create(this, m_instance)); + m_selectedPage = dynamic_cast<ModPage*>(pages[0]); + return pages; } @@ -178,12 +181,22 @@ void ModDownloadDialog::selectedPageChanged(BasePage* previous, BasePage* select return; } - auto* selected_page = dynamic_cast<ModPage*>(selected); - if (!selected_page) { + m_selectedPage = dynamic_cast<ModPage*>(selected); + if (!m_selectedPage) { qCritical() << "Page '" << selected->displayName() << "' in ModDownloadDialog is not a ModPage!"; return; } // Same effect as having a global search bar - selected_page->setSearchTerm(prev_page->getSearchTerm()); + m_selectedPage->setSearchTerm(prev_page->getSearchTerm()); +} + +bool ModDownloadDialog::selectPage(QString pageId) +{ + return m_container->selectPage(pageId); +} + +ModPage* ModDownloadDialog::getSelectedPage() +{ + return m_selectedPage; } |