X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=HomeScreen%2Fsrc%2Fapplauncherwidget.cpp;h=69350db81202d53cac55cdaca37245c3cfb11e02;hb=refs%2Ftags%2Fv0.3.1;hp=94dd357f6c0bf2252d55cb1d6841d25ad653ed10;hpb=0a468d9b5ae7b3e5ba106facf17698d89b1ce200;p=staging%2FHomeScreen.git diff --git a/HomeScreen/src/applauncherwidget.cpp b/HomeScreen/src/applauncherwidget.cpp index 94dd357..69350db 100644 --- a/HomeScreen/src/applauncherwidget.cpp +++ b/HomeScreen/src/applauncherwidget.cpp @@ -18,6 +18,9 @@ #include "ui_applauncherwidget.h" #include #include +#ifdef __i386__ + #include +#endif #define APP_LIST_COLUMN_COUNT 5 @@ -42,8 +45,6 @@ AppLauncherWidget::AppLauncherWidget(QWidget *parent) : "/AppFramework", QDBusConnection::sessionBus(), 0); - - populateAppList(); } AppLauncherWidget::~AppLauncherWidget() @@ -64,23 +65,24 @@ void AppLauncherWidget::updateColorScheme() "/colorschemes/" + settings.value("systemsettings/colorscheme", "default").toString() + "/" + + QString::number(settings.value("systemsettings/proximityobjectdetected", false).toBool()) + + "/" + QString::number(settings.value("systemsettings/daynightmode", SystemDayNight::DAYNIGHTMODE_DAY).toInt()) + ".ini", QSettings::IniFormat); - mp_ui->widget_Background->setStyleSheet(settings_cs.value("AppLauncherWidget/widget_Background").toString()); - mp_ui->widget_Home_Icon->setStyleSheet(settings_cs.value("AppLauncherWidget/widget_Home_Icon").toString()); + mp_ui->widget_background->setStyleSheet(settings_cs.value("AppLauncherWidget/widget_Background").toString()); + mp_ui->widget_homeIcon->setStyleSheet(settings_cs.value("AppLauncherWidget/widget_Home_Icon").toString()); + + setStyleSheet(settings_cs.value("AppLauncherWidget/common_css").toString()); } void AppLauncherWidget::populateAppList() { - setStyleSheet("QTableWidget {background-color: transparent;}" - "QTableCornerButton::section {background-color: transparent;}"); - if (0 == mp_appTable) { mp_appTable = new QTableWidget(this); - QObject::connect(mp_appTable, SIGNAL(cellClicked(int, int)), this, SLOT(on_tableView_clicked(int, int))); + QObject::connect(mp_appTable, SIGNAL(cellClicked(int,int)), this, SLOT(on_tableView_clicked(int,int))); } else { @@ -99,7 +101,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 +146,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); } }