aboutsummaryrefslogtreecommitdiff
path: root/confui/ui_automation.h
blob: 2c081e36b5bad032bded055486606f69c922062e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#pragma once

#include <QWidget>
#include <QHBoxLayout>
#include <QPushButton>
#include <QString>
#include <QComboBox>

#include "mesh_connector.h"

class CDAutomationWidget : public QWidget {
	Q_OBJECT

private:
	cd_s_automation* _automation = nullptr;
	cd_link_t _id;

	QHBoxLayout* main_layout;
	QComboBox* dropdown_button;
	QComboBox* dropdown_action;
	QComboBox* dropdown_light;
	QPushButton* button_remove;

public:
	CDAutomationWidget(QWidget *parent = nullptr);
	virtual ~CDAutomationWidget();
	/** @brief redraw ui with new values */
	virtual void update();
	/** @brief register automation that this widget controls */
	virtual void set_automation(cd_link_t link, cd_s_automation* automation);
	/** @brief test if all fields are valid / entered */
	virtual bool conf_valid();
	/** @brief apply new automation rule */
	virtual void apply();
};