mirror of
https://github.com/obsproject/obs-studio.git
synced 2026-05-11 16:59:43 -04:00
frontend: Close rename dialog if name unchanged
This commit is contained in:
@@ -491,6 +491,10 @@ void VolumeControl::renameSource()
|
||||
continue;
|
||||
}
|
||||
|
||||
if (name == prevName) {
|
||||
return;
|
||||
}
|
||||
|
||||
OBSSourceAutoRelease sourceTest = obs_get_source_by_name(name.c_str());
|
||||
|
||||
if (sourceTest) {
|
||||
|
||||
@@ -562,14 +562,20 @@ void OBSBasic::RenameTransition(OBSSource transition)
|
||||
bool accepted = NameDialog::AskForName(this, QTStr("TransitionNameDlg.Title"), QTStr("TransitionNameDlg.Text"),
|
||||
name, placeHolderText);
|
||||
|
||||
if (!accepted)
|
||||
if (!accepted) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (name.empty()) {
|
||||
OBSMessageBox::warning(this, QTStr("NoNameEntered.Title"), QTStr("NoNameEntered.Text"));
|
||||
RenameTransition(transition);
|
||||
return;
|
||||
}
|
||||
|
||||
if (name == oldName) {
|
||||
return;
|
||||
}
|
||||
|
||||
source = FindTransition(name.c_str());
|
||||
if (source) {
|
||||
OBSMessageBox::warning(this, QTStr("NameExists.Title"), QTStr("NameExists.Text"));
|
||||
|
||||
Reference in New Issue
Block a user