aboutsummaryrefslogtreecommitdiff
path: root/libs/fnistool/src/FNISToolReset.py
diff options
context:
space:
mode:
authorSulfurNitride <SulfurNitride@users.noreply.github.com>2026-02-11 02:37:39 -0600
committerSulfurNitride <SulfurNitride@users.noreply.github.com>2026-02-11 02:37:39 -0600
commit7ee008e150bc5bcf76082d726f719ee0fdfda982 (patch)
tree27fb39be241fdb5ac2734c574de678977d1856d0 /libs/fnistool/src/FNISToolReset.py
Fluorine Manager: full Linux port of Mod Organizer 2
Complete native Linux port with FUSE-based virtual filesystem, Proton/umu-run integration, and Flatpak packaging. Key features: - FUSE VFS replacing Windows USVFS (in-process + standalone helper for Flatpak) - Proton/GE-Proton/umu-run launcher with env var forwarding - Flatpak support (sandbox-aware VFS, NXM handler, umu-run) - Wine prefix management UI - Case-insensitive path resolution for Linux filesystems - QSettings-safe INI handling (avoids Bethesda INI corruption) - Portable instance support with auto-generated launcher scripts Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Diffstat (limited to 'libs/fnistool/src/FNISToolReset.py')
-rw-r--r--libs/fnistool/src/FNISToolReset.py76
1 files changed, 76 insertions, 0 deletions
diff --git a/libs/fnistool/src/FNISToolReset.py b/libs/fnistool/src/FNISToolReset.py
new file mode 100644
index 0000000..d1f4bc9
--- /dev/null
+++ b/libs/fnistool/src/FNISToolReset.py
@@ -0,0 +1,76 @@
+import os
+import sys
+
+from FNISTool import FNISTool
+from PyQt6.QtCore import QFileInfo, QCoreApplication
+from PyQt6.QtGui import QFileSystemModel, QIcon
+from PyQt6.QtWidgets import QMessageBox
+
+import mobase
+
+class FNISToolReset(mobase.IPluginTool):
+ def __init__(self):
+ super(FNISToolReset, self).__init__()
+ self.__organizer = None
+ self.__parentWidget = None
+
+ def init(self, organizer):
+ self.__organizer = organizer
+ return True
+
+ def name(self):
+ return "FNIS Integration Tool Reset"
+
+ def localizedName(self):
+ return self.tr("FNIS Integration Tool Reset")
+
+ def author(self):
+ return "LostDragonist"
+
+ def description(self):
+ return self.tr("Provides an easier way to reset the FNIS integration tool settings when needed.")
+
+ def version(self):
+ return mobase.VersionInfo(1, 0, 0, 0)
+
+ def master(self):
+ return "FNIS Integration Tool"
+
+ def settings(self):
+ return []
+
+ def displayName(self):
+ return self.tr("FNIS/Reset FNIS Settings")
+
+ def tooltip(self):
+ return self.description()
+
+ def icon(self):
+ fnisPath = self.__organizer.pluginSetting(self.__mainToolName(), "fnis-path")
+ if os.path.exists(fnisPath):
+ # We can't directly grab the icon from an executable, but this seems like the simplest alternative.
+ fin = QFileInfo(fnisPath)
+ model = QFileSystemModel()
+ model.setRootPath(fin.path())
+ return model.fileIcon(model.index(fin.filePath()))
+ else:
+ # Fall back to where the user might have put an icon manually.
+ return QIcon("plugins/FNIS.ico")
+
+ def setParentWidget(self, widget):
+ self.__parentWidget = widget
+
+ def display(self):
+ result = QMessageBox.question(self.__parentWidget, self.tr("Reset settings?"), self.tr("Would you like to reset the options that pop up when you first ran \"{}\"?").format(self.__mainToolName()))
+ if result == QMessageBox.StandardButton.Yes:
+ self.__organizer.setPluginSetting(self.__mainToolName(), "initialised", False)
+
+ def tr(self, str):
+ return QCoreApplication.translate("FNISToolReset", str)
+
+ @staticmethod
+ def __mainToolName():
+ return FNISTool().name()
+
+def createPlugin():
+ return FNISToolReset()