summaryrefslogtreecommitdiff
path: root/src/modlist.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/modlist.cpp')
-rw-r--r--src/modlist.cpp30
1 files changed, 30 insertions, 0 deletions
diff --git a/src/modlist.cpp b/src/modlist.cpp
index 0d084c22..afed2241 100644
--- a/src/modlist.cpp
+++ b/src/modlist.cpp
@@ -1231,3 +1231,33 @@ bool ModList::eventFilter(QObject *obj, QEvent *event)
}
return QAbstractItemModel::eventFilter(obj, event);
}
+
+
+void ModList::enableSelected(const QItemSelectionModel *selectionModel)
+{
+ if (selectionModel->hasSelection()) {
+ bool dirty = false;
+ for (auto row : selectionModel->selectedRows(COL_PRIORITY)) {
+ int modID = m_Profile->modIndexByPriority(row.data().toInt());
+ if (!m_Profile->modEnabled(modID)) {
+ m_Profile->setModEnabled(modID, true);
+ emit modlist_changed(row, 0);
+ }
+ }
+ }
+}
+
+
+void ModList::disableSelected(const QItemSelectionModel *selectionModel)
+{
+ if (selectionModel->hasSelection()) {
+ bool dirty = false;
+ for (auto row : selectionModel->selectedRows(COL_PRIORITY)) {
+ int modID = m_Profile->modIndexByPriority(row.data().toInt());
+ if (m_Profile->modEnabled(modID)) {
+ m_Profile->setModEnabled(modID, false);
+ emit modlist_changed(row, 0);
+ }
+ }
+ }
+} \ No newline at end of file