summaryrefslogtreecommitdiff
path: root/indra/newview/llmediactrl.cpp
diff options
context:
space:
mode:
authorEuclid Linden <euclid@lindenlab.com>2022-04-18 21:56:26 +0000
committerEuclid Linden <euclid@lindenlab.com>2022-04-18 21:56:26 +0000
commite71201ac125cab5f3d3cf7d6a30500253fc29d90 (patch)
tree270e46eb85dd46fb6962a36a9357dbf31c3afb29 /indra/newview/llmediactrl.cpp
parent2d63d2044e0a00d1969c3da254e016a6e520c0d5 (diff)
parent035b1996df3f357b5060e3eb778588da5b9e7b37 (diff)
Merged in DV528-merge-6.5.5 (pull request #945)
DRTVWR-528 merge up to 6.5.5
Diffstat (limited to 'indra/newview/llmediactrl.cpp')
-rw-r--r--indra/newview/llmediactrl.cpp28
1 files changed, 25 insertions, 3 deletions
diff --git a/indra/newview/llmediactrl.cpp b/indra/newview/llmediactrl.cpp
index 0affe8efb4..9142aadab9 100644
--- a/indra/newview/llmediactrl.cpp
+++ b/indra/newview/llmediactrl.cpp
@@ -46,6 +46,7 @@
#include "lluictrlfactory.h" // LLDefaultChildRegistry
#include "llkeyboard.h"
#include "llviewermenu.h"
+#include "llviewermenufile.h" // LLFilePickerThread
// linden library includes
#include "llfocusmgr.h"
@@ -105,7 +106,8 @@ LLMediaCtrl::LLMediaCtrl( const Params& p) :
mTrusted(p.trusted_content),
mWindowShade(NULL),
mHoverTextChanged(false),
- mContextMenu(NULL)
+ mContextMenu(NULL),
+ mAllowFileDownload(false)
{
{
LLColor4 color = p.caret_color().get();
@@ -1129,8 +1131,28 @@ void LLMediaCtrl::handleMediaEvent(LLPluginClassMedia* self, EMediaEvent event)
case MEDIA_EVENT_FILE_DOWNLOAD:
{
- //llinfos << "Media event - file download requested - filename is " << self->getFileDownloadFilename() << llendl;
- //LLNotificationsUtil::add("MediaFileDownloadUnsupported");
+ if (mAllowFileDownload)
+ {
+ // pick a file from SAVE FILE dialog
+ // for now the only thing that should be allowed to save is 360s
+ std::string suggested_filename = self->getFileDownloadFilename();
+ LLFilePicker::ESaveFilter filter = LLFilePicker::FFSAVE_ALL;
+ if (suggested_filename.find(".jpg") != std::string::npos || suggested_filename.find(".jpeg") != std::string::npos)
+ filter = LLFilePicker::FFSAVE_JPEG;
+ if (suggested_filename.find(".png") != std::string::npos)
+ filter = LLFilePicker::FFSAVE_PNG;
+
+ (new LLMediaFilePicker(self, filter, suggested_filename))->getFile();
+ }
+ else
+ {
+ // Media might be blocked, waiting for a file,
+ // send an empty response to unblock it
+ const std::vector<std::string> empty_response;
+ self->sendPickFileResponse(empty_response);
+
+ LLNotificationsUtil::add("MediaFileDownloadUnsupported");
+ }
};
break;