diff options
| author | isanae <14251494+isanae@users.noreply.github.com> | 2019-06-14 04:30:33 -0400 |
|---|---|---|
| committer | isanae <14251494+isanae@users.noreply.github.com> | 2019-06-15 14:40:40 -0400 |
| commit | 7671725436551b7254ea89ff6985c5491fcc743d (patch) | |
| tree | 8b9b36e71e7a5725b912f68dcb9b39db76a4f70d /src/executableslist.h | |
| parent | 82975a6a38d0807e962b0e4b6cbd76337dc8189c (diff) | |
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
Diffstat (limited to 'src/executableslist.h')
| -rw-r--r-- | src/executableslist.h | 24 |
1 files changed, 20 insertions, 4 deletions
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 <http://www.gnu.org/licenses/>. #include "executableinfo.h"
#include <vector>
+#include <optional>
#include <QFileInfo>
#include <QMetaType>
@@ -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<QString> makeNonConflictingTitle(const QString& prefix);
+
private:
+ enum SetFlags
+ {
+ IgnoreExisting = 1,
+ MergeExisting,
+ MoveExisting
+ };
+
std::vector<Executable> 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)
|
