X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;ds=sidebyside;f=HomeScreenSimulator%2Fsrc%2Fmainwindow.cpp;h=5bb148764b64a31b67ad237a018b19438e4e34f3;hb=43c6b242b71a35a164b8e14a54c99f2bf667b37b;hp=d670154dc7e4c8f7e14f8cd2e91120749c23a9cf;hpb=5a040cf1e77872dd567f6ffba50ed79fc27d5822;p=staging%2FHomeScreen.git diff --git a/HomeScreenSimulator/src/mainwindow.cpp b/HomeScreenSimulator/src/mainwindow.cpp index d670154..5bb1487 100644 --- a/HomeScreenSimulator/src/mainwindow.cpp +++ b/HomeScreenSimulator/src/mainwindow.cpp @@ -20,9 +20,11 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), mp_ui(new Ui::MainWindow), - mp_dBusDayNightModeAdapter(0), + mp_dBusDayNightModeAdaptor(0), mp_dBusStatusBarProxy(0), - mp_dBusPopupProxy(0) + mp_dBusPopupProxy(0), + mp_dBusProximityProxy(0), + mp_dBusHomeScreenProxy(0) { mp_ui->setupUi(this); @@ -30,7 +32,7 @@ MainWindow::MainWindow(QWidget *parent) : QDBusConnection dbus = QDBusConnection::sessionBus(); // publish dbus day night mode interface - mp_dBusDayNightModeAdapter = new DaynightmodeAdaptor((QObject*)this); + mp_dBusDayNightModeAdaptor = new DaynightmodeAdaptor((QObject*)this); dbus.registerService("org.agl.homescreen.simulator"); dbus.registerObject("/", 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,12 +67,14 @@ 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; - if (0 == mp_dBusDayNightModeAdapter) + if (0 == mp_dBusDayNightModeAdaptor) { - delete mp_dBusDayNightModeAdapter; + delete mp_dBusDayNightModeAdaptor; } delete mp_ui; } @@ -159,3 +172,8 @@ void MainWindow::on_pushButton_comboBoxExample_clicked() 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()); +}