diff options
Diffstat (limited to 'indra/newview/llviewermenufile.cpp')
-rwxr-xr-x | indra/newview/llviewermenufile.cpp | 94 |
1 files changed, 47 insertions, 47 deletions
diff --git a/indra/newview/llviewermenufile.cpp b/indra/newview/llviewermenufile.cpp index be78603e2d..80f47ecab2 100755 --- a/indra/newview/llviewermenufile.cpp +++ b/indra/newview/llviewermenufile.cpp @@ -215,7 +215,8 @@ std::string build_extensions_string(LLFilePicker::ELoadFilter filter) #endif case LLFilePicker::FFLOAD_XML: return XML_EXTENSIONS; - case LLFilePicker::FFLOAD_ALL: + case LLFilePicker::FFLOAD_ALL: + case LLFilePicker::FFLOAD_EXE: return ALL_FILE_EXTENSIONS; #endif default: @@ -253,7 +254,7 @@ const std::string upload_pick(void* data) LLFilePicker& picker = LLFilePicker::instance(); if (!picker.getOpenFile(type)) { - llinfos << "Couldn't import objects from file" << llendl; + LL_INFOS() << "Couldn't import objects from file" << LL_ENDL; return std::string(); } @@ -327,7 +328,7 @@ const std::string upload_pick(void* data) std::string error_msg; if (check_for_invalid_wav_formats(filename,error_msg)) { - llinfos << error_msg << ": " << filename << llendl; + LL_INFOS() << error_msg << ": " << filename << LL_ENDL; LLSD args; args["FILE"] = filename; LLNotificationsUtil::add( error_msg, args ); @@ -442,9 +443,9 @@ class LLFileUploadBulk : public view_listener_t 0, LLFolderType::FT_NONE, LLInventoryType::IT_NONE, - LLFloaterPerms::getNextOwnerPerms(), - LLFloaterPerms::getGroupPerms(), - LLFloaterPerms::getEveryonePerms(), + LLFloaterPerms::getNextOwnerPerms("Uploads"), + LLFloaterPerms::getGroupPerms("Uploads"), + LLFloaterPerms::getEveryonePerms("Uploads"), display_name, callback, expected_upload_cost, @@ -455,7 +456,7 @@ class LLFileUploadBulk : public view_listener_t } else { - llinfos << "Couldn't import objects from file" << llendl; + LL_INFOS() << "Couldn't import objects from file" << LL_ENDL; } return true; } @@ -463,11 +464,11 @@ class LLFileUploadBulk : public view_listener_t void upload_error(const std::string& error_message, const std::string& label, const std::string& filename, const LLSD& args) { - llwarns << error_message << llendl; + LL_WARNS() << error_message << LL_ENDL; LLNotificationsUtil::add(label, args); if(LLFile::remove(filename) == -1) { - lldebugs << "unable to remove temp file" << llendl; + LL_DEBUGS() << "unable to remove temp file" << LL_ENDL; } LLFilePicker::instance().reset(); } @@ -494,7 +495,9 @@ class LLFileEnableCloseAllWindows : public view_listener_t { bool handleEvent(const LLSD& userdata) { - bool open_children = gFloaterView->allChildrenClosed() && !LLFloaterSnapshot::getInstance()->isInVisibleChain(); + LLFloaterSnapshot* floater_snapshot = LLFloaterSnapshot::findInstance(); + bool is_floater_snapshot_opened = floater_snapshot && floater_snapshot->isInVisibleChain(); + bool open_children = gFloaterView->allChildrenClosed() && !is_floater_snapshot_opened; return !open_children; } }; @@ -542,7 +545,7 @@ class LLFileTakeSnapshotToDisk : public view_listener_t formatted = new LLImageJPEG(gSavedSettings.getS32("SnapshotQuality")); break; default: - llwarns << "Unknown local snapshot format: " << fmt << llendl; + LL_WARNS() << "Unknown local snapshot format: " << fmt << LL_ENDL; case LLFloaterSnapshot::SNAPSHOT_FORMAT_PNG: formatted = new LLImagePNG; break; @@ -579,8 +582,8 @@ void handle_compress_image(void*) { std::string outfile = infile + ".j2c"; - llinfos << "Input: " << infile << llendl; - llinfos << "Output: " << outfile << llendl; + LL_INFOS() << "Input: " << infile << LL_ENDL; + LL_INFOS() << "Output: " << outfile << LL_ENDL; BOOL success; @@ -588,11 +591,11 @@ void handle_compress_image(void*) if (success) { - llinfos << "Compression complete" << llendl; + LL_INFOS() << "Compression complete" << LL_ENDL; } else { - llinfos << "Compression failed: " << LLImage::getLastError() << llendl; + LL_INFOS() << "Compression failed: " << LLImage::getLastError() << LL_ENDL; } infile = picker.getNextFile(); @@ -660,7 +663,7 @@ LLUUID upload_new_resource( asset_type = LLAssetType::AT_SOUND; // tag it as audio S32 encode_result = 0; - llinfos << "Attempting to encode wav as an ogg file" << llendl; + LL_INFOS() << "Attempting to encode wav as an ogg file" << LL_ENDL; encode_result = encode_vorbis_file(src_filename, filename); @@ -711,8 +714,8 @@ LLUUID upload_new_resource( "%254s %254s\n", label, value); - llinfos << "got: " << label << " = " << value - << llendl; + LL_INFOS() << "got: " << label << " = " << value + << LL_ENDL; if (EOF == tokens_read) { @@ -765,7 +768,7 @@ LLUUID upload_new_resource( // read in and throw out most of the header except for the type if (fread(buf, header_size, 1, in) != 1) { - llwarns << "Short read" << llendl; + LL_WARNS() << "Short read" << LL_ENDL; } memcpy(&type_num, buf + 16, sizeof(S16)); /* Flawfinder: ignore */ asset_type = (LLAssetType::EType)type_num; @@ -779,7 +782,7 @@ LLUUID upload_new_resource( { if (fwrite(buf, 1, readbytes, out) != readbytes) { - llwarns << "Short write" << llendl; + LL_WARNS() << "Short write" << LL_ENDL; } } fclose(out); @@ -797,7 +800,7 @@ LLUUID upload_new_resource( } else { - llinfos << "Couldn't open .lin file " << src_filename << llendl; + LL_INFOS() << "Couldn't open .lin file " << src_filename << LL_ENDL; } } else if (exten == "bvh") @@ -873,13 +876,13 @@ LLUUID upload_new_resource( } else { - llwarns << error_message << llendl; + LL_WARNS() << error_message << LL_ENDL; LLSD args; args["ERROR_MESSAGE"] = error_message; LLNotificationsUtil::add("ErrorMessage", args); if(LLFile::remove(filename) == -1) { - lldebugs << "unable to remove temp file" << llendl; + LL_DEBUGS() << "unable to remove temp file" << LL_ENDL; } LLFilePicker::instance().reset(); } @@ -947,7 +950,7 @@ void upload_done_callback( if(is_balance_sufficient) { // Actually add the upload to inventory - llinfos << "Adding " << uuid << " to inventory." << llendl; + LL_INFOS() << "Adding " << uuid << " to inventory." << LL_ENDL; const LLUUID folder_id = gInventory.findCategoryUUIDForType(dest_loc); if(folder_id.notNull()) { @@ -964,7 +967,7 @@ void upload_done_callback( } else { - llwarns << "Can't find a folder to put it in" << llendl; + LL_WARNS() << "Can't find a folder to put it in" << LL_ENDL; } } } @@ -1004,9 +1007,9 @@ void upload_done_callback( 0, LLFolderType::FT_NONE, LLInventoryType::IT_NONE, - PERM_NONE, - PERM_NONE, - PERM_NONE, + LLFloaterPerms::getNextOwnerPerms("Uploads"), + LLFloaterPerms::getGroupPerms("Uploads"), + LLFloaterPerms::getEveryonePerms("Uploads"), display_name, callback, expected_upload_cost, // assuming next in a group of uploads is of roughly the same type, i.e. same upload cost @@ -1096,17 +1099,17 @@ void upload_new_resource( if( LLAssetType::AT_SOUND == asset_type ) { - LLViewerStats::getInstance()->incStat(LLViewerStats::ST_UPLOAD_SOUND_COUNT ); + add(LLStatViewer::UPLOAD_SOUND, 1); } else if( LLAssetType::AT_TEXTURE == asset_type ) { - LLViewerStats::getInstance()->incStat(LLViewerStats::ST_UPLOAD_TEXTURE_COUNT ); + add(LLStatViewer::UPLOAD_TEXTURE, 1); } else if( LLAssetType::AT_ANIMATION == asset_type) { - LLViewerStats::getInstance()->incStat(LLViewerStats::ST_UPLOAD_ANIM_COUNT ); + add(LLStatViewer::ANIMATION_UPLOADS, 1); } if(LLInventoryType::IT_NONE == inv_type) @@ -1129,21 +1132,21 @@ void upload_new_resource( upload_message.append(display_name); LLUploadDialog::modalUploadDialog(upload_message); - llinfos << "*** Uploading: " << llendl; - llinfos << "Type: " << LLAssetType::lookup(asset_type) << llendl; - llinfos << "UUID: " << uuid << llendl; - llinfos << "Name: " << name << llendl; - llinfos << "Desc: " << desc << llendl; - llinfos << "Expected Upload Cost: " << expected_upload_cost << llendl; - 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; + LL_INFOS() << "*** Uploading: " << LL_ENDL; + LL_INFOS() << "Type: " << LLAssetType::lookup(asset_type) << LL_ENDL; + LL_INFOS() << "UUID: " << uuid << LL_ENDL; + LL_INFOS() << "Name: " << name << LL_ENDL; + LL_INFOS() << "Desc: " << desc << LL_ENDL; + LL_INFOS() << "Expected Upload Cost: " << expected_upload_cost << LL_ENDL; + LL_DEBUGS() << "Folder: " << gInventory.findCategoryUUIDForType((destination_folder_type == LLFolderType::FT_NONE) ? LLFolderType::assetTypeToFolderType(asset_type) : destination_folder_type) << LL_ENDL; + LL_DEBUGS() << "Asset Type: " << LLAssetType::lookup(asset_type) << LL_ENDL; std::string url = gAgent.getRegion()->getCapability( "NewFileAgentInventory"); if ( !url.empty() ) { - llinfos << "New Agent Inventory via capability" << llendl; + LL_INFOS() << "New Agent Inventory via capability" << LL_ENDL; LLSD body; body = generate_new_resource_upload_capability_body( @@ -1166,7 +1169,7 @@ void upload_new_resource( } else { - llinfos << "NewAgentInventory capability not found, new agent inventory via asset system." << llendl; + LL_INFOS() << "NewAgentInventory capability not found, new agent inventory via asset system." << LL_ENDL; // check for adequate funds // TODO: do this check on the sim if (LLAssetType::AT_SOUND == asset_type || @@ -1231,18 +1234,15 @@ void increase_new_upload_stats(LLAssetType::EType asset_type) { if ( LLAssetType::AT_SOUND == asset_type ) { - LLViewerStats::getInstance()->incStat( - LLViewerStats::ST_UPLOAD_SOUND_COUNT ); + add(LLStatViewer::UPLOAD_SOUND, 1); } else if ( LLAssetType::AT_TEXTURE == asset_type ) { - LLViewerStats::getInstance()->incStat( - LLViewerStats::ST_UPLOAD_TEXTURE_COUNT ); + add(LLStatViewer::UPLOAD_TEXTURE, 1); } else if ( LLAssetType::AT_ANIMATION == asset_type ) { - LLViewerStats::getInstance()->incStat( - LLViewerStats::ST_UPLOAD_ANIM_COUNT ); + add(LLStatViewer::ANIMATION_UPLOADS, 1); } } |