X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=HomeScreenSimulator%2Fsrc%2Fmainwindow.cpp;h=743c8541b83fe3b805e1f339a2fe9323e4ba5dff;hb=c32114eb2ccbe142d73c06a5992544d6eacb97d0;hp=74c02d7c01f5deba230a056c2aff2c8cf2c19afe;hpb=0a468d9b5ae7b3e5ba106facf17698d89b1ce200;p=staging%2FHomeScreen.git diff --git a/HomeScreenSimulator/src/mainwindow.cpp b/HomeScreenSimulator/src/mainwindow.cpp index 74c02d7..743c854 100644 --- a/HomeScreenSimulator/src/mainwindow.cpp +++ b/HomeScreenSimulator/src/mainwindow.cpp @@ -22,7 +22,8 @@ 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_ui->setupUi(this); @@ -43,6 +44,10 @@ MainWindow::MainWindow(QWidget *parent) : "/Popup", QDBusConnection::sessionBus(), 0); + mp_dBusProximityProxy = new org::agl::proximity("org.agl.homescreen", + "/Proximity", + 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 +61,7 @@ MainWindow::~MainWindow() settings.setValue("homescreensimulator/daymode", mp_ui->radioButton_DayMode->isChecked()); settings.setValue("homescreensimulator/nightmode", mp_ui->radioButton_NightMode->isChecked()); + delete mp_dBusProximityProxy; delete mp_dBusPopupProxy; delete mp_dBusStatusBarProxy; @@ -149,3 +155,18 @@ 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()); +}