|
|
@ -0,0 +1,63 @@ |
|
|
|
// SPDX-License-Identifier: GPL-3.0-or-later
|
|
|
|
/*
|
|
|
|
* Qt mutizone MQTT thermostat |
|
|
|
* |
|
|
|
* Copyright (C) 2020 Richard Genoud |
|
|
|
* |
|
|
|
*/ |
|
|
|
|
|
|
|
#include <QApplication>
|
|
|
|
#include <QPushButton>
|
|
|
|
#include <QCalendarWidget>
|
|
|
|
#include <QVBoxLayout>
|
|
|
|
#include <QHBoxLayout>
|
|
|
|
#include <QSizePolicy>
|
|
|
|
#include <QLocale>
|
|
|
|
|
|
|
|
#include "settings.h"
|
|
|
|
#include "holiday_dlg.h"
|
|
|
|
|
|
|
|
HolidayDlg::HolidayDlg(QWidget *parent, Qt::WindowFlags f) : |
|
|
|
QWidget(parent, f) |
|
|
|
{ |
|
|
|
QVBoxLayout *middleLayout = new QVBoxLayout; |
|
|
|
QHBoxLayout *mainLayout = new QHBoxLayout; |
|
|
|
QCalendarWidget *cal = new QCalendarWidget(this); |
|
|
|
QSizePolicy *szPolicy = new QSizePolicy(QSizePolicy::Minimum, |
|
|
|
QSizePolicy::MinimumExpanding, |
|
|
|
QSizePolicy::PushButton); |
|
|
|
|
|
|
|
QPushButton *next_btn = new QPushButton("+", this); |
|
|
|
QPushButton *prev_btn = new QPushButton("-", this); |
|
|
|
QPushButton *ok_btn = new QPushButton(tr("Ok"), this); |
|
|
|
QPushButton *cancel_btn = new QPushButton(tr("Cancel"), this); |
|
|
|
|
|
|
|
next_btn->setSizePolicy(*szPolicy); |
|
|
|
prev_btn->setSizePolicy(*szPolicy); |
|
|
|
ok_btn->setSizePolicy(*szPolicy); |
|
|
|
cancel_btn->setSizePolicy(*szPolicy); |
|
|
|
|
|
|
|
middleLayout->addWidget(prev_btn); |
|
|
|
middleLayout->addWidget(next_btn); |
|
|
|
middleLayout->addWidget(ok_btn); |
|
|
|
middleLayout->addWidget(cancel_btn); |
|
|
|
|
|
|
|
mainLayout->addWidget(cal); |
|
|
|
mainLayout->addLayout(middleLayout); |
|
|
|
|
|
|
|
connect(cal, SIGNAL(clicked(void)), this, SIGNAL(show_holiday_dlg(void))); |
|
|
|
connect(next_btn, SIGNAL(clicked(void)), cal, SLOT(showNextMonth(void))); |
|
|
|
connect(prev_btn, SIGNAL(clicked(void)), cal, SLOT(showPreviousMonth(void))); |
|
|
|
// connect(ok_btn, SIGNAL(clicked(void)), this, SIGNAL(closed(void)));
|
|
|
|
// connect(cancel_btn, SIGNAL(clicked(void)), this, SLOT(show_confirm_exit_dlg(void)));
|
|
|
|
|
|
|
|
|
|
|
|
this->setLayout(mainLayout); |
|
|
|
} |
|
|
|
|
|
|
|
HolidayDlg::~HolidayDlg() |
|
|
|
{ |
|
|
|
} |
|
|
|
|
|
|
|
/* vim: set tabstop=8 shiftwidth=8 softtabstop=0 noexpandtab: */ |
|
|
|
|