summaryrefslogtreecommitdiff
path: root/src/organizercore.cpp
diff options
context:
space:
mode:
authorMikaël Capelle <capelle.mikael@gmail.com>2020-12-27 23:23:56 +0100
committerMikaël Capelle <capelle.mikael@gmail.com>2021-01-02 15:38:15 +0100
commitcc5f0c8555fbbcc4b6d0dc29a42b8c7869df1859 (patch)
treef274552d9310bce72d4153bae417cdf38f841bb9 /src/organizercore.cpp
parentc46432cc2ef4a108557c1405a0f9c01616bc176e (diff)
Drag and drop from download view to install + Expand and scroll to mod on install.
Diffstat (limited to 'src/organizercore.cpp')
-rw-r--r--src/organizercore.cpp14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/organizercore.cpp b/src/organizercore.cpp
index 74b6ed08..454247b6 100644
--- a/src/organizercore.cpp
+++ b/src/organizercore.cpp
@@ -830,13 +830,13 @@ MOBase::IModInterface *OrganizerCore::installMod(const QString &fileName,
return nullptr;
}
-void OrganizerCore::installDownload(int index)
+ModInfo::Ptr OrganizerCore::installDownload(int index, int priority)
{
if (m_InstallationManager.isRunning()) {
QMessageBox::information(
qApp->activeWindow(), tr("Installation cancelled"),
tr("Another installation is currently in progress."), QMessageBox::Ok);
- return;
+ return nullptr;
}
try {
@@ -873,10 +873,15 @@ void OrganizerCore::installDownload(int index)
refresh();
int modIndex = ModInfo::getIndex(modName);
+ ModInfo::Ptr modInfo = nullptr;
if (modIndex != UINT_MAX) {
- ModInfo::Ptr modInfo = ModInfo::getByIndex(modIndex);
+ modInfo = ModInfo::getByIndex(modIndex);
modInfo->addInstalledFile(modID, fileID);
+ if (priority != -1) {
+ m_ModList.changeModPriority(modIndex, priority);
+ }
+
if (hasIniTweaks && m_UserInterface != nullptr
&& (QMessageBox::question(qApp->activeWindow(), tr("Configure Mod"),
tr("This mod contains ini tweaks. Do you "
@@ -894,6 +899,7 @@ void OrganizerCore::installDownload(int index)
}
m_DownloadManager.markInstalled(index);
emit modInstalled(modName);
+ return modInfo;
}
else {
m_InstallationManager.notifyInstallationEnd(result, nullptr);
@@ -909,6 +915,8 @@ void OrganizerCore::installDownload(int index)
} catch (const std::exception &e) {
reportError(e.what());
}
+
+ return nullptr;
}
QString OrganizerCore::resolvePath(const QString &fileName) const