From 8b3f4b56f93bfae8251e79c9210836437d2e945b Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Mon, 26 Apr 2021 23:55:45 +0300 Subject: SL-14664 Increase range of supported cursors on prim's media --- indra/newview/llviewermedia.cpp | 63 +++++++++++++++++++++++++++++++++-------- 1 file changed, 51 insertions(+), 12 deletions(-) (limited to 'indra/newview/llviewermedia.cpp') diff --git a/indra/newview/llviewermedia.cpp b/indra/newview/llviewermedia.cpp index 9ed2df2759..8cf9f4a85c 100644 --- a/indra/newview/llviewermedia.cpp +++ b/indra/newview/llviewermedia.cpp @@ -3194,18 +3194,57 @@ void LLViewerMediaImpl::handleMediaEvent(LLPluginClassMedia* plugin, LLPluginCla std::string cursor = plugin->getCursorName(); - if(cursor == "arrow") - mLastSetCursor = UI_CURSOR_ARROW; - else if(cursor == "ibeam") - mLastSetCursor = UI_CURSOR_IBEAM; - else if(cursor == "splith") - mLastSetCursor = UI_CURSOR_SIZEWE; - else if(cursor == "splitv") - mLastSetCursor = UI_CURSOR_SIZENS; - else if(cursor == "hand") - mLastSetCursor = UI_CURSOR_HAND; - else // for anything else, default to the arrow - mLastSetCursor = UI_CURSOR_ARROW; + static const std::map cursor_name_to_enum + { + {std::string("arrow"), UI_CURSOR_ARROW}, + {std::string("wait"), UI_CURSOR_WAIT}, + {std::string("hand"), UI_CURSOR_HAND}, + {std::string("ibeam"), UI_CURSOR_IBEAM}, + {std::string("cross"), UI_CURSOR_CROSS}, + {std::string("split_nwse"), UI_CURSOR_SIZENWSE}, + {std::string("split_nesw"), UI_CURSOR_SIZENESW}, + {std::string("split_we"), UI_CURSOR_SIZEWE}, + {std::string("split_ns"), UI_CURSOR_SIZENS}, + {std::string("cursor_no"), UI_CURSOR_NO}, + {std::string("working"), UI_CURSOR_WORKING}, + {std::string("tool_grab"), UI_CURSOR_TOOLGRAB}, + {std::string("tool_land"), UI_CURSOR_TOOLLAND}, + {std::string("tool_focus"), UI_CURSOR_TOOLFOCUS}, + {std::string("tool_create"), UI_CURSOR_TOOLCREATE}, + {std::string("arrow_drag"), UI_CURSOR_ARROWDRAG}, + {std::string("arrow_copy"), UI_CURSOR_ARROWCOPY}, + {std::string("arrow_drag_multi"), UI_CURSOR_ARROWDRAGMULTI}, + {std::string("arrow_copy_multi"), UI_CURSOR_ARROWCOPYMULTI}, + {std::string("cursor_no_locked"), UI_CURSOR_NOLOCKED}, + {std::string("arrow_locked"), UI_CURSOR_ARROWLOCKED}, + {std::string("grab_locked"), UI_CURSOR_GRABLOCKED}, + {std::string("tool_translate"), UI_CURSOR_TOOLTRANSLATE}, + {std::string("tool_rotate"), UI_CURSOR_TOOLROTATE}, + {std::string("tool_scale"), UI_CURSOR_TOOLSCALE}, + {std::string("tool_camera"), UI_CURSOR_TOOLCAMERA}, + {std::string("tool_pan"), UI_CURSOR_TOOLPAN}, + {std::string("tool_zoomin"), UI_CURSOR_TOOLZOOMIN}, + {std::string("tool_pick_object3"), UI_CURSOR_TOOLPICKOBJECT3}, + {std::string("tool_play"), UI_CURSOR_TOOLPLAY}, + {std::string("tool_pause"), UI_CURSOR_TOOLPAUSE}, + {std::string("tool_media_open"), UI_CURSOR_TOOLMEDIAOPEN}, + {std::string("tool_pipette"), UI_CURSOR_PIPETTE}, + {std::string("tool_sit"), UI_CURSOR_TOOLSIT}, + {std::string("tool_buy"), UI_CURSOR_TOOLBUY}, + {std::string("tool_open"), UI_CURSOR_TOOLOPEN}, + {std::string("tool_pathfinding"), UI_CURSOR_TOOLPATHFINDING}, + }; + + std::map::const_iterator iter = cursor_name_to_enum.find(cursor); + if (iter != cursor_name_to_enum.end()) + { + mLastSetCursor = iter->second; + } + else + { + // for anything else, default to the arrow + mLastSetCursor = UI_CURSOR_ARROW; + } } break; -- cgit v1.2.3 From 5cde118ec848cc9053a3a502daeecb417c8cfc18 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Tue, 27 Apr 2021 22:52:00 +0300 Subject: SL-14664 Added zoomout and sizeall Remade code to use getCursorFromString --- indra/newview/llviewermedia.cpp | 53 +---------------------------------------- 1 file changed, 1 insertion(+), 52 deletions(-) (limited to 'indra/newview/llviewermedia.cpp') diff --git a/indra/newview/llviewermedia.cpp b/indra/newview/llviewermedia.cpp index 8cf9f4a85c..661a520394 100644 --- a/indra/newview/llviewermedia.cpp +++ b/indra/newview/llviewermedia.cpp @@ -3193,58 +3193,7 @@ void LLViewerMediaImpl::handleMediaEvent(LLPluginClassMedia* plugin, LLPluginCla LL_DEBUGS("Media") << "Media event: MEDIA_EVENT_CURSOR_CHANGED, new cursor is " << plugin->getCursorName() << LL_ENDL; std::string cursor = plugin->getCursorName(); - - static const std::map cursor_name_to_enum - { - {std::string("arrow"), UI_CURSOR_ARROW}, - {std::string("wait"), UI_CURSOR_WAIT}, - {std::string("hand"), UI_CURSOR_HAND}, - {std::string("ibeam"), UI_CURSOR_IBEAM}, - {std::string("cross"), UI_CURSOR_CROSS}, - {std::string("split_nwse"), UI_CURSOR_SIZENWSE}, - {std::string("split_nesw"), UI_CURSOR_SIZENESW}, - {std::string("split_we"), UI_CURSOR_SIZEWE}, - {std::string("split_ns"), UI_CURSOR_SIZENS}, - {std::string("cursor_no"), UI_CURSOR_NO}, - {std::string("working"), UI_CURSOR_WORKING}, - {std::string("tool_grab"), UI_CURSOR_TOOLGRAB}, - {std::string("tool_land"), UI_CURSOR_TOOLLAND}, - {std::string("tool_focus"), UI_CURSOR_TOOLFOCUS}, - {std::string("tool_create"), UI_CURSOR_TOOLCREATE}, - {std::string("arrow_drag"), UI_CURSOR_ARROWDRAG}, - {std::string("arrow_copy"), UI_CURSOR_ARROWCOPY}, - {std::string("arrow_drag_multi"), UI_CURSOR_ARROWDRAGMULTI}, - {std::string("arrow_copy_multi"), UI_CURSOR_ARROWCOPYMULTI}, - {std::string("cursor_no_locked"), UI_CURSOR_NOLOCKED}, - {std::string("arrow_locked"), UI_CURSOR_ARROWLOCKED}, - {std::string("grab_locked"), UI_CURSOR_GRABLOCKED}, - {std::string("tool_translate"), UI_CURSOR_TOOLTRANSLATE}, - {std::string("tool_rotate"), UI_CURSOR_TOOLROTATE}, - {std::string("tool_scale"), UI_CURSOR_TOOLSCALE}, - {std::string("tool_camera"), UI_CURSOR_TOOLCAMERA}, - {std::string("tool_pan"), UI_CURSOR_TOOLPAN}, - {std::string("tool_zoomin"), UI_CURSOR_TOOLZOOMIN}, - {std::string("tool_pick_object3"), UI_CURSOR_TOOLPICKOBJECT3}, - {std::string("tool_play"), UI_CURSOR_TOOLPLAY}, - {std::string("tool_pause"), UI_CURSOR_TOOLPAUSE}, - {std::string("tool_media_open"), UI_CURSOR_TOOLMEDIAOPEN}, - {std::string("tool_pipette"), UI_CURSOR_PIPETTE}, - {std::string("tool_sit"), UI_CURSOR_TOOLSIT}, - {std::string("tool_buy"), UI_CURSOR_TOOLBUY}, - {std::string("tool_open"), UI_CURSOR_TOOLOPEN}, - {std::string("tool_pathfinding"), UI_CURSOR_TOOLPATHFINDING}, - }; - - std::map::const_iterator iter = cursor_name_to_enum.find(cursor); - if (iter != cursor_name_to_enum.end()) - { - mLastSetCursor = iter->second; - } - else - { - // for anything else, default to the arrow - mLastSetCursor = UI_CURSOR_ARROW; - } + mLastSetCursor = getCursorFromString(cursor); } break; -- cgit v1.2.3 From 454c7f4543688126b2fa5c0560710f5a1733702e Mon Sep 17 00:00:00 2001 From: Callum Linden Date: Tue, 5 Oct 2021 14:37:48 -0700 Subject: Fix: SL-12320 The Viewer functionality is broken with an in-viewer enabled proxy --- indra/newview/llviewermedia.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'indra/newview/llviewermedia.cpp') diff --git a/indra/newview/llviewermedia.cpp b/indra/newview/llviewermedia.cpp index d35dbda907..5de7744972 100644 --- a/indra/newview/llviewermedia.cpp +++ b/indra/newview/llviewermedia.cpp @@ -1759,6 +1759,10 @@ LLPluginClassMedia* LLViewerMediaImpl::newSourceFromMediaType(std::string media_ // need to set agent string here before instance created media_source->setBrowserUserAgent(LLViewerMedia::getInstance()->getCurrentUserAgent()); + // configure and pass proxy setup based on debug settings that are + // configured by UI in prefs -> setup + media_source->proxy_setup(gSavedSettings.getBOOL("BrowserProxyEnabled"), gSavedSettings.getString("BrowserProxyAddress"), gSavedSettings.getS32("BrowserProxyPort")); + media_source->setTarget(target); const std::string plugin_dir = gDirUtilp->getLLPluginDir(); @@ -1842,8 +1846,6 @@ bool LLViewerMediaImpl::initializePlugin(const std::string& media_type) std::string ca_path = gDirUtilp->getCAFile(); media_source->addCertificateFilePath( ca_path ); - media_source->proxy_setup(gSavedSettings.getBOOL("BrowserProxyEnabled"), gSavedSettings.getString("BrowserProxyAddress"), gSavedSettings.getS32("BrowserProxyPort")); - if(mClearCache) { mClearCache = false; -- cgit v1.2.3 From a4431fe12f84d1c2a90d82603d670a0a4bb756e3 Mon Sep 17 00:00:00 2001 From: Mnikolenko Productengine Date: Fri, 14 Jan 2022 15:36:00 +0200 Subject: SL-16638 don't allow downloading files from the built-in browser --- indra/newview/llviewermedia.cpp | 45 ++++------------------------------------- 1 file changed, 4 insertions(+), 41 deletions(-) (limited to 'indra/newview/llviewermedia.cpp') diff --git a/indra/newview/llviewermedia.cpp b/indra/newview/llviewermedia.cpp index 55a8489f25..07190d0538 100644 --- a/indra/newview/llviewermedia.cpp +++ b/indra/newview/llviewermedia.cpp @@ -78,41 +78,12 @@ #include // for SkinFolder listener #include -class LLMediaFilePicker : public LLFilePickerThread // deletes itself when done -{ -public: - LLMediaFilePicker(LLPluginClassMedia* plugin, LLFilePicker::ELoadFilter filter, bool get_multiple) - : LLFilePickerThread(filter, get_multiple), - mPlugin(plugin->getSharedPrt()) - { - } - - LLMediaFilePicker(LLPluginClassMedia* plugin, LLFilePicker::ESaveFilter filter, const std::string &proposed_name) - : LLFilePickerThread(filter, proposed_name), - mPlugin(plugin->getSharedPrt()) - { - } - - virtual void notify(const std::vector& filenames) - { - mPlugin->sendPickFileResponse(mResponses); - mPlugin = NULL; - } - -private: - boost::shared_ptr mPlugin; -}; void init_threaded_picker_load_dialog(LLPluginClassMedia* plugin, LLFilePicker::ELoadFilter filter, bool get_multiple) { (new LLMediaFilePicker(plugin, filter, get_multiple))->getFile(); // will delete itself } -void init_threaded_picker_save_dialog(LLPluginClassMedia* plugin, LLFilePicker::ESaveFilter filter, std::string &proposed_name) -{ - (new LLMediaFilePicker(plugin, filter, proposed_name))->getFile(); // will delete itself -} - /////////////////////////////////////////////////////////////////////////////// // Move this to its own file. @@ -3227,18 +3198,10 @@ void LLViewerMediaImpl::handleMediaEvent(LLPluginClassMedia* plugin, LLPluginCla case LLViewerMediaObserver::MEDIA_EVENT_FILE_DOWNLOAD: { LL_DEBUGS("Media") << "Media event - file download requested - filename is " << plugin->getFileDownloadFilename() << LL_ENDL; - // pick a file from SAVE FILE dialog - - // need a better algorithm that this or else, pass in type of save type - // from event that initiated it - this is okay for now - only thing - // that saves is 360s - std::string suggested_filename = plugin->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; - init_threaded_picker_save_dialog(plugin, filter, suggested_filename); + + //unblock media plugin + const std::vector empty_response; + plugin->sendPickFileResponse(empty_response); } break; -- cgit v1.2.3 From 8116078c7273bc0f52424ede96563a4418155508 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Wed, 2 Mar 2022 23:41:13 +0200 Subject: SL-16965 360 Snapshot tool fails to save file to computer --- indra/newview/llviewermedia.cpp | 4 ---- 1 file changed, 4 deletions(-) (limited to 'indra/newview/llviewermedia.cpp') diff --git a/indra/newview/llviewermedia.cpp b/indra/newview/llviewermedia.cpp index 07190d0538..29c926ca64 100644 --- a/indra/newview/llviewermedia.cpp +++ b/indra/newview/llviewermedia.cpp @@ -3198,10 +3198,6 @@ void LLViewerMediaImpl::handleMediaEvent(LLPluginClassMedia* plugin, LLPluginCla case LLViewerMediaObserver::MEDIA_EVENT_FILE_DOWNLOAD: { LL_DEBUGS("Media") << "Media event - file download requested - filename is " << plugin->getFileDownloadFilename() << LL_ENDL; - - //unblock media plugin - const std::vector empty_response; - plugin->sendPickFileResponse(empty_response); } break; -- cgit v1.2.3