aboutsummaryrefslogtreecommitdiff
path: root/launcher/ui/pages/instance/ModFolderPage.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'launcher/ui/pages/instance/ModFolderPage.cpp')
-rw-r--r--launcher/ui/pages/instance/ModFolderPage.cpp13
1 files changed, 12 insertions, 1 deletions
diff --git a/launcher/ui/pages/instance/ModFolderPage.cpp b/launcher/ui/pages/instance/ModFolderPage.cpp
index 45678db1..75b40e77 100644
--- a/launcher/ui/pages/instance/ModFolderPage.cpp
+++ b/launcher/ui/pages/instance/ModFolderPage.cpp
@@ -65,7 +65,7 @@
#include "ui/dialogs/ProgressDialog.h"
ModFolderPage::ModFolderPage(BaseInstance* inst, std::shared_ptr<ModFolderModel> mods, QWidget* parent)
- : ExternalResourcesPage(inst, mods, parent)
+ : ExternalResourcesPage(inst, mods, parent), m_model(mods)
{
// This is structured like that so that these changes
// do not affect the Resource pack and Shader pack tabs
@@ -124,6 +124,17 @@ bool ModFolderPage::shouldDisplay() const
return true;
}
+bool ModFolderPage::onSelectionChanged(const QModelIndex& current, const QModelIndex& previous)
+{
+ auto sourceCurrent = m_filterModel->mapToSource(current);
+ int row = sourceCurrent.row();
+ Mod const* m = m_model->at(row);
+ if (m)
+ ui->frame->updateWithMod(*m);
+
+ return true;
+}
+
void ModFolderPage::installMods()
{
if (!m_controlsEnabled)