diff options
| author | Tannin <devnull@localhost> | 2015-08-09 13:51:17 +0200 |
|---|---|---|
| committer | Tannin <devnull@localhost> | 2015-08-09 13:51:17 +0200 |
| commit | 6f09cf2205fdf9ce87b6219883585508b3cf2667 (patch) | |
| tree | 015eef2e9eec84895d12d493270b7280797f793f /src/executableslist.h | |
| parent | e6abe486a73928b8ec5bf01acd475d23aec722e0 (diff) | |
| parent | b0982148609a8a6f0d73d801ec9fcd1a22930f98 (diff) | |
Merge
Diffstat (limited to 'src/executableslist.h')
| -rw-r--r-- | src/executableslist.h | 63 |
1 files changed, 50 insertions, 13 deletions
diff --git a/src/executableslist.h b/src/executableslist.h index 907b37aa..4aba4ce2 100644 --- a/src/executableslist.h +++ b/src/executableslist.h @@ -35,27 +35,38 @@ struct Executable { QString m_Title;
QFileInfo m_BinaryInfo;
QString m_Arguments;
- MOBase::ExecutableInfo::CloseMOStyle m_CloseMO;
QString m_SteamAppID;
QString m_WorkingDirectory;
- enum Flag {
+ //These flags are set by other parts of the system and can't be
+ //changed when modifying from the custom executable window
+ enum OtherFlag__ {
CustomExecutable = 0x01,
- ShowInToolbar = 0x02,
- UseApplicationIcon = 0x04
+ ShowInToolbar = 0x02
};
+ Q_DECLARE_FLAGS(OtherFlags, OtherFlag__)
- Q_DECLARE_FLAGS(Flags, Flag)
+ OtherFlags m_OtherFlags;
- Flags m_Flags;
+ //These flags can be changed from the Custom Executable window.
+ enum SettableFlag__ {
+ CloseOnExecution = 0x01,
+ UseApplicationIcon = 0x02
+ };
+ Q_DECLARE_FLAGS(SettableFlags, SettableFlag__)
+
+ SettableFlags m_SettableFlags;
- bool isCustom() const { return m_Flags.testFlag(CustomExecutable); }
+ bool isCustom() const { return m_OtherFlags.testFlag(CustomExecutable); }
- bool shownOnToolbar() const { return m_Flags.testFlag(ShowInToolbar); }
+ bool shownOnToolbar() const { return m_OtherFlags.testFlag(ShowInToolbar); }
void showOnToolbar(bool state);
- bool usesOwnIcon() const { return m_Flags.testFlag(UseApplicationIcon); }
+ bool usesOwnIcon() const { return m_SettableFlags.testFlag(UseApplicationIcon); }
+
+ bool closeOnExecution() const { return m_SettableFlags.testFlag(CloseOnExecution); }
+
};
@@ -138,9 +149,24 @@ public: const QString &executableName,
const QString &arguments,
const QString &workingDirectory,
- MOBase::ExecutableInfo::CloseMOStyle closeMO,
const QString &steamAppID,
- Executable::Flags flags);
+ Executable::SettableFlags settable
+ )
+ {
+ addExecutable(title, executableName, arguments, workingDirectory, steamAppID, settable, false, 0);
+ }
+
+ void addExecutable(const QString &title,
+ const QString &executableName,
+ const QString &arguments,
+ const QString &workingDirectory,
+ const QString &steamAppID,
+ Executable::SettableFlags settable,
+ Executable::OtherFlags other
+ )
+ {
+ addExecutable(title, executableName, arguments, workingDirectory, steamAppID, settable, true, other);
+ }
/**
* @brief remove the executable with the specified file name. This needs to be an absolute file path
@@ -177,8 +203,18 @@ private: std::vector<Executable>::iterator findExe(const QString &title);
+ void addExecutable(const QString &title,
+ const QString &executableName,
+ const QString &arguments,
+ const QString &workingDirectory,
+ const QString &steamAppID,
+ Executable::SettableFlags settable,
+ bool set_other,
+ Executable::OtherFlags other
+ );
+
void addExecutableInternal(const QString &title, const QString &executableName, const QString &arguments,
- const QString &workingDirectory, MOBase::ExecutableInfo::CloseMOStyle closeMO,
+ const QString &workingDirectory,
const QString &steamAppID);
private:
@@ -187,6 +223,7 @@ private: };
-Q_DECLARE_OPERATORS_FOR_FLAGS(Executable::Flags)
+Q_DECLARE_OPERATORS_FOR_FLAGS(Executable::OtherFlags)
+Q_DECLARE_OPERATORS_FOR_FLAGS(Executable::SettableFlags)
#endif // EXECUTABLESLIST_H
|
