diff options
author | Monroe Linden <monroe@lindenlab.com> | 2010-09-10 16:43:35 -0700 |
---|---|---|
committer | Monroe Linden <monroe@lindenlab.com> | 2010-09-10 16:43:35 -0700 |
commit | 24f308caaeda941a626b6143d95adbfe07450f97 (patch) | |
tree | 848fee057e9df5a1198dd3120ecf0fe920e713f9 /indra/newview | |
parent | f6645b10dd391218edff67579a4388dc8bbac7d2 (diff) |
Added support for a media plugin message that asks the viewer to open a file picker on the plugin's behalf.
Reviewed by Callum.
Diffstat (limited to 'indra/newview')
-rw-r--r-- | indra/newview/llmediactrl.cpp | 6 | ||||
-rw-r--r-- | indra/newview/llviewermedia.cpp | 17 | ||||
-rw-r--r-- | indra/newview/llviewerparcelmedia.cpp | 6 |
3 files changed, 29 insertions, 0 deletions
diff --git a/indra/newview/llmediactrl.cpp b/indra/newview/llmediactrl.cpp index 40ae9b06b7..1de249a3c1 100644 --- a/indra/newview/llmediactrl.cpp +++ b/indra/newview/llmediactrl.cpp @@ -956,6 +956,12 @@ void LLMediaCtrl::handleMediaEvent(LLPluginClassMedia* self, EMediaEvent event) LL_DEBUGS("Media") << "Media event: MEDIA_EVENT_CLOSE_REQUEST" << LL_ENDL; } break; + + case MEDIA_EVENT_PICK_FILE_REQUEST: + { + LL_DEBUGS("Media") << "Media event: MEDIA_EVENT_PICK_FILE_REQUEST" << LL_ENDL; + } + break; }; // chain all events to any potential observers of this object. diff --git a/indra/newview/llviewermedia.cpp b/indra/newview/llviewermedia.cpp index 2e3570a3af..012a4d2920 100644 --- a/indra/newview/llviewermedia.cpp +++ b/indra/newview/llviewermedia.cpp @@ -51,6 +51,7 @@ #include "llvoavatarself.h" #include "llviewerregion.h" #include "llwebsharing.h" // For LLWebSharing::setOpenIDCookie(), *TODO: find a better way to do this! +#include "llfilepicker.h" #include "llevent.h" // LLSimpleListener #include "llnotificationsutil.h" @@ -2967,6 +2968,22 @@ void LLViewerMediaImpl::handleMediaEvent(LLPluginClassMedia* plugin, LLPluginCla } break; + case LLViewerMediaObserver::MEDIA_EVENT_PICK_FILE_REQUEST: + { + // Display a file picker + std::string response; + + LLFilePicker& picker = LLFilePicker::instance(); + if (!picker.getOpenFile(LLFilePicker::FFLOAD_ALL)) + { + // The user didn't pick a file -- the empty response string will indicate this. + } + + response = picker.getFirstFile(); + + plugin->sendPickFileResponse(response); + } + break; default: break; diff --git a/indra/newview/llviewerparcelmedia.cpp b/indra/newview/llviewerparcelmedia.cpp index 0cb1ad2f39..335776029f 100644 --- a/indra/newview/llviewerparcelmedia.cpp +++ b/indra/newview/llviewerparcelmedia.cpp @@ -574,6 +574,12 @@ void LLViewerParcelMedia::handleMediaEvent(LLPluginClassMedia* self, EMediaEvent LL_DEBUGS("Media") << "Media event: MEDIA_EVENT_CLOSE_REQUEST" << LL_ENDL; } break; + + case MEDIA_EVENT_PICK_FILE_REQUEST: + { + LL_DEBUGS("Media") << "Media event: MEDIA_EVENT_PICK_FILE_REQUEST" << LL_ENDL; + } + break; }; } |