mirror of
https://github.com/WarmUpTill/SceneSwitcher.git
synced 2026-03-22 01:44:49 -05:00
Allow empty string as argument and increase max length of argument
This commit is contained in:
parent
211eac5313
commit
5be2cd278f
|
|
@ -55,7 +55,8 @@ ProcessConfigEdit::ProcessConfigEdit(QWidget *parent)
|
|||
_argList(new StringListEdit(
|
||||
this, obs_module_text("AdvSceneSwitcher.process.addArgument"),
|
||||
obs_module_text(
|
||||
"AdvSceneSwitcher.process.addArgumentDescription"))),
|
||||
"AdvSceneSwitcher.process.addArgumentDescription"),
|
||||
4096, true)),
|
||||
_workingDirectory(new FileSelection(FileSelection::Type::FOLDER))
|
||||
{
|
||||
_advancedSettingsLayout->setContentsMargins(0, 0, 0, 0);
|
||||
|
|
|
|||
|
|
@ -39,7 +39,8 @@ bool StringList::Load(obs_data_t *obj, const char *name,
|
|||
}
|
||||
|
||||
StringListEdit::StringListEdit(QWidget *parent, const QString &addString,
|
||||
const QString &addStringDescription)
|
||||
const QString &addStringDescription,
|
||||
int maxStringSize, bool allowEmtpy)
|
||||
: QWidget(parent),
|
||||
_list(new QListWidget()),
|
||||
_add(new QPushButton()),
|
||||
|
|
@ -47,7 +48,9 @@ StringListEdit::StringListEdit(QWidget *parent, const QString &addString,
|
|||
_up(new QPushButton()),
|
||||
_down(new QPushButton()),
|
||||
_addString(addString),
|
||||
_addStringDescription(addStringDescription)
|
||||
_addStringDescription(addStringDescription),
|
||||
_maxStringSize(maxStringSize),
|
||||
_allowEmpty(allowEmtpy)
|
||||
{
|
||||
_add->setMaximumWidth(22);
|
||||
_add->setProperty("themeID",
|
||||
|
|
@ -130,7 +133,7 @@ void StringListEdit::Add()
|
|||
_addStringDescription, name,
|
||||
"", _maxStringSize, false);
|
||||
|
||||
if (!accepted || name.empty()) {
|
||||
if (!accepted || (!_allowEmpty && name.empty())) {
|
||||
return;
|
||||
}
|
||||
StringVariable string = name;
|
||||
|
|
@ -199,7 +202,7 @@ void StringListEdit::Clicked(QListWidgetItem *item)
|
|||
item->text(),
|
||||
_maxStringSize, false);
|
||||
|
||||
if (!accepted || name.empty()) {
|
||||
if (!accepted || (!_allowEmpty && name.empty())) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -25,7 +25,8 @@ class StringListEdit : public QWidget {
|
|||
|
||||
public:
|
||||
StringListEdit(QWidget *parent, const QString &addString = "",
|
||||
const QString &addStringDescription = "");
|
||||
const QString &addStringDescription = "",
|
||||
int maxStringSize = 170, bool allowEmtpy = false);
|
||||
void SetStringList(const StringList &);
|
||||
void SetMaxStringSize(int);
|
||||
|
||||
|
|
@ -55,6 +56,7 @@ private:
|
|||
QString _addString;
|
||||
QString _addStringDescription;
|
||||
int _maxStringSize = 170;
|
||||
bool _allowEmpty = false;
|
||||
};
|
||||
|
||||
} // namespace advss
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user