mirror of
https://github.com/WarmUpTill/SceneSwitcher.git
synced 2026-03-22 01:44:49 -05:00
Adjust to refactor of variable string
This commit is contained in:
parent
b932af1c97
commit
5d6f08e38f
|
|
@ -25,8 +25,7 @@ public:
|
|||
}
|
||||
|
||||
std::string _file = obs_module_text("AdvSceneSwitcher.enterPath");
|
||||
VariableResolvingString _text =
|
||||
obs_module_text("AdvSceneSwitcher.enterText");
|
||||
StringVariable _text = obs_module_text("AdvSceneSwitcher.enterText");
|
||||
FileAction _action = FileAction::WRITE;
|
||||
|
||||
private:
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ public:
|
|||
SourceSelection _source;
|
||||
OBSWeakSource _filter;
|
||||
Action _action = Action::ENABLE;
|
||||
VariableResolvingString _settings = "";
|
||||
StringVariable _settings = "";
|
||||
|
||||
private:
|
||||
void ResolveVariables();
|
||||
|
|
|
|||
|
|
@ -28,10 +28,8 @@ public:
|
|||
POST,
|
||||
};
|
||||
|
||||
VariableResolvingString _url =
|
||||
obs_module_text("AdvSceneSwitcher.enterURL");
|
||||
VariableResolvingString _data =
|
||||
obs_module_text("AdvSceneSwitcher.enterText");
|
||||
StringVariable _url = obs_module_text("AdvSceneSwitcher.enterURL");
|
||||
StringVariable _data = obs_module_text("AdvSceneSwitcher.enterText");
|
||||
bool _setHeaders = false;
|
||||
StringList _headers;
|
||||
Method _method = Method::GET;
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ public:
|
|||
|
||||
SceneSelection _scene;
|
||||
SceneItemSelection _source;
|
||||
VariableResolvingString _settings = "";
|
||||
StringVariable _settings = "";
|
||||
|
||||
private:
|
||||
void ApplySettings(const std::string &);
|
||||
|
|
|
|||
|
|
@ -33,8 +33,7 @@ public:
|
|||
TargetType _targetType = TargetType::SOURCE;
|
||||
SceneSelection _scene;
|
||||
SourceSelection _source;
|
||||
VariableResolvingString _path =
|
||||
obs_module_text("AdvSceneSwitcher.enterPath");
|
||||
StringVariable _path = obs_module_text("AdvSceneSwitcher.enterPath");
|
||||
|
||||
private:
|
||||
void FrontendScreenshot(OBSWeakSource &);
|
||||
|
|
|
|||
|
|
@ -41,7 +41,7 @@ public:
|
|||
|
||||
SourceSelection _source;
|
||||
SourceSettingButton _button;
|
||||
VariableResolvingString _settings = "";
|
||||
StringVariable _settings = "";
|
||||
SourceAction _action = SourceAction::ENABLE;
|
||||
|
||||
private:
|
||||
|
|
|
|||
|
|
@ -28,8 +28,7 @@ public:
|
|||
};
|
||||
|
||||
Type _type = Type::REQUEST;
|
||||
VariableResolvingString _message =
|
||||
obs_module_text("AdvSceneSwitcher.enterText");
|
||||
StringVariable _message = obs_module_text("AdvSceneSwitcher.enterText");
|
||||
std::string _connection;
|
||||
|
||||
private:
|
||||
|
|
|
|||
|
|
@ -36,8 +36,7 @@ public:
|
|||
};
|
||||
|
||||
std::string _file = obs_module_text("AdvSceneSwitcher.enterPath");
|
||||
VariableResolvingString _text =
|
||||
obs_module_text("AdvSceneSwitcher.enterText");
|
||||
StringVariable _text = obs_module_text("AdvSceneSwitcher.enterText");
|
||||
FileType _fileType = FileType::LOCAL;
|
||||
ConditionType _condition = ConditionType::MATCH;
|
||||
RegexConfig _regex;
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ public:
|
|||
SourceSelection _source;
|
||||
OBSWeakSource _filter;
|
||||
Condition _condition = Condition::ENABLED;
|
||||
VariableResolvingString _settings = "";
|
||||
StringVariable _settings = "";
|
||||
RegexConfig _regex;
|
||||
|
||||
private:
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ public:
|
|||
SceneSelection _scene;
|
||||
SceneItemSelection _source;
|
||||
RegexConfig _regex;
|
||||
VariableResolvingString _settings = "";
|
||||
StringVariable _settings = "";
|
||||
|
||||
private:
|
||||
static bool _registered;
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ public:
|
|||
|
||||
SourceSelection _source;
|
||||
SourceCondition _condition = SourceCondition::ACTIVE;
|
||||
VariableResolvingString _settings = "";
|
||||
StringVariable _settings = "";
|
||||
RegexConfig _regex;
|
||||
|
||||
private:
|
||||
|
|
|
|||
|
|
@ -25,8 +25,7 @@ public:
|
|||
};
|
||||
|
||||
Type _type = Type::REQUEST;
|
||||
VariableResolvingString _message =
|
||||
obs_module_text("AdvSceneSwitcher.enterText");
|
||||
StringVariable _message = obs_module_text("AdvSceneSwitcher.enterText");
|
||||
RegexConfig _regex;
|
||||
std::string _connection;
|
||||
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
#include <source-selection.hpp>
|
||||
#include <scene-selection.hpp>
|
||||
#include <regex-config.hpp>
|
||||
#include <variable.hpp>
|
||||
#include <variable-string.hpp>
|
||||
#include <obs.hpp>
|
||||
#include <obs-module.h>
|
||||
|
||||
|
|
@ -89,8 +89,7 @@ public:
|
|||
tesseract::PageSegMode GetPageMode() const { return pageSegMode; }
|
||||
tesseract::TessBaseAPI *GetOCR() const { return ocr.get(); }
|
||||
|
||||
VariableResolvingString text =
|
||||
obs_module_text("AdvSceneSwitcher.enterText");
|
||||
VariableString text = obs_module_text("AdvSceneSwitcher.enterText");
|
||||
RegexConfig regex = RegexConfig::PartialMatchRegexConfig();
|
||||
QColor color = Qt::black;
|
||||
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ FileSelection::FileSelection(FileSelection::Type type, QWidget *parent)
|
|||
setLayout(layout);
|
||||
}
|
||||
|
||||
void FileSelection::SetPath(const VariableResolvingString &path)
|
||||
void FileSelection::SetPath(const StringVariable &path)
|
||||
{
|
||||
_filePath->setText(path);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ public:
|
|||
|
||||
FileSelection(FileSelection::Type type = FileSelection::Type::READ,
|
||||
QWidget *parent = 0);
|
||||
void SetPath(const VariableResolvingString &);
|
||||
void SetPath(const StringVariable &);
|
||||
void SetPath(const QString &);
|
||||
QPushButton *Button() { return _browseButton; }
|
||||
static QString ValidPathOrDesktop(const QString &path);
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ bool StringList::Load(obs_data_t *obj, const char *name,
|
|||
size_t count = obs_data_array_count(strings);
|
||||
for (size_t i = 0; i < count; i++) {
|
||||
obs_data_t *array_obj = obs_data_array_item(strings, i);
|
||||
VariableResolvingString string;
|
||||
StringVariable string;
|
||||
string.Load(array_obj, elementName);
|
||||
*this << string;
|
||||
obs_data_release(array_obj);
|
||||
|
|
@ -114,7 +114,7 @@ void StringListEdit::Add()
|
|||
if (!accepted || name.empty()) {
|
||||
return;
|
||||
}
|
||||
VariableResolvingString string = name;
|
||||
StringVariable string = name;
|
||||
QVariant v = QVariant::fromValue(string);
|
||||
QListWidgetItem *item = new QListWidgetItem(
|
||||
QString::fromStdString(string.UnresolvedValue()), _list);
|
||||
|
|
@ -179,7 +179,7 @@ void StringListEdit::Clicked(QListWidgetItem *item)
|
|||
return;
|
||||
}
|
||||
|
||||
VariableResolvingString string = name;
|
||||
StringVariable string = name;
|
||||
QVariant v = QVariant::fromValue(string);
|
||||
item->setText(QString::fromStdString(string.UnresolvedValue()));
|
||||
item->setData(Qt::UserRole, string);
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
#pragma once
|
||||
#include "variable.hpp"
|
||||
#include "variable-string.hpp"
|
||||
|
||||
#include <obs-data.h>
|
||||
#include <obs-module.h>
|
||||
|
|
@ -8,7 +8,7 @@
|
|||
#include <QListWidget>
|
||||
#include <QStringList>
|
||||
|
||||
class StringList : public QList<VariableResolvingString> {
|
||||
class StringList : public QList<StringVariable> {
|
||||
public:
|
||||
bool Save(obs_data_t *obj, const char *name,
|
||||
const char *elementName = "string") const;
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ void VariableLineEdit::setText(const QString &string)
|
|||
QLineEdit::setText(string);
|
||||
}
|
||||
|
||||
void VariableLineEdit::setText(const VariableResolvingString &string)
|
||||
void VariableLineEdit::setText(const StringVariable &string)
|
||||
{
|
||||
QLineEdit::setText(QString::fromStdString(string.UnresolvedValue()));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
#pragma once
|
||||
#include "variable.hpp"
|
||||
#include "variable-string.hpp"
|
||||
|
||||
#include <QLineEdit>
|
||||
|
||||
|
|
@ -8,7 +8,7 @@ class VariableLineEdit : public QLineEdit {
|
|||
public:
|
||||
VariableLineEdit(QWidget *parent);
|
||||
void setText(const QString &);
|
||||
void setText(const VariableResolvingString &);
|
||||
void setText(const StringVariable &);
|
||||
|
||||
private:
|
||||
};
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ void VariableTextEdit::setPlainText(const QString &string)
|
|||
QPlainTextEdit::setPlainText(string);
|
||||
}
|
||||
|
||||
void VariableTextEdit::setPlainText(const VariableResolvingString &string)
|
||||
void VariableTextEdit::setPlainText(const StringVariable &string)
|
||||
{
|
||||
QPlainTextEdit::setPlainText(
|
||||
QString::fromStdString(string.UnresolvedValue()));
|
||||
|
|
|
|||
|
|
@ -1,13 +1,13 @@
|
|||
#pragma once
|
||||
#include "resizing-text-edit.hpp"
|
||||
#include "variable.hpp"
|
||||
#include "variable-string.hpp"
|
||||
|
||||
class VariableTextEdit : public ResizingPlainTextEdit {
|
||||
Q_OBJECT
|
||||
public:
|
||||
VariableTextEdit(QWidget *parent);
|
||||
void setPlainText(const QString &);
|
||||
void setPlainText(const VariableResolvingString &);
|
||||
void setPlainText(const StringVariable &);
|
||||
|
||||
private:
|
||||
};
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user