Add warning for macro action source

This commit is contained in:
WarmUpTill 2021-05-24 15:16:31 +02:00 committed by WarmUpTill
parent 198a5dc1ec
commit e7f031641f
3 changed files with 10 additions and 2 deletions

View File

@ -171,6 +171,7 @@ AdvSceneSwitcher.action.source="Source"
AdvSceneSwitcher.action.source.type.enable="Enable"
AdvSceneSwitcher.action.source.type.disable="Disable"
AdvSceneSwitcher.action.source.entry="{{actions}} {{sources}}"
AdvSceneSwitcher.action.source.warning="Warning: Enabling and disabling sources globally cannot be controlled by the OBS UI"
AdvSceneSwitcher.action.media="Media"
AdvSceneSwitcher.action.media.type.play="Play"
AdvSceneSwitcher.action.media.type.pause="Pause"

View File

@ -1,5 +1,6 @@
#pragma once
#include <QSpinBox>
#include <QLabel>
#include "macro-action-edit.hpp"
enum class SourceAction {
@ -50,6 +51,7 @@ private slots:
protected:
QComboBox *_sources;
QComboBox *_actions;
QLabel *_warning;
std::shared_ptr<MacroActionSource> _entryData;
private:

View File

@ -73,6 +73,8 @@ MacroActionSourceEdit::MacroActionSourceEdit(
{
_sources = new QComboBox();
_actions = new QComboBox();
_warning = new QLabel(
obs_module_text("AdvSceneSwitcher.action.source.warning"));
populateActionSelection(_actions);
populateSourceSelection(_sources);
@ -82,13 +84,16 @@ MacroActionSourceEdit::MacroActionSourceEdit(
QWidget::connect(_sources, SIGNAL(currentTextChanged(const QString &)),
this, SLOT(SourceChanged(const QString &)));
QHBoxLayout *mainLayout = new QHBoxLayout;
QVBoxLayout *mainLayout = new QVBoxLayout;
QHBoxLayout *entryLayout = new QHBoxLayout;
std::unordered_map<std::string, QWidget *> widgetPlaceholders = {
{"{{sources}}", _sources},
{"{{actions}}", _actions},
};
placeWidgets(obs_module_text("AdvSceneSwitcher.action.source.entry"),
mainLayout, widgetPlaceholders);
entryLayout, widgetPlaceholders);
mainLayout->addLayout(entryLayout);
mainLayout->addWidget(_warning);
setLayout(mainLayout);
_entryData = entryData;