summaryrefslogtreecommitdiff
path: root/indra/newview/llpreviewgesture.cpp
diff options
context:
space:
mode:
authorDon Kjer <don@lindenlab.com>2007-09-14 21:13:20 +0000
committerDon Kjer <don@lindenlab.com>2007-09-14 21:13:20 +0000
commit13c391f1984bb8cb9d67a7729af2ee5714409215 (patch)
tree112edff1d25adabb4893e6746ba76a4182865f8a /indra/newview/llpreviewgesture.cpp
parentb3d807d5ff8dca6c891e9a5e0ddc7bc147d69f8c (diff)
EFFECTIVE MERGE: svn merge -r 68118:68999 svn+ssh://svn/svn/linden/branches/maintenance
ACTUAL MERGE: svn merge -r 69685:69687 svn+ssh://svn/svn/linden/branches/release-r69649-maintenance-sync EQUIVALENT TO: svn merge -r 68118:69663 svn+ssh://svn/svn/linden/branches/maintenance-r68999
Diffstat (limited to 'indra/newview/llpreviewgesture.cpp')
-rw-r--r--indra/newview/llpreviewgesture.cpp27
1 files changed, 24 insertions, 3 deletions
diff --git a/indra/newview/llpreviewgesture.cpp b/indra/newview/llpreviewgesture.cpp
index 0e0ade17a2..a4eac30f20 100644
--- a/indra/newview/llpreviewgesture.cpp
+++ b/indra/newview/llpreviewgesture.cpp
@@ -269,6 +269,12 @@ void LLPreviewGesture::onClose(bool app_quitting)
}
// virtual
+void LLPreviewGesture::onUpdateSucceeded()
+{
+ refresh();
+}
+
+// virtual
void LLPreviewGesture::setMinimized(BOOL minimize)
{
if (minimize != isMinimized())
@@ -1100,19 +1106,29 @@ void LLPreviewGesture::saveIfNeeded()
file.setMaxSize(size);
file.write((U8*)buffer, size);
+ BOOL delayedUpload = FALSE;
+
// Upload that asset to the database
- const LLInventoryItem* item = getItem();
+ LLViewerInventoryItem* item = (LLViewerInventoryItem*) getItem();
if (item)
{
std::string agent_url = gAgent.getRegion()->getCapability("UpdateGestureAgentInventory");
std::string task_url = gAgent.getRegion()->getCapability("UpdateGestureTaskInventory");
if (mObjectUUID.isNull() && !agent_url.empty())
{
+ //need to disable the preview floater so item
+ //isn't re-saved before new asset arrives
+ //fake out refresh.
+ item->setComplete(FALSE);
+ refresh();
+ item->setComplete(TRUE);
+
// Saving into agent inventory
LLSD body;
body["item_id"] = mItemUUID;
LLHTTPClient::post(agent_url, body,
new LLUpdateAgentInventoryResponder(body, asset_id, LLAssetType::AT_GESTURE));
+ delayedUpload = TRUE;
}
else if (!mObjectUUID.isNull() && !task_url.empty())
{
@@ -1133,7 +1149,7 @@ void LLPreviewGesture::saveIfNeeded()
// If this gesture is active, then we need to update the in-memory
// active map with the new pointer.
- if (gGestureManager.isGestureActive(mItemUUID))
+ if (!delayedUpload && gGestureManager.isGestureActive(mItemUUID))
{
// gesture manager now owns the pointer
gGestureManager.replaceGesture(mItemUUID, gesture, asset_id);
@@ -1150,7 +1166,12 @@ void LLPreviewGesture::saveIfNeeded()
}
mDirty = FALSE;
- refresh();
+ // refresh will be called when callback
+ // if triggered when delayedUpload
+ if(!delayedUpload)
+ {
+ refresh();
+ }
}
delete [] buffer;