Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
obs-studio
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Yunxiang Li
obs-studio
Commits
4d02563d
Commit
4d02563d
authored
10 years ago
by
Jim
Browse files
Options
Downloads
Plain Diff
Merge pull request #235 from Socapex/master
Alert user when using existing source name.
parents
69b9e722
6597206d
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
obs/data/locale/en-US.ini
+2
-1
2 additions, 1 deletion
obs/data/locale/en-US.ini
obs/window-basic-main.cpp
+16
-5
16 additions, 5 deletions
obs/window-basic-main.cpp
obs/window-basic-source-select.cpp
+2
-2
2 additions, 2 deletions
obs/window-basic-source-select.cpp
with
20 additions
and
8 deletions
obs/data/locale/en-US.ini
+
2
−
1
View file @
4d02563d
...
...
@@ -30,7 +30,8 @@ DroppedFrames="Dropped Frames %1 (%2%)"
NameExists.Title
=
"Name already exists"
NameExists.Text
=
"The name is already in use."
NoNameEntered
=
"Please enter a valid name"
NoNameEntered.Title
=
"Please enter a valid name"
NoNameEntered.Text
=
"You cannot use empty names."
# confirm delete dialog box
ConfirmRemove.Title
=
"Confirm Remove"
...
...
This diff is collapsed.
Click to expand it.
obs/window-basic-main.cpp
+
16
−
5
View file @
4d02563d
...
...
@@ -1480,8 +1480,8 @@ void OBSBasic::on_actionAddScene_triggered()
if
(
accepted
)
{
if
(
name
.
empty
())
{
QMessageBox
::
information
(
this
,
QTStr
(
"NoNameEntered"
),
QTStr
(
"NoNameEntered"
));
QTStr
(
"NoNameEntered
.Title
"
),
QTStr
(
"NoNameEntered
.Text
"
));
on_actionAddScene_triggered
();
return
;
}
...
...
@@ -1818,7 +1818,7 @@ void OBSBasic::logUploadFinished()
logDialog
.
exec
();
}
static
void
RenameListItem
(
QListWidget
*
listWidget
,
obs_source_t
source
,
static
void
RenameListItem
(
OBSBasic
*
parent
,
QListWidget
*
listWidget
,
obs_source_t
source
,
const
string
&
name
)
{
const
char
*
prevName
=
obs_source_get_name
(
source
);
...
...
@@ -1827,6 +1827,17 @@ static void RenameListItem(QListWidget *listWidget, obs_source_t source,
if
(
foundSource
||
name
.
compare
(
prevName
)
==
0
||
name
.
empty
())
{
listItem
->
setText
(
QT_UTF8
(
prevName
));
if
(
foundSource
||
name
.
compare
(
prevName
)
==
0
)
{
QMessageBox
::
information
(
parent
,
QTStr
(
"NameExists.Title"
),
QTStr
(
"NameExists.Text"
));
}
else
if
(
name
.
empty
())
{
QMessageBox
::
information
(
parent
,
QTStr
(
"NoNameEntered.Title"
),
QTStr
(
"NoNameEntered.Text"
));
}
obs_source_release
(
foundSource
);
}
else
{
listItem
->
setText
(
QT_UTF8
(
name
.
c_str
()));
...
...
@@ -1845,7 +1856,7 @@ void OBSBasic::SceneNameEdited(QWidget *editor,
return
;
obs_source_t
source
=
obs_scene_get_source
(
scene
);
RenameListItem
(
ui
->
scenes
,
source
,
text
);
RenameListItem
(
this
,
ui
->
scenes
,
source
,
text
);
UNUSED_PARAMETER
(
endHint
);
}
...
...
@@ -1861,7 +1872,7 @@ void OBSBasic::SceneItemNameEdited(QWidget *editor,
return
;
obs_source_t
source
=
obs_sceneitem_get_source
(
item
);
RenameListItem
(
ui
->
sources
,
source
,
text
);
RenameListItem
(
this
,
ui
->
sources
,
source
,
text
);
UNUSED_PARAMETER
(
endHint
);
}
...
...
This diff is collapsed.
Click to expand it.
obs/window-basic-source-select.cpp
+
2
−
2
View file @
4d02563d
...
...
@@ -140,8 +140,8 @@ void OBSBasicSourceSelect::on_buttonBox_accepted()
}
else
{
if
(
ui
->
sourceName
->
text
().
isEmpty
())
{
QMessageBox
::
information
(
this
,
QTStr
(
"NoNameEntered"
),
QTStr
(
"NoNameEntered"
));
QTStr
(
"NoNameEntered
.Title
"
),
QTStr
(
"NoNameEntered
.Text
"
));
return
;
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment