From 2bd6daab453f34d281d32ec4dd332e972601feeb Mon Sep 17 00:00:00 2001 From: WarmUpTill Date: Sat, 17 Feb 2024 23:30:02 +0100 Subject: [PATCH] Update header info of action queue macro segments --- lib/macro/macro-action-queue.cpp | 2 ++ lib/macro/macro-condition-queue.cpp | 7 +++++++ lib/macro/macro-condition-queue.hpp | 1 + 3 files changed, 10 insertions(+) diff --git a/lib/macro/macro-action-queue.cpp b/lib/macro/macro-action-queue.cpp index ef13c17fc..34db2d3d6 100644 --- a/lib/macro/macro-action-queue.cpp +++ b/lib/macro/macro-action-queue.cpp @@ -176,6 +176,8 @@ void MacroActionQueueEdit::QueueChanged(const QString &text) auto lock = LockContext(); _entryData->_queue = GetWeakActionQueueByQString(text); + emit HeaderInfoChanged( + QString::fromStdString(_entryData->GetShortDesc())); } void MacroActionQueueEdit::ActionChanged(int value) diff --git a/lib/macro/macro-condition-queue.cpp b/lib/macro/macro-condition-queue.cpp index 942f84770..f7859c388 100644 --- a/lib/macro/macro-condition-queue.cpp +++ b/lib/macro/macro-condition-queue.cpp @@ -58,6 +58,11 @@ bool MacroConditionQueue::Load(obs_data_t *obj) return true; } +std::string MacroConditionQueue::GetShortDesc() const +{ + return GetActionQueueName(_queue); +} + static inline void populateQueueTypeSelection(QComboBox *list) { for (const auto &[_, name] : conditionTypes) { @@ -102,6 +107,8 @@ void MacroConditionQueueEdit::ConditionChanged(int condition) auto lock = LockContext(); _entryData->_condition = static_cast(condition); + emit HeaderInfoChanged( + QString::fromStdString(_entryData->GetShortDesc())); SetWidgetVisibility(); } diff --git a/lib/macro/macro-condition-queue.hpp b/lib/macro/macro-condition-queue.hpp index 92d030338..7e5b76d8b 100644 --- a/lib/macro/macro-condition-queue.hpp +++ b/lib/macro/macro-condition-queue.hpp @@ -15,6 +15,7 @@ class MacroConditionQueue : public MacroCondition { bool CheckCondition(); bool Save(obs_data_t *obj) const; bool Load(obs_data_t *obj); + std::string GetShortDesc() const; std::string GetId() const { return id; }; static std::shared_ptr Create(Macro *m) {