diff options
author | Mnikolenko Productengine <mnikolenko@productengine.com> | 2022-03-02 00:46:10 +0200 |
---|---|---|
committer | Mnikolenko Productengine <mnikolenko@productengine.com> | 2022-03-02 00:46:10 +0200 |
commit | 0aaf5284dced4ec41924c771a382d12ddc5f3d1b (patch) | |
tree | 448ad9399feee611f992ceeb667cd4e47e9ab594 /indra/newview/llmediactrl.cpp | |
parent | 882600de2afa366729be870355767282247be0ef (diff) | |
parent | 6ca09a94554ec01f5c94ec60fffd01d7e33f3546 (diff) |
Merge branch 'master' into DRTVWR-539
# Conflicts:
# autobuild.xml
# doc/contributions.txt
# indra/cmake/GLOD.cmake
# indra/llcommon/tests/llprocess_test.cpp
# indra/newview/VIEWER_VERSION.txt
# indra/newview/lldrawpoolavatar.cpp
# indra/newview/llfloatermodelpreview.cpp
# indra/newview/llmodelpreview.cpp
# indra/newview/llviewertexturelist.cpp
# indra/newview/llvovolume.cpp
# indra/newview/viewer_manifest.py
Diffstat (limited to 'indra/newview/llmediactrl.cpp')
-rw-r--r-- | indra/newview/llmediactrl.cpp | 23 |
1 files changed, 20 insertions, 3 deletions
diff --git a/indra/newview/llmediactrl.cpp b/indra/newview/llmediactrl.cpp index 0affe8efb4..5393d0b0b7 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,23 @@ 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 + { + LLNotificationsUtil::add("MediaFileDownloadUnsupported"); + } }; break; |