mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-10 23:44:24 +00:00
ContentSharer: Update interface to return safer ScopedMessageBox instances
This commit is contained in:
parent
557d690ff4
commit
9d1a6a3b28
22 changed files with 1304 additions and 1033 deletions
|
|
@ -54,6 +54,7 @@ target_sources(DemoRunner PRIVATE
|
|||
target_compile_definitions(DemoRunner PRIVATE
|
||||
PIP_JUCE_EXAMPLES_DIRECTORY_STRING="${JUCE_SOURCE_DIR}/examples"
|
||||
JUCE_ALLOW_STATIC_NULL_VARIABLES=0
|
||||
JUCE_CONTENT_SHARING=1
|
||||
JUCE_DEMO_RUNNER=1
|
||||
JUCE_PLUGINHOST_LV2=1
|
||||
JUCE_PLUGINHOST_VST3=1
|
||||
|
|
|
|||
|
|
@ -314,12 +314,11 @@ private:
|
|||
|
||||
SafePointer<CameraDemo> safeThis (this);
|
||||
|
||||
juce::ContentSharer::getInstance()->shareFiles ({url},
|
||||
[safeThis] (bool success, const String&) mutable
|
||||
{
|
||||
if (safeThis)
|
||||
safeThis->sharingFinished (success, false);
|
||||
});
|
||||
messageBox = ContentSharer::shareFilesScoped ({ url }, [safeThis] (bool success, const String&)
|
||||
{
|
||||
if (safeThis)
|
||||
safeThis->sharingFinished (success, false);
|
||||
});
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
|
@ -355,12 +354,11 @@ private:
|
|||
|
||||
SafePointer<CameraDemo> safeThis (this);
|
||||
|
||||
juce::ContentSharer::getInstance()->shareFiles ({url},
|
||||
[safeThis] (bool success, const String&) mutable
|
||||
{
|
||||
if (safeThis)
|
||||
safeThis->sharingFinished (success, true);
|
||||
});
|
||||
messageBox = ContentSharer::shareFilesScoped ({ url }, [safeThis] (bool success, const String&)
|
||||
{
|
||||
if (safeThis)
|
||||
safeThis->sharingFinished (success, true);
|
||||
});
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
|
|
|||
|
|
@ -462,7 +462,7 @@ private:
|
|||
}
|
||||
else if (type == shareText)
|
||||
{
|
||||
ContentSharer::getInstance()->shareText ("I love JUCE!", [ptr = Component::SafePointer (this)] (bool success, const String& error)
|
||||
messageBox = ContentSharer::shareTextScoped ("I love JUCE!", [ptr = Component::SafePointer (this)] (bool success, const String& error)
|
||||
{
|
||||
if (ptr == nullptr)
|
||||
return;
|
||||
|
|
@ -489,7 +489,7 @@ private:
|
|||
Array<URL> urls;
|
||||
urls.add (URL (fileToSave));
|
||||
|
||||
ContentSharer::getInstance()->shareFiles (urls, [ptr = Component::SafePointer (this)] (bool success, const String& error)
|
||||
messageBox = ContentSharer::shareFilesScoped (urls, [ptr = Component::SafePointer (this)] (bool success, const String& error)
|
||||
{
|
||||
if (ptr == nullptr)
|
||||
return;
|
||||
|
|
@ -519,7 +519,7 @@ private:
|
|||
|
||||
Array<Image> images { myImage, myImage2 };
|
||||
|
||||
ContentSharer::getInstance()->shareImages (images, [ptr = Component::SafePointer (this)] (bool success, const String& error)
|
||||
messageBox = ContentSharer::shareImagesScoped (images, nullptr, [ptr = Component::SafePointer (this)] (bool success, const String& error)
|
||||
{
|
||||
if (ptr == nullptr)
|
||||
return;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue