From e91eebefbea450a447b44a81dcabcc6ac8000a48 Mon Sep 17 00:00:00 2001 From: Tannin Date: Sat, 24 Aug 2013 22:50:00 +0200 Subject: - download size is now displayed - multiple esps/mods can now be enabled/disabled at once using space - bugfix: fomod installer didn't compile because of changes to condition checking - bugfix: broken inverse virtual name resolution in case of non-default mod directory --- src/modlist.cpp | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'src/modlist.cpp') diff --git a/src/modlist.cpp b/src/modlist.cpp index 9c537300..a08162e7 100644 --- a/src/modlist.cpp +++ b/src/modlist.cpp @@ -801,6 +801,26 @@ bool ModList::eventFilter(QObject *obj, QEvent *event) removeRow(rows[0].data(Qt::UserRole + 1).toInt(), QModelIndex()); } return true; + } else if (keyEvent->key() == Qt::Key_Space) { + QItemSelectionModel *selectionModel = itemView->selectionModel(); + const QSortFilterProxyModel *proxyModel = qobject_cast(selectionModel->model()); + + QModelIndex minRow, maxRow; + foreach (QModelIndex idx, selectionModel->selectedRows()) { + if (proxyModel != NULL) { + idx = proxyModel->mapToSource(idx); + } + if (!minRow.isValid() || (idx.row() < minRow.row())) { + minRow = idx; + } + if (!maxRow.isValid() || (idx.row() > maxRow.row())) { + maxRow = idx; + } + int oldState = idx.data(Qt::CheckStateRole).toInt(); + setData(idx, oldState == Qt::Unchecked ? Qt::Checked : Qt::Unchecked, Qt::CheckStateRole); + } + emit dataChanged(minRow, maxRow); + return true; } } return QObject::eventFilter(obj, event); -- cgit v1.3.1