Allow to set notifications for the progress bar sandbox/mvlad/tests-send-events-for-applauncher
authorMarius Vlad <marius.vlad@collabora.com>
Wed, 22 Jul 2020 22:01:35 +0000 (01:01 +0300)
committerMarius Vlad <marius.vlad@collabora.com>
Thu, 23 Jul 2020 10:38:32 +0000 (13:38 +0300)
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
homescreen/src/applicationlauncher.h
homescreen/src/homescreenhandler.cpp
homescreen/src/homescreenhandler.h
homescreen/src/main.cpp

index bd7656e..046ed52 100644 (file)
@@ -41,8 +41,6 @@ signals:
 
 public slots:
     void setCurrent(const QString &current);
-
-private:
     void setLaunching(bool launching);
 
 private:
index e13ba53..605505c 100644 (file)
 
 void* HomescreenHandler::myThis = 0;
 
-HomescreenHandler::HomescreenHandler(Shell *_aglShell, QObject *parent) :
+HomescreenHandler::HomescreenHandler(Shell *_aglShell, ApplicationLauncher *_launcher, QObject *parent) :
     QObject(parent),
-    aglShell(_aglShell)
+    aglShell(_aglShell),
+    launcher(_launcher)
 {
 
 }
@@ -96,6 +97,7 @@ void HomescreenHandler::tapShortcut(QString application_id)
 {
        HMI_DEBUG("HomeScreen","tapShortcut %s", application_id.toStdString().c_str());
        mp_hs->showWindow(application_id.toStdString().c_str(), nullptr);
+       launcher->setLaunching(true);
 
        // this works (and it is redundant the first time), due to the default
        // policy engine installed which actives the application, when starting
index 3d939ce..c99d0b5 100644 (file)
@@ -22,6 +22,7 @@
 #include <libhomescreen.hpp>
 
 #include "shell.h"
+#include "applicationlauncher.h"
 #include <string>
 
 using namespace std;
@@ -30,7 +31,7 @@ class HomescreenHandler : public QObject
 {
     Q_OBJECT
 public:
-    explicit HomescreenHandler(Shell *aglShell, QObject *parent = 0);
+    explicit HomescreenHandler(Shell *aglShell, ApplicationLauncher *launcher, QObject *parent = 0);
     ~HomescreenHandler();
 
     void init(int port, const char* token);
@@ -50,6 +51,7 @@ signals:
 private:
     LibHomeScreen *mp_hs;
     Shell *aglShell;
+    ApplicationLauncher *launcher;
 };
 
 #endif // HOMESCREENHANDLER_H
index 15ce5c7..a82921e 100644 (file)
@@ -299,7 +299,7 @@ int main(int argc, char *argv[])
                                                  QLatin1String("SpeechChromeController is uncreatable."));
 
 
-    HomescreenHandler* homescreenHandler = new HomescreenHandler(aglShell);
+    HomescreenHandler* homescreenHandler = new HomescreenHandler(aglShell, launcher);
     homescreenHandler->init(port, token.toStdString().c_str());
 
     QUrl bindingAddress;