aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--homescreen/src/homescreenhandler.cpp8
-rw-r--r--homescreen/src/homescreenhandler.h4
-rw-r--r--homescreen/src/main.cpp5
3 files changed, 11 insertions, 6 deletions
diff --git a/homescreen/src/homescreenhandler.cpp b/homescreen/src/homescreenhandler.cpp
index bf98a53..e31f122 100644
--- a/homescreen/src/homescreenhandler.cpp
+++ b/homescreen/src/homescreenhandler.cpp
@@ -24,11 +24,11 @@
void* HomescreenHandler::myThis = 0;
-HomescreenHandler::HomescreenHandler(Shell *_aglShell, QObject *parent) :
+HomescreenHandler::HomescreenHandler(Shell *_aglShell, ApplicationLauncher *launcher, QObject *parent) :
QObject(parent),
aglShell(_aglShell)
{
-
+ mp_launcher = launcher;
}
HomescreenHandler::~HomescreenHandler()
@@ -113,6 +113,10 @@ void HomescreenHandler::tapShortcut(QString application_id)
// the first time. Later calls to HomescreenHandler::tapShortcut will
// require calling 'agl_shell_activate_app'
agl_shell_activate_app(agl_shell, application_id.toStdString().c_str(), output);
+
+ if (mp_launcher) {
+ mp_launcher->setCurrent(application_id);
+ }
}
void HomescreenHandler::onRep_static(struct json_object* reply_contents)
diff --git a/homescreen/src/homescreenhandler.h b/homescreen/src/homescreenhandler.h
index 3d939ce..790c4fd 100644
--- a/homescreen/src/homescreenhandler.h
+++ b/homescreen/src/homescreenhandler.h
@@ -20,6 +20,7 @@
#include <QObject>
#include <libhomescreen.hpp>
+#include "applicationlauncher.h"
#include "shell.h"
#include <string>
@@ -30,7 +31,7 @@ class HomescreenHandler : public QObject
{
Q_OBJECT
public:
- explicit HomescreenHandler(Shell *aglShell, QObject *parent = 0);
+ explicit HomescreenHandler(Shell *aglShell, ApplicationLauncher *launcher = 0, QObject *parent = 0);
~HomescreenHandler();
void init(int port, const char* token);
@@ -49,6 +50,7 @@ signals:
void showInformation(QString info);
private:
LibHomeScreen *mp_hs;
+ ApplicationLauncher *mp_launcher;
Shell *aglShell;
};
diff --git a/homescreen/src/main.cpp b/homescreen/src/main.cpp
index 742daa6..8c7bb22 100644
--- a/homescreen/src/main.cpp
+++ b/homescreen/src/main.cpp
@@ -234,15 +234,14 @@ int main(int argc, char *argv[])
Shell *aglShell = new Shell(shell, &a);
// import C++ class to QML
- // qmlRegisterType<ApplicationLauncher>("HomeScreen", 1, 0, "ApplicationLauncher");
qmlRegisterType<StatusBarModel>("HomeScreen", 1, 0, "StatusBarModel");
qmlRegisterType<MasterVolume>("MasterVolume", 1, 0, "MasterVolume");
qmlRegisterUncreatableType<ChromeController>("SpeechChrome", 1, 0, "SpeechChromeController",
QLatin1String("SpeechChromeController is uncreatable."));
ApplicationLauncher *launcher = new ApplicationLauncher();
-
- HomescreenHandler* homescreenHandler = new HomescreenHandler(aglShell);
+ launcher->setCurrent(QStringLiteral("launcher"));
+ HomescreenHandler* homescreenHandler = new HomescreenHandler(aglShell, launcher);
homescreenHandler->init(port, token.toStdString().c_str());
QUrl bindingAddress;