X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=HomeScreenSimulator%2Fsrc%2Fmainwindow.cpp;h=6c0dc2f21e987fe1665c37e20b9f73d66da204da;hb=ec688535558c31989e7da221b858328b2e0766c8;hp=ffc5170e154571e0e64960af29b502fdb3a8fc86;hpb=ca3605ea664834acdf712e691be8f0358b1c6b6f;p=staging%2FHomeScreen.git diff --git a/HomeScreenSimulator/src/mainwindow.cpp b/HomeScreenSimulator/src/mainwindow.cpp index ffc5170..6c0dc2f 100644 --- a/HomeScreenSimulator/src/mainwindow.cpp +++ b/HomeScreenSimulator/src/mainwindow.cpp @@ -22,7 +22,9 @@ MainWindow::MainWindow(QWidget *parent) : mp_ui(new Ui::MainWindow), mp_dBusDayNightModeAdapter(0), mp_dBusStatusBarProxy(0), - mp_dBusPopupProxy(0) + mp_dBusPopupProxy(0), + mp_dBusProximityProxy(0), + mp_dBusHomeScreenProxy(0) { mp_ui->setupUi(this); @@ -43,6 +45,15 @@ MainWindow::MainWindow(QWidget *parent) : "/Popup", QDBusConnection::sessionBus(), 0); + mp_dBusProximityProxy = new org::agl::proximity("org.agl.homescreen", + "/Proximity", + QDBusConnection::sessionBus(), + 0); + mp_dBusHomeScreenProxy = new org::agl::homescreen("org.agl.homescreen", + "/HomeScreen", + QDBusConnection::sessionBus(), + 0); + QSettings settings; this->move(settings.value("homescreensimulator/pos").toPoint()); mp_ui->radioButton_DayMode->setChecked(settings.value("homescreensimulator/daymode", true).toBool()); // if nothing is stored, use "true" @@ -56,6 +67,8 @@ MainWindow::~MainWindow() settings.setValue("homescreensimulator/daymode", mp_ui->radioButton_DayMode->isChecked()); settings.setValue("homescreensimulator/nightmode", mp_ui->radioButton_NightMode->isChecked()); + delete mp_dBusHomeScreenProxy; + delete mp_dBusProximityProxy; delete mp_dBusPopupProxy; delete mp_dBusStatusBarProxy; @@ -144,3 +157,23 @@ void MainWindow::on_pushButton_IconExample_clicked() // Home Screen app resources... mp_ui->tableWidget_Status->setItem(0, 2, new QTableWidgetItem(":/icons/home_day.png")); } + +void MainWindow::on_pushButton_PopupExample_clicked() +{ + mp_dBusPopupProxy->showPopup(0, "Hello Popup!\nNice to see you!"); +} + +void MainWindow::on_pushButton_comboBoxExample_clicked() +{ + QStringList choices; + choices.append("Item1"); + choices.append("Item2"); + choices.append("Item3"); + choices.append("Item4"); + mp_dBusPopupProxy->showPopupComboBox("Make your choice!", choices); +} + +void MainWindow::on_checkBox_ObjectDetected_clicked() +{ + mp_dBusProximityProxy->setObjectDetected(Qt::Checked == mp_ui->checkBox_ObjectDetected->checkState()); +}