summaryrefslogtreecommitdiff
path: root/indra/newview/llviewermedia.cpp
diff options
context:
space:
mode:
authorMonroe Linden <monroe@lindenlab.com>2010-09-10 16:43:35 -0700
committerMonroe Linden <monroe@lindenlab.com>2010-09-10 16:43:35 -0700
commit24f308caaeda941a626b6143d95adbfe07450f97 (patch)
tree848fee057e9df5a1198dd3120ecf0fe920e713f9 /indra/newview/llviewermedia.cpp
parentf6645b10dd391218edff67579a4388dc8bbac7d2 (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/llviewermedia.cpp')
-rw-r--r--indra/newview/llviewermedia.cpp17
1 files changed, 17 insertions, 0 deletions
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;