mirror of
https://github.com/WarmUpTill/SceneSwitcher.git
synced 2026-08-11 19:58:49 -05:00
Restructure library and plugins
The "core" macro conditions and actions have been extracted out to the "base" plugin. The library now mostly contains functionality which is required across all plugins and (e.g. definitions for macro segments). The goal is to reduce the complexity and cross-dependencies and group the source files in a better way. This should relsove the "library limit of 65535 objects exceeded" build issue occuring in some Windows build environments.
This commit is contained in:
46
lib/utils/variable-line-edit.cpp
Normal file
46
lib/utils/variable-line-edit.cpp
Normal file
@@ -0,0 +1,46 @@
|
||||
#include "variable-line-edit.hpp"
|
||||
#include "obs-module-helper.hpp"
|
||||
|
||||
#include <utility.hpp>
|
||||
|
||||
namespace advss {
|
||||
|
||||
VariableLineEdit::VariableLineEdit(QWidget *parent) : QLineEdit(parent)
|
||||
{
|
||||
QLineEdit::setToolTip(
|
||||
obs_module_text("AdvSceneSwitcher.tooltip.availableVariables"));
|
||||
|
||||
QWidget::connect(this, SIGNAL(inputRejected()), this,
|
||||
SLOT(DisplayValidationMessages()));
|
||||
}
|
||||
|
||||
void VariableLineEdit::setText(const QString &string)
|
||||
{
|
||||
QLineEdit::setText(string);
|
||||
}
|
||||
|
||||
void VariableLineEdit::setText(const StringVariable &string)
|
||||
{
|
||||
QLineEdit::setText(QString::fromStdString(string.UnresolvedValue()));
|
||||
}
|
||||
|
||||
void VariableLineEdit::setToolTip(const QString &string)
|
||||
{
|
||||
QLineEdit::setToolTip(
|
||||
string + "\n" +
|
||||
obs_module_text("AdvSceneSwitcher.tooltip.availableVariables"));
|
||||
}
|
||||
|
||||
void VariableLineEdit::DisplayValidationMessages()
|
||||
{
|
||||
int maxLength = QLineEdit::maxLength();
|
||||
|
||||
if (QLineEdit::text().length() == maxLength) {
|
||||
DisplayMessage(
|
||||
QString(obs_module_text(
|
||||
"AdvSceneSwitcher.validation.text.maxLength"))
|
||||
.arg(QString::number(maxLength)));
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace advss
|
||||
Reference in New Issue
Block a user