summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--autobuild.xml14
-rw-r--r--indra/media_plugins/cef/media_plugin_cef.cpp47
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 @@
<key>archive</key>
<map>
<key>hash</key>
- <string>92703992ed6ce4e93326744b91e20cfc</string>
+ <string>1937f9f84f0f33563b9d33cf1c8e695a</string>
<key>url</key>
- <string>http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/11557/66312/dullahan-1.1.920_3.3202.1686.gd665578-darwin64-511302.tar.bz2</string>
+ <string>http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/11646/67094/dullahan-1.1.925_3.3202.1686.gd665578-darwin64-511376.tar.bz2</string>
</map>
<key>name</key>
<string>darwin64</string>
@@ -568,9 +568,9 @@
<key>archive</key>
<map>
<key>hash</key>
- <string>fd0d6d9e70dd9b811c72866f8285b79b</string>
+ <string>08edc9fa2dc586e7a1c7c4b7a6b6c548</string>
<key>url</key>
- <string>http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/11559/66324/dullahan-1.1.920_3.3202.1686.gd665578-windows-511302.tar.bz2</string>
+ <string>http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/11648/67101/dullahan-1.1.925_3.3202.1686.gd665578-windows-511376.tar.bz2</string>
</map>
<key>name</key>
<string>windows</string>
@@ -580,16 +580,16 @@
<key>archive</key>
<map>
<key>hash</key>
- <string>5e3defb1f2fc98e23d940c321ee360c2</string>
+ <string>b220e427ade837e45a92fffab02c068f</string>
<key>url</key>
- <string>http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/11558/66318/dullahan-1.1.920_3.3202.1686.gd665578-windows64-511302.tar.bz2</string>
+ <string>http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/11649/67106/dullahan-1.1.925_3.3202.1686.gd665578-windows64-511376.tar.bz2</string>
</map>
<key>name</key>
<string>windows64</string>
</map>
</map>
<key>version</key>
- <string>1.1.920_3.3202.1686.gd665578</string>
+ <string>1.1.925_3.3202.1686.gd665578</string>
</map>
<key>elfio</key>
<map>
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));