summaryrefslogtreecommitdiff
path: root/indra/newview/llpreviewscript.cpp
diff options
context:
space:
mode:
authorAnsariel <none@none>2016-04-07 10:04:05 +0200
committerAnsariel <none@none>2016-04-07 10:04:05 +0200
commit77ef10e0493a192a1e7f1cb988bac757bd199f69 (patch)
treed05b644d202e0293d8ff2aa4153af25e8fa94f39 /indra/newview/llpreviewscript.cpp
parentf0107eb8aae46a928b0b3e6564cc4ed3031e1271 (diff)
OPEN-292: More removal of orphaned legacy script upload methods
Diffstat (limited to 'indra/newview/llpreviewscript.cpp')
-rw-r--r--indra/newview/llpreviewscript.cpp172
1 files changed, 0 insertions, 172 deletions
diff --git a/indra/newview/llpreviewscript.cpp b/indra/newview/llpreviewscript.cpp
index 26b5a743d0..fc185667d7 100644
--- a/indra/newview/llpreviewscript.cpp
+++ b/indra/newview/llpreviewscript.cpp
@@ -1690,94 +1690,6 @@ void LLPreviewLSL::saveIfNeeded(bool sync /*= true*/)
}
}
-
-// static
-void LLPreviewLSL::onSaveComplete(const LLUUID& asset_uuid, void* user_data, S32 status, LLExtStat ext_status) // StoreAssetData callback (fixed)
-{
- LLScriptSaveInfo* info = reinterpret_cast<LLScriptSaveInfo*>(user_data);
- if(0 == status)
- {
- if (info)
- {
- const LLViewerInventoryItem* item;
- item = (const LLViewerInventoryItem*)gInventory.getItem(info->mItemUUID);
- if(item)
- {
- LLPointer<LLViewerInventoryItem> new_item = new LLViewerInventoryItem(item);
- new_item->setAssetUUID(asset_uuid);
- new_item->setTransactionID(info->mTransactionID);
- new_item->updateServer(FALSE);
- gInventory.updateItem(new_item);
- gInventory.notifyObservers();
- }
- else
- {
- LL_WARNS() << "Inventory item for script " << info->mItemUUID
- << " is no longer in agent inventory." << LL_ENDL;
- }
-
- // Find our window and close it if requested.
- LLPreviewLSL* self = LLFloaterReg::findTypedInstance<LLPreviewLSL>("preview_script", info->mItemUUID);
- if (self)
- {
- getWindow()->decBusyCount();
- self->mPendingUploads--;
- if (self->mPendingUploads <= 0
- && self->mCloseAfterSave)
- {
- self->closeFloater();
- }
- }
- }
- }
- else
- {
- LL_WARNS() << "Problem saving script: " << status << LL_ENDL;
- LLSD args;
- args["REASON"] = std::string(LLAssetStorage::getErrorString(status));
- LLNotificationsUtil::add("SaveScriptFailReason", args);
- }
- delete info;
-}
-
-// static
-void LLPreviewLSL::onSaveBytecodeComplete(const LLUUID& asset_uuid, void* user_data, S32 status, LLExtStat ext_status) // StoreAssetData callback (fixed)
-{
- LLUUID* instance_uuid = (LLUUID*)user_data;
- LLPreviewLSL* self = NULL;
- if(instance_uuid)
- {
- self = LLFloaterReg::findTypedInstance<LLPreviewLSL>("preview_script", *instance_uuid);
- }
- if (0 == status)
- {
- if (self)
- {
- LLSD row;
- row["columns"][0]["value"] = "Compile successful!";
- row["columns"][0]["font"] = "SANSSERIF_SMALL";
- self->mScriptEd->mErrorList->addElement(row);
-
- // Find our window and close it if requested.
- self->getWindow()->decBusyCount();
- self->mPendingUploads--;
- if (self->mPendingUploads <= 0
- && self->mCloseAfterSave)
- {
- self->closeFloater();
- }
- }
- }
- else
- {
- LL_WARNS() << "Problem saving LSL Bytecode (Preview)" << LL_ENDL;
- LLSD args;
- args["REASON"] = std::string(LLAssetStorage::getErrorString(status));
- LLNotificationsUtil::add("SaveBytecodeFailReason", args);
- }
- delete instance_uuid;
-}
-
// static
void LLPreviewLSL::onLoadComplete( LLVFS *vfs, const LLUUID& asset_uuid, LLAssetType::EType type,
void* user_data, S32 status, LLExtStat ext_status)
@@ -2308,90 +2220,6 @@ void LLLiveLSLEditor::saveIfNeeded(bool sync /*= true*/)
}
}
-
-void LLLiveLSLEditor::onSaveTextComplete(const LLUUID& asset_uuid, void* user_data, S32 status, LLExtStat ext_status) // StoreAssetData callback (fixed)
-{
- LLLiveLSLSaveData* data = (LLLiveLSLSaveData*)user_data;
-
- if (status)
- {
- LL_WARNS() << "Unable to save text for a script." << LL_ENDL;
- LLSD args;
- args["REASON"] = std::string(LLAssetStorage::getErrorString(status));
- LLNotificationsUtil::add("CompileQueueSaveText", args);
- }
- else
- {
- LLSD floater_key;
- floater_key["taskid"] = data->mSaveObjectID;
- floater_key["itemid"] = data->mItem->getUUID();
- LLLiveLSLEditor* self = LLFloaterReg::findTypedInstance<LLLiveLSLEditor>("preview_scriptedit", floater_key);
- if (self)
- {
- self->getWindow()->decBusyCount();
- self->mPendingUploads--;
- if (self->mPendingUploads <= 0
- && self->mCloseAfterSave)
- {
- self->closeFloater();
- }
- }
- }
- delete data;
- data = NULL;
-}
-
-
-void LLLiveLSLEditor::onSaveBytecodeComplete(const LLUUID& asset_uuid, void* user_data, S32 status, LLExtStat ext_status) // StoreAssetData callback (fixed)
-{
- LLLiveLSLSaveData* data = (LLLiveLSLSaveData*)user_data;
- if(!data)
- return;
- if(0 ==status)
- {
- LL_INFOS() << "LSL Bytecode saved" << LL_ENDL;
- LLSD floater_key;
- floater_key["taskid"] = data->mSaveObjectID;
- floater_key["itemid"] = data->mItem->getUUID();
- LLLiveLSLEditor* self = LLFloaterReg::findTypedInstance<LLLiveLSLEditor>("preview_scriptedit", floater_key);
- if (self)
- {
- // Tell the user that the compile worked.
- self->mScriptEd->mErrorList->setCommentText(LLTrans::getString("SaveComplete"));
- // close the window if this completes both uploads
- self->getWindow()->decBusyCount();
- self->mPendingUploads--;
- if (self->mPendingUploads <= 0
- && self->mCloseAfterSave)
- {
- self->closeFloater();
- }
- }
- LLViewerObject* object = gObjectList.findObject(data->mSaveObjectID);
- if(object)
- {
- object->saveScript(data->mItem, data->mActive, false);
- dialog_refresh_all();
- //LLToolDragAndDrop::dropScript(object, ids->first,
- // LLAssetType::AT_LSL_TEXT, FALSE);
- }
- }
- else
- {
- LL_INFOS() << "Problem saving LSL Bytecode (Live Editor)" << LL_ENDL;
- LL_WARNS() << "Unable to save a compiled script." << LL_ENDL;
-
- LLSD args;
- args["REASON"] = std::string(LLAssetStorage::getErrorString(status));
- LLNotificationsUtil::add("CompileQueueSaveBytecode", args);
- }
-
- std::string filepath = gDirUtilp->getExpandedFilename(LL_PATH_CACHE,asset_uuid.asString());
- std::string dst_filename = llformat("%s.lso", filepath.c_str());
- LLFile::remove(dst_filename);
- delete data;
-}
-
BOOL LLLiveLSLEditor::canClose()
{
return (mScriptEd->canClose());