mirror of
https://github.com/WarmUpTill/SceneSwitcher.git
synced 2026-08-12 04:11:06 -05:00
Move variable files to to variables folder
This commit is contained in:
45
lib/variables/variable-line-edit.cpp
Normal file
45
lib/variables/variable-line-edit.cpp
Normal file
@@ -0,0 +1,45 @@
|
||||
#include "variable-line-edit.hpp"
|
||||
#include "obs-module-helper.hpp"
|
||||
#include "ui-helpers.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