summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview')
-rw-r--r--indra/newview/llinventorybridge.cpp47
-rw-r--r--indra/newview/llinventorybridge.h3
-rw-r--r--indra/newview/llstartup.cpp14
3 files changed, 61 insertions, 3 deletions
diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp
index d3671239bb..a4b80ed7c1 100644
--- a/indra/newview/llinventorybridge.cpp
+++ b/indra/newview/llinventorybridge.cpp
@@ -755,6 +755,10 @@ void LLItemBridge::performAction(LLFolderView* folder, LLInventoryModel* model,
model->deleteObject(mUUID);
model->notifyObservers();
}
+ else if ("restoreToWorld" == action)
+ {
+ restoreToWorld();
+ }
else if ("restore" == action)
{
restoreItem();
@@ -811,6 +815,47 @@ void LLItemBridge::restoreItem()
}
}
+void LLItemBridge::restoreToWorld()
+{
+ LLViewerInventoryItem* itemp = (LLViewerInventoryItem*)getItem();
+ if (itemp)
+ {
+ LLMessageSystem* msg = gMessageSystem;
+ msg->newMessage("RezRestoreToWorld");
+ msg->nextBlockFast(_PREHASH_AgentData);
+ msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID());
+ msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID());
+
+ msg->nextBlockFast(_PREHASH_InventoryData);
+ itemp->packMessage(msg);
+ msg->sendReliable(gAgent.getRegion()->getHost());
+ }
+
+ //Similar functionality to the drag and drop rez logic
+ BOOL remove_from_inventory = FALSE;
+
+ //remove local inventory copy, sim will deal with permissions and removing the item
+ //from the actual inventory if its a no-copy etc
+ if(!itemp->getPermissions().allowCopyBy(gAgent.getID()))
+ {
+ remove_from_inventory = TRUE;
+ }
+
+ // Check if it's in the trash. (again similar to the normal rez logic)
+ LLUUID trash_id;
+ trash_id = gInventory.findCategoryUUIDForType(LLAssetType::AT_TRASH);
+ if(gInventory.isObjectDescendentOf(itemp->getUUID(), trash_id))
+ {
+ remove_from_inventory = TRUE;
+ }
+
+ if(remove_from_inventory)
+ {
+ gInventory.deleteObject(itemp->getUUID());
+ gInventory.notifyObservers();
+ }
+}
+
LLUIImagePtr LLItemBridge::getIcon() const
{
return LLUI::getUIImage(ICON_NAME[OBJECT_ICON_NAME]);
@@ -3375,6 +3420,7 @@ void LLObjectBridge::buildContextMenu(LLMenuGL& menu, U32 flags)
items.push_back(std::string("Object Wear"));
items.push_back(std::string("Attach To"));
items.push_back(std::string("Attach To HUD"));
+ items.push_back(std::string("Restore to Last Position"));
LLMenuGL* attach_menu = menu.getChildMenuByName("Attach To", TRUE);
LLMenuGL* attach_hud_menu = menu.getChildMenuByName("Attach To HUD", TRUE);
@@ -4363,7 +4409,6 @@ void LLWearableBridge::buildContextMenu(LLMenuGL& menu, U32 flags)
items.push_back(std::string("Wearable Wear"));
items.push_back(std::string("Wearable Edit"));
-
if ((flags & FIRST_SELECTED_ITEM) == 0)
{
disabled_items.push_back(std::string("Wearable Edit"));
diff --git a/indra/newview/llinventorybridge.h b/indra/newview/llinventorybridge.h
index d038c10c73..5df3ba23af 100644
--- a/indra/newview/llinventorybridge.h
+++ b/indra/newview/llinventorybridge.h
@@ -159,6 +159,7 @@ public:
virtual const std::string& getPrefix() { return LLStringUtil::null; }
virtual void restoreItem() {}
+ virtual void restoreToWorld() {}
// LLFolderViewEventListener functions
virtual const std::string& getName() const;
@@ -234,6 +235,7 @@ public:
virtual void selectItem();
virtual void restoreItem();
+ virtual void restoreToWorld();
virtual LLUIImagePtr getIcon() const;
virtual const std::string& getDisplayName() const;
@@ -274,7 +276,6 @@ public:
virtual void selectItem();
virtual void restoreItem();
-
virtual LLUIImagePtr getIcon() const;
virtual BOOL renameItem(const std::string& new_name);
virtual BOOL removeItem();
diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp
index 21af491408..ca310cf8e4 100644
--- a/indra/newview/llstartup.cpp
+++ b/indra/newview/llstartup.cpp
@@ -478,6 +478,14 @@ bool idle_startup()
}
LLHTTPSender::setDefaultSender(new LLNullHTTPSender());
+
+ // TODO parameterize
+ const F32 circuit_heartbeat_interval = 5;
+ const F32 circuit_timeout = 100;
+
+ const LLUseCircuitCodeResponder* responder = NULL;
+ bool failure_is_fatal = true;
+
if(!start_messaging_system(
message_template_path,
port,
@@ -485,7 +493,11 @@ bool idle_startup()
LL_VERSION_MINOR,
LL_VERSION_PATCH,
FALSE,
- std::string()))
+ std::string(),
+ responder,
+ failure_is_fatal,
+ circuit_heartbeat_interval,
+ circuit_timeout))
{
std::string msg = LLTrans::getString("LoginFailedNoNetwork");
msg.append(llformat(" Error: %d", gMessageSystem->getErrorCode()));