X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=HomeScreen%2Fsrc%2Fpopupwidget.cpp;h=919bea0fe635d6315f7651c5ebcc2a269001c108;hb=5a040cf1e77872dd567f6ffba50ed79fc27d5822;hp=4a8977161e000ca61851dd06239d30da6cd3f666;hpb=3478f65b39560b333ba189e7d86e2c2cebfc9c7a;p=staging%2FHomeScreen.git diff --git a/HomeScreen/src/popupwidget.cpp b/HomeScreen/src/popupwidget.cpp index 4a89771..919bea0 100644 --- a/HomeScreen/src/popupwidget.cpp +++ b/HomeScreen/src/popupwidget.cpp @@ -16,12 +16,13 @@ #include "popupwidget.h" #include "ui_popupwidget.h" -#include "../interfaces/daynightmode.h" +#include PopupWidget::PopupWidget(QWidget *parent) : QWidget(parent), mp_ui(new Ui::PopupWidget), - mp_popupAdaptor(0) + mp_popupAdaptor(0), + m_sendComboBoxChoice(false) { // publish dbus popup interface mp_popupAdaptor = new PopupAdaptor((QObject*)this); @@ -29,7 +30,11 @@ PopupWidget::PopupWidget(QWidget *parent) : dbus.registerObject("/Popup", this); dbus.registerService("org.agl.homescreen"); + // no window decoration + setWindowFlags(Qt::FramelessWindowHint); + mp_ui->setupUi(this); + this->close(); } @@ -56,6 +61,18 @@ void PopupWidget::updateColorScheme() void PopupWidget::showPopup(int /*type*/, const QString &text) { + m_sendComboBoxChoice = false; + mp_ui->comboBox->hide(); + this->show(); + this->raise(); + mp_ui->label_Text->setText(text); +} + +void PopupWidget::showPopupComboBox(const QString &text, const QStringList &choices) +{ + m_sendComboBoxChoice = true; + mp_ui->comboBox->addItems(choices); + mp_ui->comboBox->show(); this->show(); this->raise(); mp_ui->label_Text->setText(text); @@ -63,5 +80,10 @@ void PopupWidget::showPopup(int /*type*/, const QString &text) void PopupWidget::on_pushButton_OK_clicked() { + if (m_sendComboBoxChoice) + { + comboBoxResult(mp_ui->comboBox->currentText()); + m_sendComboBoxChoice = false; + } this->close(); }