mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-10 23:44:24 +00:00
PluginListComponent: Use lambda form of ModalCallbackFunction
This commit is contained in:
parent
5d50d6bcdc
commit
dc890c69c2
1 changed files with 7 additions and 14 deletions
|
|
@ -194,9 +194,13 @@ public:
|
|||
pathChooserWindow.addButton (TRANS ("Cancel"), 0, KeyPress (KeyPress::escapeKey));
|
||||
|
||||
pathChooserWindow.enterModalState (true,
|
||||
ModalCallbackFunction::forComponent (startScanCallback,
|
||||
&pathChooserWindow, this),
|
||||
false);
|
||||
ModalCallbackFunction::create ([this] (auto result)
|
||||
{
|
||||
if (result != 0)
|
||||
warnUserAboutStupidPaths();
|
||||
else
|
||||
finishedScan();
|
||||
}));
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -230,17 +234,6 @@ private:
|
|||
std::set<String> initiallyBlacklistedFiles;
|
||||
ScopedMessageBox messageBox;
|
||||
|
||||
static void startScanCallback (int result, AlertWindow* alert, Scanner* scanner)
|
||||
{
|
||||
if (alert != nullptr && scanner != nullptr)
|
||||
{
|
||||
if (result != 0)
|
||||
scanner->warnUserAboutStupidPaths();
|
||||
else
|
||||
scanner->finishedScan();
|
||||
}
|
||||
}
|
||||
|
||||
// Try to dissuade people from to scanning their entire C: drive, or other system folders.
|
||||
void warnUserAboutStupidPaths()
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue