2022-08-04 Fred Gleason <fredg@paravelsystems.com>

* Added interlock logic to the 'Edit Switcher Event' dialog in
	rdcatch(1) to prevent creation of events containing null endpoints.

Signed-off-by: Fred Gleason <fredg@paravelsystems.com>
This commit is contained in:
Fred Gleason 2022-08-04 14:20:11 -04:00
parent 8949fcc3fb
commit cdc9c77139
3 changed files with 23 additions and 0 deletions

View File

@ -23220,3 +23220,6 @@
* Fixed a bug in rdcatch(1) that caused switch event endpoints
to be sorted alphabetically rather than by endpoint number in
the 'Edit Switcher Event' dialog.
2022-08-04 Fred Gleason <fredg@paravelsystems.com>
* Added interlock logic to the 'Edit Switcher Event' dialog in
rdcatch(1) to prevent creation of events containing null endpoints.

View File

@ -295,18 +295,21 @@ void EditSwitchEvent::activateMatrixData(const QString &str)
}
}
delete q;
UpdateOkButton();
}
void EditSwitchEvent::activateInputData(const QString &str)
{
edit_input_spin->setValue(GetSource());
UpdateOkButton();
}
void EditSwitchEvent::activateOutputData(const QString &str)
{
edit_output_spin->setValue(GetDestination());
UpdateOkButton();
}
@ -318,6 +321,7 @@ void EditSwitchEvent::inputChangedData(int value)
else {
edit_input_box->setCurrentText(tr("--OFF--"));
}
UpdateOkButton();
}
@ -326,6 +330,7 @@ void EditSwitchEvent::outputChangedData(int value)
if((value>0)&&(edit_output_box->count()>0)) {
edit_output_box->setCurrentText(edit_matrix->outputName(value));
}
UpdateOkButton();
}
@ -530,3 +535,17 @@ bool EditSwitchEvent::CheckEvent(bool include_myself)
return res;
}
void EditSwitchEvent::UpdateOkButton()
{
QString null_endpt=" - "+tr("[none]");
bool ok=(!edit_matrix_box->currentText().isEmpty())&&
(!edit_output_box->currentText().isEmpty())&&
(!edit_input_box->currentText().isEmpty())&&
(edit_output_box->currentText().right(null_endpt.length())!=null_endpt)&&
(edit_input_box->currentText().right(null_endpt.length())!=null_endpt);
edit_ok_button->setEnabled(ok);
edit_saveas_button->setEnabled(ok);
}

View File

@ -69,6 +69,7 @@ class EditSwitchEvent : public RDDialog
int GetSource();
int GetDestination();
bool CheckEvent(bool include_myself);
void UpdateOkButton();
RDMatrix *edit_matrix;
RDDeck *edit_deck;
RDRecording *edit_recording;