diff --git a/FIRESTORM-FEATURETABLE.txt b/FIRESTORM-FEATURETABLE.txt index 238eaf9a3b..fbbb9bd43d 100644 --- a/FIRESTORM-FEATURETABLE.txt +++ b/FIRESTORM-FEATURETABLE.txt @@ -49,4 +49,5 @@ QuickAdditionalInv LGPL UpdatedLibCURL Curl (MIT/X11) UpdatedWebKit LGPL Progress_screens LGPL -Prim_align_tool third party viewers (imprudence, Kirsten’s, etc, etc, etc) please feel free to include this code into yours. +Prim_align_tool third party viewers (imprudence, Kirsten's, etc, etc, etc) please feel free to include this code into yours. +Temp_Uploads LGPL (from Dolphin Viewer 2.4) \ No newline at end of file diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 6f2438dc20..e8cf7f9112 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -10313,6 +10313,17 @@ Value 0 + TemporaryUpload + + Comment + Temporary texture upload flag (volatile) + Persist + 0 + Type + Boolean + Value + 0 + TerrainColorHeightRange Comment diff --git a/indra/newview/llfloaterimagepreview.cpp b/indra/newview/llfloaterimagepreview.cpp index c7fbdd5745..cb7f794d03 100644 --- a/indra/newview/llfloaterimagepreview.cpp +++ b/indra/newview/llfloaterimagepreview.cpp @@ -51,6 +51,8 @@ #include "pipeline.h" #include "lluictrlfactory.h" #include "llviewertexturelist.h" +#include "llviewercontrol.h" +#include "lleconomy.h" #include "llstring.h" #include "llendianswizzle.h" @@ -115,6 +117,12 @@ BOOL LLFloaterImagePreview::postBuild() if (mRawImagep->getWidth() * mRawImagep->getHeight () <= LL_IMAGE_REZ_LOSSLESS_CUTOFF * LL_IMAGE_REZ_LOSSLESS_CUTOFF) getChildView("lossless_check")->setEnabled(TRUE); + + gSavedSettings.setBOOL("TemporaryUpload", FALSE); + if (LLGlobalEconomy::Singleton::getInstance()->getPriceUpload() == 0) + { + childHide("temp_check"); + } } else { diff --git a/indra/newview/llfloatersnapshot.cpp b/indra/newview/llfloatersnapshot.cpp index 1aba5ef92f..160a9441c9 100644 --- a/indra/newview/llfloatersnapshot.cpp +++ b/indra/newview/llfloatersnapshot.cpp @@ -83,8 +83,8 @@ ///---------------------------------------------------------------------------- /// Local function declarations, constants, enums, and typedefs ///---------------------------------------------------------------------------- -S32 LLFloaterSnapshot::sUIWinHeightLong = 530 ; -S32 LLFloaterSnapshot::sUIWinHeightShort = LLFloaterSnapshot::sUIWinHeightLong - 240 ; +S32 LLFloaterSnapshot::sUIWinHeightLong = 550 ; +S32 LLFloaterSnapshot::sUIWinHeightShort = LLFloaterSnapshot::sUIWinHeightLong - 260 ; S32 LLFloaterSnapshot::sUIWinWidth = 215 ; LLSnapshotFloaterView* gSnapshotFloaterView = NULL; @@ -1335,6 +1335,12 @@ void LLFloaterSnapshot::Impl::updateControls(LLFloaterSnapshot* floater) floater->getChildView("keep_aspect_check")->setEnabled(shot_type != LLSnapshotLivePreview::SNAPSHOT_TEXTURE && !floater->impl.mAspectRatioCheckOff); floater->getChildView("layer_types")->setEnabled(shot_type == LLSnapshotLivePreview::SNAPSHOT_LOCAL); + if (shot_type != LLSnapshotLivePreview::SNAPSHOT_TEXTURE) + { + floater->childSetValue("temp_check", false); + } + floater->childSetEnabled("temp_check", shot_type == LLSnapshotLivePreview::SNAPSHOT_TEXTURE); + BOOL is_advance = gSavedSettings.getBOOL("AdvanceSnapshot"); BOOL is_local = shot_type == LLSnapshotLivePreview::SNAPSHOT_LOCAL; BOOL show_slider = (shot_type == LLSnapshotLivePreview::SNAPSHOT_POSTCARD || @@ -1376,6 +1382,7 @@ void LLFloaterSnapshot::Impl::updateControls(LLFloaterSnapshot* floater) LLResMgr::getInstance()->getIntegerString(bytes_string, (previewp->getDataSize()) >> 10 ); } S32 upload_cost = LLGlobalEconomy::Singleton::getInstance()->getPriceUpload(); + floater->childSetVisible("temp_check", is_advance && upload_cost > 0); floater->getChild("texture")->setLabelArg("[AMOUNT]", llformat("%d",upload_cost)); floater->getChild("upload_btn")->setLabelArg("[AMOUNT]", llformat("%d",upload_cost)); floater->getChild("file_size_label")->setTextArg("[SIZE]", got_snap ? bytes_string : floater->getString("unknown")); @@ -2151,6 +2158,8 @@ BOOL LLFloaterSnapshot::postBuild() parent_view->addChild(previewp); parent_view->addChild(gSnapshotFloaterView); + gSavedSettings.setBOOL("TemporaryUpload", FALSE); + //move snapshot floater to special purpose snapshotfloaterview gFloaterView->removeChild(this); gSnapshotFloaterView->addChild(this); diff --git a/indra/newview/llviewermenufile.cpp b/indra/newview/llviewermenufile.cpp index 048691696b..11d3a3570d 100644 --- a/indra/newview/llviewermenufile.cpp +++ b/indra/newview/llviewermenufile.cpp @@ -896,6 +896,44 @@ void upload_done_callback(const LLUUID& uuid, void* user_data, S32 result, LLExt } } +void temp_upload_done_callback(const LLUUID& uuid, void* user_data, S32 result, LLExtStat ext_status) +{ + LLResourceData* data = (LLResourceData*)user_data; + if (result >= 0) + { + LLFolderType::EType dest_loc = (data->mPreferredLocation == LLFolderType::FT_NONE) ? LLFolderType::assetTypeToFolderType(data->mAssetInfo.mType) : data->mPreferredLocation; + LLUUID folder_id(gInventory.findCategoryUUIDForType(dest_loc)); + LLUUID item_id; + item_id.generate(); + LLPermissions perm; + perm.init(gAgentID, gAgentID, gAgentID, gAgentID); + perm.setMaskBase(PERM_ALL); + perm.setMaskOwner(PERM_ALL); + perm.setMaskEveryone(PERM_ALL); + perm.setMaskGroup(PERM_ALL); + LLPointer item = new LLViewerInventoryItem(item_id, folder_id, perm, + data->mAssetInfo.mTransactionID.makeAssetID(gAgent.getSecureSessionID()), + data->mAssetInfo.mType, data->mInventoryType, data->mAssetInfo.getName(), + "Temporary asset", LLSaleInfo::DEFAULT, LLInventoryItemFlags::II_FLAGS_NONE, + time_corrected()); + item->updateServer(TRUE); + gInventory.updateItem(item); + gInventory.notifyObservers(); + LLFloaterReg::showInstance("preview_texture", LLSD(item_id), TRUE); +// open_texture(item_id, std::string("Texture: ") + item->getName(), TRUE, LLUUID::null, FALSE); + } + else + { + LLSD args; + args["FILE"] = LLInventoryType::lookupHumanReadable(data->mInventoryType); + args["REASON"] = std::string(LLAssetStorage::getErrorString(result)); + LLNotificationsUtil::add("CannotUploadReason", args); + } + + LLUploadDialog::modalUploadFinished(); + delete data; +} + void upload_new_resource(const LLTransactionID &tid, LLAssetType::EType asset_type, std::string name, std::string desc, S32 compression_info, @@ -915,6 +953,7 @@ void upload_new_resource(const LLTransactionID &tid, LLAssetType::EType asset_ty } LLAssetID uuid = tid.makeAssetID(gAgent.getSecureSessionID()); + BOOL temp_upload = FALSE; if( LLAssetType::AT_SOUND == asset_type ) { @@ -924,6 +963,12 @@ void upload_new_resource(const LLTransactionID &tid, LLAssetType::EType asset_ty if( LLAssetType::AT_TEXTURE == asset_type ) { LLViewerStats::getInstance()->incStat(LLViewerStats::ST_UPLOAD_TEXTURE_COUNT ); + temp_upload = gSavedSettings.getBOOL("TemporaryUpload"); + if (temp_upload) + { + name = "[temp] " + name; + } + gSavedSettings.setBOOL("TemporaryUpload", FALSE); } else if( LLAssetType::AT_ANIMATION == asset_type) @@ -960,7 +1005,7 @@ void upload_new_resource(const LLTransactionID &tid, LLAssetType::EType asset_ty lldebugs << "Folder: " << gInventory.findCategoryUUIDForType((destination_folder_type == LLFolderType::FT_NONE) ? LLFolderType::assetTypeToFolderType(asset_type) : destination_folder_type) << llendl; lldebugs << "Asset Type: " << LLAssetType::lookup(asset_type) << llendl; std::string url = gAgent.getRegion()->getCapability("NewFileAgentInventory"); - if (!url.empty()) + if (!url.empty() && !temp_upload) { llinfos << "New Agent Inventory via capability" << llendl; LLSD body; @@ -982,6 +1027,8 @@ void upload_new_resource(const LLTransactionID &tid, LLAssetType::EType asset_ty } else { + if (!temp_upload) + { llinfos << "NewAgentInventory capability not found, new agent inventory via asset system." << llendl; // check for adequate funds // TODO: do this check on the sim @@ -1000,6 +1047,7 @@ void upload_new_resource(const LLTransactionID &tid, LLAssetType::EType asset_ty return; } } + } LLResourceData* data = new LLResourceData; data->mAssetInfo.mTransactionID = tid; @@ -1014,7 +1062,7 @@ void upload_new_resource(const LLTransactionID &tid, LLAssetType::EType asset_ty data->mAssetInfo.setDescription(desc); data->mPreferredLocation = destination_folder_type; - LLAssetStorage::LLStoreAssetCallback asset_callback = &upload_done_callback; + LLAssetStorage::LLStoreAssetCallback asset_callback = temp_upload ? &temp_upload_done_callback : &upload_done_callback; if (callback) { asset_callback = callback; @@ -1022,7 +1070,9 @@ void upload_new_resource(const LLTransactionID &tid, LLAssetType::EType asset_ty gAssetStorage->storeAssetData(data->mAssetInfo.mTransactionID, data->mAssetInfo.mType, asset_callback, (void*)data, - FALSE); + temp_upload, + TRUE, + temp_upload); } } diff --git a/indra/newview/llviewermenufile.h b/indra/newview/llviewermenufile.h index 56b9e19049..1e6d4a7108 100644 --- a/indra/newview/llviewermenufile.h +++ b/indra/newview/llviewermenufile.h @@ -30,6 +30,7 @@ #include "llfoldertype.h" #include "llassetstorage.h" #include "llinventorytype.h" +#include "llinventorydefines.h" class LLTransactionID; diff --git a/indra/newview/skins/default/xui/en/floater_image_preview.xml b/indra/newview/skins/default/xui/en/floater_image_preview.xml index 86232de1a4..e174221048 100644 --- a/indra/newview/skins/default/xui/en/floater_image_preview.xml +++ b/indra/newview/skins/default/xui/en/floater_image_preview.xml @@ -130,6 +130,11 @@ Try saving image as 24 bit Targa (.tga). name="lossless_check" top_pad="162" width="280" /> +