aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/llpreviewgesture.cpp
diff options
context:
space:
mode:
authorJacek Antonelli2008-08-15 23:44:50 -0500
committerJacek Antonelli2008-08-15 23:44:50 -0500
commit89fe5dab825a62a0e3fd8d248cbc91c65eb2a426 (patch)
treebcff14b7888d04a2fec799c59369f6095224bd08 /linden/indra/newview/llpreviewgesture.cpp
parentSecond Life viewer sources 1.13.3.2 (diff)
downloadmeta-impy-89fe5dab825a62a0e3fd8d248cbc91c65eb2a426.zip
meta-impy-89fe5dab825a62a0e3fd8d248cbc91c65eb2a426.tar.gz
meta-impy-89fe5dab825a62a0e3fd8d248cbc91c65eb2a426.tar.bz2
meta-impy-89fe5dab825a62a0e3fd8d248cbc91c65eb2a426.tar.xz
Second Life viewer sources 1.14.0.0
Diffstat (limited to '')
-rw-r--r--linden/indra/newview/llpreviewgesture.cpp42
1 files changed, 31 insertions, 11 deletions
diff --git a/linden/indra/newview/llpreviewgesture.cpp b/linden/indra/newview/llpreviewgesture.cpp
index 1ff782a..fdbeb6c 100644
--- a/linden/indra/newview/llpreviewgesture.cpp
+++ b/linden/indra/newview/llpreviewgesture.cpp
@@ -41,6 +41,7 @@
41 41
42// newview 42// newview
43#include "llagent.h" // todo: remove 43#include "llagent.h" // todo: remove
44#include "llassetuploadresponders.h"
44#include "llbutton.h" 45#include "llbutton.h"
45#include "llcheckboxctrl.h" 46#include "llcheckboxctrl.h"
46#include "llcombobox.h" 47#include "llcombobox.h"
@@ -57,6 +58,7 @@
57#include "llviewerinventory.h" 58#include "llviewerinventory.h"
58#include "llviewerobject.h" 59#include "llviewerobject.h"
59#include "llviewerobjectlist.h" 60#include "llviewerobjectlist.h"
61#include "llviewerregion.h"
60#include "llviewerstats.h" 62#include "llviewerstats.h"
61#include "llviewerwindow.h" // busycount 63#include "llviewerwindow.h" // busycount
62#include "viewer.h" // gVFS 64#include "viewer.h" // gVFS
@@ -112,7 +114,7 @@ LLPreviewGesture* LLPreviewGesture::show(const std::string& title, const LLUUID&
112 LLPreviewGesture* previewp = (LLPreviewGesture*)LLPreview::find(item_id); 114 LLPreviewGesture* previewp = (LLPreviewGesture*)LLPreview::find(item_id);
113 if (previewp) 115 if (previewp)
114 { 116 {
115 previewp->open(); 117 previewp->open(); /*Flawfinder: ignore*/
116 if (take_focus) 118 if (take_focus)
117 { 119 {
118 previewp->setFocus(TRUE); 120 previewp->setFocus(TRUE);
@@ -790,8 +792,8 @@ void LLPreviewGesture::refresh()
790 mWaitTimeCheck->setVisible(TRUE); 792 mWaitTimeCheck->setVisible(TRUE);
791 mWaitTimeCheck->set(wait_step->mFlags & WAIT_FLAG_TIME); 793 mWaitTimeCheck->set(wait_step->mFlags & WAIT_FLAG_TIME);
792 mWaitTimeEditor->setVisible(TRUE); 794 mWaitTimeEditor->setVisible(TRUE);
793 char buffer[16]; 795 char buffer[16]; /*Flawfinder: ignore*/
794 sprintf(buffer, "%.1f", (double)wait_step->mWaitSeconds); 796 snprintf(buffer, sizeof(buffer), "%.1f", (double)wait_step->mWaitSeconds); /*Flawfinder: ignore*/
795 mWaitTimeEditor->setText(buffer); 797 mWaitTimeEditor->setText(buffer);
796 break; 798 break;
797 } 799 }
@@ -895,7 +897,7 @@ void LLPreviewGesture::onLoadComplete(LLVFS *vfs,
895 S32 size = file.getSize(); 897 S32 size = file.getSize();
896 898
897 char* buffer = new char[size+1]; 899 char* buffer = new char[size+1];
898 file.read((U8*)buffer, size); 900 file.read((U8*)buffer, size); /*Flawfinder: ignore*/
899 buffer[size] = '\0'; 901 buffer[size] = '\0';
900 902
901 LLMultiGesture* gesture = new LLMultiGesture(); 903 LLMultiGesture* gesture = new LLMultiGesture();
@@ -1120,13 +1122,31 @@ void LLPreviewGesture::saveIfNeeded()
1120 LLInventoryItem* item = getItem(); 1122 LLInventoryItem* item = getItem();
1121 if (item) 1123 if (item)
1122 { 1124 {
1123 LLLineEditor* descEditor = LLUICtrlFactory::getLineEditorByName(this, "desc"); 1125 std::string agent_url = gAgent.getRegion()->getCapability("UpdateGestureAgentInventory");
1124 LLSaveInfo* info = new LLSaveInfo(mItemUUID, mObjectUUID, descEditor->getText(), tid); 1126 std::string task_url = gAgent.getRegion()->getCapability("UpdateGestureTaskInventory");
1125 1127 if (mObjectUUID.isNull() && !agent_url.empty())
1126 const BOOL temp_file = FALSE; 1128 {
1127 1129 // Saving into agent inventory
1128 gAssetStorage->storeAssetData(tid, LLAssetType::AT_GESTURE, onSaveComplete, info, temp_file); 1130 LLSD body;
1129 1131 body["item_id"] = mItemUUID;
1132 LLHTTPClient::post(agent_url, body,
1133 new LLUpdateAgentInventoryResponder(body, asset_id, LLAssetType::AT_GESTURE));
1134 }
1135 else if (!mObjectUUID.isNull() && !task_url.empty())
1136 {
1137 // Saving into task inventory
1138 LLSD body;
1139 body["task_id"] = mObjectUUID;
1140 body["item_id"] = mItemUUID;
1141 LLHTTPClient::post(task_url, body,
1142 new LLUpdateTaskInventoryResponder(body, asset_id, LLAssetType::AT_GESTURE));
1143 }
1144 else if (gAssetStorage)
1145 {
1146 LLLineEditor* descEditor = LLUICtrlFactory::getLineEditorByName(this, "desc");
1147 LLSaveInfo* info = new LLSaveInfo(mItemUUID, mObjectUUID, descEditor->getText(), tid);
1148 gAssetStorage->storeAssetData(tid, LLAssetType::AT_GESTURE, onSaveComplete, info, FALSE);
1149 }
1130 } 1150 }
1131 1151
1132 // If this gesture is active, then we need to update the in-memory 1152 // If this gesture is active, then we need to update the in-memory