#include "popupwidget.h"
#include "ui_popupwidget.h"
-#include "../interfaces/daynightmode.h"
+#include <include/daynightmode.hpp>
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);
dbus.registerObject("/Popup", this);
dbus.registerService("org.agl.homescreen");
+ // no window decoration
+ setWindowFlags(Qt::FramelessWindowHint);
+
mp_ui->setupUi(this);
+
this->close();
}
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);
void PopupWidget::on_pushButton_OK_clicked()
{
+ if (m_sendComboBoxChoice)
+ {
+ comboBoxResult(mp_ui->comboBox->currentText());
+ m_sendComboBoxChoice = false;
+ }
this->close();
}