1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-06-16 16:10:06 +02:00

Bug 646 - Additional fix the Cancel button

It now interrupts the scan if the user clicks OK first.
This commit is contained in:
lllucius 2013-10-30 02:42:51 +00:00
parent 88b0e0c264
commit a53defedf3

View File

@ -450,6 +450,8 @@ class PluginRegistrationDialog:public wxDialog {
wxArrayString mFiles;
wxArrayInt miState;
bool mCancelClicked;
DECLARE_EVENT_TABLE()
};
@ -659,9 +661,10 @@ void PluginRegistrationDialog::ToggleItem(int i)
void PluginRegistrationDialog::OnApply(wxCommandEvent & WXUNUSED(event))
{
mCancelClicked = false;
size_t cnt = mFiles.GetCount();
for (size_t i = 0; i < cnt; i++) {
for (size_t i = 0; i < cnt && !mCancelClicked; i++) {
wxString file = mFiles[i];
mPlugins->EnsureVisible( i );
@ -671,13 +674,17 @@ void PluginRegistrationDialog::OnApply(wxCommandEvent & WXUNUSED(event))
VSTEffect::ScanOnePlugin( file );
mPlugins->SetItemImage( i, SHOW_CHECKED );
}
wxYield();
}
EndModal(wxID_OK);
EndModal(mCancelClicked ? wxID_CANCEL : wxID_OK);
}
void PluginRegistrationDialog::OnCancel(wxCommandEvent & WXUNUSED(event))
{
EndModal(wxID_CANCEL);
mCancelClicked = true;
EndModal(mCancelClicked ? wxID_CANCEL : wxID_OK);
}