summaryrefslogtreecommitdiffstats
path: root/HomeScreen/src/applauncherwidget.cpp
diff options
context:
space:
mode:
authorBocklage, Jens <Jens_Bocklage@mentor.com>2016-09-30 14:31:09 +0200
committerBocklage, Jens <Jens_Bocklage@mentor.com>2016-09-30 14:59:21 +0200
commitcf8cd699e91df40c3f9070019f7c561432b4b4dd (patch)
treef1801eb22d1b51c80401f56eede6f79fb985333a /HomeScreen/src/applauncherwidget.cpp
parent0a468d9b5ae7b3e5ba106facf17698d89b1ce200 (diff)
Implementing app launch and app surface control workflow. Using WindowManager to control layer and surfaces (ongoing).
Defining three layouts. Adding combobox selection feature to popup widget. Known issue: IVI-shell is currently disabled in AGL due to issues (porting to Yocto 2.1.1). Signed-off-by: Bocklage, Jens <Jens_Bocklage@mentor.com>
Diffstat (limited to 'HomeScreen/src/applauncherwidget.cpp')
-rw-r--r--HomeScreen/src/applauncherwidget.cpp23
1 files changed, 19 insertions, 4 deletions
diff --git a/HomeScreen/src/applauncherwidget.cpp b/HomeScreen/src/applauncherwidget.cpp
index 94dd357..18c373b 100644
--- a/HomeScreen/src/applauncherwidget.cpp
+++ b/HomeScreen/src/applauncherwidget.cpp
@@ -18,6 +18,9 @@
#include "ui_applauncherwidget.h"
#include <include/daynightmode.hpp>
#include <QSettings>
+#ifdef __i386__
+ #include <QProcess>
+#endif
#define APP_LIST_COLUMN_COUNT 5
@@ -42,8 +45,6 @@ AppLauncherWidget::AppLauncherWidget(QWidget *parent) :
"/AppFramework",
QDBusConnection::sessionBus(),
0);
-
- populateAppList();
}
AppLauncherWidget::~AppLauncherWidget()
@@ -99,7 +100,13 @@ void AppLauncherWidget::populateAppList()
int i;
+#ifdef __arm__
QStringList apps = mp_dBusAppFrameworkProxy->getAvailableAppNames();
+#endif
+#ifdef __i386__
+ QStringList apps;
+ apps.append(QString("/usr/bin/gnome-terminal"));
+#endif
mp_appList->clear();
mp_appTable->setRowCount((apps.size() + (APP_LIST_COLUMN_COUNT - 1)) / APP_LIST_COLUMN_COUNT);
@@ -138,16 +145,24 @@ void AppLauncherWidget::populateAppList()
mp_appTable->item(i / APP_LIST_COLUMN_COUNT,
i % APP_LIST_COLUMN_COUNT)->setTextAlignment(Qt::AlignHCenter | Qt::AlignVCenter);
}
-
-
}
void AppLauncherWidget::on_tableView_clicked(int row, int col)
{
if (mp_appList->size() > row * APP_LIST_COLUMN_COUNT + col)
{
+#ifdef __arm__
int pid = mp_dBusAppFrameworkProxy->launchApp(mp_appList->at(row * APP_LIST_COLUMN_COUNT + col).getName());
+#endif
+#ifdef __i386__
+ QProcess *myProcess = new QProcess();
+ myProcess->start(mp_appList->at(row * APP_LIST_COLUMN_COUNT + col).getName(), NULL);
+ int pid = myProcess->pid();
+#endif
qDebug("%d, %d: start app %s", row, col, mp_appList->at(row * APP_LIST_COLUMN_COUNT + col).getName().toStdString().c_str());
qDebug("pid: %d", pid);
+
+ // the new app wants to be visible by default
+ newRequestsToBeVisibleApp(pid);
}
}