summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/installationmanager.cpp8
-rw-r--r--src/installationmanager.h7
-rw-r--r--src/modinfodialog.ui22
-rw-r--r--src/modlist.cpp6
-rw-r--r--src/organizercore.cpp2
-rw-r--r--src/processrunner.cpp12
-rw-r--r--src/version.rc6
7 files changed, 50 insertions, 13 deletions
diff --git a/src/installationmanager.cpp b/src/installationmanager.cpp
index b9f35af8..801b2a67 100644
--- a/src/installationmanager.cpp
+++ b/src/installationmanager.cpp
@@ -369,7 +369,7 @@ QString InstallationManager::generateBackupName(const QString &directoryName) co
}
-bool InstallationManager::testOverwrite(GuessedValue<QString> &modName, bool *merge) const
+bool InstallationManager::testOverwrite(GuessedValue<QString> &modName, bool *merge)
{
QString targetDirectory = QDir::fromNativeSeparators(m_ModsDirectory + "\\" + modName);
@@ -406,6 +406,12 @@ bool InstallationManager::testOverwrite(GuessedValue<QString> &modName, bool *me
targetDirectory = QDir::fromNativeSeparators(m_ModsDirectory) + "/" + modName;
}
} else if (overwriteDialog.action() == QueryOverwriteDialog::ACT_REPLACE) {
+ unsigned int idx = ModInfo::getIndex(modName);
+ if (idx != UINT_MAX) {
+ auto modInfo = ModInfo::getByIndex(idx);
+ // mark the old install file as uninstalled
+ emit modReplaced(modInfo->getInstallationFile());
+ }
// save original settings like categories. Because it makes sense
QString metaFilename = targetDirectory + "/meta.ini";
QFile settingsFile(metaFilename);
diff --git a/src/installationmanager.h b/src/installationmanager.h
index 695f2ed6..b3a7362f 100644
--- a/src/installationmanager.h
+++ b/src/installationmanager.h
@@ -185,7 +185,7 @@ public:
* @param merge if this value is not null, the value will be set to whether the use chose to merge or replace
* @return true if we can proceed with the installation, false if the user canceled or in case of an unrecoverable error
*/
- virtual bool testOverwrite(MOBase::GuessedValue<QString> &modName, bool *merge = nullptr) const;
+ virtual bool testOverwrite(MOBase::GuessedValue<QString> &modName, bool *merge = nullptr);
QString generateBackupName(const QString &directoryName) const;
@@ -225,6 +225,11 @@ signals:
*/
void progressUpdate();
+ /**
+ * @brief An existing mod has been replaced with a newly installed one.
+ */
+ void modReplaced(const QString fileName);
+
private:
struct ByPriority {
diff --git a/src/modinfodialog.ui b/src/modinfodialog.ui
index f035d93b..9fa60e40 100644
--- a/src/modinfodialog.ui
+++ b/src/modinfodialog.ui
@@ -550,12 +550,15 @@ Most mods do not have optional esps, so chances are good you are looking at an e
<verstretch>0</verstretch>
</sizepolicy>
</property>
+ <property name="toolTip">
+ <string>Files that exist in other mods but are overwritten by this mod</string>
+ </property>
<property name="styleSheet">
<string notr="true">border: none;
text-align: left;</string>
</property>
<property name="text">
- <string>The following conflicted files are provided by this mod</string>
+ <string>Winning file conflicts:</string>
</property>
</widget>
</item>
@@ -584,6 +587,9 @@ text-align: left;</string>
<property name="contextMenuPolicy">
<enum>Qt::CustomContextMenu</enum>
</property>
+ <property name="toolTip">
+ <string>Files that exist in other mods but are overwritten by this mod</string>
+ </property>
<property name="alternatingRowColors">
<bool>true</bool>
</property>
@@ -613,12 +619,15 @@ text-align: left;</string>
<verstretch>0</verstretch>
</sizepolicy>
</property>
+ <property name="toolTip">
+ <string>Files that are unused because they are overwritten by other mods</string>
+ </property>
<property name="styleSheet">
<string notr="true">border: none;
text-align: left;</string>
</property>
<property name="text">
- <string>The following conflicted files are provided by other mods</string>
+ <string>Losing file conflicts:</string>
</property>
</widget>
</item>
@@ -644,6 +653,9 @@ text-align: left;</string>
<property name="contextMenuPolicy">
<enum>Qt::CustomContextMenu</enum>
</property>
+ <property name="toolTip">
+ <string>Files that are unused because they are overwritten by other mods</string>
+ </property>
<property name="alternatingRowColors">
<bool>true</bool>
</property>
@@ -673,6 +685,9 @@ text-align: left;</string>
<verstretch>0</verstretch>
</sizepolicy>
</property>
+ <property name="toolTip">
+ <string>Files that have no conflicts</string>
+ </property>
<property name="styleSheet">
<string notr="true">border: none;
text-align: left;</string>
@@ -704,6 +719,9 @@ text-align: left;</string>
<property name="contextMenuPolicy">
<enum>Qt::CustomContextMenu</enum>
</property>
+ <property name="toolTip">
+ <string>Files that have no conflicts</string>
+ </property>
<property name="alternatingRowColors">
<bool>true</bool>
</property>
diff --git a/src/modlist.cpp b/src/modlist.cpp
index 06e5e9bf..cb08c6f4 100644
--- a/src/modlist.cpp
+++ b/src/modlist.cpp
@@ -1156,8 +1156,10 @@ void ModList::removeRowForce(int row, const QModelIndex &parent)
if (wasEnabled) {
emit removeOrigin(modInfo->name());
}
-
- emit modUninstalled(modInfo->getInstallationFile());
+ auto flags = modInfo->getFlags();
+ if (std::find(flags.begin(), flags.end(), ModInfo::FLAG_BACKUP) == flags.end()) {
+ emit modUninstalled(modInfo->getInstallationFile());
+ }
}
bool ModList::removeRows(int row, int count, const QModelIndex &parent)
diff --git a/src/organizercore.cpp b/src/organizercore.cpp
index 2d469a6b..28bb06db 100644
--- a/src/organizercore.cpp
+++ b/src/organizercore.cpp
@@ -247,6 +247,8 @@ void OrganizerCore::setUserInterface(IUserInterface* ui)
SLOT(modRenamed(QString, QString)));
connect(&m_ModList, SIGNAL(modUninstalled(QString)), w,
SLOT(modRemoved(QString)));
+ connect(&m_InstallationManager, SIGNAL(modReplaced(QString)), w,
+ SLOT(modRemoved(QString)));
connect(&m_ModList, SIGNAL(removeSelectedMods()), w,
SLOT(removeMod_clicked()));
connect(&m_ModList, SIGNAL(clearOverwrite()), w,
diff --git a/src/processrunner.cpp b/src/processrunner.cpp
index 3ea40da2..97b5c580 100644
--- a/src/processrunner.cpp
+++ b/src/processrunner.cpp
@@ -19,12 +19,16 @@ void adjustForVirtualized(
// "environment" with the appropriate paths fixed:
// (i.e. mods\FNIS\path\exe => game\data\path\exe)
QString cwdPath = sp.currentDirectory.absolutePath();
- bool virtualizedCwd = cwdPath.startsWith(modsPath, Qt::CaseInsensitive);
+ QString trailedModsPath = modsPath;
+ if (!trailedModsPath.endsWith('/')) {
+ trailedModsPath = trailedModsPath + '/';
+ }
+ bool virtualizedCwd = cwdPath.startsWith(trailedModsPath, Qt::CaseInsensitive);
QString binPath = sp.binary.absoluteFilePath();
- bool virtualizedBin = binPath.startsWith(modsPath, Qt::CaseInsensitive);
+ bool virtualizedBin = binPath.startsWith(trailedModsPath, Qt::CaseInsensitive);
if (virtualizedCwd || virtualizedBin) {
if (virtualizedCwd) {
- int cwdOffset = cwdPath.indexOf('/', modsPath.length() + 1);
+ int cwdOffset = cwdPath.indexOf('/', trailedModsPath.length());
QString adjustedCwd = cwdPath.mid(cwdOffset, -1);
cwdPath = game->dataDirectory().absolutePath();
if (cwdOffset >= 0)
@@ -33,7 +37,7 @@ void adjustForVirtualized(
}
if (virtualizedBin) {
- int binOffset = binPath.indexOf('/', modsPath.length() + 1);
+ int binOffset = binPath.indexOf('/', trailedModsPath.length());
QString adjustedBin = binPath.mid(binOffset, -1);
binPath = game->dataDirectory().absolutePath();
if (binOffset >= 0)
diff --git a/src/version.rc b/src/version.rc
index 8e2000ed..7e62e114 100644
--- a/src/version.rc
+++ b/src/version.rc
@@ -3,14 +3,14 @@
// If VS_FF_PRERELEASE is not set, MO labels the build as a release and uses VER_FILEVERSION to determine version number.
// Otherwise, if letters are used in VER_FILEVERSION_STR, uses the full MOBase::VersionInfo parser
// Otherwise, uses the numbers from VER_FILEVERSION and sets the release type as pre-alpha
-#define VER_FILEVERSION 2,3,1
-#define VER_FILEVERSION_STR "2.3.1\0"
+#define VER_FILEVERSION 2,4,0
+#define VER_FILEVERSION_STR "2.4.0alpha0\0"
VS_VERSION_INFO VERSIONINFO
FILEVERSION VER_FILEVERSION
PRODUCTVERSION VER_FILEVERSION
FILEFLAGSMASK VS_FFI_FILEFLAGSMASK
-FILEFLAGS (0)
+FILEFLAGS VS_FF_PRERELEASE
FILEOS VOS__WINDOWS32
FILETYPE VFT_APP
FILESUBTYPE (0)