summaryrefslogtreecommitdiff
path: root/src/organizercore.cpp
diff options
context:
space:
mode:
authorJeremy Rimpo <jeremy.rimpo@servermonkey.com>2023-09-25 17:39:41 -0500
committerGitHub <noreply@github.com>2023-09-25 17:39:41 -0500
commit79d457f598bcfa7a8d094a87033a31f370c9c4c1 (patch)
tree3674e6b1223ac104422ce77b06d020c50ad31cc0 /src/organizercore.cpp
parent70509275405d2a5c5e94743786f03b17ef2051f2 (diff)
parent74668b9363d877d055a5e8b8c7d001ba448dc832 (diff)
Merge pull request #1880 from ModOrganizer2/qt6-category
WIP: Category Revamp
Diffstat (limited to 'src/organizercore.cpp')
-rw-r--r--src/organizercore.cpp36
1 files changed, 24 insertions, 12 deletions
diff --git a/src/organizercore.cpp b/src/organizercore.cpp
index e3d1ff29..b4e758d1 100644
--- a/src/organizercore.cpp
+++ b/src/organizercore.cpp
@@ -1,4 +1,5 @@
#include "organizercore.h"
+#include "categoriesdialog.h"
#include "credentialsdialog.h"
#include "delayedfilewriter.h"
#include "directoryrefresher.h"
@@ -759,8 +760,9 @@ OrganizerCore::doInstall(const QString& archivePath, GuessedValue<QString> modNa
// this prevents issue with third-party plugins, e.g., if the installed mod is
// activated before the structure is ready
//
- // we need to fetch modIndex() within the call back because the index is only valid
- // after the call to refresh(), but we do not want to connect after refresh()
+ // we need to fetch modIndex() within the call back because the index is only
+ // valid after the call to refresh(), but we do not want to connect after
+ // refresh()
//
connect(
this, &OrganizerCore::directoryStructureReady, this,
@@ -801,16 +803,26 @@ OrganizerCore::doInstall(const QString& archivePath, GuessedValue<QString> modNa
emit modInstalled(modName);
return {modIndex, modInfo};
} else {
- m_InstallationManager.notifyInstallationEnd(result, nullptr);
- if (m_InstallationManager.wasCancelled()) {
- QMessageBox::information(
- qApp->activeWindow(), tr("Extraction cancelled"),
- tr("The installation was cancelled while extracting files. "
- "If this was prior to a FOMOD setup, this warning may be ignored. "
- "However, if this was during installation, the mod will likely be missing "
- "files."),
- QMessageBox::Ok);
- refresh();
+ if (result.result() == MOBase::IPluginInstaller::RESULT_CATEGORYREQUESTED) {
+ CategoriesDialog dialog(qApp->activeWindow());
+
+ if (dialog.exec() == QDialog::Accepted) {
+ dialog.commitChanges();
+ refresh();
+ }
+ } else {
+ m_InstallationManager.notifyInstallationEnd(result, nullptr);
+ if (m_InstallationManager.wasCancelled()) {
+ QMessageBox::information(
+ qApp->activeWindow(), tr("Extraction cancelled"),
+ tr("The installation was cancelled while extracting files. "
+ "If this was prior to a FOMOD setup, this warning may be ignored. "
+ "However, if this was during installation, the mod will likely be "
+ "missing "
+ "files."),
+ QMessageBox::Ok);
+ refresh();
+ }
}
}