From 51bfa6adf76353a4ac0f7941bae138cc5cb665c5 Mon Sep 17 00:00:00 2001 From: lonkaars Date: Mon, 5 Dec 2022 12:39:12 +0100 Subject: automation widget + renaming --- confui/ui_automation.cpp | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 confui/ui_automation.cpp (limited to 'confui/ui_automation.cpp') diff --git a/confui/ui_automation.cpp b/confui/ui_automation.cpp new file mode 100644 index 0000000..f427930 --- /dev/null +++ b/confui/ui_automation.cpp @@ -0,0 +1,35 @@ +#include "ui_automation.h" + +CDAutomationWidget::~CDAutomationWidget() { } +CDAutomationWidget::CDAutomationWidget(cd_s_automation* automation, QWidget *parent) : QWidget(parent) { + set_automation(automation); + + main_layout = new QHBoxLayout; + + dropdown_button = new QComboBox; + dropdown_action = new QComboBox; + dropdown_light = new QComboBox; + button_remove = new QPushButton; + + main_layout->addWidget(dropdown_button); + main_layout->addWidget(dropdown_action); + main_layout->addWidget(dropdown_light); + main_layout->addStretch(); + main_layout->addWidget(button_remove); + + update(); + setLayout(main_layout); +} + +void CDAutomationWidget::set_automation(cd_s_automation* automation) { + _automation = automation; +} + +void CDAutomationWidget::update() { + button_remove->setText("Delete"); + + dropdown_action->clear(); + dropdown_action->addItem("Toggles", CD_AUTOMATION_TYPE_TOGGLE); + dropdown_action->addItem("Switches on", CD_AUTOMATION_TYPE_TURN_ON); + dropdown_action->addItem("Switches off", CD_AUTOMATION_TYPE_TURN_OFF); +} -- cgit v1.2.3