From 3e80fa3dbc943de9b784fedc202ba38cf238f46d Mon Sep 17 00:00:00 2001 From: David Parks Date: Mon, 2 Nov 2009 19:55:37 +0000 Subject: Sync up with render-pipeline-7 ignore-dead-branch --- indra/newview/llviewermenufile.cpp | 330 +++++++++++++++++++++++++++++-------- 1 file changed, 258 insertions(+), 72 deletions(-) (limited to 'indra/newview/llviewermenufile.cpp') diff --git a/indra/newview/llviewermenufile.cpp b/indra/newview/llviewermenufile.cpp index d3a9e1cef8..836ac79a87 100644 --- a/indra/newview/llviewermenufile.cpp +++ b/indra/newview/llviewermenufile.cpp @@ -39,6 +39,7 @@ #include "llfilepicker.h" #include "llfloaterreg.h" #include "llfloaterbuycurrency.h" +#include "llfloatermodelpreview.h" #include "llfloatersnapshot.h" #include "llinventorymodel.h" // gInventory #include "llresourcedata.h" @@ -62,6 +63,7 @@ #include "lleconomy.h" #include "llhttpclient.h" #include "llsdserialize.h" +#include "llsdutil.h" #include "llstring.h" #include "lltransactiontypes.h" #include "lluuid.h" @@ -101,6 +103,7 @@ static std::string XML_EXTENSIONS = "xml"; static std::string SLOBJECT_EXTENSIONS = "slobject"; #endif static std::string ALL_FILE_EXTENSIONS = "*.*"; +static std::string MODEL_EXTENSIONS = "dae"; std::string build_extensions_string(LLFilePicker::ELoadFilter filter) { @@ -115,6 +118,8 @@ std::string build_extensions_string(LLFilePicker::ELoadFilter filter) return ANIM_EXTENSIONS; case LLFilePicker::FFLOAD_SLOBJECT: return SLOBJECT_EXTENSIONS; + case LLFilePicker::FFLOAD_MODEL: + return MODEL_EXTENSIONS; #ifdef _CORY_TESTING case LLFilePicker::FFLOAD_GEOMETRY: return GEOMETRY_EXTENSIONS; @@ -258,6 +263,16 @@ class LLFileUploadImage : public view_listener_t } }; +class LLFileUploadModel : public view_listener_t +{ + bool handleEvent(const LLSD& userdata) + { + LLFloaterReg::showInstance("upload_model"); + + return TRUE; + } +}; + class LLFileUploadSound : public view_listener_t { bool handleEvent(const LLSD& userdata) @@ -319,10 +334,21 @@ class LLFileUploadBulk : public view_listener_t LLAssetStorage::LLStoreAssetCallback callback = NULL; S32 expected_upload_cost = LLGlobalEconomy::Singleton::getInstance()->getPriceUpload(); void *userdata = NULL; - upload_new_resource(filename, asset_name, asset_name, 0, LLAssetType::AT_NONE, LLInventoryType::IT_NONE, - LLFloaterPerms::getNextOwnerPerms(), LLFloaterPerms::getGroupPerms(), LLFloaterPerms::getEveryonePerms(), - display_name, - callback, expected_upload_cost, userdata); + + upload_new_resource( + filename, + asset_name, + asset_name, + 0, + LLAssetType::AT_NONE, + LLInventoryType::IT_NONE, + LLFloaterPerms::getNextOwnerPerms(), + LLFloaterPerms::getGroupPerms(), + LLFloaterPerms::getEveryonePerms(), + display_name, + callback, + expected_upload_cost, + userdata); // *NOTE: Ew, we don't iterate over the file list here, // we handle the next files in upload_done_callback() @@ -491,17 +517,20 @@ void handle_compress_image(void*) } } -void upload_new_resource(const std::string& src_filename, std::string name, - std::string desc, S32 compression_info, - LLAssetType::EType destination_folder_type, - LLInventoryType::EType inv_type, - U32 next_owner_perms, - U32 group_perms, - U32 everyone_perms, - const std::string& display_name, - LLAssetStorage::LLStoreAssetCallback callback, - S32 expected_upload_cost, - void *userdata) +void upload_new_resource( + const std::string& src_filename, + std::string name, + std::string desc, + S32 compression_info, + LLAssetType::EType destination_folder_type, + LLInventoryType::EType inv_type, + U32 next_owner_perms, + U32 group_perms, + U32 everyone_perms, + const std::string& display_name, + LLAssetStorage::LLStoreAssetCallback callback, + S32 expected_upload_cost, + void *userdata) { // Generate the temporary UUID. std::string filename = gDirUtilp->getTempFilename(); @@ -783,9 +812,21 @@ void upload_new_resource(const std::string& src_filename, std::string name, { t_disp_name = src_filename; } - upload_new_resource(tid, asset_type, name, desc, compression_info, // tid - destination_folder_type, inv_type, next_owner_perms, group_perms, everyone_perms, - display_name, callback, expected_upload_cost, userdata); + upload_new_resource( + tid, + asset_type, + name, + desc, + compression_info, // tid + destination_folder_type, + inv_type, + next_owner_perms, + group_perms, + everyone_perms, + display_name, + callback, + expected_upload_cost, + userdata); } else { @@ -801,7 +842,11 @@ void upload_new_resource(const std::string& src_filename, std::string name, } } -void upload_done_callback(const LLUUID& uuid, void* user_data, S32 result, LLExtStat ext_status) // StoreAssetData callback (fixed) +void upload_done_callback( + const LLUUID& uuid, + void* user_data, + S32 result, + LLExtStat ext_status) // StoreAssetData callback (fixed) { LLResourceData* data = (LLResourceData*)user_data; S32 expected_upload_cost = data ? data->mExpectedUploadCost : 0; @@ -902,71 +947,134 @@ void upload_done_callback(const LLUUID& uuid, void* user_data, S32 result, LLExt std::string display_name = LLStringUtil::null; LLAssetStorage::LLStoreAssetCallback callback = NULL; void *userdata = NULL; - upload_new_resource(next_file, asset_name, asset_name, // file - 0, LLAssetType::AT_NONE, LLInventoryType::IT_NONE, - PERM_NONE, PERM_NONE, PERM_NONE, - display_name, - callback, - expected_upload_cost, // assuming next in a group of uploads is of roughly the same type, i.e. same upload cost - userdata); + upload_new_resource( + next_file, + asset_name, + asset_name, // file + 0, + LLAssetType::AT_NONE, + LLInventoryType::IT_NONE, + PERM_NONE, + PERM_NONE, + PERM_NONE, + display_name, + callback, + expected_upload_cost, // assuming next in a group of uploads is of roughly the same type, i.e. same upload cost + userdata); } } -void upload_new_resource(const LLTransactionID &tid, LLAssetType::EType asset_type, - std::string name, - std::string desc, S32 compression_info, - LLAssetType::EType destination_folder_type, - LLInventoryType::EType inv_type, - U32 next_owner_perms, - U32 group_perms, - U32 everyone_perms, - const std::string& display_name, - LLAssetStorage::LLStoreAssetCallback callback, - S32 expected_upload_cost, - void *userdata) +LLAssetID upload_new_resource_prep( + const LLTransactionID &tid, + LLAssetType::EType asset_type, + LLInventoryType::EType& inventory_type, + std::string& name, + const std::string& display_name, + std::string& description) { - if(gDisconnected) + if ( gDisconnected ) { - return ; + LLAssetID rv; + + rv.setNull(); + return rv; } LLAssetID uuid = tid.makeAssetID(gAgent.getSecureSessionID()); - if( LLAssetType::AT_SOUND == asset_type ) + if ( LLAssetType::AT_SOUND == asset_type ) { - LLViewerStats::getInstance()->incStat(LLViewerStats::ST_UPLOAD_SOUND_COUNT ); + LLViewerStats::getInstance()->incStat( + LLViewerStats::ST_UPLOAD_SOUND_COUNT ); } - else - if( LLAssetType::AT_TEXTURE == asset_type ) + else if ( LLAssetType::AT_TEXTURE == asset_type ) { - LLViewerStats::getInstance()->incStat(LLViewerStats::ST_UPLOAD_TEXTURE_COUNT ); + LLViewerStats::getInstance()->incStat( + LLViewerStats::ST_UPLOAD_TEXTURE_COUNT ); } - else - if( LLAssetType::AT_ANIMATION == asset_type) + else if ( LLAssetType::AT_ANIMATION == asset_type ) { - LLViewerStats::getInstance()->incStat(LLViewerStats::ST_UPLOAD_ANIM_COUNT ); + LLViewerStats::getInstance()->incStat( + LLViewerStats::ST_UPLOAD_ANIM_COUNT ); } - if(LLInventoryType::IT_NONE == inv_type) + if ( LLInventoryType::IT_NONE == inventory_type ) { - inv_type = LLInventoryType::defaultForAssetType(asset_type); + inventory_type = LLInventoryType::defaultForAssetType(asset_type); } LLStringUtil::stripNonprintable(name); - LLStringUtil::stripNonprintable(desc); - if(name.empty()) + LLStringUtil::stripNonprintable(description); + + if ( name.empty() ) { name = "(No Name)"; } - if(desc.empty()) + if ( description.empty() ) { - desc = "(No Description)"; + description = "(No Description)"; } - + // At this point, we're ready for the upload. std::string upload_message = "Uploading...\n\n"; upload_message.append(display_name); LLUploadDialog::modalUploadDialog(upload_message); + return uuid; +} + +LLSD generate_new_resource_upload_capability_body( + LLAssetType::EType asset_type, + const std::string& name, + const std::string& desc, + LLAssetType::EType destination_folder_type, + LLInventoryType::EType inv_type, + U32 next_owner_perms, + U32 group_perms, + U32 everyone_perms) +{ + LLSD body; + + body["folder_id"] = gInventory.findCategoryUUIDForType( + (destination_folder_type == LLAssetType::AT_NONE) ? + asset_type : + destination_folder_type); + + body["asset_type"] = LLAssetType::lookup(asset_type); + body["inventory_type"] = LLInventoryType::lookup(inv_type); + body["name"] = name; + body["description"] = desc; + body["next_owner_mask"] = LLSD::Integer(next_owner_perms); + body["group_mask"] = LLSD::Integer(group_perms); + body["everyone_mask"] = LLSD::Integer(everyone_perms); + + return body; +} + +void upload_new_resource( + const LLTransactionID &tid, + LLAssetType::EType asset_type, + std::string name, + std::string desc, + S32 compression_info, + LLAssetType::EType destination_folder_type, + LLInventoryType::EType inv_type, + U32 next_owner_perms, + U32 group_perms, + U32 everyone_perms, + const std::string& display_name, + LLAssetStorage::LLStoreAssetCallback callback, + S32 expected_upload_cost, + void *userdata) +{ + LLAssetID uuid = + upload_new_resource_prep( + tid, + asset_type, + inv_type, + name, + display_name, + desc); + llinfos << "*** Uploading: " << llendl; llinfos << "Type: " << LLAssetType::lookup(asset_type) << llendl; llinfos << "UUID: " << uuid << llendl; @@ -975,26 +1083,32 @@ void upload_new_resource(const LLTransactionID &tid, LLAssetType::EType asset_ty llinfos << "Expected Upload Cost: " << expected_upload_cost << llendl; lldebugs << "Folder: " << gInventory.findCategoryUUIDForType((destination_folder_type == LLAssetType::AT_NONE) ? asset_type : destination_folder_type) << llendl; lldebugs << "Asset Type: " << LLAssetType::lookup(asset_type) << llendl; - std::string url = gAgent.getRegion()->getCapability("NewFileAgentInventory"); - if (!url.empty()) + + std::string url = gAgent.getRegion()->getCapability( + "NewFileAgentInventory"); + + if ( !url.empty() ) { llinfos << "New Agent Inventory via capability" << llendl; - LLSD body; - body["folder_id"] = gInventory.findCategoryUUIDForType((destination_folder_type == LLAssetType::AT_NONE) ? asset_type : destination_folder_type); - body["asset_type"] = LLAssetType::lookup(asset_type); - body["inventory_type"] = LLInventoryType::lookup(inv_type); - body["name"] = name; - body["description"] = desc; - body["next_owner_mask"] = LLSD::Integer(next_owner_perms); - body["group_mask"] = LLSD::Integer(group_perms); - body["everyone_mask"] = LLSD::Integer(everyone_perms); - body["expected_upload_cost"] = LLSD::Integer(expected_upload_cost); - - //std::ostringstream llsdxml; - //LLSDSerialize::toPrettyXML(body, llsdxml); - //llinfos << "posting body to capability: " << llsdxml.str() << llendl; - LLHTTPClient::post(url, body, new LLNewAgentInventoryResponder(body, uuid, asset_type)); + LLSD body; + body = generate_new_resource_upload_capability_body( + asset_type, + name, + desc, + destination_folder_type, + inv_type, + next_owner_perms, + group_perms, + everyone_perms); + + LLHTTPClient::post( + url, + body, + new LLNewAgentInventoryResponder( + body, + uuid, + asset_type)); } else { @@ -1039,11 +1153,83 @@ void upload_new_resource(const LLTransactionID &tid, LLAssetType::EType asset_ty } } +BOOL upload_new_variable_cost_resource( + const LLTransactionID &tid, + LLAssetType::EType asset_type, + std::string name, + std::string desc, + S32 compression_info, + LLAssetType::EType destination_folder_type, + LLInventoryType::EType inv_type, + U32 next_owner_perms, + U32 group_perms, + U32 everyone_perms, + const std::string& display_name, + LLAssetStorage::LLStoreAssetCallback callback, + void *userdata) +{ + LLAssetID uuid = + upload_new_resource_prep( + tid, + asset_type, + inv_type, + name, + display_name, + desc); + + llinfos << "*** Uploading: " << llendl; + llinfos << "Type: " << LLAssetType::lookup(asset_type) << llendl; + llinfos << "UUID: " << uuid << llendl; + llinfos << "Name: " << name << llendl; + llinfos << "Desc: " << desc << llendl; + lldebugs << "Folder: " + << gInventory.findCategoryUUIDForType((destination_folder_type == LLAssetType::AT_NONE) ? asset_type : destination_folder_type) << llendl; + lldebugs << "Asset Type: " << LLAssetType::lookup(asset_type) << llendl; + + std::string url = gAgent.getRegion()->getCapability( + "NewFileAgentInventoryVariablePrice"); + + if ( !url.empty() ) + { + llinfos << "New Agent Inventory variable price upload" + << llendl; + + // Each of the two capabilities has similar data, so + // let's reuse that code + + LLSD body; + + body = generate_new_resource_upload_capability_body( + asset_type, + name, + desc, + destination_folder_type, + inv_type, + next_owner_perms, + group_perms, + everyone_perms); + + LLHTTPClient::post( + url, + body, + new LLNewAgentInventoryVariablePriceResponder( + uuid, + body)); + + return TRUE; + } + else + { + return FALSE; + } +} + void init_menu_file() { view_listener_t::addCommit(new LLFileUploadImage(), "File.UploadImage"); view_listener_t::addCommit(new LLFileUploadSound(), "File.UploadSound"); view_listener_t::addCommit(new LLFileUploadAnim(), "File.UploadAnim"); + view_listener_t::addCommit(new LLFileUploadModel(), "File.UploadModel"); view_listener_t::addCommit(new LLFileUploadBulk(), "File.UploadBulk"); view_listener_t::addCommit(new LLFileCloseWindow(), "File.CloseWindow"); view_listener_t::addCommit(new LLFileCloseAllWindows(), "File.CloseAllWindows"); -- cgit v1.2.3 From 9c3595465972ba4be916e871f6b0a62cc0c13d4a Mon Sep 17 00:00:00 2001 From: Jon Wolk Date: Tue, 3 Nov 2009 19:36:39 +0000 Subject: Changed variable price upload responders to reflect server changes. I hope this gets pulled into the hg repository --- indra/newview/llviewermenufile.cpp | 138 ++++++++++++++++++++++--------------- 1 file changed, 84 insertions(+), 54 deletions(-) (limited to 'indra/newview/llviewermenufile.cpp') diff --git a/indra/newview/llviewermenufile.cpp b/indra/newview/llviewermenufile.cpp index 836ac79a87..7b9494c02a 100644 --- a/indra/newview/llviewermenufile.cpp +++ b/indra/newview/llviewermenufile.cpp @@ -964,60 +964,24 @@ void upload_done_callback( } } -LLAssetID upload_new_resource_prep( - const LLTransactionID &tid, +static LLAssetID upload_new_resource_prep( + const LLTransactionID& tid, LLAssetType::EType asset_type, LLInventoryType::EType& inventory_type, std::string& name, const std::string& display_name, std::string& description) { - if ( gDisconnected ) - { - LLAssetID rv; + LLAssetID uuid = generate_asset_id_for_new_upload(tid); - rv.setNull(); - return rv; - } + increase_new_upload_stats(asset_type); - LLAssetID uuid = tid.makeAssetID(gAgent.getSecureSessionID()); - - if ( LLAssetType::AT_SOUND == asset_type ) - { - LLViewerStats::getInstance()->incStat( - LLViewerStats::ST_UPLOAD_SOUND_COUNT ); - } - else if ( LLAssetType::AT_TEXTURE == asset_type ) - { - LLViewerStats::getInstance()->incStat( - LLViewerStats::ST_UPLOAD_TEXTURE_COUNT ); - } - else if ( LLAssetType::AT_ANIMATION == asset_type ) - { - LLViewerStats::getInstance()->incStat( - LLViewerStats::ST_UPLOAD_ANIM_COUNT ); - } - - if ( LLInventoryType::IT_NONE == inventory_type ) - { - inventory_type = LLInventoryType::defaultForAssetType(asset_type); - } - LLStringUtil::stripNonprintable(name); - LLStringUtil::stripNonprintable(description); - - if ( name.empty() ) - { - name = "(No Name)"; - } - if ( description.empty() ) - { - description = "(No Description)"; - } - - // At this point, we're ready for the upload. - std::string upload_message = "Uploading...\n\n"; - upload_message.append(display_name); - LLUploadDialog::modalUploadDialog(upload_message); + assign_defaults_and_show_upload_message( + asset_type, + inventory_type, + name, + display_name, + description); return uuid; } @@ -1146,27 +1110,27 @@ void upload_new_resource( { asset_callback = callback; } - gAssetStorage->storeAssetData(data->mAssetInfo.mTransactionID, data->mAssetInfo.mType, - asset_callback, - (void*)data, - FALSE); + gAssetStorage->storeAssetData( + data->mAssetInfo.mTransactionID, + data->mAssetInfo.mType, + asset_callback, + (void*)data, + FALSE); } } -BOOL upload_new_variable_cost_resource( +BOOL upload_new_variable_price_resource( const LLTransactionID &tid, LLAssetType::EType asset_type, std::string name, std::string desc, - S32 compression_info, LLAssetType::EType destination_folder_type, LLInventoryType::EType inv_type, U32 next_owner_perms, U32 group_perms, U32 everyone_perms, const std::string& display_name, - LLAssetStorage::LLStoreAssetCallback callback, - void *userdata) + const LLSD& asset_resources) { LLAssetID uuid = upload_new_resource_prep( @@ -1209,6 +1173,8 @@ BOOL upload_new_variable_cost_resource( group_perms, everyone_perms); + body["asset_resources"] = asset_resources; + LLHTTPClient::post( url, body, @@ -1224,6 +1190,70 @@ BOOL upload_new_variable_cost_resource( } } +LLAssetID generate_asset_id_for_new_upload(const LLTransactionID& tid) +{ + if ( gDisconnected ) + { + LLAssetID rv; + + rv.setNull(); + return rv; + } + + LLAssetID uuid = tid.makeAssetID(gAgent.getSecureSessionID()); + + return uuid; +} + +void increase_new_upload_stats(LLAssetType::EType asset_type) +{ + if ( LLAssetType::AT_SOUND == asset_type ) + { + LLViewerStats::getInstance()->incStat( + LLViewerStats::ST_UPLOAD_SOUND_COUNT ); + } + else if ( LLAssetType::AT_TEXTURE == asset_type ) + { + LLViewerStats::getInstance()->incStat( + LLViewerStats::ST_UPLOAD_TEXTURE_COUNT ); + } + else if ( LLAssetType::AT_ANIMATION == asset_type ) + { + LLViewerStats::getInstance()->incStat( + LLViewerStats::ST_UPLOAD_ANIM_COUNT ); + } +} + +void assign_defaults_and_show_upload_message( + LLAssetType::EType asset_type, + LLInventoryType::EType& inventory_type, + std::string& name, + const std::string& display_name, + std::string& description) +{ + if ( LLInventoryType::IT_NONE == inventory_type ) + { + inventory_type = LLInventoryType::defaultForAssetType(asset_type); + } + LLStringUtil::stripNonprintable(name); + LLStringUtil::stripNonprintable(description); + + if ( name.empty() ) + { + name = "(No Name)"; + } + if ( description.empty() ) + { + description = "(No Description)"; + } + + // At this point, we're ready for the upload. + std::string upload_message = "Uploading...\n\n"; + upload_message.append(display_name); + LLUploadDialog::modalUploadDialog(upload_message); +} + + void init_menu_file() { view_listener_t::addCommit(new LLFileUploadImage(), "File.UploadImage"); -- cgit v1.2.3 From 7fa698252060a72be6b5ebc52f0ff01bcea6134c Mon Sep 17 00:00:00 2001 From: "Karl Stiefvater (qarl)" Date: Mon, 9 Nov 2009 17:57:21 -0600 Subject: super importer stuff (gui, texture upload, etc.) --- indra/newview/llviewermenufile.cpp | 41 +++++++++++++++++++++++++++----------- 1 file changed, 29 insertions(+), 12 deletions(-) (limited to 'indra/newview/llviewermenufile.cpp') diff --git a/indra/newview/llviewermenufile.cpp b/indra/newview/llviewermenufile.cpp index 7b9494c02a..53067c5c93 100644 --- a/indra/newview/llviewermenufile.cpp +++ b/indra/newview/llviewermenufile.cpp @@ -39,6 +39,7 @@ #include "llfilepicker.h" #include "llfloaterreg.h" #include "llfloaterbuycurrency.h" +#include "llfloaterimportcollada.h" #include "llfloatermodelpreview.h" #include "llfloatersnapshot.h" #include "llinventorymodel.h" // gInventory @@ -56,7 +57,7 @@ #include "llappviewer.h" #include "lluploaddialog.h" #include "lltrans.h" - +#include "llfloaterimportcollada.h" // linden libraries #include "llassetuploadresponders.h" @@ -263,6 +264,19 @@ class LLFileUploadImage : public view_listener_t } }; +class LLFileUploadScene : public view_listener_t +{ + bool handleEvent(const LLSD& userdata) + { + std::string filename = upload_pick((void *)LLFilePicker::FFLOAD_COLLADA); + if (!filename.empty()) + { + LLImportCollada::getInstance()->importFile(filename); + } + return TRUE; + } +}; + class LLFileUploadModel : public view_listener_t { bool handleEvent(const LLSD& userdata) @@ -517,7 +531,7 @@ void handle_compress_image(void*) } } -void upload_new_resource( +LLUUID upload_new_resource( const std::string& src_filename, std::string name, std::string desc, @@ -555,7 +569,7 @@ void upload_new_resource( short_name.c_str()); args["FILE"] = short_name; upload_error(error_message, "NofileExtension", filename, args); - return; + return LLUUID(); } else if( exten == "bmp") { @@ -569,7 +583,7 @@ void upload_new_resource( args["FILE"] = src_filename; args["ERROR"] = LLImage::getLastError(); upload_error(error_message, "ProblemWithFile", filename, args); - return; + return LLUUID(); } } else if( exten == "tga") @@ -584,7 +598,7 @@ void upload_new_resource( args["FILE"] = src_filename; args["ERROR"] = LLImage::getLastError(); upload_error(error_message, "ProblemWithFile", filename, args); - return; + return LLUUID(); } } else if( exten == "jpg" || exten == "jpeg") @@ -599,7 +613,7 @@ void upload_new_resource( args["FILE"] = src_filename; args["ERROR"] = LLImage::getLastError(); upload_error(error_message, "ProblemWithFile", filename, args); - return; + return LLUUID(); } } else if( exten == "png") @@ -614,7 +628,7 @@ void upload_new_resource( args["FILE"] = src_filename; args["ERROR"] = LLImage::getLastError(); upload_error(error_message, "ProblemWithFile", filename, args); - return; + return LLUUID(); } } else if(exten == "wav") @@ -642,7 +656,7 @@ void upload_new_resource( upload_error(error_message, "UnknownVorbisEncodeFailure", filename, args); break; } - return; + return LLUUID(); } } else if(exten == "tmp") @@ -682,7 +696,7 @@ void upload_new_resource( error_message = llformat("corrupt resource file: %s", src_filename.c_str()); args["FILE"] = src_filename; upload_error(error_message, "CorruptResourceFile", filename, args); - return; + return LLUUID(); } if (2 == tokens_read) @@ -710,7 +724,7 @@ void upload_new_resource( error_message = llformat("unknown linden resource file version in file: %s", src_filename.c_str()); args["FILE"] = src_filename; upload_error(error_message, "UnknownResourceFileVersion", filename, args); - return; + return LLUUID(); } } else @@ -752,7 +766,7 @@ void upload_new_resource( error_message = llformat( "Unable to create output file: %s", filename.c_str()); args["FILE"] = filename; upload_error(error_message, "UnableToCreateOutputFile", filename, args); - return; + return LLUUID(); } fclose(in); @@ -766,7 +780,7 @@ void upload_new_resource( { error_message = llformat("We do not currently support bulk upload of animation files\n"); upload_error(error_message, "DoNotSupportBulkAnimationUpload", filename, args); - return; + return LLUUID(); } else { @@ -840,6 +854,8 @@ void upload_new_resource( } LLFilePicker::instance().reset(); } + + return uuid; } void upload_done_callback( @@ -1260,6 +1276,7 @@ void init_menu_file() view_listener_t::addCommit(new LLFileUploadSound(), "File.UploadSound"); view_listener_t::addCommit(new LLFileUploadAnim(), "File.UploadAnim"); view_listener_t::addCommit(new LLFileUploadModel(), "File.UploadModel"); + view_listener_t::addCommit(new LLFileUploadScene(), "File.UploadScene"); view_listener_t::addCommit(new LLFileUploadBulk(), "File.UploadBulk"); view_listener_t::addCommit(new LLFileCloseWindow(), "File.CloseWindow"); view_listener_t::addCommit(new LLFileCloseAllWindows(), "File.CloseAllWindows"); -- cgit v1.2.3 From 596d3cfb6018789e3ffca5bf3ae9fa4e1e8a707a Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Thu, 12 Nov 2009 13:23:48 -0600 Subject: CTS-15 Force loading of high LOD when opening model import floater. CTS-9 Auto-fill description field with --- indra/newview/llviewermenufile.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'indra/newview/llviewermenufile.cpp') diff --git a/indra/newview/llviewermenufile.cpp b/indra/newview/llviewermenufile.cpp index 505d2afb69..2ce37612b2 100644 --- a/indra/newview/llviewermenufile.cpp +++ b/indra/newview/llviewermenufile.cpp @@ -281,7 +281,11 @@ class LLFileUploadModel : public view_listener_t { bool handleEvent(const LLSD& userdata) { - LLFloaterReg::showInstance("upload_model"); + LLFloaterModelPreview* fmp = (LLFloaterModelPreview*) LLFloaterReg::showInstance("upload_model"); + if (fmp) + { + fmp->loadModel(3); + } return TRUE; } -- cgit v1.2.3 From 1f71cd20e831983aa5f4682958a3619b9f37a6f1 Mon Sep 17 00:00:00 2001 From: "Jonathan@Chomp.lindenlab.com" Date: Wed, 18 Nov 2009 11:38:31 -0800 Subject: Fixed variable price upload path. --- indra/newview/llviewermenufile.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'indra/newview/llviewermenufile.cpp') diff --git a/indra/newview/llviewermenufile.cpp b/indra/newview/llviewermenufile.cpp index 8b101748a3..2c0a41e1ff 100644 --- a/indra/newview/llviewermenufile.cpp +++ b/indra/newview/llviewermenufile.cpp @@ -1175,9 +1175,9 @@ BOOL upload_new_variable_price_resource( if ( !url.empty() ) { - llinfos << "New Agent Inventory variable price upload" - << llendl; - + lldebugs + << "New Agent Inventory variable price upload" << llendl; + // Each of the two capabilities has similar data, so // let's reuse that code @@ -1200,6 +1200,7 @@ BOOL upload_new_variable_price_resource( body, new LLNewAgentInventoryVariablePriceResponder( uuid, + asset_type, body)); return TRUE; -- cgit v1.2.3 From 078278bf51b50ded63d5f7c4a9d99146f72aba69 Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Wed, 6 Jan 2010 15:02:43 -0600 Subject: LLImportCollada no longer a singleton to prepare for subclassing. --- indra/newview/llviewermenufile.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'indra/newview/llviewermenufile.cpp') diff --git a/indra/newview/llviewermenufile.cpp b/indra/newview/llviewermenufile.cpp index de6fcbd8bc..47f9031ac2 100644 --- a/indra/newview/llviewermenufile.cpp +++ b/indra/newview/llviewermenufile.cpp @@ -272,7 +272,10 @@ class LLFileUploadScene : public view_listener_t std::string filename = upload_pick((void *)LLFilePicker::FFLOAD_COLLADA); if (!filename.empty()) { - LLImportCollada::getInstance()->importFile(filename); + LLFloaterReg::showInstance("import_collada"); + LLFloaterImportCollada* floater = LLFloaterReg::findTypedInstance("import_collada"); + floater->enableOK(TRUE); + floater->importFile(filename); } return TRUE; } @@ -1080,7 +1083,8 @@ void upload_new_resource( new LLNewAgentInventoryResponder( body, uuid, - asset_type)); + asset_type, + (LLImportCollada*) userdata)); } else { -- cgit v1.2.3 From 3972ae18d195549968e21c3b744cc3a917679358 Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Thu, 7 Jan 2010 08:49:34 -0600 Subject: Backed out changeset: 0e0f8b0b0fa8 --- indra/newview/llviewermenufile.cpp | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'indra/newview/llviewermenufile.cpp') diff --git a/indra/newview/llviewermenufile.cpp b/indra/newview/llviewermenufile.cpp index 47f9031ac2..de6fcbd8bc 100644 --- a/indra/newview/llviewermenufile.cpp +++ b/indra/newview/llviewermenufile.cpp @@ -272,10 +272,7 @@ class LLFileUploadScene : public view_listener_t std::string filename = upload_pick((void *)LLFilePicker::FFLOAD_COLLADA); if (!filename.empty()) { - LLFloaterReg::showInstance("import_collada"); - LLFloaterImportCollada* floater = LLFloaterReg::findTypedInstance("import_collada"); - floater->enableOK(TRUE); - floater->importFile(filename); + LLImportCollada::getInstance()->importFile(filename); } return TRUE; } @@ -1083,8 +1080,7 @@ void upload_new_resource( new LLNewAgentInventoryResponder( body, uuid, - asset_type, - (LLImportCollada*) userdata)); + asset_type)); } else { -- cgit v1.2.3 From b414b5067e3e47da7d9baf490d94534b4c65a8eb Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Sun, 28 Feb 2010 16:40:30 -0600 Subject: Remove some dead code. Add LH transform to LLVector3 Add DebugShowUploadCost Make LOD generation on model preview less finnicky. Remove error level based LOD generation. Better framing of model before upload. Better error handling for model uploader. Remove [COST] argument from model upload menu item. Remove L$ check from model upload menu item being enabled. --- indra/newview/llviewermenufile.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'indra/newview/llviewermenufile.cpp') diff --git a/indra/newview/llviewermenufile.cpp b/indra/newview/llviewermenufile.cpp index 0f26975149..53688f1210 100644 --- a/indra/newview/llviewermenufile.cpp +++ b/indra/newview/llviewermenufile.cpp @@ -92,6 +92,15 @@ class LLFileEnableUpload : public view_listener_t } }; +class LLFileEnableUploadModel : public view_listener_t +{ + bool handleEvent(const LLSD& userdata) + { + bool new_value = gAgent.getRegion() && !gAgent.getRegion()->getCapability("NewFileAgentInventoryVariablePrice").empty(); + return new_value; + } +}; + //============================================================================ #if LL_WINDOWS @@ -1283,6 +1292,7 @@ void init_menu_file() view_listener_t::addCommit(new LLFileQuit(), "File.Quit"); view_listener_t::addEnable(new LLFileEnableUpload(), "File.EnableUpload"); + view_listener_t::addEnable(new LLFileEnableUploadModel(), "File.EnableUploadModel"); // "File.SaveTexture" moved to llpanelmaininventory so that it can be properly handled. } -- cgit v1.2.3 From dc01f8db212a09c9745e72e7f01c61ba648b3355 Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Mon, 1 Mar 2010 19:36:10 -0600 Subject: "Model..." upload button always enabled now. Default fast alpha to on. --- indra/newview/llviewermenufile.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'indra/newview/llviewermenufile.cpp') diff --git a/indra/newview/llviewermenufile.cpp b/indra/newview/llviewermenufile.cpp index 53688f1210..e260220493 100644 --- a/indra/newview/llviewermenufile.cpp +++ b/indra/newview/llviewermenufile.cpp @@ -96,8 +96,7 @@ class LLFileEnableUploadModel : public view_listener_t { bool handleEvent(const LLSD& userdata) { - bool new_value = gAgent.getRegion() && !gAgent.getRegion()->getCapability("NewFileAgentInventoryVariablePrice").empty(); - return new_value; + return true; } }; -- cgit v1.2.3 From 38334e22e3dbbf7ddc735e8f64a8dc39691d1701 Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Mon, 8 Mar 2010 21:33:19 -0600 Subject: Multi-threaded file dialog --- indra/newview/llviewermenufile.cpp | 53 +++++++++++++++++++++++++++++++++++++- 1 file changed, 52 insertions(+), 1 deletion(-) (limited to 'indra/newview/llviewermenufile.cpp') diff --git a/indra/newview/llviewermenufile.cpp b/indra/newview/llviewermenufile.cpp index e260220493..8b53751275 100644 --- a/indra/newview/llviewermenufile.cpp +++ b/indra/newview/llviewermenufile.cpp @@ -100,6 +100,57 @@ class LLFileEnableUploadModel : public view_listener_t } }; +LLMutex* LLFilePickerThread::sMutex = NULL; +std::queue LLFilePickerThread::sDeadQ; + +//virtual +void LLFilePickerThread::run() +{ + LLFilePicker picker; + if (picker.getOpenFile(mFilter, FALSE)) + { + mFile = picker.getFirstFile(); + } + + { + LLMutexLock lock(sMutex); + sDeadQ.push(this); + } + +} + +//static +void LLFilePickerThread::initClass() +{ + sMutex = new LLMutex(NULL); +} + +//static +void LLFilePickerThread::cleanupClass() +{ + clearDead(); + + delete sMutex; + sMutex = NULL; +} + +//static +void LLFilePickerThread::clearDead() +{ + if (!sDeadQ.empty()) + { + LLMutexLock lock(sMutex); + while (!sDeadQ.empty()) + { + LLFilePickerThread* thread = sDeadQ.front(); + thread->notify(thread->mFile); + delete thread; + sDeadQ.pop(); + } + } +} + + //============================================================================ #if LL_WINDOWS @@ -290,7 +341,7 @@ class LLFileUploadModel : public view_listener_t { bool handleEvent(const LLSD& userdata) { - LLFloaterModelPreview* fmp = (LLFloaterModelPreview*) LLFloaterReg::showInstance("upload_model"); + LLFloaterModelPreview* fmp = (LLFloaterModelPreview*) LLFloaterReg::getInstance("upload_model"); if (fmp) { fmp->loadModel(3); -- cgit v1.2.3 From b26d5803468c029bba735acf2ae57ea50b542dee Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Mon, 8 Mar 2010 21:50:24 -0600 Subject: little bool --- indra/newview/llviewermenufile.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview/llviewermenufile.cpp') diff --git a/indra/newview/llviewermenufile.cpp b/indra/newview/llviewermenufile.cpp index 8b53751275..b22a74080f 100644 --- a/indra/newview/llviewermenufile.cpp +++ b/indra/newview/llviewermenufile.cpp @@ -107,7 +107,7 @@ std::queue LLFilePickerThread::sDeadQ; void LLFilePickerThread::run() { LLFilePicker picker; - if (picker.getOpenFile(mFilter, FALSE)) + if (picker.getOpenFile(mFilter, false)) { mFile = picker.getFirstFile(); } -- cgit v1.2.3 From 294e7036e48b7efc17b2d48ebc050045bb0c5d14 Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Fri, 12 Mar 2010 17:24:57 -0600 Subject: Fix for file dialog crashing on mac and linux when uploading meshes. --- indra/newview/llviewermenufile.cpp | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'indra/newview/llviewermenufile.cpp') diff --git a/indra/newview/llviewermenufile.cpp b/indra/newview/llviewermenufile.cpp index b22a74080f..1026ff86a5 100644 --- a/indra/newview/llviewermenufile.cpp +++ b/indra/newview/llviewermenufile.cpp @@ -103,15 +103,31 @@ class LLFileEnableUploadModel : public view_listener_t LLMutex* LLFilePickerThread::sMutex = NULL; std::queue LLFilePickerThread::sDeadQ; +void LLFilePickerThread::getFile() +{ +#if LL_WINDOWS + start(); +#else + run(); +#endif +} + //virtual void LLFilePickerThread::run() { LLFilePicker picker; +#if LL_WINDOWS if (picker.getOpenFile(mFilter, false)) { mFile = picker.getFirstFile(); } - +#else + if (picker.getOpenFile(mFilter, true)) + { + mFile = picker.getFirstFile(); + } +#endif + { LLMutexLock lock(sMutex); sDeadQ.push(this); -- cgit v1.2.3