summaryrefslogtreecommitdiff
path: root/src/mainwindow.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mainwindow.cpp')
-rw-r--r--src/mainwindow.cpp24
1 files changed, 18 insertions, 6 deletions
diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp
index 74f3fd62..ea7d5967 100644
--- a/src/mainwindow.cpp
+++ b/src/mainwindow.cpp
@@ -578,7 +578,6 @@ void MainWindow::setupModList()
ui->modList->sortByColumn(ModList::COL_PRIORITY, Qt::AscendingOrder);
-
connect(
ui->modList, SIGNAL(dropModeUpdate(bool)),
m_OrganizerCore.modList(), SLOT(dropModeUpdate(bool)));
@@ -653,6 +652,10 @@ void MainWindow::setupModList()
ui->modList->header()->setSectionHidden(ModList::COL_NAME, false);
ui->modList->installEventFilter(m_OrganizerCore.modList());
+
+ connect(m_OrganizerCore.modList(), &ModList::downloadArchiveDropped, this, [this](int row, int priority) {
+ m_OrganizerCore.installDownload(row, priority);
+ });
}
void MainWindow::resetActionIcons()
@@ -743,6 +746,7 @@ MainWindow::~MainWindow()
}
}
+
void MainWindow::updateWindowTitle(const APIUserAccount& user)
{
//"\xe2\x80\x93" is an "em dash", a longer "-"
@@ -2483,15 +2487,23 @@ void MainWindow::modorder_changed()
void MainWindow::modInstalled(const QString &modName)
{
- QModelIndexList posList =
- m_OrganizerCore.modList()->match(m_OrganizerCore.modList()->index(0, 0), Qt::DisplayRole, modName);
- if (posList.count() == 1) {
- ui->modList->scrollTo(posList.at(0));
+ unsigned int index = ModInfo::getIndex(modName);
+
+ if (index == UINT_MAX) {
+ return;
+ }
+
+ QModelIndex qIndex = m_OrganizerCore.modList()->index(index, 0);
+
+ if (m_ModListSortProxy->sourceModel() == m_ModListByPriorityProxy) {
+ qIndex = m_ModListByPriorityProxy->mapFromSource(qIndex);
+ ui->modList->expand(m_ModListSortProxy->mapFromSource(qIndex));
}
+ ui->modList->scrollTo(m_ModListSortProxy->mapFromSource(qIndex));
// force an update to happen
std::multimap<QString, int> IDs;
- ModInfo::Ptr info = ModInfo::getByIndex(ModInfo::getIndex(modName));
+ ModInfo::Ptr info = ModInfo::getByIndex(index);
IDs.insert(std::make_pair<QString, int>(info->gameName(), info->nexusId()));
modUpdateCheck(IDs);
}