damiensellier / CtrlrX

CtlrX is an alternative fork of Roman Kubiak's Ctrlr. This project is ONLY aimed at delivering updates, a wiki, documentations, tutorials or anything that the community cannot share on the original Ctrlr github due to credential restrictions.
BSD 3-Clause "New" or "Revised" License
16 stars 3 forks source link

Open/Save File manager needs to be set to JUCE instead of Native for macOS by default #18

Open damiensellier opened 2 weeks ago

damiensellier commented 2 weeks ago

Native macOS is not called properly when saving/opening restricted instance for exemple.

The command to call the native file manager must be fixed or worst case scenario Open/Save File manager needs to be set to JUCE instead of Native for macOS by default.

damiensellier commented 1 week ago

Source/Native/CtrlrMac.cpp

https://github.com/damiensellier/CtrlrX/blob/d1052344ce5a9768e9d3ea75e3a15b8203920ce9/Source/Native/CtrlrMac.cpp#L20

https://docs.juce.com/master/classFileChooser.html

Try launch async :

std::unique_ptr<FileChooser> [myChooser](https://docs.juce.com/master/classStaticAnimationLimits.html);

void [loadMooseFile](https://docs.juce.com/master/classStaticAnimationLimits.html)()
{
    [myChooser](https://docs.juce.com/master/classStaticAnimationLimits.html) = std::make_unique<FileChooser> ("Please select the moose you want to load...",
                                               [File::getSpecialLocation](https://docs.juce.com/master/classFile.html#a2a4396bc0e6f8b0430f6f54d029899e5) ([File::userHomeDirectory](https://docs.juce.com/master/classFile.html#a3e19cafabb03c5838160263a6e76313da8620eabc38cfbd921a52d10157463c5e)),
                                               "*.moose");

    auto [folderChooserFlags](https://docs.juce.com/master/classStaticAnimationLimits.html) = [FileBrowserComponent::openMode](https://docs.juce.com/master/classFileBrowserComponent.html#a32888a950cc0e51c8e1350f53bea43d6a15f4871e1610d912885cc6de504e13e5) | [FileBrowserComponent::canSelectDirectories](https://docs.juce.com/master/classFileBrowserComponent.html#a32888a950cc0e51c8e1350f53bea43d6ab7e808e7b8a33afb0150e9ea6047c2dd);

    [myChooser](https://docs.juce.com/master/classStaticAnimationLimits.html)->launchAsync ([folderChooserFlags](https://docs.juce.com/master/classStaticAnimationLimits.html), [this] (const [FileChooser](https://docs.juce.com/master/classFileChooser.html)& chooser)
    {
        [File](https://docs.juce.com/master/classFile.html) [mooseFile](https://docs.juce.com/master/classStaticAnimationLimits.html) (chooser.[getResult](https://docs.juce.com/master/classFileChooser.html#a0ece12c12985b388f4fe988cbccfade6)());

        [loadMoose](https://docs.juce.com/master/classStaticAnimationLimits.html) ([mooseFile](https://docs.juce.com/master/classStaticAnimationLimits.html));
    });
}
damiensellier commented 1 week ago

SEE : https://forum.juce.com/t/file-chooser-async/47657