Skip to content
Snippets Groups Projects
Commit 97a01081 authored by Denis Serdjuk's avatar Denis Serdjuk
Browse files

fixed bug EXT-1768 Unable to store landmark attached to notecard into Landmarks

--HG--
branch : product-engine
parent 10aa210e
No related branches found
No related tags found
No related merge requests found
......@@ -44,6 +44,9 @@
#include "llinventory.h"
#include "llinventorybridge.h"
#include "llinventorymodel.h"
#include "lllandmark.h"
#include "lllandmarkactions.h"
#include "lllandmarklist.h"
#include "llmemorystream.h"
#include "llmenugl.h"
#include "llnotecard.h"
......@@ -64,10 +67,47 @@
#include "llviewertexturelist.h"
#include "llviewerwindow.h"
#include "llappviewer.h" // for gPacificDaylightTime
static LLDefaultChildRegistry::Register<LLViewerTextEditor> r("text_editor");
///-----------------------------------------------------------------------
/// Class LLEmbeddedLandmarkCopied
///-----------------------------------------------------------------------
class LLEmbeddedLandmarkCopied: public LLInventoryCallback
{
public:
LLEmbeddedLandmarkCopied(){}
void fire(const LLUUID& inv_item)
{
showInfo(inv_item);
}
static void showInfo(const LLUUID& landmark_inv_id)
{
LLSD key;
key["type"] = "landmark";
key["id"] = landmark_inv_id;
LLSideTray::getInstance()->showPanel("panel_places", key);
}
static void processForeignLandmark(LLLandmark* landmark,
const LLUUID& object_id, const LLUUID& notecard_inventory_id,
LLInventoryItem* item)
{
LLVector3d global_pos;
landmark->getGlobalPos(global_pos);
LLViewerInventoryItem* agent_lanmark =
LLLandmarkActions::findLandmarkForGlobalPos(global_pos);
if (agent_lanmark)
{
showInfo(agent_lanmark->getUUID());
}
else
{
LLPointer<LLEmbeddedLandmarkCopied> cb = new LLEmbeddedLandmarkCopied();
copy_inventory_from_notecard(object_id, notecard_inventory_id, item, gInventoryCallbacks.registerCB(cb));
}
}
};
///----------------------------------------------------------------------------
/// Class LLEmbeddedNotecardOpener
///----------------------------------------------------------------------------
......@@ -1099,14 +1139,12 @@ void LLViewerTextEditor::openEmbeddedLandmark( LLInventoryItem* item, llwchar wc
if (!item)
return;
LLSD key;
key["type"] = "landmark";
key["id"] = item->getUUID();
LLPanelPlaces *panel = dynamic_cast<LLPanelPlaces*>(LLSideTray::getInstance()->showPanel("panel_places", key));
if (panel)
LLLandmark* landmark = gLandmarkList.getAsset(item->getAssetUUID(),
boost::bind(&LLEmbeddedLandmarkCopied::processForeignLandmark, _1, mObjectID, mNotecardInventoryID, item));
if (landmark)
{
panel->setItem(item);
LLEmbeddedLandmarkCopied::processForeignLandmark(landmark, mObjectID,
mNotecardInventoryID, item);
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment