From 3717f4ee464c688dd4ace5ea27f7be604264a841 Mon Sep 17 00:00:00 2001 From: Jonathan Feenstra <26406078+JonathanFeenstra@users.noreply.github.com> Date: Sun, 18 Jan 2026 17:10:23 +0100 Subject: [PATCH 1/3] Add executables list to plugin API --- include/uibase/iexecutable.h | 82 +++++++++++++++++++++++++++++++ include/uibase/iexecutableslist.h | 74 ++++++++++++++++++++++++++++ include/uibase/imoinfo.h | 6 +++ src/CMakeLists.txt | 2 + 4 files changed, 164 insertions(+) create mode 100644 include/uibase/iexecutable.h create mode 100644 include/uibase/iexecutableslist.h diff --git a/include/uibase/iexecutable.h b/include/uibase/iexecutable.h new file mode 100644 index 0000000..1ff5e71 --- /dev/null +++ b/include/uibase/iexecutable.h @@ -0,0 +1,82 @@ +/* +Mod Organizer shared UI functionality + +Copyright (C) 2012 Sebastian Herbord. All rights reserved. + +This library is free software; you can redistribute it and/or +modify it under the terms of the GNU Lesser General Public +License as published by the Free Software Foundation; either +version 3 of the License, or (at your option) any later version. + +This library is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +Lesser General Public License for more details. + +You should have received a copy of the GNU Lesser General Public +License along with this library; if not, write to the Free Software +Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +#ifndef IEXECUTABLE_H +#define IEXECUTABLE_H + +#include +#include + +namespace MOBase +{ +class IExecutable +{ +public: // Information found in ExecutableInfo + /** + * @return the title of the executable. + */ + virtual const QString& title() const = 0; + + /** + * @return the file info of the executable binary. + */ + virtual const QFileInfo& binaryInfo() const = 0; + + /** + * @return the arguments to be passed to the executable. + */ + virtual const QString& arguments() const = 0; + + /** + * @return the Steam App ID associated with this executable, or an empty string if + * there is none. + */ + virtual const QString& steamAppID() const = 0; + + /** + * @return the working directory for the executable. + */ + virtual const QString& workingDirectory() const = 0; + +public: // Information found in flags + /** + * @return true if the executable is shown on the toolbar. + */ + virtual bool isShownOnToolbar() const = 0; + + /** + * @return true if the executable's application icon is used for desktop shortcuts. + */ + virtual bool usesOwnIcon() const = 0; + + /** + * @return true if Mod Organizer should minimize to the system tray while this + * executable is running. + */ + virtual bool minimizeToSystemTray() const = 0; + + /** + * @return true if this executable is hidden in the user interface. + */ + virtual bool hide() const = 0; +}; +} // namespace MOBase + +#endif // IEXECUTABLE_H \ No newline at end of file diff --git a/include/uibase/iexecutableslist.h b/include/uibase/iexecutableslist.h new file mode 100644 index 0000000..51d9298 --- /dev/null +++ b/include/uibase/iexecutableslist.h @@ -0,0 +1,74 @@ +/* +Mod Organizer shared UI functionality + +Copyright (C) 2012 Sebastian Herbord. All rights reserved. + +This library is free software; you can redistribute it and/or +modify it under the terms of the GNU Lesser General Public +License as published by the Free Software Foundation; either +version 3 of the License, or (at your option) any later version. + +This library is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +Lesser General Public License for more details. + +You should have received a copy of the GNU Lesser General Public +License along with this library; if not, write to the Free Software +Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +#ifndef IEXECUTABLESLIST_H +#define IEXECUTABLESLIST_H + +#include +#include +#include +#include + +#include "iexecutable.h" + +namespace MOBase +{ +/** + * @brief Interface to the list of executables configured in Mod Organizer. + */ +class IExecutablesList +{ +public: + /** + * @return a list of all executables configured in Mod Organizer. + */ + virtual std::vector> executables() const = 0; + + /** + * @brief Retrieve an executable by its title. + * + * @param title Title of the executable to retrieve. + * + * @return the executable with the specified title, or nullptr if not found. + */ + virtual std::shared_ptr getByTitle(const QString& title) const = 0; + + /** + * @brief Retrieve an executable by its binary file info. + * + * @param info File info of the executable binary to retrieve. + * + * @return the executable with the specified binary, or nullptr if not found. + */ + virtual std::shared_ptr + getByBinary(const QFileInfo& info) const = 0; + + /** + * @brief Check if an executable with the specified title exists. + * + * @param title Title of the executable to check. + * + * @return true if an executable with the specified title exists, false otherwise. + */ + virtual bool titleExists(const QString& title) const = 0; +}; +} // namespace MOBase + +#endif // IEXECUTABLESLIST_H \ No newline at end of file diff --git a/include/uibase/imoinfo.h b/include/uibase/imoinfo.h index a6c9883..dde0b82 100644 --- a/include/uibase/imoinfo.h +++ b/include/uibase/imoinfo.h @@ -33,6 +33,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA #include "game_features/game_feature.h" #include "guessedvalue.h" +#include "iexecutableslist.h" #include "imodlist.h" #include "iprofile.h" #include "versioninfo.h" @@ -330,6 +331,11 @@ class QDLLEXPORT IOrganizer : public QObject */ virtual IModList* modList() const = 0; + /** + * @return interface to the list of executables + */ + virtual IExecutablesList* executablesList() const = 0; + /** * @return interface to the active profile */ diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index b8cedfe..ffab48a 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -34,6 +34,8 @@ set(root_headers ../include/uibase/versioninfo.h ) set(interface_headers + ../include/uibase/iexecutable.h + ../include/uibase/iexecutableslist.h ../include/uibase/ifiletree.h ../include/uibase/ifiletree_utils.h ../include/uibase/iinstallationmanager.h From dcde16ef36044ba7a453ba5ef76d17651d2686f8 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Sun, 18 Jan 2026 16:18:00 +0000 Subject: [PATCH 2/3] [pre-commit.ci] Auto fixes from pre-commit.com hooks. --- include/uibase/iexecutable.h | 2 +- include/uibase/iexecutableslist.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/include/uibase/iexecutable.h b/include/uibase/iexecutable.h index 1ff5e71..e9f8fc4 100644 --- a/include/uibase/iexecutable.h +++ b/include/uibase/iexecutable.h @@ -79,4 +79,4 @@ class IExecutable }; } // namespace MOBase -#endif // IEXECUTABLE_H \ No newline at end of file +#endif // IEXECUTABLE_H diff --git a/include/uibase/iexecutableslist.h b/include/uibase/iexecutableslist.h index 51d9298..135b776 100644 --- a/include/uibase/iexecutableslist.h +++ b/include/uibase/iexecutableslist.h @@ -71,4 +71,4 @@ class IExecutablesList }; } // namespace MOBase -#endif // IEXECUTABLESLIST_H \ No newline at end of file +#endif // IEXECUTABLESLIST_H From 4137bf143e8d6c405c88347f84789da97b8b11a8 Mon Sep 17 00:00:00 2001 From: Jonathan Feenstra <26406078+JonathanFeenstra@users.noreply.github.com> Date: Sat, 24 Jan 2026 19:38:18 +0100 Subject: [PATCH 3/3] WIP --- include/uibase/iexecutable.h | 2 ++ include/uibase/iexecutableslist.h | 17 +++++++++-------- include/uibase/imoinfo.h | 2 +- 3 files changed, 12 insertions(+), 9 deletions(-) diff --git a/include/uibase/iexecutable.h b/include/uibase/iexecutable.h index e9f8fc4..7873b10 100644 --- a/include/uibase/iexecutable.h +++ b/include/uibase/iexecutable.h @@ -41,6 +41,8 @@ class IExecutable /** * @return the arguments to be passed to the executable. + * + * @note This API might be changed in the future to return a QStringList instead. */ virtual const QString& arguments() const = 0; diff --git a/include/uibase/iexecutableslist.h b/include/uibase/iexecutableslist.h index 135b776..f8f7a3f 100644 --- a/include/uibase/iexecutableslist.h +++ b/include/uibase/iexecutableslist.h @@ -23,8 +23,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA #include #include -#include -#include + +#include #include "iexecutable.h" @@ -37,9 +37,11 @@ class IExecutablesList { public: /** - * @return a list of all executables configured in Mod Organizer. + * @brief Retrieve all configured executables. + * + * @return a generator yielding all configured executables. */ - virtual std::vector> executables() const = 0; + virtual std::generator executables() const = 0; /** * @brief Retrieve an executable by its title. @@ -48,7 +50,7 @@ class IExecutablesList * * @return the executable with the specified title, or nullptr if not found. */ - virtual std::shared_ptr getByTitle(const QString& title) const = 0; + virtual const IExecutable* getByTitle(const QString& title) const = 0; /** * @brief Retrieve an executable by its binary file info. @@ -57,8 +59,7 @@ class IExecutablesList * * @return the executable with the specified binary, or nullptr if not found. */ - virtual std::shared_ptr - getByBinary(const QFileInfo& info) const = 0; + virtual const IExecutable* getByBinary(const QFileInfo& info) const = 0; /** * @brief Check if an executable with the specified title exists. @@ -67,7 +68,7 @@ class IExecutablesList * * @return true if an executable with the specified title exists, false otherwise. */ - virtual bool titleExists(const QString& title) const = 0; + virtual bool contains(const QString& title) const = 0; }; } // namespace MOBase diff --git a/include/uibase/imoinfo.h b/include/uibase/imoinfo.h index dde0b82..36233b1 100644 --- a/include/uibase/imoinfo.h +++ b/include/uibase/imoinfo.h @@ -33,7 +33,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA #include "game_features/game_feature.h" #include "guessedvalue.h" -#include "iexecutableslist.h" #include "imodlist.h" #include "iprofile.h" #include "versioninfo.h" @@ -42,6 +41,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA namespace MOBase { +class IExecutablesList; class IFileTree; class IModInterface; class IModRepositoryBridge;