diff options
| author | Brian Munro <brian.alexander.munro@gmail.com> | 2018-08-21 12:23:47 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-08-21 12:23:47 +0200 |
| commit | 364289db72ca452e7af56dbf6ff43d0573656e57 (patch) | |
| tree | 176e8c349fffe87996fbe4708937bc4bd587c86b /src/pluginlist.cpp | |
| parent | 7b1821a5189f0187ea776c150f29e3bd7446724a (diff) | |
| parent | ef771fd8ca262a136c95c5141bb0de95712d14c2 (diff) | |
Merge pull request #495 from Modorganizer2/Develop
Release 2.1.5
Diffstat (limited to 'src/pluginlist.cpp')
| -rw-r--r-- | src/pluginlist.cpp | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/src/pluginlist.cpp b/src/pluginlist.cpp index 323cd98f..18e40a6e 100644 --- a/src/pluginlist.cpp +++ b/src/pluginlist.cpp @@ -289,6 +289,47 @@ void PluginList::enableESP(const QString &name, bool enable) }
}
+void PluginList::enableSelected(const QItemSelectionModel *selectionModel)
+{
+ if (selectionModel->hasSelection()){
+ bool dirty = false;
+ for (auto row : selectionModel->selectedRows(COL_PRIORITY)) {
+ int rowPriority = row.data().toInt();
+ for (int i = 0; i < m_ESPs.size(); i++) {
+ if (m_ESPs[i].m_Priority == rowPriority) {
+ if (!m_ESPs[i].m_Enabled) {
+ m_ESPs[i].m_Enabled = true;
+ dirty = true;
+ }
+
+ break;
+ }
+ }
+ }
+ if (dirty) emit writePluginsList();
+ }
+}
+
+void PluginList::disableSelected(const QItemSelectionModel *selectionModel)
+{
+ if (selectionModel->hasSelection()){
+ bool dirty = false;
+ for (auto row : selectionModel->selectedRows(COL_PRIORITY)) {
+ int rowPriority = row.data().toInt();
+ for (int i = 0; i < m_ESPs.size(); i++) {
+ if (m_ESPs[i].m_Priority == rowPriority) {
+ if (!m_ESPs[i].m_ForceEnabled && m_ESPs[i].m_Enabled) {
+ m_ESPs[i].m_Enabled = false;
+ dirty = true;
+ }
+ break;
+ }
+ }
+ }
+ if (dirty) emit writePluginsList();
+ }
+}
+
void PluginList::enableAll()
{
|
