#include "ui_applauncherwidget.h"
#include <include/daynightmode.hpp>
#include <QSettings>
+#ifdef __i386__
+ #include <QProcess>
+#endif
#define APP_LIST_COLUMN_COUNT 5
"/AppFramework",
QDBusConnection::sessionBus(),
0);
-
- populateAppList();
}
AppLauncherWidget::~AppLauncherWidget()
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);
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);
}
}