Change-Id: I426bcc55842711c1cd00d11163c12899c00a9e42
Signed-off-by: Tasuku Suzuki <tasuku.suzuki@qt.io>
id: applicationModel
ListElement {
name: 'Home'
id: applicationModel
ListElement {
name: 'Home'
- application: 'home@0.1'
}
ListElement {
name: 'Multimedia'
}
ListElement {
name: 'Multimedia'
- property int currentIndex: -1 // TODO: to be moved to whereever right
property int pid: -1
RowLayout {
property int pid: -1
RowLayout {
Layout.fillWidth: true
Layout.fillHeight: true
name: model.name
Layout.fillWidth: true
Layout.fillHeight: true
name: model.name
- active: model.index === root.currentIndex
+ active: model.application === launcher.current
- root.currentIndex = active ? -1 : model.index
if (0 === model.index) {
appLauncherAreaLauncher.visible = true
applicationArea.visible = false
layoutHandler.hideAppLayer()
if (0 === model.index) {
appLauncherAreaLauncher.visible = true
applicationArea.visible = false
layoutHandler.hideAppLayer()
}
else {
pid = launcher.launch(model.application)
}
else {
pid = launcher.launch(model.application)
result = mp_dBusAppFrameworkProxy->launchApp(application);
qDebug() << "pid:" << result;
result = mp_dBusAppFrameworkProxy->launchApp(application);
qDebug() << "pid:" << result;
+ if (result > 1) {
+ setCurrent(application);
+ }
+
+QString ApplicationLauncher::current() const
+{
+ return m_current;
+}
+
+void ApplicationLauncher::setCurrent(const QString ¤t)
+{
+ if (m_current == current) return;
+ m_current = current;
+ emit currentChanged(current);
+}
class ApplicationLauncher : public QObject
{
Q_OBJECT
class ApplicationLauncher : public QObject
{
Q_OBJECT
+ Q_PROPERTY(QString current READ current WRITE setCurrent NOTIFY currentChanged)
public:
explicit ApplicationLauncher(QObject *parent = NULL);
~ApplicationLauncher();
public:
explicit ApplicationLauncher(QObject *parent = NULL);
~ApplicationLauncher();
+ QString current() const;
+
signals:
void newAppRequestsToBeVisible(int pid);
signals:
void newAppRequestsToBeVisible(int pid);
+ void currentChanged(const QString ¤t);
public slots:
int launch(const QString &application);
public slots:
int launch(const QString &application);
+ void setCurrent(const QString ¤t);
private:
org::agl::appframework *mp_dBusAppFrameworkProxy;
private:
org::agl::appframework *mp_dBusAppFrameworkProxy;
};
#endif // APPLICATIONLAUNCHER_H
};
#endif // APPLICATIONLAUNCHER_H