summaryrefslogtreecommitdiffstats
path: root/application/pages/instance/ModFolderPage.cpp
diff options
context:
space:
mode:
authorPetr Mrázek <peterix@gmail.com>2019-08-05 00:44:56 +0200
committerPetr Mrázek <peterix@gmail.com>2019-08-05 00:46:59 +0200
commitc291946d2a8c3e03940da4070533e124283d303c (patch)
tree23155f22afed3812b187b915d2f28b8dc0c5e0f2 /application/pages/instance/ModFolderPage.cpp
parentdfb30d91397f6b5ed80d94b7dde4e71346b1be35 (diff)
downloadMultiMC-0.6.7.tar
MultiMC-0.6.7.tar.gz
MultiMC-0.6.7.tar.lz
MultiMC-0.6.7.tar.xz
MultiMC-0.6.7.zip
NOISSUE do not lose selection on mod enable/disable toggle0.6.7
Diffstat (limited to 'application/pages/instance/ModFolderPage.cpp')
-rw-r--r--application/pages/instance/ModFolderPage.cpp13
1 files changed, 7 insertions, 6 deletions
diff --git a/application/pages/instance/ModFolderPage.cpp b/application/pages/instance/ModFolderPage.cpp
index 9e987e95..d449f8bf 100644
--- a/application/pages/instance/ModFolderPage.cpp
+++ b/application/pages/instance/ModFolderPage.cpp
@@ -147,12 +147,13 @@ ModFolderPage::ModFolderPage(
connect(m_inst, &BaseInstance::runningStatusChanged, this, &ModFolderPage::on_RunningState_changed);
}
-void ModFolderPage::modItemActivated(const QModelIndex& index)
+void ModFolderPage::modItemActivated(const QModelIndex&)
{
- auto modsModelIndex = m_filterModel->mapToSource(index);
- if(modsModelIndex.isValid()) {
- m_mods->toggleEnabled(modsModelIndex);
+ if(!m_controlsEnabled) {
+ return;
}
+ auto selection = m_filterModel->mapSelectionToSource(ui->modTreeView->selectionModel()->selection());
+ m_mods->setModStatus(selection.indexes(), ModFolderModel::Toggle);
}
QMenu * ModFolderPage::createPopupMenu()
@@ -297,7 +298,7 @@ void ModFolderPage::on_actionEnable_triggered()
return;
}
auto selection = m_filterModel->mapSelectionToSource(ui->modTreeView->selectionModel()->selection());
- m_mods->enableMods(selection.indexes(), true);
+ m_mods->setModStatus(selection.indexes(), ModFolderModel::Enable);
}
void ModFolderPage::on_actionDisable_triggered()
@@ -306,7 +307,7 @@ void ModFolderPage::on_actionDisable_triggered()
return;
}
auto selection = m_filterModel->mapSelectionToSource(ui->modTreeView->selectionModel()->selection());
- m_mods->enableMods(selection.indexes(), false);
+ m_mods->setModStatus(selection.indexes(), ModFolderModel::Disable);
}
void ModFolderPage::on_actionRemove_triggered()