Disable events while processing all file change events in SubsEditBox as apparently wxComboBox::Clear triggers change events on some platforms

Originally committed to SVN as r4960.
This commit is contained in:
Thomas Goyne 2010-12-12 00:34:02 +00:00
parent fc9607cbb1
commit 36ded6ef89

View file

@ -336,6 +336,7 @@ SubsEditBox::~SubsEditBox() {
} }
void SubsEditBox::Update(int type) { void SubsEditBox::Update(int type) {
SetEvtHandlerEnabled(false);
if (type == AssFile::COMMIT_FULL || type == AssFile::COMMIT_UNDO) { if (type == AssFile::COMMIT_FULL || type == AssFile::COMMIT_UNDO) {
/// @todo maybe preserve selection over undo? /// @todo maybe preserve selection over undo?
StyleBox->Clear(); StyleBox->Clear();
@ -355,15 +356,16 @@ void SubsEditBox::Update(int type) {
ActorBox->Thaw(); ActorBox->Thaw();
TextEdit->SetSelection(0,0); TextEdit->SetSelection(0,0);
SetEvtHandlerEnabled(true);
return; return;
} }
SetControlsState(!!line); SetControlsState(!!line);
if (!line) { if (!line) {
SetEvtHandlerEnabled(true);
return; return;
} }
SetEvtHandlerEnabled(false);
StartTime->SetTime(line->Start); StartTime->SetTime(line->Start);
EndTime->SetTime(line->End); EndTime->SetTime(line->End);
Duration->SetTime(line->End-line->Start); Duration->SetTime(line->End-line->Start);