Double check that the user is sure when setting a non-empty mod as the output mod.

This commit is contained in:
AnyOldName3
2018-09-27 22:57:39 +01:00
parent a6657f1678
commit 9a67827bd7
2 changed files with 27 additions and 14 deletions
+14 -1
View File
@@ -142,7 +142,7 @@ class FNISTool(mobase.IPluginTool):
modDirectory = self.__getModDirectory()
isAMod = pathlibPath.parent.samefile(modDirectory)
if not pathlibPath.is_dir() or not isAMod:
QMessageBox.information(self.__parentWidget, self.__tr("Choose an output mod"), self.__tr("Please choose an output mod for Fore's New Idles in Skyrim. This must be a directory in Mod Organizer's mods directory, and you can create one if you do not have one already. FNIS will delete any existing contents of this directory when it is run, so do not choose a mod you use for anything else. This setting can be updated in the Plugins tab of the Mod Organizer Settings menu."))
QMessageBox.information(self.__parentWidget, self.__tr("Choose an output mod"), self.__tr("Please choose an output mod for Fore's New Idles in Skyrim. This must be a directory in Mod Organizer's mods directory, and you can create one if you do not have one already. This mod will not be available to the VFS when FNIS is run, so do not choose a mod you use for anything else. This setting can be updated in the Plugins tab of the Mod Organizer Settings menu."))
while not pathlibPath.is_dir() or not isAMod:
path = QFileDialog.getExistingDirectory(self.__parentWidget, self.__tr("Choose an output mod"), str(modDirectory), QFileDialog.ShowDirsOnly)
pathlibPath = pathlib.Path(path)
@@ -152,6 +152,19 @@ class FNISTool(mobase.IPluginTool):
isAMod = pathlibPath.parent.samefile(modDirectory)
if not isAMod:
QMessageBox.information(self.__parentWidget, self.__tr("Not a mod..."), self.__tr("The selected directory is not a Mod Organizer managed mod. Please choose a directory within the mods directory."))
continue
empty = True
for item in pathlibPath.iterdir():
if item.name != "meta.ini":
empty = False
break
if not empty:
if QMessageBox.question(self.__parentWidget, self.__tr("Mod not empty"), self.__tr("The selected mod already contains files. Are you sure want to use it as the output mod?"), QMessageBox.StandardButtons(QMessageBox.Yes | QMessageBox.No)) == QMessageBox.Yes:
# Proceed normally - the user is happy
pass
else:
# Restart outer loop - the user wants to pick again
isAMod = False
# The user may have created a new mod in the MO mods directory, so we must trigger a refresh
self.__organizer.refreshModList()
self.__organizer.setPluginSetting(self.name(), "output-path", path)
+13 -13
View File
@@ -141,49 +141,49 @@
<translation type="unfinished"></translation>
</message>
<message>
<location filename="FNISTool.py" line="146"/>
<location filename="FNISTool.py" line="147"/>
<source>Choose an output mod</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="FNISTool.py" line="144"/>
<source>Please choose an output mod for Fore&apos;s New Idles in Skyrim. This must be a directory in Mod Organizer&apos;s mods directory, and you can create one if you do not have one already. FNIS will delete any existing contents of this directory when it is run, so do not choose a mod you use for anything else. This setting can be updated in the Plugins tab of the Mod Organizer Settings menu.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="FNISTool.py" line="152"/>
<location filename="FNISTool.py" line="154"/>
<source>Not a mod...</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="FNISTool.py" line="152"/>
<location filename="FNISTool.py" line="154"/>
<source>The selected directory is not a Mod Organizer managed mod. Please choose a directory within the mods directory.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="FNISTool.py" line="167"/>
<location filename="FNISTool.py" line="172"/>
<source>Find FNIS</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="FNISTool.py" line="167"/>
<location filename="FNISTool.py" line="172"/>
<source>Fore&apos;s New Idles in Skyrim can&apos;t be found using the location saved in Mod Organizer&apos;s settings. Please find GenerateFNISforUsers.exe in the file picker. FNIS must be visible within the VFS, so choose an installation either within the game&apos;s data directory or within a mod folder. This setting can be updated in the Plugins tab of the Mod Organizer Settings menu.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="FNISTool.py" line="169"/>
<location filename="FNISTool.py" line="174"/>
<source>Locate GenerateFNISforUsers.exe</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="FNISTool.py" line="181"/>
<location filename="FNISTool.py" line="186"/>
<source>Not a compatible location...</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="FNISTool.py" line="181"/>
<location filename="FNISTool.py" line="186"/>
<source>Fore&apos;s New Idles in Skyrim only works when within the VFS, so must be installed to the game&apos;s data directory or within a mod folder. Please select a different FNIS installation.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="FNISTool.py" line="145"/>
<source>Please choose an output mod for Fore&apos;s New Idles in Skyrim. This must be a directory in Mod Organizer&apos;s mods directory, and you can create one if you do not have one already. This mod will not be available to the VFS when FNIS is run, so do not choose a mod you use for anything else. This setting can be updated in the Plugins tab of the Mod Organizer Settings menu.</source>
<translation type="unfinished"></translation>
</message>
</context>
</TS>