Trying to fix a problem with the file import dialog. The dialog is not actually modal, so it's possible to close the plugin GUI or delete the plugin while the dialog is still open. No complete fix yet and the dialog opened by launchAsync has the ancient GUI style on Windows...Big SIGH.

This commit is contained in:
xenakios
2019-01-21 16:10:17 +02:00
parent 0dd0fb962e
commit 409c053057
4 changed files with 30 additions and 7 deletions

View File

@ -524,12 +524,14 @@ void PaulstretchpluginAudioProcessorEditor::chooseFile()
String filterstring = processor.m_afm->getWildcardForAllFormats();
//auto prevcomp = std::make_unique<AudioFilePreviewComponent>(&processor);
//processor.setAudioPreview(prevcomp.get());
FileChooser myChooser("Please select audio file...",
m_filechooser = std::make_unique<FileChooser>("Please select audio file...",
initialloc,
filterstring,true);
if (myChooser.browseForFileToOpen())
filterstring,true,false,this);
m_filechooser->launchAsync(0, processor.m_filechoose_callback);
return;
//if (m_filechooser->launchAsync(0,processor.m_filechoose_callback))
{
File resu = myChooser.getResult();
File resu = m_filechooser->getResult();
String pathname = resu.getFullPathName();
if (pathname.startsWith("/localhost"))
{
@ -539,8 +541,8 @@ void PaulstretchpluginAudioProcessorEditor::chooseFile()
processor.m_propsfile->m_props_file->setValue("importfilefolder", resu.getParentDirectory().getFullPathName());
m_last_err = processor.setAudioFile(resu);
}
processor.setAudioPreview(nullptr);
toFront(true);
//processor.setAudioPreview(nullptr);
//toFront(true);
}
void PaulstretchpluginAudioProcessorEditor::showSettingsMenu()