diff options
| author | Mikaël Capelle <capelle.mikael@gmail.com> | 2020-12-31 23:26:14 +0100 |
|---|---|---|
| committer | Mikaël Capelle <capelle.mikael@gmail.com> | 2021-01-02 15:38:18 +0100 |
| commit | fff41be8455e588d181c7349678dff6fe29be76b (patch) | |
| tree | 907bef5b779ba5b6983b5b3ddbef97b2350d58cb /src/modlistview.cpp | |
| parent | 399ff3fcf7920adec128d30f3c97a7636a6f10be (diff) | |
Remove selection-related stuff from plugin/mod lists.
Diffstat (limited to 'src/modlistview.cpp')
| -rw-r--r-- | src/modlistview.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/modlistview.cpp b/src/modlistview.cpp index f23e84fe..42627e3f 100644 --- a/src/modlistview.cpp +++ b/src/modlistview.cpp @@ -594,6 +594,8 @@ void ModListView::setup(OrganizerCore& core, CategoryFactory& factory, MainWindo connect(m_core, &OrganizerCore::modInstalled, this, &ModListView::onModInstalled);
connect(core.modList(), &ModList::modPrioritiesChanged, this, &ModListView::onModPrioritiesChanged);
connect(core.modList(), &ModList::clearOverwrite, m_actions, &ModListViewActions::clearOverwrite);
+ connect(core.modList(), qOverload<QModelIndex const&, int>(&ModList::modlistChanged), [=]() { updateModCount(); });
+ connect(core.modList(), qOverload<QModelIndexList const&, int>(&ModList::modlistChanged), [=]() { updateModCount(); });
m_byPriorityProxy = new ModListByPriorityProxy(core.currentProfile(), core, this);
m_byPriorityProxy->setSourceModel(core.modList());
@@ -672,6 +674,16 @@ void ModListView::setup(OrganizerCore& core, CategoryFactory& factory, MainWindo header()->setSectionResizeMode(ModList::COL_NAME, QHeaderView::Stretch);
}
+ // highligth plugins
+ connect(selectionModel(), &QItemSelectionModel::selectionChanged, [=](auto&& selected) {
+ std::vector<unsigned int> modIndices;
+ for (auto& idx : selectionModel()->selectedRows()) {
+ modIndices.push_back(idx.data(ModList::IndexRole).toInt());
+ }
+ m_core->pluginList()->highlightPlugins(modIndices, *m_core->directoryStructure());
+ mwui->espList->verticalScrollBar()->repaint();
+ });
+
// prevent the name-column from being hidden
header()->setSectionHidden(ModList::COL_NAME, false);
|
