diff options
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); +} |