From eba6d0236fc9b7f4a54189766709948599d4b8a2 Mon Sep 17 00:00:00 2001 From: Rick Pasetto Date: Wed, 21 Oct 2009 16:01:52 -0700 Subject: Backed out changeset: 57dc52edbbc9 --- indra/newview/llviewerwindow.cpp | 14 ++++++++++++++ indra/newview/llviewerwindow.h | 3 ++- 2 files changed, 16 insertions(+), 1 deletion(-) (limited to 'indra/newview') diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index c659e58e47..2bda6eddbc 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -815,6 +815,20 @@ BOOL LLViewerWindow::handleMiddleMouseDown(LLWindow *window, LLCoordGL pos, MAS // Always handled as far as the OS is concerned. return TRUE; } + +BOOL LLViewerWindow::handleDrop(LLWindow *window, LLCoordGL pos, MASK mask, void* data) +{ + LLPickInfo pick_info = pickImmediate( pos.mX, pos.mY, TRUE /*BOOL pick_transparent*/ ); + + LLUUID object_id = pick_info.getObjectID(); + S32 object_face = pick_info.mObjectFace; + std::string url = std::string( (char*)data ); + + llinfos << "### Object: picked at " << pos.mX << ", " << pos.mY << " - face = " << object_face << " - URL = " << url << llendl; + + // Always handled as far as the OS is concerned. + return TRUE; +} BOOL LLViewerWindow::handleMiddleMouseUp(LLWindow *window, LLCoordGL pos, MASK mask) { diff --git a/indra/newview/llviewerwindow.h b/indra/newview/llviewerwindow.h index d7c403739e..44704b99e3 100644 --- a/indra/newview/llviewerwindow.h +++ b/indra/newview/llviewerwindow.h @@ -170,7 +170,8 @@ public: /*virtual*/ BOOL handleRightMouseUp(LLWindow *window, LLCoordGL pos, MASK mask); /*virtual*/ BOOL handleMiddleMouseDown(LLWindow *window, LLCoordGL pos, MASK mask); /*virtual*/ BOOL handleMiddleMouseUp(LLWindow *window, LLCoordGL pos, MASK mask); - /*virtual*/ void handleMouseMove(LLWindow *window, LLCoordGL pos, MASK mask); + /*virtual*/ BOOL handleDrop(LLWindow *window, LLCoordGL pos, MASK mask, void* data); + void handleMouseMove(LLWindow *window, LLCoordGL pos, MASK mask); /*virtual*/ void handleMouseLeave(LLWindow *window); /*virtual*/ void handleResize(LLWindow *window, S32 x, S32 y); /*virtual*/ void handleFocus(LLWindow *window); -- cgit v1.2.3 From 19fc3fb32c3cd95fcfb5708b59b5620e506c5179 Mon Sep 17 00:00:00 2001 From: Rick Pasetto Date: Wed, 21 Oct 2009 17:40:36 -0700 Subject: Add setting for PrimMediaDragNDrop, and add implementation that sets the current URL and auto play on drop --- indra/newview/app_settings/settings.xml | 11 +++++++++++ indra/newview/llviewerwindow.cpp | 24 +++++++++++++++++++----- 2 files changed, 30 insertions(+), 5 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 91d5e04665..9adf893e4b 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -5305,6 +5305,17 @@ Value 13 + PrimMediaDragNDrop + + Comment + Enable drag and drop + Persist + 1 + Type + Boolean + Value + 1 + PrimMediaMaxRetries Comment diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index 2bda6eddbc..a080243086 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -79,6 +79,7 @@ #include "timing.h" #include "llviewermenu.h" #include "lltooltip.h" +#include "llmediaentry.h" // newview includes #include "llagent.h" @@ -818,14 +819,27 @@ BOOL LLViewerWindow::handleMiddleMouseDown(LLWindow *window, LLCoordGL pos, MAS BOOL LLViewerWindow::handleDrop(LLWindow *window, LLCoordGL pos, MASK mask, void* data) { - LLPickInfo pick_info = pickImmediate( pos.mX, pos.mY, TRUE /*BOOL pick_transparent*/ ); + if (gSavedSettings.getBOOL("PrimMediaDragNDrop")) + { + LLPickInfo pick_info = pickImmediate( pos.mX, pos.mY, TRUE /*BOOL pick_transparent*/ ); - LLUUID object_id = pick_info.getObjectID(); - S32 object_face = pick_info.mObjectFace; - std::string url = std::string( (char*)data ); + LLUUID object_id = pick_info.getObjectID(); + S32 object_face = pick_info.mObjectFace; + std::string url = std::string( (char*)data ); - llinfos << "### Object: picked at " << pos.mX << ", " << pos.mY << " - face = " << object_face << " - URL = " << url << llendl; + llinfos << "### Object: picked at " << pos.mX << ", " << pos.mY << " - face = " << object_face << " - URL = " << url << llendl; + LLVOVolume *obj = dynamic_cast(static_cast(pick_info.getObject())); + if (obj) + { + LLSD media_data; + /// XXX home URL too? + media_data[LLMediaEntry::CURRENT_URL_KEY] = url; + media_data[LLMediaEntry::AUTO_PLAY_KEY] = true; + obj->syncMediaData(object_face, media_data, true, true); + obj->sendMediaDataUpdate(); + } + } // Always handled as far as the OS is concerned. return TRUE; } -- cgit v1.2.3 From caa631bf5b69ef1e39989b8e1e4b3372491cb9b4 Mon Sep 17 00:00:00 2001 From: callum Date: Tue, 27 Oct 2009 17:52:04 -0700 Subject: Added IDropTarget interface. Still lots of cleanup but this works ok. You can drag over from Firefox or IE onto a prim --- indra/newview/llviewerwindow.cpp | 4 ++-- indra/newview/llviewerwindow.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index a080243086..220f90c2f5 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -817,7 +817,7 @@ BOOL LLViewerWindow::handleMiddleMouseDown(LLWindow *window, LLCoordGL pos, MAS return TRUE; } -BOOL LLViewerWindow::handleDrop(LLWindow *window, LLCoordGL pos, MASK mask, void* data) +BOOL LLViewerWindow::handleDrop( LLWindow *window, LLCoordGL pos, MASK mask, std::string data ) { if (gSavedSettings.getBOOL("PrimMediaDragNDrop")) { @@ -825,7 +825,7 @@ BOOL LLViewerWindow::handleDrop(LLWindow *window, LLCoordGL pos, MASK mask, voi LLUUID object_id = pick_info.getObjectID(); S32 object_face = pick_info.mObjectFace; - std::string url = std::string( (char*)data ); + std::string url = data; llinfos << "### Object: picked at " << pos.mX << ", " << pos.mY << " - face = " << object_face << " - URL = " << url << llendl; diff --git a/indra/newview/llviewerwindow.h b/indra/newview/llviewerwindow.h index 44704b99e3..cf024df9bf 100644 --- a/indra/newview/llviewerwindow.h +++ b/indra/newview/llviewerwindow.h @@ -170,7 +170,7 @@ public: /*virtual*/ BOOL handleRightMouseUp(LLWindow *window, LLCoordGL pos, MASK mask); /*virtual*/ BOOL handleMiddleMouseDown(LLWindow *window, LLCoordGL pos, MASK mask); /*virtual*/ BOOL handleMiddleMouseUp(LLWindow *window, LLCoordGL pos, MASK mask); - /*virtual*/ BOOL handleDrop(LLWindow *window, LLCoordGL pos, MASK mask, void* data); + /*virtual*/ BOOL handleDrop(LLWindow *window, LLCoordGL pos, MASK mask, std::string data); void handleMouseMove(LLWindow *window, LLCoordGL pos, MASK mask); /*virtual*/ void handleMouseLeave(LLWindow *window); /*virtual*/ void handleResize(LLWindow *window, S32 x, S32 y); -- cgit v1.2.3 From 4f0731d722c41b6717d08b8165e941a06edd3a1f Mon Sep 17 00:00:00 2001 From: Rick Pasetto Date: Thu, 5 Nov 2009 17:51:04 -0800 Subject: make drop add media if not there, navigate if already there --- indra/newview/llviewerwindow.cpp | 27 +++++++++++++++++++++------ 1 file changed, 21 insertions(+), 6 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index b43479689f..ead99613fb 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -831,12 +831,27 @@ BOOL LLViewerWindow::handleDrop( LLWindow *window, LLCoordGL pos, MASK mask, st LLVOVolume *obj = dynamic_cast(static_cast(pick_info.getObject())); if (obj) { - LLSD media_data; - /// XXX home URL too? - media_data[LLMediaEntry::CURRENT_URL_KEY] = url; - media_data[LLMediaEntry::AUTO_PLAY_KEY] = true; - obj->syncMediaData(object_face, media_data, true, true); - obj->sendMediaDataUpdate(); + LLTextureEntry *te = obj->getTE(object_face); + if (te) + { + if (! te->hasMedia()) + { + // Create new media entry + LLSD media_data; + // XXX Should we really do Home URL too? + media_data[LLMediaEntry::HOME_URL_KEY] = url; + media_data[LLMediaEntry::CURRENT_URL_KEY] = url; + media_data[LLMediaEntry::AUTO_PLAY_KEY] = true; + obj->syncMediaData(object_face, media_data, true, true); + // XXX This shouldn't be necessary, should it ?!? + obj->getMediaImpl(object_face)->navigateReload(); + obj->sendMediaDataUpdate(); + } + else { + // just navigate to the URL + obj->getMediaImpl(object_face)->navigateTo(url); + } + } } } // Always handled as far as the OS is concerned. -- cgit v1.2.3 From bf5ce0fcbd9a71ce1372db0f42395ba47747fd78 Mon Sep 17 00:00:00 2001 From: Rick Pasetto Date: Thu, 12 Nov 2009 11:06:29 -0800 Subject: Change 'handleDrop()' API to 'handleDragNDrop', which now takes a "drop" BOOL --- indra/newview/llviewerwindow.cpp | 39 +++++++++++++++++++++++---------------- indra/newview/llviewerwindow.h | 2 +- 2 files changed, 24 insertions(+), 17 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index 06d6819b5e..d2f81f21ac 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -819,8 +819,9 @@ BOOL LLViewerWindow::handleMiddleMouseDown(LLWindow *window, LLCoordGL pos, MAS return TRUE; } -BOOL LLViewerWindow::handleDrop( LLWindow *window, LLCoordGL pos, MASK mask, std::string data ) +BOOL LLViewerWindow::handleDragNDrop( LLWindow *window, LLCoordGL pos, MASK mask, BOOL drop, std::string data ) { + BOOL result = FALSE; if (gSavedSettings.getBOOL("PrimMediaDragNDrop")) { LLPickInfo pick_info = pickImmediate( pos.mX, pos.mY, TRUE /*BOOL pick_transparent*/ ); @@ -837,28 +838,34 @@ BOOL LLViewerWindow::handleDrop( LLWindow *window, LLCoordGL pos, MASK mask, st LLTextureEntry *te = obj->getTE(object_face); if (te) { - if (! te->hasMedia()) + if (drop) { - // Create new media entry - LLSD media_data; - // XXX Should we really do Home URL too? - media_data[LLMediaEntry::HOME_URL_KEY] = url; - media_data[LLMediaEntry::CURRENT_URL_KEY] = url; - media_data[LLMediaEntry::AUTO_PLAY_KEY] = true; - obj->syncMediaData(object_face, media_data, true, true); - // XXX This shouldn't be necessary, should it ?!? - obj->getMediaImpl(object_face)->navigateReload(); - obj->sendMediaDataUpdate(); + if (! te->hasMedia()) + { + // Create new media entry + LLSD media_data; + // XXX Should we really do Home URL too? + media_data[LLMediaEntry::HOME_URL_KEY] = url; + media_data[LLMediaEntry::CURRENT_URL_KEY] = url; + media_data[LLMediaEntry::AUTO_PLAY_KEY] = true; + obj->syncMediaData(object_face, media_data, true, true); + // XXX This shouldn't be necessary, should it ?!? + obj->getMediaImpl(object_face)->navigateReload(); + obj->sendMediaDataUpdate(); + } + else { + // just navigate to the URL + obj->getMediaImpl(object_face)->navigateTo(url); + } } else { - // just navigate to the URL - obj->getMediaImpl(object_face)->navigateTo(url); + // XXX TODO: make object glow? Hard because how do we "unglow?" } + result = TRUE; } } } - // Always handled as far as the OS is concerned. - return TRUE; + return result; } BOOL LLViewerWindow::handleMiddleMouseUp(LLWindow *window, LLCoordGL pos, MASK mask) diff --git a/indra/newview/llviewerwindow.h b/indra/newview/llviewerwindow.h index cdc9eb4786..d7cfcff925 100644 --- a/indra/newview/llviewerwindow.h +++ b/indra/newview/llviewerwindow.h @@ -170,7 +170,7 @@ public: /*virtual*/ BOOL handleRightMouseUp(LLWindow *window, LLCoordGL pos, MASK mask); /*virtual*/ BOOL handleMiddleMouseDown(LLWindow *window, LLCoordGL pos, MASK mask); /*virtual*/ BOOL handleMiddleMouseUp(LLWindow *window, LLCoordGL pos, MASK mask); - /*virtual*/ BOOL handleDrop(LLWindow *window, LLCoordGL pos, MASK mask, std::string data); + /*virtual*/ BOOL handleDragNDrop(LLWindow *window, LLCoordGL pos, MASK mask, BOOL drop, std::string data); void handleMouseMove(LLWindow *window, LLCoordGL pos, MASK mask); /*virtual*/ void handleMouseLeave(LLWindow *window); /*virtual*/ void handleResize(LLWindow *window, S32 x, S32 y); -- cgit v1.2.3 From 4419e367bcbe8c1b248e88eab8096f0b8ac4707c Mon Sep 17 00:00:00 2001 From: callum Date: Wed, 18 Nov 2009 21:15:44 -0800 Subject: Add support for removing the Windows specific drag/drop code from the codebase via a new CMake file (DragDrop.cmake). --- indra/newview/CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) (limited to 'indra/newview') diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index b129bca1f3..352e9a9382 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -7,6 +7,7 @@ include(Boost) include(BuildVersion) include(DBusGlib) include(DirectX) +include(DragDrop) include(ELFIO) include(FMOD) include(OPENAL) -- cgit v1.2.3 From dbe1f9755896e41e2064a3ee69725d753c67921f Mon Sep 17 00:00:00 2001 From: Rick Pasetto Date: Mon, 23 Nov 2009 17:18:54 -0800 Subject: Highlight the object if it is being dragged over and can be dropped upon --- indra/newview/llviewerwindow.cpp | 10 ++++++++-- indra/newview/llviewerwindow.h | 3 +++ 2 files changed, 11 insertions(+), 2 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index 55e66e1138..17b9490f63 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -833,7 +833,8 @@ BOOL LLViewerWindow::handleDragNDrop( LLWindow *window, LLCoordGL pos, MASK mas llinfos << "### Object: picked at " << pos.mX << ", " << pos.mY << " - face = " << object_face << " - URL = " << url << llendl; LLVOVolume *obj = dynamic_cast(static_cast(pick_info.getObject())); - if (obj) + gPipeline.setHighlightObject(NULL); + if (obj && obj->permModify()) { LLTextureEntry *te = obj->getTE(object_face); if (te) @@ -859,11 +860,16 @@ BOOL LLViewerWindow::handleDragNDrop( LLWindow *window, LLCoordGL pos, MASK mas } } else { - // XXX TODO: make object glow? Hard because how do we "unglow?" + mDragHoveredObject = obj; + // Make the object glow + gPipeline.setHighlightObject(mDragHoveredObject->mDrawable); } result = TRUE; } } + else { + mDragHoveredObject = NULL; + } } return result; } diff --git a/indra/newview/llviewerwindow.h b/indra/newview/llviewerwindow.h index 311fea3508..428c602b73 100644 --- a/indra/newview/llviewerwindow.h +++ b/indra/newview/llviewerwindow.h @@ -474,6 +474,9 @@ protected: static std::string sSnapshotDir; static std::string sMovieBaseName; + +private: + LLPointer mDragHoveredObject; }; void toggle_flying(void*); -- cgit v1.2.3 From e2e7d544b6a114e70e3b46f516a4f0e8d7db4bd1 Mon Sep 17 00:00:00 2001 From: callum Date: Tue, 24 Nov 2009 20:20:53 -0800 Subject: Added support for dropping SURLs onto viewer Does right thing when logged in - needs some work at login page Removed (commented out) WM_DROPFILES code for now --- indra/newview/llviewerwindow.cpp | 10 +++++++++- indra/newview/llviewerwindow.h | 2 +- 2 files changed, 10 insertions(+), 2 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index 17b9490f63..dd84140d5b 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -80,6 +80,7 @@ #include "llviewermenu.h" #include "lltooltip.h" #include "llmediaentry.h" +#include "llurldispatcher.h" // newview includes #include "llagent.h" @@ -819,11 +820,18 @@ BOOL LLViewerWindow::handleMiddleMouseDown(LLWindow *window, LLCoordGL pos, MAS return TRUE; } -BOOL LLViewerWindow::handleDragNDrop( LLWindow *window, LLCoordGL pos, MASK mask, BOOL drop, std::string data ) +BOOL LLViewerWindow::handleDragNDrop( LLWindow *window, LLCoordGL pos, MASK mask, BOOL drop, std::string data, BOOL slurl ) { BOOL result = FALSE; if (gSavedSettings.getBOOL("PrimMediaDragNDrop")) { + // special case SLURLs + if ( slurl ) + { + LLURLDispatcher::dispatch( data, NULL, true ); + return TRUE; + }; + LLPickInfo pick_info = pickImmediate( pos.mX, pos.mY, TRUE /*BOOL pick_transparent*/ ); LLUUID object_id = pick_info.getObjectID(); diff --git a/indra/newview/llviewerwindow.h b/indra/newview/llviewerwindow.h index 428c602b73..4296495067 100644 --- a/indra/newview/llviewerwindow.h +++ b/indra/newview/llviewerwindow.h @@ -170,7 +170,7 @@ public: /*virtual*/ BOOL handleRightMouseUp(LLWindow *window, LLCoordGL pos, MASK mask); /*virtual*/ BOOL handleMiddleMouseDown(LLWindow *window, LLCoordGL pos, MASK mask); /*virtual*/ BOOL handleMiddleMouseUp(LLWindow *window, LLCoordGL pos, MASK mask); - /*virtual*/ BOOL handleDragNDrop(LLWindow *window, LLCoordGL pos, MASK mask, BOOL drop, std::string data); + /*virtual*/ BOOL handleDragNDrop(LLWindow *window, LLCoordGL pos, MASK mask, BOOL drop, std::string data, BOOL slurl); void handleMouseMove(LLWindow *window, LLCoordGL pos, MASK mask); /*virtual*/ void handleMouseLeave(LLWindow *window); /*virtual*/ void handleResize(LLWindow *window, S32 x, S32 y); -- cgit v1.2.3 From 97af20b4ba4a400569e99a616fc026190d3eec6c Mon Sep 17 00:00:00 2001 From: Rick Pasetto Date: Wed, 25 Nov 2009 09:52:20 -0800 Subject: Change drag highlighting to use LLSelectMgr::{un}highlightObjectOnly() instead of gPipeline.setHighlightObject(). The latter seems a little buggy. --- indra/newview/llviewerwindow.cpp | 14 ++++++++++---- indra/newview/llviewerwindow.h | 1 + 2 files changed, 11 insertions(+), 4 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index 17b9490f63..cc74c1fbe2 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -833,7 +833,7 @@ BOOL LLViewerWindow::handleDragNDrop( LLWindow *window, LLCoordGL pos, MASK mas llinfos << "### Object: picked at " << pos.mX << ", " << pos.mY << " - face = " << object_face << " - URL = " << url << llendl; LLVOVolume *obj = dynamic_cast(static_cast(pick_info.getObject())); - gPipeline.setHighlightObject(NULL); + if (obj && obj->permModify()) { LLTextureEntry *te = obj->getTE(object_face); @@ -858,19 +858,25 @@ BOOL LLViewerWindow::handleDragNDrop( LLWindow *window, LLCoordGL pos, MASK mas // just navigate to the URL obj->getMediaImpl(object_face)->navigateTo(url); } + LLSelectMgr::getInstance()->unhighlightObjectOnly(mDragHoveredObject); + mDragHoveredObject = NULL; } else { mDragHoveredObject = obj; - // Make the object glow - gPipeline.setHighlightObject(mDragHoveredObject->mDrawable); + // Highlight the dragged object + LLSelectMgr::getInstance()->highlightObjectOnly(mDragHoveredObject); } result = TRUE; } } - else { + + if (!result && !mDragHoveredObject.isNull()) + { + LLSelectMgr::getInstance()->unhighlightObjectOnly(mDragHoveredObject); mDragHoveredObject = NULL; } } + return result; } diff --git a/indra/newview/llviewerwindow.h b/indra/newview/llviewerwindow.h index 428c602b73..c3aa1b2407 100644 --- a/indra/newview/llviewerwindow.h +++ b/indra/newview/llviewerwindow.h @@ -476,6 +476,7 @@ protected: static std::string sMovieBaseName; private: + // Object temporarily hovered over while dragging LLPointer mDragHoveredObject; }; -- cgit v1.2.3 From e0a7b7608f087b7d3a4b91ba7868e0a5c04aaa86 Mon Sep 17 00:00:00 2001 From: callum Date: Mon, 30 Nov 2009 20:19:39 -0800 Subject: Add support for dropping a region SLURL on login page and populating the UI --- indra/newview/llpanellogin.cpp | 15 +++++++++++++++ indra/newview/llpanellogin.h | 3 ++- indra/newview/llviewerwindow.cpp | 6 +++++- 3 files changed, 22 insertions(+), 2 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llpanellogin.cpp b/indra/newview/llpanellogin.cpp index d2a17dbd97..ba3782bf53 100644 --- a/indra/newview/llpanellogin.cpp +++ b/indra/newview/llpanellogin.cpp @@ -682,6 +682,21 @@ void LLPanelLogin::refreshLocation( bool force_visible ) #endif } +// static +void LLPanelLogin::updateLocationUI() +{ + std::string sim_string = LLURLSimString::sInstance.mSimString; + if (!sim_string.empty()) + { + // Replace "" with this region name + LLComboBox* combo = sInstance->getChild("start_location_combo"); + combo->remove(2); + combo->add( sim_string ); + combo->setTextEntry(sim_string); + combo->setCurrentByIndex( 2 ); + } +} + // static void LLPanelLogin::closePanel() { diff --git a/indra/newview/llpanellogin.h b/indra/newview/llpanellogin.h index acb2001c22..8f24450c08 100644 --- a/indra/newview/llpanellogin.h +++ b/indra/newview/llpanellogin.h @@ -70,6 +70,7 @@ public: static void addServer(const std::string& server, S32 domain_name); static void refreshLocation( bool force_visible ); + static void updateLocationUI(); static void getFields(std::string *firstname, std::string *lastname, std::string *password); @@ -99,7 +100,7 @@ private: static void onPassKey(LLLineEditor* caller, void* user_data); static void onSelectServer(LLUICtrl*, void*); static void onServerComboLostFocus(LLFocusableElement*); - + private: LLPointer mLogoImage; diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index f953a45890..31b30344be 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -50,6 +50,7 @@ #include "llviewquery.h" #include "llxmltree.h" +#include "llslurl.h" //#include "llviewercamera.h" #include "llrender.h" @@ -828,9 +829,12 @@ BOOL LLViewerWindow::handleDragNDrop( LLWindow *window, LLCoordGL pos, MASK mas if (gSavedSettings.getBOOL("PrimMediaDragNDrop")) { // special case SLURLs - if ( slurl ) + if ( drop && slurl ) { LLURLDispatcher::dispatch( data, NULL, true ); + LLURLSimString::setString( LLSLURL::stripProtocol( data ) ); + LLPanelLogin::refreshLocation( true ); + LLPanelLogin::updateLocationUI(); return TRUE; }; -- cgit v1.2.3 From c272582ab78d43c595eefb843126c999c09dfd4f Mon Sep 17 00:00:00 2001 From: Rick Pasetto Date: Thu, 3 Dec 2009 11:48:28 -0800 Subject: Change API to no longer include slurl argument (its a platform-agnostic policy), add some code (not working yet) to implement DND on the mac --- indra/newview/llviewerwindow.cpp | 22 ++++++++++++++-------- indra/newview/llviewerwindow.h | 2 +- 2 files changed, 15 insertions(+), 9 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index f953a45890..fe6c9439bb 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -822,16 +822,16 @@ BOOL LLViewerWindow::handleMiddleMouseDown(LLWindow *window, LLCoordGL pos, MAS return TRUE; } -BOOL LLViewerWindow::handleDragNDrop( LLWindow *window, LLCoordGL pos, MASK mask, BOOL drop, std::string data, BOOL slurl ) +LLWindowCallbacks::DragNDropResult LLViewerWindow::handleDragNDrop( LLWindow *window, LLCoordGL pos, MASK mask, BOOL drop, std::string data) { - BOOL result = FALSE; + LLWindowCallbacks::DragNDropResult result = LLWindowCallbacks::DND_NONE; if (gSavedSettings.getBOOL("PrimMediaDragNDrop")) { // special case SLURLs - if ( slurl ) + if ( std::string::npos != data.find("slurl.com") ) { LLURLDispatcher::dispatch( data, NULL, true ); - return TRUE; + return LLWindowCallbacks::DND_MOVE; }; LLPickInfo pick_info = pickImmediate( pos.mX, pos.mY, TRUE /*BOOL pick_transparent*/ ); @@ -863,24 +863,30 @@ BOOL LLViewerWindow::handleDragNDrop( LLWindow *window, LLCoordGL pos, MASK mas // XXX This shouldn't be necessary, should it ?!? obj->getMediaImpl(object_face)->navigateReload(); obj->sendMediaDataUpdate(); + + result = LLWindowCallbacks::DND_COPY; } else { // just navigate to the URL obj->getMediaImpl(object_face)->navigateTo(url); + + result = LLWindowCallbacks::DND_LINK; } LLSelectMgr::getInstance()->unhighlightObjectOnly(mDragHoveredObject); mDragHoveredObject = NULL; + } else { mDragHoveredObject = obj; // Highlight the dragged object LLSelectMgr::getInstance()->highlightObjectOnly(mDragHoveredObject); + + result = (! te->hasMedia()) ? LLWindowCallbacks::DND_COPY : LLWindowCallbacks::DND_LINK; } - result = TRUE; } } - if (!result && !mDragHoveredObject.isNull()) + if (result == LLWindowCallbacks::DND_NONE && !mDragHoveredObject.isNull()) { LLSelectMgr::getInstance()->unhighlightObjectOnly(mDragHoveredObject); mDragHoveredObject = NULL; @@ -3312,8 +3318,8 @@ LLPickInfo LLViewerWindow::pickImmediate(S32 x, S32 y_from_bot, BOOL pick_trans } else { - llwarns << "List of last picks is empty" << llendl; - llwarns << "Using stub pick" << llendl; + lldebugs << "List of last picks is empty" << llendl; + lldebugs << "Using stub pick" << llendl; mLastPick = LLPickInfo(); } diff --git a/indra/newview/llviewerwindow.h b/indra/newview/llviewerwindow.h index 11d19cf24d..dc58292a6a 100644 --- a/indra/newview/llviewerwindow.h +++ b/indra/newview/llviewerwindow.h @@ -170,7 +170,7 @@ public: /*virtual*/ BOOL handleRightMouseUp(LLWindow *window, LLCoordGL pos, MASK mask); /*virtual*/ BOOL handleMiddleMouseDown(LLWindow *window, LLCoordGL pos, MASK mask); /*virtual*/ BOOL handleMiddleMouseUp(LLWindow *window, LLCoordGL pos, MASK mask); - /*virtual*/ BOOL handleDragNDrop(LLWindow *window, LLCoordGL pos, MASK mask, BOOL drop, std::string data, BOOL slurl); + /*virtual*/ LLWindowCallbacks::DragNDropResult handleDragNDrop(LLWindow *window, LLCoordGL pos, MASK mask, BOOL drop, std::string data); void handleMouseMove(LLWindow *window, LLCoordGL pos, MASK mask); /*virtual*/ void handleMouseLeave(LLWindow *window); /*virtual*/ void handleResize(LLWindow *window, S32 x, S32 y); -- cgit v1.2.3 From fe0b027d4d7381a532bb0f14f64ecffdeb7190b6 Mon Sep 17 00:00:00 2001 From: Monroe Linden Date: Thu, 3 Dec 2009 17:40:58 -0800 Subject: Added the LLWindowCallbacks::DragNDropAction enum, and made the mac implementation and the cross-platform window callbacks use it (instead of 'bool drop'). This will break the windows impl until someone fixes it to match. --- indra/newview/llviewerwindow.cpp | 122 +++++++++++++++++++++++---------------- indra/newview/llviewerwindow.h | 2 +- 2 files changed, 72 insertions(+), 52 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index e80a2ae11c..fed676775c 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -823,71 +823,91 @@ BOOL LLViewerWindow::handleMiddleMouseDown(LLWindow *window, LLCoordGL pos, MAS return TRUE; } -LLWindowCallbacks::DragNDropResult LLViewerWindow::handleDragNDrop( LLWindow *window, LLCoordGL pos, MASK mask, BOOL drop, std::string data) +LLWindowCallbacks::DragNDropResult LLViewerWindow::handleDragNDrop( LLWindow *window, LLCoordGL pos, MASK mask, LLWindowCallbacks::DragNDropAction action, std::string data) { LLWindowCallbacks::DragNDropResult result = LLWindowCallbacks::DND_NONE; if (gSavedSettings.getBOOL("PrimMediaDragNDrop")) { - // special case SLURLs - if ( drop && std::string::npos != data.find("slurl.com") ) + + switch(action) { - LLURLDispatcher::dispatch( data, NULL, true ); - LLURLSimString::setString( LLSLURL::stripProtocol( data ) ); - LLPanelLogin::refreshLocation( true ); - LLPanelLogin::updateLocationUI(); - return LLWindowCallbacks::DND_MOVE; - }; + // Much of the handling for these two cases is the same. + case LLWindowCallbacks::DNDA_TRACK: + case LLWindowCallbacks::DNDA_DROPPED: + { + bool drop = (LLWindowCallbacks::DNDA_DROPPED == action); + + // special case SLURLs + if ( drop && std::string::npos != data.find("slurl.com") ) + { + LLURLDispatcher::dispatch( data, NULL, true ); + LLURLSimString::setString( LLSLURL::stripProtocol( data ) ); + LLPanelLogin::refreshLocation( true ); + LLPanelLogin::updateLocationUI(); + return LLWindowCallbacks::DND_MOVE; + }; - LLPickInfo pick_info = pickImmediate( pos.mX, pos.mY, TRUE /*BOOL pick_transparent*/ ); + LLPickInfo pick_info = pickImmediate( pos.mX, pos.mY, TRUE /*BOOL pick_transparent*/ ); - LLUUID object_id = pick_info.getObjectID(); - S32 object_face = pick_info.mObjectFace; - std::string url = data; + LLUUID object_id = pick_info.getObjectID(); + S32 object_face = pick_info.mObjectFace; + std::string url = data; - llinfos << "### Object: picked at " << pos.mX << ", " << pos.mY << " - face = " << object_face << " - URL = " << url << llendl; + llinfos << "### Object: picked at " << pos.mX << ", " << pos.mY << " - face = " << object_face << " - URL = " << url << llendl; - LLVOVolume *obj = dynamic_cast(static_cast(pick_info.getObject())); - - if (obj && obj->permModify()) - { - LLTextureEntry *te = obj->getTE(object_face); - if (te) - { - if (drop) + LLVOVolume *obj = dynamic_cast(static_cast(pick_info.getObject())); + + if (obj && obj->permModify()) { - if (! te->hasMedia()) + LLTextureEntry *te = obj->getTE(object_face); + if (te) { - // Create new media entry - LLSD media_data; - // XXX Should we really do Home URL too? - media_data[LLMediaEntry::HOME_URL_KEY] = url; - media_data[LLMediaEntry::CURRENT_URL_KEY] = url; - media_data[LLMediaEntry::AUTO_PLAY_KEY] = true; - obj->syncMediaData(object_face, media_data, true, true); - // XXX This shouldn't be necessary, should it ?!? - obj->getMediaImpl(object_face)->navigateReload(); - obj->sendMediaDataUpdate(); - - result = LLWindowCallbacks::DND_COPY; - } - else { - // just navigate to the URL - obj->getMediaImpl(object_face)->navigateTo(url); - - result = LLWindowCallbacks::DND_LINK; + if (drop) + { + if (! te->hasMedia()) + { + // Create new media entry + LLSD media_data; + // XXX Should we really do Home URL too? + media_data[LLMediaEntry::HOME_URL_KEY] = url; + media_data[LLMediaEntry::CURRENT_URL_KEY] = url; + media_data[LLMediaEntry::AUTO_PLAY_KEY] = true; + obj->syncMediaData(object_face, media_data, true, true); + // XXX This shouldn't be necessary, should it ?!? + obj->getMediaImpl(object_face)->navigateReload(); + obj->sendMediaDataUpdate(); + + result = LLWindowCallbacks::DND_COPY; + } + else { + // just navigate to the URL + obj->getMediaImpl(object_face)->navigateTo(url); + + result = LLWindowCallbacks::DND_LINK; + } + LLSelectMgr::getInstance()->unhighlightObjectOnly(mDragHoveredObject); + mDragHoveredObject = NULL; + + } + else { + mDragHoveredObject = obj; + // Highlight the dragged object + LLSelectMgr::getInstance()->highlightObjectOnly(mDragHoveredObject); + + result = (! te->hasMedia()) ? LLWindowCallbacks::DND_COPY : LLWindowCallbacks::DND_LINK; + } } - LLSelectMgr::getInstance()->unhighlightObjectOnly(mDragHoveredObject); - mDragHoveredObject = NULL; - - } - else { - mDragHoveredObject = obj; - // Highlight the dragged object - LLSelectMgr::getInstance()->highlightObjectOnly(mDragHoveredObject); - - result = (! te->hasMedia()) ? LLWindowCallbacks::DND_COPY : LLWindowCallbacks::DND_LINK; } } + break; + + case LLWindowCallbacks::DNDA_START_TRACKING: + // No special handling here yet -- we'll actually start tracking on the first DNDA_TRACK event. + break; + + case LLWindowCallbacks::DNDA_STOP_TRACKING: + // The cleanup case below will make sure things are unhilighted if necessary. + break; } if (result == LLWindowCallbacks::DND_NONE && !mDragHoveredObject.isNull()) diff --git a/indra/newview/llviewerwindow.h b/indra/newview/llviewerwindow.h index 2543d1096f..e209ff1ad9 100644 --- a/indra/newview/llviewerwindow.h +++ b/indra/newview/llviewerwindow.h @@ -170,7 +170,7 @@ public: /*virtual*/ BOOL handleRightMouseUp(LLWindow *window, LLCoordGL pos, MASK mask); /*virtual*/ BOOL handleMiddleMouseDown(LLWindow *window, LLCoordGL pos, MASK mask); /*virtual*/ BOOL handleMiddleMouseUp(LLWindow *window, LLCoordGL pos, MASK mask); - /*virtual*/ LLWindowCallbacks::DragNDropResult handleDragNDrop(LLWindow *window, LLCoordGL pos, MASK mask, BOOL drop, std::string data); + /*virtual*/ LLWindowCallbacks::DragNDropResult handleDragNDrop(LLWindow *window, LLCoordGL pos, MASK mask, LLWindowCallbacks::DragNDropAction action, std::string data); void handleMouseMove(LLWindow *window, LLCoordGL pos, MASK mask); /*virtual*/ void handleMouseLeave(LLWindow *window); /*virtual*/ void handleResize(LLWindow *window, S32 x, S32 y); -- cgit v1.2.3 From 064c9be9aedf238530ccdc941861fd057580e5b1 Mon Sep 17 00:00:00 2001 From: Rick Pasetto Date: Wed, 16 Dec 2009 18:56:01 -0800 Subject: Don't allow drag if the cap URL is empty or if the whitelist does not pass --- indra/newview/llviewerwindow.cpp | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index 5d2ca331d6..e3de2891a1 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -827,9 +827,9 @@ BOOL LLViewerWindow::handleMiddleMouseDown(LLWindow *window, LLCoordGL pos, MAS LLWindowCallbacks::DragNDropResult LLViewerWindow::handleDragNDrop( LLWindow *window, LLCoordGL pos, MASK mask, LLWindowCallbacks::DragNDropAction action, std::string data) { LLWindowCallbacks::DragNDropResult result = LLWindowCallbacks::DND_NONE; + if (gSavedSettings.getBOOL("PrimMediaDragNDrop")) { - switch(action) { // Much of the handling for these two cases is the same. @@ -854,11 +854,11 @@ LLWindowCallbacks::DragNDropResult LLViewerWindow::handleDragNDrop( LLWindow *wi S32 object_face = pick_info.mObjectFace; std::string url = data; - llinfos << "### Object: picked at " << pos.mX << ", " << pos.mY << " - face = " << object_face << " - URL = " << url << llendl; + lldebugs << "Object: picked at " << pos.mX << ", " << pos.mY << " - face = " << object_face << " - URL = " << url << llendl; LLVOVolume *obj = dynamic_cast(static_cast(pick_info.getObject())); - if (obj && obj->permModify()) + if (obj && obj->permModify() && !obj->getRegion()->getCapability("ObjectMedia").empty()) { LLTextureEntry *te = obj->getTE(object_face); if (te) @@ -881,10 +881,14 @@ LLWindowCallbacks::DragNDropResult LLViewerWindow::handleDragNDrop( LLWindow *wi result = LLWindowCallbacks::DND_COPY; } else { - // just navigate to the URL - obj->getMediaImpl(object_face)->navigateTo(url); + // Check the whitelist + if (te->getMediaData()->checkCandidateUrl(url)) + { + // just navigate to the URL + obj->getMediaImpl(object_face)->navigateTo(url); - result = LLWindowCallbacks::DND_LINK; + result = LLWindowCallbacks::DND_LINK; + } } LLSelectMgr::getInstance()->unhighlightObjectOnly(mDragHoveredObject); mDragHoveredObject = NULL; -- cgit v1.2.3 From 3b110e76332712e7efb7972fb27324a763596b6c Mon Sep 17 00:00:00 2001 From: Rick Pasetto Date: Fri, 18 Dec 2009 15:52:45 -0800 Subject: Fix crash when DnD onto an item with media but no impl --- indra/newview/llviewerwindow.cpp | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index 6c73cc18db..08f598b288 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -875,7 +875,8 @@ LLWindowCallbacks::DragNDropResult LLViewerWindow::handleDragNDrop( LLWindow *wi media_data[LLMediaEntry::AUTO_PLAY_KEY] = true; obj->syncMediaData(object_face, media_data, true, true); // XXX This shouldn't be necessary, should it ?!? - obj->getMediaImpl(object_face)->navigateReload(); + if (obj->getMediaImpl(object_face)) + obj->getMediaImpl(object_face)->navigateReload(); obj->sendMediaDataUpdate(); result = LLWindowCallbacks::DND_COPY; @@ -885,8 +886,20 @@ LLWindowCallbacks::DragNDropResult LLViewerWindow::handleDragNDrop( LLWindow *wi if (te->getMediaData()->checkCandidateUrl(url)) { // just navigate to the URL - obj->getMediaImpl(object_face)->navigateTo(url); - + if (obj->getMediaImpl(object_face)) + { + obj->getMediaImpl(object_face)->navigateTo(url); + } + else { + // This is very strange. Navigation should + // happen via the Impl, but we don't have one. + // This sends it to the server, which /should/ + // trigger us getting it. Hopefully. + LLSD media_data; + media_data[LLMediaEntry::CURRENT_URL_KEY] = url; + obj->syncMediaData(object_face, media_data, true, true); + obj->sendMediaDataUpdate(); + } result = LLWindowCallbacks::DND_LINK; } } -- cgit v1.2.3 From 9204681c31184c4c76c8f41c48da76e174e3276a Mon Sep 17 00:00:00 2001 From: Rick Pasetto Date: Fri, 18 Dec 2009 16:21:57 -0800 Subject: Fix slurl crashing, fix slurls highlighting objects, fix overlapping objects not "unhighlighting" --- indra/newview/llpanellogin.cpp | 2 ++ indra/newview/llviewerwindow.cpp | 24 +++++++++++++++--------- 2 files changed, 17 insertions(+), 9 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llpanellogin.cpp b/indra/newview/llpanellogin.cpp index cdfa64ba57..ce83ab3e37 100644 --- a/indra/newview/llpanellogin.cpp +++ b/indra/newview/llpanellogin.cpp @@ -688,6 +688,8 @@ void LLPanelLogin::refreshLocation( bool force_visible ) // static void LLPanelLogin::updateLocationUI() { + if (!sInstance) return; + std::string sim_string = LLURLSimString::sInstance.mSimString; if (!sim_string.empty()) { diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index 08f598b288..71fe8dd773 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -839,12 +839,15 @@ LLWindowCallbacks::DragNDropResult LLViewerWindow::handleDragNDrop( LLWindow *wi bool drop = (LLWindowCallbacks::DNDA_DROPPED == action); // special case SLURLs - if ( drop && std::string::npos != data.find("slurl.com") ) + if (std::string::npos != data.find("slurl.com") ) { - LLURLDispatcher::dispatch( data, NULL, true ); - LLURLSimString::setString( LLSLURL::stripProtocol( data ) ); - LLPanelLogin::refreshLocation( true ); - LLPanelLogin::updateLocationUI(); + if (drop) + { + LLURLDispatcher::dispatch( data, NULL, true ); + LLURLSimString::setString( LLSLURL::stripProtocol( data ) ); + LLPanelLogin::refreshLocation( true ); + LLPanelLogin::updateLocationUI(); + } return LLWindowCallbacks::DND_MOVE; }; @@ -908,10 +911,13 @@ LLWindowCallbacks::DragNDropResult LLViewerWindow::handleDragNDrop( LLWindow *wi } else { - mDragHoveredObject = obj; - // Highlight the dragged object - LLSelectMgr::getInstance()->highlightObjectOnly(mDragHoveredObject); - + if ( obj != mDragHoveredObject) + { + // Highlight the dragged object + LLSelectMgr::getInstance()->unhighlightObjectOnly(mDragHoveredObject); + mDragHoveredObject = obj; + LLSelectMgr::getInstance()->highlightObjectOnly(mDragHoveredObject); + } result = (! te->hasMedia()) ? LLWindowCallbacks::DND_COPY : LLWindowCallbacks::DND_LINK; } } -- cgit v1.2.3 From 75c1fb26649df73770459a31641c434e156e2c17 Mon Sep 17 00:00:00 2001 From: Rick Pasetto Date: Tue, 5 Jan 2010 15:03:27 -0800 Subject: Build fix: add missing #include --- indra/newview/llviewerwindow.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'indra/newview') diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index 21bf567b0c..313f728489 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -83,6 +83,7 @@ #include "lltooltip.h" #include "llmediaentry.h" #include "llurldispatcher.h" +#include "llurlsimstring.h" // newview includes #include "llagent.h" -- cgit v1.2.3 From e57f6a5cee1cf03df2bf43cd7a8b2c42c3918f8b Mon Sep 17 00:00:00 2001 From: Callum Prentice Date: Thu, 7 Jan 2010 14:21:57 -0800 Subject: Fix drag and drop for windows. Makes Win32 state machine behave more like Mac. --- indra/newview/llviewerwindow.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index 02b8158188..81fcfc13c2 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -835,6 +835,7 @@ LLWindowCallbacks::DragNDropResult LLViewerWindow::handleDragNDrop( LLWindow *wi // Much of the handling for these two cases is the same. case LLWindowCallbacks::DNDA_TRACK: case LLWindowCallbacks::DNDA_DROPPED: + case LLWindowCallbacks::DNDA_START_TRACKING: { bool drop = (LLWindowCallbacks::DNDA_DROPPED == action); @@ -925,10 +926,6 @@ LLWindowCallbacks::DragNDropResult LLViewerWindow::handleDragNDrop( LLWindow *wi } break; - case LLWindowCallbacks::DNDA_START_TRACKING: - // No special handling here yet -- we'll actually start tracking on the first DNDA_TRACK event. - break; - case LLWindowCallbacks::DNDA_STOP_TRACKING: // The cleanup case below will make sure things are unhilighted if necessary. break; -- cgit v1.2.3 From a74d494dd7c13e0307ee5ba526ba021583b1f2b5 Mon Sep 17 00:00:00 2001 From: Rick Pasetto Date: Mon, 11 Jan 2010 16:41:08 -0800 Subject: Fix unposted bug: drag feedback didn't check whitelist http://codereview.lindenlab.com/274039/show --- indra/newview/llviewerwindow.cpp | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index 81fcfc13c2..5dd640539f 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -912,14 +912,18 @@ LLWindowCallbacks::DragNDropResult LLViewerWindow::handleDragNDrop( LLWindow *wi } else { - if ( obj != mDragHoveredObject) + // Check the whitelist, if there's media (otherwise just show it) + if (te->getMediaData() == NULL || te->getMediaData()->checkCandidateUrl(url)) { - // Highlight the dragged object - LLSelectMgr::getInstance()->unhighlightObjectOnly(mDragHoveredObject); - mDragHoveredObject = obj; - LLSelectMgr::getInstance()->highlightObjectOnly(mDragHoveredObject); + if ( obj != mDragHoveredObject) + { + // Highlight the dragged object + LLSelectMgr::getInstance()->unhighlightObjectOnly(mDragHoveredObject); + mDragHoveredObject = obj; + LLSelectMgr::getInstance()->highlightObjectOnly(mDragHoveredObject); + } + result = (! te->hasMedia()) ? LLWindowCallbacks::DND_COPY : LLWindowCallbacks::DND_LINK; } - result = (! te->hasMedia()) ? LLWindowCallbacks::DND_COPY : LLWindowCallbacks::DND_LINK; } } } -- cgit v1.2.3 From a3ca95e3bd0e288792f6024d9487d618730fd40f Mon Sep 17 00:00:00 2001 From: Callum Prentice Date: Mon, 11 Jan 2010 17:26:28 -0800 Subject: Fix that stops "Start Location" corruption if you drag an invalid http://slurl.com SLURL onto the login page --- indra/newview/llviewerwindow.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview') diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index 81fcfc13c2..c5c9e49934 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -840,7 +840,7 @@ LLWindowCallbacks::DragNDropResult LLViewerWindow::handleDragNDrop( LLWindow *wi bool drop = (LLWindowCallbacks::DNDA_DROPPED == action); // special case SLURLs - if (std::string::npos != data.find("slurl.com") ) + if ( LLSLURL::isSLURL( data ) ) { if (drop) { -- cgit v1.2.3 From 228d37a8d72146d9baed57c7406a9324ce8c0175 Mon Sep 17 00:00:00 2001 From: Callum Prentice Date: Tue, 19 Jan 2010 11:52:41 -0800 Subject: Fix for EXT-4191 - Drag and Drop viewer resolves some slurls to "//" --- indra/newview/llviewerwindow.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index 45e153049b..d4ffe70f24 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -824,8 +824,7 @@ LLWindowCallbacks::DragNDropResult LLViewerWindow::handleDragNDrop( LLWindow *wi { if (drop) { - LLURLDispatcher::dispatch( data, NULL, true ); - LLURLSimString::setString( LLSLURL::stripProtocol( data ) ); + LLURLSimString::setStringRaw( LLSLURL::stripProtocol( data ) ); LLPanelLogin::refreshLocation( true ); LLPanelLogin::updateLocationUI(); } -- cgit v1.2.3 From ae079af48d8ab6b1939168b0a2ac95876da66d24 Mon Sep 17 00:00:00 2001 From: Rick Pasetto Date: Wed, 20 Jan 2010 09:55:36 -0800 Subject: Add another setting controlling whether SLURL drag-and-drop performs a teleport --- indra/newview/app_settings/settings.xml | 13 ++- indra/newview/llviewerwindow.cpp | 146 +++++++++++++++++--------------- 2 files changed, 90 insertions(+), 69 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 9f261978e6..6096504b96 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -5552,7 +5552,7 @@ PrimMediaDragNDrop Comment - Enable drag and drop + Enable drag and drop of URLs onto prim faces Persist 1 Type @@ -10786,6 +10786,17 @@ Value 0 + SLURLDragNDrop + + Comment + Enable drag and drop of SLURLs onto the viewer + Persist + 1 + Type + Boolean + Value + 1 + soundsbeacon Comment diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index 45e153049b..e743d3419e 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -808,7 +808,10 @@ LLWindowCallbacks::DragNDropResult LLViewerWindow::handleDragNDrop( LLWindow *wi { LLWindowCallbacks::DragNDropResult result = LLWindowCallbacks::DND_NONE; - if (gSavedSettings.getBOOL("PrimMediaDragNDrop")) + const bool prim_media_dnd_enabled = gSavedSettings.getBOOL("PrimMediaDragNDrop"); + const bool slurl_dnd_enabled = gSavedSettings.getBOOL("SLURLDragNDrop"); + + if ( prim_media_dnd_enabled || slurl_dnd_enabled ) { switch(action) { @@ -819,90 +822,96 @@ LLWindowCallbacks::DragNDropResult LLViewerWindow::handleDragNDrop( LLWindow *wi { bool drop = (LLWindowCallbacks::DNDA_DROPPED == action); - // special case SLURLs - if ( LLSLURL::isSLURL( data ) ) + if (slurl_dnd_enabled) { - if (drop) + // special case SLURLs + if ( LLSLURL::isSLURL( data ) ) { - LLURLDispatcher::dispatch( data, NULL, true ); - LLURLSimString::setString( LLSLURL::stripProtocol( data ) ); - LLPanelLogin::refreshLocation( true ); - LLPanelLogin::updateLocationUI(); - } - return LLWindowCallbacks::DND_MOVE; - }; + if (drop) + { + LLURLDispatcher::dispatch( data, NULL, true ); + LLURLSimString::setString( LLSLURL::stripProtocol( data ) ); + LLPanelLogin::refreshLocation( true ); + LLPanelLogin::updateLocationUI(); + } + return LLWindowCallbacks::DND_MOVE; + }; + } - LLPickInfo pick_info = pickImmediate( pos.mX, pos.mY, TRUE /*BOOL pick_transparent*/ ); + if (prim_media_dnd_enabled) + { + LLPickInfo pick_info = pickImmediate( pos.mX, pos.mY, TRUE /*BOOL pick_transparent*/ ); - LLUUID object_id = pick_info.getObjectID(); - S32 object_face = pick_info.mObjectFace; - std::string url = data; + LLUUID object_id = pick_info.getObjectID(); + S32 object_face = pick_info.mObjectFace; + std::string url = data; - lldebugs << "Object: picked at " << pos.mX << ", " << pos.mY << " - face = " << object_face << " - URL = " << url << llendl; + lldebugs << "Object: picked at " << pos.mX << ", " << pos.mY << " - face = " << object_face << " - URL = " << url << llendl; - LLVOVolume *obj = dynamic_cast(static_cast(pick_info.getObject())); + LLVOVolume *obj = dynamic_cast(static_cast(pick_info.getObject())); - if (obj && obj->permModify() && !obj->getRegion()->getCapability("ObjectMedia").empty()) - { - LLTextureEntry *te = obj->getTE(object_face); - if (te) + if (obj && obj->permModify() && !obj->getRegion()->getCapability("ObjectMedia").empty()) { - if (drop) + LLTextureEntry *te = obj->getTE(object_face); + if (te) { - if (! te->hasMedia()) + if (drop) { - // Create new media entry - LLSD media_data; - // XXX Should we really do Home URL too? - media_data[LLMediaEntry::HOME_URL_KEY] = url; - media_data[LLMediaEntry::CURRENT_URL_KEY] = url; - media_data[LLMediaEntry::AUTO_PLAY_KEY] = true; - obj->syncMediaData(object_face, media_data, true, true); - // XXX This shouldn't be necessary, should it ?!? - if (obj->getMediaImpl(object_face)) - obj->getMediaImpl(object_face)->navigateReload(); - obj->sendMediaDataUpdate(); - - result = LLWindowCallbacks::DND_COPY; - } - else { - // Check the whitelist - if (te->getMediaData()->checkCandidateUrl(url)) + if (! te->hasMedia()) { - // just navigate to the URL + // Create new media entry + LLSD media_data; + // XXX Should we really do Home URL too? + media_data[LLMediaEntry::HOME_URL_KEY] = url; + media_data[LLMediaEntry::CURRENT_URL_KEY] = url; + media_data[LLMediaEntry::AUTO_PLAY_KEY] = true; + obj->syncMediaData(object_face, media_data, true, true); + // XXX This shouldn't be necessary, should it ?!? if (obj->getMediaImpl(object_face)) + obj->getMediaImpl(object_face)->navigateReload(); + obj->sendMediaDataUpdate(); + + result = LLWindowCallbacks::DND_COPY; + } + else { + // Check the whitelist + if (te->getMediaData()->checkCandidateUrl(url)) { - obj->getMediaImpl(object_face)->navigateTo(url); + // just navigate to the URL + if (obj->getMediaImpl(object_face)) + { + obj->getMediaImpl(object_face)->navigateTo(url); + } + else { + // This is very strange. Navigation should + // happen via the Impl, but we don't have one. + // This sends it to the server, which /should/ + // trigger us getting it. Hopefully. + LLSD media_data; + media_data[LLMediaEntry::CURRENT_URL_KEY] = url; + obj->syncMediaData(object_face, media_data, true, true); + obj->sendMediaDataUpdate(); + } + result = LLWindowCallbacks::DND_LINK; } - else { - // This is very strange. Navigation should - // happen via the Impl, but we don't have one. - // This sends it to the server, which /should/ - // trigger us getting it. Hopefully. - LLSD media_data; - media_data[LLMediaEntry::CURRENT_URL_KEY] = url; - obj->syncMediaData(object_face, media_data, true, true); - obj->sendMediaDataUpdate(); - } - result = LLWindowCallbacks::DND_LINK; } - } - LLSelectMgr::getInstance()->unhighlightObjectOnly(mDragHoveredObject); - mDragHoveredObject = NULL; + LLSelectMgr::getInstance()->unhighlightObjectOnly(mDragHoveredObject); + mDragHoveredObject = NULL; - } - else { - // Check the whitelist, if there's media (otherwise just show it) - if (te->getMediaData() == NULL || te->getMediaData()->checkCandidateUrl(url)) - { - if ( obj != mDragHoveredObject) + } + else { + // Check the whitelist, if there's media (otherwise just show it) + if (te->getMediaData() == NULL || te->getMediaData()->checkCandidateUrl(url)) { - // Highlight the dragged object - LLSelectMgr::getInstance()->unhighlightObjectOnly(mDragHoveredObject); - mDragHoveredObject = obj; - LLSelectMgr::getInstance()->highlightObjectOnly(mDragHoveredObject); + if ( obj != mDragHoveredObject) + { + // Highlight the dragged object + LLSelectMgr::getInstance()->unhighlightObjectOnly(mDragHoveredObject); + mDragHoveredObject = obj; + LLSelectMgr::getInstance()->highlightObjectOnly(mDragHoveredObject); + } + result = (! te->hasMedia()) ? LLWindowCallbacks::DND_COPY : LLWindowCallbacks::DND_LINK; } - result = (! te->hasMedia()) ? LLWindowCallbacks::DND_COPY : LLWindowCallbacks::DND_LINK; } } } @@ -915,7 +924,8 @@ LLWindowCallbacks::DragNDropResult LLViewerWindow::handleDragNDrop( LLWindow *wi break; } - if (result == LLWindowCallbacks::DND_NONE && !mDragHoveredObject.isNull()) + if (prim_media_dnd_enabled && + result == LLWindowCallbacks::DND_NONE && !mDragHoveredObject.isNull()) { LLSelectMgr::getInstance()->unhighlightObjectOnly(mDragHoveredObject); mDragHoveredObject = NULL; -- cgit v1.2.3 From f44ee460c5d2c3531ea213b22e112bc74fe471d0 Mon Sep 17 00:00:00 2001 From: Rick Pasetto Date: Mon, 1 Feb 2010 15:12:57 -0800 Subject: Fix regression where SLURL DND when logged in didn't work (line got dropped) Reviewed by callum --- indra/newview/llviewerwindow.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'indra/newview') diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index b36cd5b934..fdc6675db1 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -825,7 +825,8 @@ LLWindowCallbacks::DragNDropResult LLViewerWindow::handleDragNDrop( LLWindow *wi { if (drop) { - LLURLSimString::setStringRaw( LLSLURL::stripProtocol( data ) ); + LLURLDispatcher::dispatch( data, NULL, true ); + LLURLSimString::setStringRaw( LLSLURL::stripProtocol( data ) ); LLPanelLogin::refreshLocation( true ); LLPanelLogin::updateLocationUI(); } -- cgit v1.2.3