diff options
Diffstat (limited to 'HomeScreen/src2')
-rw-r--r-- | HomeScreen/src2/applicationlauncher.cpp | 15 | ||||
-rw-r--r-- | HomeScreen/src2/applicationlauncher.h | 6 |
2 files changed, 21 insertions, 0 deletions
diff --git a/HomeScreen/src2/applicationlauncher.cpp b/HomeScreen/src2/applicationlauncher.cpp index 0ebc9b9..7011ebf 100644 --- a/HomeScreen/src2/applicationlauncher.cpp +++ b/HomeScreen/src2/applicationlauncher.cpp @@ -43,5 +43,20 @@ int ApplicationLauncher::launch(const QString &application) result = mp_dBusAppFrameworkProxy->launchApp(application); qDebug() << "pid:" << result; + if (result > 1) { + setCurrent(application); + } return result; } + +QString ApplicationLauncher::current() const +{ + return m_current; +} + +void ApplicationLauncher::setCurrent(const QString ¤t) +{ + if (m_current == current) return; + m_current = current; + emit currentChanged(current); +} diff --git a/HomeScreen/src2/applicationlauncher.h b/HomeScreen/src2/applicationlauncher.h index 14acae8..00fbbe8 100644 --- a/HomeScreen/src2/applicationlauncher.h +++ b/HomeScreen/src2/applicationlauncher.h @@ -25,18 +25,24 @@ class ApplicationLauncher : public QObject { Q_OBJECT + Q_PROPERTY(QString current READ current WRITE setCurrent NOTIFY currentChanged) public: explicit ApplicationLauncher(QObject *parent = NULL); ~ApplicationLauncher(); + QString current() const; + signals: void newAppRequestsToBeVisible(int pid); + void currentChanged(const QString ¤t); public slots: int launch(const QString &application); + void setCurrent(const QString ¤t); private: org::agl::appframework *mp_dBusAppFrameworkProxy; + QString m_current; }; #endif // APPLICATIONLAUNCHER_H |