New upstream version 19.0.3+dfsg1
This commit is contained in:
parent
3708b8e092
commit
1f1bbb3518
534 changed files with 13862 additions and 2459 deletions
|
|
@ -364,7 +364,7 @@ void OBSBasic::AddTransition()
|
|||
|
||||
if (accepted) {
|
||||
if (name.empty()) {
|
||||
QMessageBox::information(this,
|
||||
OBSMessageBox::information(this,
|
||||
QTStr("NoNameEntered.Title"),
|
||||
QTStr("NoNameEntered.Text"));
|
||||
AddTransition();
|
||||
|
|
@ -373,7 +373,7 @@ void OBSBasic::AddTransition()
|
|||
|
||||
source = FindTransition(name.c_str());
|
||||
if (source) {
|
||||
QMessageBox::information(this,
|
||||
OBSMessageBox::information(this,
|
||||
QTStr("NameExists.Title"),
|
||||
QTStr("NameExists.Text"));
|
||||
|
||||
|
|
@ -392,6 +392,9 @@ void OBSBasic::AddTransition()
|
|||
|
||||
if (api)
|
||||
api->on_event(OBS_FRONTEND_EVENT_TRANSITION_LIST_CHANGED);
|
||||
|
||||
ClearQuickTransitionWidgets();
|
||||
RefreshQuickTransitions();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -445,6 +448,9 @@ void OBSBasic::on_transitionRemove_clicked()
|
|||
|
||||
if (api)
|
||||
api->on_event(OBS_FRONTEND_EVENT_TRANSITION_LIST_CHANGED);
|
||||
|
||||
ClearQuickTransitionWidgets();
|
||||
RefreshQuickTransitions();
|
||||
}
|
||||
|
||||
void OBSBasic::RenameTransition()
|
||||
|
|
@ -464,7 +470,7 @@ void OBSBasic::RenameTransition()
|
|||
|
||||
if (accepted) {
|
||||
if (name.empty()) {
|
||||
QMessageBox::information(this,
|
||||
OBSMessageBox::information(this,
|
||||
QTStr("NoNameEntered.Title"),
|
||||
QTStr("NoNameEntered.Text"));
|
||||
RenameTransition();
|
||||
|
|
@ -473,7 +479,7 @@ void OBSBasic::RenameTransition()
|
|||
|
||||
source = FindTransition(name.c_str());
|
||||
if (source) {
|
||||
QMessageBox::information(this,
|
||||
OBSMessageBox::information(this,
|
||||
QTStr("NameExists.Title"),
|
||||
QTStr("NameExists.Text"));
|
||||
|
||||
|
|
@ -483,8 +489,11 @@ void OBSBasic::RenameTransition()
|
|||
|
||||
obs_source_set_name(transition, name.c_str());
|
||||
int idx = ui->transitions->findData(variant);
|
||||
if (idx != -1)
|
||||
if (idx != -1) {
|
||||
ui->transitions->setItemText(idx, QT_UTF8(name.c_str()));
|
||||
ClearQuickTransitionWidgets();
|
||||
RefreshQuickTransitions();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -919,6 +928,31 @@ void OBSBasic::QuickTransitionRemoveClicked()
|
|||
quickTransitions.erase(quickTransitions.begin() + idx);
|
||||
}
|
||||
|
||||
void OBSBasic::ClearQuickTransitionWidgets()
|
||||
{
|
||||
if (!IsPreviewProgramMode())
|
||||
return;
|
||||
|
||||
QVBoxLayout *programLayout =
|
||||
reinterpret_cast<QVBoxLayout*>(programOptions->layout());
|
||||
|
||||
for (int idx = 0;; idx++) {
|
||||
QLayoutItem *item = programLayout->itemAt(idx);
|
||||
if (!item)
|
||||
break;
|
||||
|
||||
QWidget *widget = item->widget();
|
||||
if (!widget)
|
||||
continue;
|
||||
|
||||
int id = widget->property("id").toInt();
|
||||
if (id != 0) {
|
||||
delete widget;
|
||||
idx--;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void OBSBasic::RefreshQuickTransitions()
|
||||
{
|
||||
if (!IsPreviewProgramMode())
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue