From 7671725436551b7254ea89ff6985c5491fcc743d Mon Sep 17 00:00:00 2001
From: isanae <14251494+isanae@users.noreply.github.com>
Date: Fri, 14 Jun 2019 04:30:33 -0400
Subject: removed concept of custom executables, everything is modifiable added
apply button to dialog added reset button that re-adds plugin executables and
renames existing ones if needed moved executables files to their filter in
visual studio
---
src/executableslist.h | 24 ++++++++++++++++++++----
1 file changed, 20 insertions(+), 4 deletions(-)
(limited to 'src/executableslist.h')
diff --git a/src/executableslist.h b/src/executableslist.h
index 54a105d0..61582e71 100644
--- a/src/executableslist.h
+++ b/src/executableslist.h
@@ -23,6 +23,7 @@ along with Mod Organizer. If not, see .
#include "executableinfo.h"
#include
+#include
#include
#include
@@ -37,14 +38,13 @@ class Executable
public:
enum Flag
{
- CustomExecutable = 0x01,
ShowInToolbar = 0x02,
UseApplicationIcon = 0x04
};
Q_DECLARE_FLAGS(Flags, Flag);
- Executable() = default;
+ Executable(QString title={});
/**
* @brief Executable from plugin
@@ -65,7 +65,6 @@ public:
Executable& workingDirectory(const QString& s);
Executable& flags(Flags f);
- bool isCustom() const;
bool isShownOnToolbar() const;
void setShownOnToolbar(bool state);
bool usesOwnIcon() const;
@@ -106,6 +105,8 @@ public:
*/
void load(const MOBase::IPluginGame* game, QSettings& settings);
+ void resetFromPlugin(MOBase::IPluginGame const *game);
+
/**
* @brief writes the current list to the settings
*/
@@ -166,13 +167,28 @@ public:
**/
void remove(const QString &title);
+ std::optional makeNonConflictingTitle(const QString& prefix);
+
private:
+ enum SetFlags
+ {
+ IgnoreExisting = 1,
+ MergeExisting,
+ MoveExisting
+ };
+
std::vector m_Executables;
/**
* @brief add the executables preconfigured for this game
**/
- void addFromPlugin(MOBase::IPluginGame const *game);
+ void addFromPlugin(MOBase::IPluginGame const *game, SetFlags flags);
+
+ /**
+ * @brief add a new executable to the list
+ * @param executable
+ */
+ void setExecutable(const Executable &exe, SetFlags flags);
};
Q_DECLARE_OPERATORS_FOR_FLAGS(Executable::Flags)
--
cgit v1.3.1