Enable empty name warning to be hidden

Used for the twitch token selection for which the whole name selection
will be hidden if no token is connected.
This commit is contained in:
WarmUpTill 2023-10-12 20:54:03 +02:00 committed by WarmUpTill
parent 6cf1073a3c
commit 0449064f5d
2 changed files with 9 additions and 2 deletions

View File

@ -298,8 +298,14 @@ void ItemSettingsDialog::NameChanged(const QString &text)
return;
}
if (text.isEmpty()) {
SetNameWarning(
obs_module_text("AdvSceneSwitcher.item.emptyName"));
if (_showNameEmptyWarning) {
SetNameWarning(obs_module_text(
"AdvSceneSwitcher.item.emptyName"));
return;
}
_nameHint->setText("");
_nameHint->hide();
_buttonbox->button(QDialogButtonBox::Ok)->setDisabled(true);
return;
}
if (text == obs_module_text(_selectStr.data()) ||

View File

@ -59,6 +59,7 @@ protected:
std::string_view _addStr;
std::string_view _conflictStr;
QString _originalName;
bool _showNameEmptyWarning = true;
};
typedef bool (*SettingsCallback)(QWidget *, Item &);