|
@ -16,6 +16,7 @@ |
|
|
#include <QVector>
|
|
|
#include <QVector>
|
|
|
|
|
|
|
|
|
#include "boost_dlg.h"
|
|
|
#include "boost_dlg.h"
|
|
|
|
|
|
#include "menu_dlg.h"
|
|
|
#include "mqttclient.h"
|
|
|
#include "mqttclient.h"
|
|
|
#include "zoneitem.h"
|
|
|
#include "zoneitem.h"
|
|
|
#include "settings.h"
|
|
|
#include "settings.h"
|
|
@ -47,6 +48,7 @@ MainWindow::MainWindow(QWidget *parent) : |
|
|
QGridLayout *mainLayout = new QGridLayout; |
|
|
QGridLayout *mainLayout = new QGridLayout; |
|
|
|
|
|
|
|
|
m_state_btn.setText(tr("Auto")); |
|
|
m_state_btn.setText(tr("Auto")); |
|
|
|
|
|
QPushButton *menu_btn = new QPushButton(tr("Menu")); |
|
|
|
|
|
|
|
|
if (s->nbZones() < MAX_NB_ZONES) { |
|
|
if (s->nbZones() < MAX_NB_ZONES) { |
|
|
// TODO
|
|
|
// TODO
|
|
@ -54,7 +56,7 @@ MainWindow::MainWindow(QWidget *parent) : |
|
|
} else { |
|
|
} else { |
|
|
mainLayout->addWidget(m_zones.at(0), 0, 0); |
|
|
mainLayout->addWidget(m_zones.at(0), 0, 0); |
|
|
mainLayout->addWidget(m_zones.at(1), 0, 1); |
|
|
mainLayout->addWidget(m_zones.at(1), 0, 1); |
|
|
mainLayout->addWidget(new QPushButton(tr("Menu")), 0, 2); |
|
|
|
|
|
|
|
|
mainLayout->addWidget(menu_btn, 0, 2); |
|
|
mainLayout->addWidget(m_zones.at(2), 1, 0); |
|
|
mainLayout->addWidget(m_zones.at(2), 1, 0); |
|
|
mainLayout->addWidget(m_zones.at(3), 1, 1); |
|
|
mainLayout->addWidget(m_zones.at(3), 1, 1); |
|
|
mainLayout->addWidget(&m_state_btn, 1, 2); |
|
|
mainLayout->addWidget(&m_state_btn, 1, 2); |
|
@ -90,6 +92,7 @@ MainWindow::MainWindow(QWidget *parent) : |
|
|
|
|
|
|
|
|
connect(&m_state_btn, SIGNAL(clicked()), this, SLOT(change_state())); |
|
|
connect(&m_state_btn, SIGNAL(clicked()), this, SLOT(change_state())); |
|
|
|
|
|
|
|
|
|
|
|
connect(menu_btn, SIGNAL(clicked()), this, SLOT(show_menu())); |
|
|
/*
|
|
|
/*
|
|
|
* Heater timer |
|
|
* Heater timer |
|
|
*/ |
|
|
*/ |
|
@ -132,6 +135,15 @@ void MainWindow::show_boost(void) |
|
|
boost.exec(); |
|
|
boost.exec(); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void MainWindow::show_menu(void) |
|
|
|
|
|
{ |
|
|
|
|
|
MenuDlg menu(this); |
|
|
|
|
|
|
|
|
|
|
|
/* TODO: fix dialog modality, use QStackedWidget instead */ |
|
|
|
|
|
menu.showFullScreen(); |
|
|
|
|
|
menu.exec(); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
void MainWindow::update_state_btn(enum power_states st) |
|
|
void MainWindow::update_state_btn(enum power_states st) |
|
|
{ |
|
|
{ |
|
|
switch (st) { |
|
|
switch (st) { |
|
|