aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarius Vlad <marius.vlad@collabora.com>2020-04-09 21:46:36 +0300
committerMarius Vlad <marius.vlad@collabora.com>2020-04-09 21:46:36 +0300
commit254a9aed37498d97bb85292e848ce28506118ed0 (patch)
tree2e46b3887b0394401ef6f9bb86c6ff22e9705c0a
parent331aeb28e15ef263770d79ed5288c31349ec48b6 (diff)
applicationhandler: Allow to start apps from the launcher
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
-rw-r--r--launcher/qml/Launcher.qml17
-rw-r--r--launcher/src/applicationhandler.cpp10
-rw-r--r--launcher/src/applicationhandler.h1
-rw-r--r--launcher/src/applicationlauncher.cpp2
4 files changed, 27 insertions, 3 deletions
diff --git a/launcher/qml/Launcher.qml b/launcher/qml/Launcher.qml
index 822c964..bd61af1 100644
--- a/launcher/qml/Launcher.qml
+++ b/launcher/qml/Launcher.qml
@@ -75,6 +75,17 @@ ApplicationWindow {
}
}
+ Timer {
+ id: timer_start_show
+ interval: 500
+ running: false
+ repeat: false
+
+ onTriggered: {
+ console.log("Should be able to see the the surface as the compositor will by default show it")
+ }
+ }
+
MouseArea {
id: loc
anchors.fill: parent
@@ -89,7 +100,11 @@ ApplicationWindow {
return
}
if (currentId === '') {
- homescreenHandler.tapShortcut(applicationModel.appid(loc.index))
+ //homescreenHandler.tapShortcut(applicationModel.appid(loc.index))
+ var app_id = applicationModel.appid(loc.index)
+ console.log("Trying to launch " + app_id)
+ homescreenHandler.launch(app_id)
+ timer_start_show.running = true
} else {
currentId = ''
}
diff --git a/launcher/src/applicationhandler.cpp b/launcher/src/applicationhandler.cpp
index 38f5220..8f3a8fd 100644
--- a/launcher/src/applicationhandler.cpp
+++ b/launcher/src/applicationhandler.cpp
@@ -28,3 +28,13 @@ ApplicationHandler::getRunnables(void)
return runnables;
}
+
+int
+ApplicationHandler::launch(const QString &app_id)
+{
+ if (m_launcher) {
+ return m_launcher->start(app_id);
+ }
+
+ return -1;
+}
diff --git a/launcher/src/applicationhandler.h b/launcher/src/applicationhandler.h
index 5a5508e..6a8abaf 100644
--- a/launcher/src/applicationhandler.h
+++ b/launcher/src/applicationhandler.h
@@ -19,6 +19,7 @@ public:
//void init(int port, const char* token, QLibWindowmanager *qwm, QString myname);
//Q_INVOKABLE void tapShortcut(QString application_id);
Q_INVOKABLE size_t getRunnables(void);
+ Q_INVOKABLE int launch(const QString &app_id);
//void onRep(struct json_object* reply_contents);
//static void* myThis;
diff --git a/launcher/src/applicationlauncher.cpp b/launcher/src/applicationlauncher.cpp
index 9dcc3fc..d9fe703 100644
--- a/launcher/src/applicationlauncher.cpp
+++ b/launcher/src/applicationlauncher.cpp
@@ -87,5 +87,3 @@ void ApplicationLauncher::setCurrent(const QString &current)
m_current = current;
emit currentChanged(current);
}
-
-