diff --git a/OpenMWExport.py b/OpenMWExport.py
index 2f38979..8d06f28 100644
--- a/OpenMWExport.py
+++ b/OpenMWExport.py
@@ -27,7 +27,7 @@ def init(self, organizer):
self.__organizer = organizer
if sys.version_info < (3, 6):
qCritical(self.__tr("OpenMWExport plugin requires a Python {0} interpreter or newer, but is running on a Python {1} interpreter.").format("3.6", ".".join(map(str, sys.version_info[:3]))))
- QMessageBox.critical(self._parentWidget(), self.__tr("Incompatible Python version."), self.__tr("This version of the OpenMW Export plugin requires a Python {0} interpreter or newer, but Mod Organizer has provided a Python {1} interpreter. Mod Organizer {2} is the earliest compatible version. You should check for an update.").format("3.6", ".".join(map(str, sys.version_info[:3])), "2.1.6"))
+ QMessageBox.critical(self.__parentWidget, self.__tr("Incompatible Python version."), self.__tr("This version of the OpenMW Export plugin requires a Python {0} interpreter or newer, but Mod Organizer has provided a Python {1} interpreter. Mod Organizer {2} is the earliest compatible version. You should check for an update.").format("3.6", ".".join(map(str, sys.version_info[:3])), "2.1.6"))
return False
if self.__organizer.appVersion() >= mobase.VersionInfo(2, 3, 1):
self.__nexusBridge = self.__organizer.createNexusBridge()
@@ -67,6 +67,9 @@ def tooltip(self):
def icon(self):
return QIcon("plugins/openmw.ico")
+ def setParentWidget(self, widget):
+ self.__parentWidget = widget
+
def display(self):
if self.__organizer.appVersion() >= mobase.VersionInfo(2, 4, 0):
allModsByProfilePriority = self.__organizer.modList().allModsByProfilePriority
@@ -77,16 +80,16 @@ def display(self):
# We can't do that directly, so instead we just test if the current game is Morrowind
game = self.__organizer.managedGame()
if game.gameName() != "Morrowind":
- QMessageBox.critical(self._parentWidget(), self.__tr("Incompatible game"), self.__tr("(At least when this plugin is being written) OpenMW only supports game data designed for the Morrowind engine. The game being managed is not Morrowind, so the export will abort. If you think you know better than this message, update this plugin."))
+ QMessageBox.critical(self.__parentWidget, self.__tr("Incompatible game"), self.__tr("(At least when this plugin is being written) OpenMW only supports game data designed for the Morrowind engine. The game being managed is not Morrowind, so the export will abort. If you think you know better than this message, update this plugin."))
return
# Give the user the opportunity to abort
- confirmationButton = QMessageBox.question(self._parentWidget(), self.__tr("Before starting export..."), self.__tr("Before starting the export to OpenMW, please ensure you've backed up anything in OpenMW.cfg which you do not want to risk losing forever."), QMessageBox.StandardButtons(QMessageBox.Ok | QMessageBox.Cancel))
+ confirmationButton = QMessageBox.question(self.__parentWidget, self.__tr("Before starting export..."), self.__tr("Before starting the export to OpenMW, please ensure you've backed up anything in OpenMW.cfg which you do not want to risk losing forever."), QMessageBox.StandardButtons(QMessageBox.Ok | QMessageBox.Cancel))
if confirmationButton != QMessageBox.Ok:
return
# Get the path to the OpenMW.cfg file
configPath = self.__getOpenMWConfigPath()
if not configPath.is_file():
- QMessageBox.critical(self._parentWidget(), self.__tr("Config file not specified"), self.__tr("No config file was specified"))
+ QMessageBox.critical(self.__parentWidget, self.__tr("Config file not specified"), self.__tr("No config file was specified"))
return
# Clear out the existing data= and content= lines from openmw.cfg
self.__clearOpenMWConfig(configPath)
@@ -107,7 +110,7 @@ def display(self):
# actually write out the list
for pluginIndex in range(len(loadOrder)):
openmwcfg.write("content=" + loadOrder[pluginIndex] + "\n")
- QMessageBox.information(self._parentWidget(), self.__tr("OpenMW Export Complete"), self.__tr("The export to OpenMW completed successfully. The current setup was saved to {0}").format(configPath))
+ QMessageBox.information(self.__parentWidget, self.__tr("OpenMW Export Complete"), self.__tr("The export to OpenMW completed successfully. The current setup was saved to {0}").format(configPath))
def __tr(self, str):
return QCoreApplication.translate("OpenMWExportPlugin", str)
@@ -160,7 +163,7 @@ def __getOpenMWConfigPath(self):
if defaultLocation.is_file():
return defaultLocation
# If we've got this far, then the user is doing something very weird, so they can find it themselves.
- return Path(QFileDialog.getOpenFileName(self._parentWidget(), self.__tr("Locate OpenMW Config File"), ".", "OpenMW Config File (openmw.cfg)")[0])
+ return Path(QFileDialog.getOpenFileName(self.__parentWidget, self.__tr("Locate OpenMW Config File"), ".", "OpenMW Config File (openmw.cfg)")[0])
def __checkForUpdate(self, mainWindow):
self.__nexusBridge.requestDescription("Morrowind", 45642, None)
diff --git a/OpenMWExport_en.ts b/OpenMWExport_en.ts
index 2ca79bb..af99fa3 100644
--- a/OpenMWExport_en.ts
+++ b/OpenMWExport_en.ts
@@ -18,47 +18,47 @@
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
@@ -78,12 +78,12 @@
-
+
-
+