From 0b97c76dbb238fab079d10433ecf37045f6134ae Mon Sep 17 00:00:00 2001 From: callum_linden Date: Wed, 13 Dec 2017 13:55:33 -0800 Subject: Pull in Dullahan 1.1.925 with fix for onFileDialogCallback(..) handling that fixes MAINT-8083 --- autobuild.xml | 14 ++++----- indra/media_plugins/cef/media_plugin_cef.cpp | 47 +++++++++++++++++----------- 2 files changed, 35 insertions(+), 26 deletions(-) diff --git a/autobuild.xml b/autobuild.xml index acb1ec1473..3f2bf9a630 100644 --- a/autobuild.xml +++ b/autobuild.xml @@ -556,9 +556,9 @@ archive hash - 92703992ed6ce4e93326744b91e20cfc + 1937f9f84f0f33563b9d33cf1c8e695a url - http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/11557/66312/dullahan-1.1.920_3.3202.1686.gd665578-darwin64-511302.tar.bz2 + http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/11646/67094/dullahan-1.1.925_3.3202.1686.gd665578-darwin64-511376.tar.bz2 name darwin64 @@ -568,9 +568,9 @@ archive hash - fd0d6d9e70dd9b811c72866f8285b79b + 08edc9fa2dc586e7a1c7c4b7a6b6c548 url - http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/11559/66324/dullahan-1.1.920_3.3202.1686.gd665578-windows-511302.tar.bz2 + http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/11648/67101/dullahan-1.1.925_3.3202.1686.gd665578-windows-511376.tar.bz2 name windows @@ -580,16 +580,16 @@ archive hash - 5e3defb1f2fc98e23d940c321ee360c2 + b220e427ade837e45a92fffab02c068f url - http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/11558/66318/dullahan-1.1.920_3.3202.1686.gd665578-windows64-511302.tar.bz2 + http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/11649/67106/dullahan-1.1.925_3.3202.1686.gd665578-windows64-511376.tar.bz2 name windows64 version - 1.1.920_3.3202.1686.gd665578 + 1.1.925_3.3202.1686.gd665578 elfio diff --git a/indra/media_plugins/cef/media_plugin_cef.cpp b/indra/media_plugins/cef/media_plugin_cef.cpp index 963c69aeb9..dbd33a736b 100644 --- a/indra/media_plugins/cef/media_plugin_cef.cpp +++ b/indra/media_plugins/cef/media_plugin_cef.cpp @@ -68,8 +68,7 @@ private: void onNavigateURLCallback(std::string url, std::string target); bool onHTTPAuthCallback(const std::string host, const std::string realm, std::string& username, std::string& password); void onCursorChangedCallback(dullahan::ECursorType type); - void onFileDownloadCallback(std::string filename); - const std::string onFileDialogCallback(); + const std::string onFileDialog(dullahan::EFileDialogType dialog_type, const std::string dialog_title, const std::string default_file, const std::string dialog_accept_filter, bool& use_default); void postDebugMessage(const std::string& msg); void authResponse(LLPluginMessage &message); @@ -285,30 +284,39 @@ bool MediaPluginCEF::onHTTPAuthCallback(const std::string host, const std::strin //////////////////////////////////////////////////////////////////////////////// // -void MediaPluginCEF::onFileDownloadCallback(const std::string filename) +const std::string MediaPluginCEF::onFileDialog(dullahan::EFileDialogType dialog_type, const std::string dialog_title, const std::string default_file, std::string dialog_accept_filter, bool& use_default) { - mAuthOK = false; + // do not use the default CEF file picker + use_default = false; - LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA, "file_download"); - message.setValue("filename", filename); + if (dialog_type == dullahan::FD_OPEN_FILE) + { + mPickedFile.clear(); - sendMessage(message); -} + LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA, "pick_file"); + message.setValueBoolean("blocking_request", true); -//////////////////////////////////////////////////////////////////////////////// -// -const std::string MediaPluginCEF::onFileDialogCallback() -{ - mPickedFile.clear(); + sendMessage(message); - LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA, "pick_file"); - message.setValueBoolean("blocking_request", true); + return mPickedFile; + } + else if (dialog_type == dullahan::FD_SAVE_FILE) + { + mAuthOK = false; - sendMessage(message); + LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA, "file_download"); + message.setValue("filename", default_file); + + sendMessage(message); + + return std::string(); + } - return mPickedFile; + return std::string(); } +//////////////////////////////////////////////////////////////////////////////// +// void MediaPluginCEF::onCursorChangedCallback(dullahan::ECursorType type) { std::string name = ""; @@ -341,6 +349,8 @@ void MediaPluginCEF::onCursorChangedCallback(dullahan::ECursorType type) sendMessage(message); } +//////////////////////////////////////////////////////////////////////////////// +// void MediaPluginCEF::authResponse(LLPluginMessage &message) { mAuthOK = message.getValueBoolean("ok"); @@ -442,8 +452,7 @@ void MediaPluginCEF::receiveMessage(const char* message_string) mCEFLib->setOnAddressChangeCallback(std::bind(&MediaPluginCEF::onAddressChangeCallback, this, std::placeholders::_1)); mCEFLib->setOnNavigateURLCallback(std::bind(&MediaPluginCEF::onNavigateURLCallback, this, std::placeholders::_1, std::placeholders::_2)); mCEFLib->setOnHTTPAuthCallback(std::bind(&MediaPluginCEF::onHTTPAuthCallback, this, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3, std::placeholders::_4)); - mCEFLib->setOnFileDownloadCallback(std::bind(&MediaPluginCEF::onFileDownloadCallback, this, std::placeholders::_1)); - mCEFLib->setOnFileDialogCallback(std::bind(&MediaPluginCEF::onFileDialogCallback, this)); + mCEFLib->setOnFileDialogCallback(std::bind(&MediaPluginCEF::onFileDialog, this, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3, std::placeholders::_4, std::placeholders::_5)); mCEFLib->setOnCursorChangedCallback(std::bind(&MediaPluginCEF::onCursorChangedCallback, this, std::placeholders::_1)); mCEFLib->setOnRequestExitCallback(std::bind(&MediaPluginCEF::onRequestExitCallback, this)); -- cgit v1.2.3