aboutsummaryrefslogtreecommitdiff
path: root/libs/plugin_python/src/mobase/wrappers/utils.cpp
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/plugin_python/src/mobase/wrappers/utils.cpp
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/plugin_python/src/mobase/wrappers/utils.cpp')
-rw-r--r--libs/plugin_python/src/mobase/wrappers/utils.cpp50
1 files changed, 50 insertions, 0 deletions
diff --git a/libs/plugin_python/src/mobase/wrappers/utils.cpp b/libs/plugin_python/src/mobase/wrappers/utils.cpp
new file mode 100644
index 0000000..95111fa
--- /dev/null
+++ b/libs/plugin_python/src/mobase/wrappers/utils.cpp
@@ -0,0 +1,50 @@
+#include "wrappers.h"
+
+#include "../pybind11_all.h"
+
+#include <uibase/report.h>
+#include <uibase/utility.h>
+
+#ifdef _WIN32
+#include "known_folders.h"
+#endif
+
+namespace py = pybind11;
+using namespace MOBase;
+
+namespace mo2::python {
+
+ void add_utils_bindings(pybind11::module_ m)
+ {
+#ifdef _WIN32
+ py::class_<KnownFolder> pyKnownFolder(m, "KnownFolder");
+ for (std::size_t i = 0; i < KNOWN_FOLDERS.size(); ++i) {
+ pyKnownFolder.attr(KNOWN_FOLDERS[i].name) = py::int_(i);
+ }
+
+ m.def(
+ "getKnownFolder",
+ [](std::size_t knownFolderId, QString what) {
+ return getKnownFolder(KNOWN_FOLDERS.at(knownFolderId).guid, what);
+ },
+ py::arg("known_folder"), py::arg("what") = "");
+
+ m.def(
+ "getOptionalKnownFolder",
+ [](std::size_t knownFolderId) {
+ const auto r =
+ getOptionalKnownFolder(KNOWN_FOLDERS.at(knownFolderId).guid);
+ return r.isEmpty() ? py::none{} : py::cast(r);
+ },
+ py::arg("known_folder"));
+#endif
+
+ m.def("getFileVersion", wrap_for_filepath(&MOBase::getFileVersion),
+ py::arg("filepath"));
+ m.def("getProductVersion", wrap_for_filepath(&MOBase::getProductVersion),
+ py::arg("executable"));
+ m.def("getIconForExecutable", wrap_for_filepath(&MOBase::iconForExecutable),
+ py::arg("executable"));
+ }
+
+} // namespace mo2::python