diff options
author | lonkaars <loek@pipeframe.xyz> | 2022-12-05 12:39:12 +0100 |
---|---|---|
committer | lonkaars <loek@pipeframe.xyz> | 2022-12-05 12:39:12 +0100 |
commit | 51bfa6adf76353a4ac0f7941bae138cc5cb665c5 (patch) | |
tree | 481234586c22f7e0927072b6c965ef240e9976a0 /confui/ui_automation.cpp | |
parent | cd89c506cf45b6de221f89388fb146efca96599c (diff) |
automation widget + renaming
Diffstat (limited to 'confui/ui_automation.cpp')
-rw-r--r-- | confui/ui_automation.cpp | 35 |
1 files changed, 35 insertions, 0 deletions
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); +} |