mirror of
https://github.com/WarmUpTill/SceneSwitcher.git
synced 2026-04-25 15:34:48 -05:00
Add support for variables in file FileSelection widget
This commit is contained in:
parent
1dd46fb777
commit
783f76d55d
|
|
@ -1257,7 +1257,7 @@ void MacroConditionVideoEdit::UpdateEntryData()
|
|||
_patternMatchMode->setCurrentIndex(_patternMatchMode->findData(
|
||||
_entryData->_patternMatchParameters.matchMode));
|
||||
_brightnessThreshold->SetDoubleValue(_entryData->_brightnessThreshold);
|
||||
_modelDataPath->SetPath(_entryData->GetModelDataPath().c_str());
|
||||
_modelDataPath->SetPath(_entryData->GetModelDataPath());
|
||||
_objectScaleThreshold->SetDoubleValue(
|
||||
_entryData->_objMatchParameters.scaleFactor);
|
||||
_matchText->setPlainText(_entryData->_ocrParamters.text);
|
||||
|
|
|
|||
|
|
@ -7,12 +7,12 @@
|
|||
#include <filesystem>
|
||||
|
||||
FileSelection::FileSelection(FileSelection::Type type, QWidget *parent)
|
||||
: QWidget(parent), _type(type)
|
||||
: QWidget(parent),
|
||||
_type(type),
|
||||
_filePath(new VariableLineEdit(this)),
|
||||
_browseButton(
|
||||
new QPushButton(obs_module_text("AdvSceneSwitcher.browse")))
|
||||
{
|
||||
_filePath = new QLineEdit();
|
||||
_browseButton =
|
||||
new QPushButton(obs_module_text("AdvSceneSwitcher.browse"));
|
||||
|
||||
QWidget::connect(_filePath, SIGNAL(editingFinished()), this,
|
||||
SLOT(PathChange()));
|
||||
QWidget::connect(_browseButton, SIGNAL(clicked()), this,
|
||||
|
|
@ -24,6 +24,11 @@ FileSelection::FileSelection(FileSelection::Type type, QWidget *parent)
|
|||
setLayout(layout);
|
||||
}
|
||||
|
||||
void FileSelection::SetPath(const VariableResolvingString &path)
|
||||
{
|
||||
_filePath->setText(path);
|
||||
}
|
||||
|
||||
void FileSelection::SetPath(const QString &path)
|
||||
{
|
||||
_filePath->setText(path);
|
||||
|
|
|
|||
|
|
@ -1,4 +1,6 @@
|
|||
#pragma once
|
||||
#include "variable-line-edit.hpp"
|
||||
|
||||
#include <QLineEdit>
|
||||
#include <QPushButton>
|
||||
#include <QWidget>
|
||||
|
|
@ -15,6 +17,7 @@ public:
|
|||
|
||||
FileSelection(FileSelection::Type type = FileSelection::Type::READ,
|
||||
QWidget *parent = 0);
|
||||
void SetPath(const VariableResolvingString &);
|
||||
void SetPath(const QString &);
|
||||
QPushButton *Button() { return _browseButton; }
|
||||
static QString ValidPathOrDesktop(const QString &path);
|
||||
|
|
@ -27,6 +30,6 @@ signals:
|
|||
|
||||
private:
|
||||
Type _type;
|
||||
QLineEdit *_filePath;
|
||||
VariableLineEdit *_filePath;
|
||||
QPushButton *_browseButton;
|
||||
};
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user