summaryrefslogtreecommitdiffstats
path: root/wayland/democompositor/processlauncher.h
diff options
context:
space:
mode:
Diffstat (limited to 'wayland/democompositor/processlauncher.h')
-rw-r--r--wayland/democompositor/processlauncher.h30
1 files changed, 28 insertions, 2 deletions
diff --git a/wayland/democompositor/processlauncher.h b/wayland/democompositor/processlauncher.h
index 092c0a3..84f9cb8 100644
--- a/wayland/democompositor/processlauncher.h
+++ b/wayland/democompositor/processlauncher.h
@@ -51,13 +51,27 @@
#ifndef PROCESSLAUNCHER_H
#define PROCESSLAUNCHER_H
+#include "apps/appentry.h"
+
#include <QObject>
+#include <QProcess>
#include <QLoggingCategory>
-class AppEntry;
-
Q_DECLARE_LOGGING_CATEGORY(procs)
+/**
+ * Transient class. Do not keep AppState beyond the
+ * finished signal.
+ */
+class AppState {
+ Q_GADGET
+ Q_PROPERTY(QProcess *process MEMBER process CONSTANT)
+ Q_PROPERTY(AppEntry appEntry MEMBER appEntry CONSTANT)
+public:
+ QProcess *process;
+ AppEntry appEntry;
+};
+
class WaylandProcessLauncher : public QObject
{
Q_OBJECT
@@ -66,6 +80,18 @@ public:
explicit WaylandProcessLauncher(QObject *parent = 0);
~WaylandProcessLauncher();
Q_INVOKABLE void launch(const AppEntry &entry);
+
+ Q_INVOKABLE bool isRunning(const AppEntry& entry) const;
+
+Q_SIGNALS:
+ void appStarted(const AppState &appState);
+ void appFinished(const AppState &appState, int exitCode, QProcess::ExitStatus exitStatus);
+ void appNotStarted(const AppState& appState);
+
+private:
+ QVector<AppState> m_appStates;
};
+Q_DECLARE_METATYPE(AppState)
+
#endif // PROCESSLAUNCHER_H