diff options
author | callum_linden <callum@lindenlab.com> | 2017-12-14 14:27:49 -0800 |
---|---|---|
committer | callum_linden <callum@lindenlab.com> | 2017-12-14 14:27:49 -0800 |
commit | 6166ab28dd43304085b23c0d35698be9d90bb8a9 (patch) | |
tree | 42731c3c98ad2efc6e4211491b05a86855e2b05c /indra/media_plugins/cef | |
parent | 0b97c76dbb238fab079d10433ecf37045f6134ae (diff) |
Pull in Dullahan 1.1.929 (multiple file picking support) and update plugin code accordingly
Diffstat (limited to 'indra/media_plugins/cef')
-rw-r--r-- | indra/media_plugins/cef/media_plugin_cef.cpp | 38 |
1 files changed, 29 insertions, 9 deletions
diff --git a/indra/media_plugins/cef/media_plugin_cef.cpp b/indra/media_plugins/cef/media_plugin_cef.cpp index dbd33a736b..558ae75c3c 100644 --- a/indra/media_plugins/cef/media_plugin_cef.cpp +++ b/indra/media_plugins/cef/media_plugin_cef.cpp @@ -68,7 +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); - 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); + const std::vector<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); @@ -94,7 +94,7 @@ private: bool mCanPaste; std::string mCachePath; std::string mCookiePath; - std::string mPickedFile; + std::vector<std::string> mPickedFiles; VolumeCatcher mVolumeCatcher; F32 mCurVolume; dullahan* mCEFLib; @@ -124,7 +124,7 @@ MediaPluginBase(host_send_func, host_user_data) mCanPaste = false; mCachePath = ""; mCookiePath = ""; - mPickedFile = ""; + mPickedFiles.clear(); mCurVolume = 0.0; mCEFLib = new dullahan(); @@ -284,21 +284,34 @@ bool MediaPluginCEF::onHTTPAuthCallback(const std::string host, const std::strin //////////////////////////////////////////////////////////////////////////////// // -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) +const std::vector<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) { // do not use the default CEF file picker use_default = false; if (dialog_type == dullahan::FD_OPEN_FILE) { - mPickedFile.clear(); + mPickedFiles.clear(); LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA, "pick_file"); message.setValueBoolean("blocking_request", true); + message.setValueBoolean("multiple_files", false); sendMessage(message); - return mPickedFile; + return mPickedFiles; + } + else if (dialog_type == dullahan::FD_OPEN_MULTIPLE_FILES) + { + mPickedFiles.clear(); + + LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA, "pick_file"); + message.setValueBoolean("blocking_request", true); + message.setValueBoolean("multiple_files", true); + + sendMessage(message); + + return mPickedFiles; } else if (dialog_type == dullahan::FD_SAVE_FILE) { @@ -309,10 +322,10 @@ const std::string MediaPluginCEF::onFileDialog(dullahan::EFileDialogType dialog_ sendMessage(message); - return std::string(); + return std::vector<std::string>(); } - return std::string(); + return std::vector<std::string>(); } //////////////////////////////////////////////////////////////////////////////// @@ -659,7 +672,14 @@ void MediaPluginCEF::receiveMessage(const char* message_string) } if (message_name == "pick_file_response") { - mPickedFile = message_in.getValue("file"); + LLSD file_list_llsd = message_in.getValueLLSD("file_list"); + + LLSD::array_const_iterator iter = file_list_llsd.beginArray(); + LLSD::array_const_iterator end = file_list_llsd.endArray(); + for (; iter != end; ++iter) + { + mPickedFiles.push_back(((*iter).asString())); + } } if (message_name == "auth_response") { |