summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLostDragonist <lost.dragonist@gmail.com>2018-07-16 15:31:08 -0500
committerLostDragonist <lost.dragonist@gmail.com>2018-07-16 15:46:43 -0500
commitb4530eb84321f684e0ad764ed3cdafbbd9e4315c (patch)
treecb94b71cc0fab3aa83dbfc8e19765b2e04095e41 /src
parentf20a1f6a849510438ca5c9abe8fdac1dada263d2 (diff)
Allow "mark as converted" to work with multiple mods
Diffstat (limited to 'src')
-rw-r--r--src/mainwindow.cpp19
1 files changed, 15 insertions, 4 deletions
diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp
index 1f5cef2f..5041f661 100644
--- a/src/mainwindow.cpp
+++ b/src/mainwindow.cpp
@@ -2642,10 +2642,21 @@ void MainWindow::ignoreMissingData_clicked()
void MainWindow::markConverted_clicked()
{
- ModInfo::Ptr info = ModInfo::getByIndex(m_ContextRow);
- info->markConverted(true);
- connect(this, SIGNAL(modListDataChanged(QModelIndex, QModelIndex)), m_OrganizerCore.modList(), SIGNAL(dataChanged(QModelIndex, QModelIndex)));
- emit modListDataChanged(m_OrganizerCore.modList()->index(m_ContextRow, 0), m_OrganizerCore.modList()->index(m_ContextRow, m_OrganizerCore.modList()->columnCount() - 1));
+ QItemSelectionModel *selection = ui->modList->selectionModel();
+ if (selection->hasSelection() && selection->selectedRows().count() > 1) {
+ for (QModelIndex idx : selection->selectedRows()) {
+ int row_idx = idx.data(Qt::UserRole + 1).toInt();
+ ModInfo::Ptr info = ModInfo::getByIndex(row_idx);
+ info->markConverted(true);
+ connect(this, SIGNAL(modListDataChanged(QModelIndex, QModelIndex)), m_OrganizerCore.modList(), SIGNAL(dataChanged(QModelIndex, QModelIndex)));
+ emit modListDataChanged(m_OrganizerCore.modList()->index(row_idx, 0), m_OrganizerCore.modList()->index(row_idx, m_OrganizerCore.modList()->columnCount() - 1));
+ }
+ } else {
+ ModInfo::Ptr info = ModInfo::getByIndex(m_ContextRow);
+ info->markConverted(true);
+ connect(this, SIGNAL(modListDataChanged(QModelIndex, QModelIndex)), m_OrganizerCore.modList(), SIGNAL(dataChanged(QModelIndex, QModelIndex)));
+ emit modListDataChanged(m_OrganizerCore.modList()->index(m_ContextRow, 0), m_OrganizerCore.modList()->index(m_ContextRow, m_OrganizerCore.modList()->columnCount() - 1));
+ }
}