summaryrefslogtreecommitdiff
path: root/src/executableslist.h
diff options
context:
space:
mode:
authorTannin <devnull@localhost>2015-08-02 14:58:17 +0200
committerTannin <devnull@localhost>2015-08-02 14:58:17 +0200
commit9c17ecc87ee6e1af87b6ee7e1b970d15dd19fbe3 (patch)
tree79801002b67a6cc47af2200ef4ca7a319bfc34f6 /src/executableslist.h
parent051589c38e4b40749e9f0f38d750f2de0c9954b4 (diff)
parent48fae44566356eebbe222c7cc9592b8f2a1b3c8d (diff)
Merge
Diffstat (limited to 'src/executableslist.h')
-rw-r--r--src/executableslist.h61
1 files changed, 43 insertions, 18 deletions
diff --git a/src/executableslist.h b/src/executableslist.h
index 888dbfe1..4e1ad644 100644
--- a/src/executableslist.h
+++ b/src/executableslist.h
@@ -39,13 +39,33 @@ struct Executable {
QString m_SteamAppID;
QString m_WorkingDirectory;
- bool m_Custom;
- bool m_Toolbar;
-};
-Q_DECLARE_METATYPE(Executable)
+ enum class Type {
+ Game,
+ Custom
+ };
+
+ enum class Toolbar {
+ Disabled,
+ Enabled
+ };
+
+ enum class Icon {
+ MO,
+ Application
+ };
+
+ Type m_Type;
+ Toolbar m_Toolbar;
+ Icon m_Icon;
+ bool isCustom() const { return m_Type == Type::Custom; }
-void registerExecutable();
+ bool shownOnToolbar() const { return m_Toolbar == Toolbar::Enabled; }
+
+ void showOnToolbar(bool state) { m_Toolbar = state ? Toolbar::Enabled : Toolbar::Disabled; }
+
+ bool usesOwnIcon() const { return m_Icon == Icon::Application; }
+};
/*!
@@ -83,7 +103,7 @@ public:
* @return the executable
* @exception runtime_error will throw an exception if the name is not correct
**/
- const Executable &find(const QString &tilte) const;
+ const Executable &find(const QString &title) const;
/**
* @brief find an executable by its name
@@ -92,7 +112,7 @@ public:
* @return the executable
* @exception runtime_error will throw an exception if the name is not correct
**/
- Executable &find(const QString &tilte);
+ Executable &find(const QString &title);
/**
* @brief find an executable by a fileinfo structure
@@ -123,17 +143,15 @@ public:
* @param arguments arguments to pass to the executable
* @param closeMO if true, MO will be closed when the binary is started
**/
- void addExecutable(const QString &title, const QString &executableName, const QString &arguments,
- const QString &workingDirectory, MOBase::ExecutableInfo::CloseMOStyle closeMO, const QString &steamAppID,
- bool custom, bool toolbar, int pos = -1);
-
- /**
- * @brief change position of an executable which is expected to exist
- * @param title title of the executable
- * @param toolbar enable/disable placement on the toolbar
- * @param pos new position for the executable
- */
- void position(const QString &title, bool toolbar, int pos);
+ void addExecutable(const QString &title,
+ const QString &executableName,
+ const QString &arguments,
+ const QString &workingDirectory,
+ MOBase::ExecutableInfo::CloseMOStyle closeMO,
+ const QString &steamAppID,
+ Executable::Type custom,
+ Executable::Toolbar toolbar,
+ Executable::Icon ownicon);
/**
* @brief remove the executable with the specified file name. This needs to be an absolute file path
@@ -159,6 +177,13 @@ public:
**/
void getExecutables(std::vector<Executable>::iterator &begin, std::vector<Executable>::iterator &end);
+ /**
+ * @brief get the number of executables (custom or otherwise)
+ **/
+ size_t size() const {
+ return m_Executables.size();
+ }
+
private:
std::vector<Executable>::iterator findExe(const QString &title);