diff options
author | Andrey Lihatskiy <alihatskiy@productengine.com> | 2024-04-24 18:45:54 +0300 |
---|---|---|
committer | Andrey Lihatskiy <alihatskiy@productengine.com> | 2024-04-24 18:45:54 +0300 |
commit | 428f21cf795f440f69a772b314f877ea0c6d4741 (patch) | |
tree | bc9cea56b8e236f52df392084552018c387cff2c /indra/newview | |
parent | 09454c53a48e88a9cdd54f68ac507694a766b213 (diff) | |
parent | d98fc504a1d4bc292ba86acdda053c8b4598a193 (diff) |
Merge branch 'main' into marchcat/x-merge
Diffstat (limited to 'indra/newview')
110 files changed, 1774 insertions, 494 deletions
diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index 798e7445b9..e97ab4c52c 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -234,6 +234,7 @@ set(viewer_SOURCE_FILES llfloaterimcontainer.cpp llfloaterinspect.cpp llfloaterinventorysettings.cpp + llfloaterinventorythumbnailshelper.cpp llfloaterjoystick.cpp llfloaterlagmeter.cpp llfloaterland.cpp @@ -890,6 +891,7 @@ set(viewer_HEADER_FILES llfloaterimcontainer.h llfloaterinspect.h llfloaterinventorysettings.h + llfloaterinventorythumbnailshelper.h llfloaterjoystick.h llfloaterlagmeter.h llfloaterland.h @@ -1577,34 +1579,15 @@ endif (WINDOWS) # Add the xui files. This is handy for searching for xui elements # from within the IDE. -set(viewer_XUI_FILES - skins/default/colors.xml - skins/default/default_languages.xml - skins/default/textures/textures.xml - ) -file(GLOB DEFAULT_XUI_FILE_GLOB_LIST - ${CMAKE_CURRENT_SOURCE_DIR}/skins/*/xui/en/*.xml) -list(APPEND viewer_XUI_FILES ${DEFAULT_XUI_FILE_GLOB_LIST}) - -file(GLOB DEFAULT_WIDGET_FILE_GLOB_LIST - ${CMAKE_CURRENT_SOURCE_DIR}/skins/*/xui/en/widgets/*.xml) -list(APPEND viewer_XUI_FILES ${DEFAULT_WIDGET_FILE_GLOB_LIST}) - -# Cannot append empty lists in CMake, wait until we have files here. -#file(GLOB SILVER_WIDGET_FILE_GLOB_LIST -# ${CMAKE_CURRENT_SOURCE_DIR}/skins/silver/xui/en-us/widgets/*.xml) -#list(APPEND viewer_XUI_FILES ${SILVER_WIDGET_FILE_GLOB_LIST}) - -list(SORT viewer_XUI_FILES) - -source_group("XUI Files" FILES ${viewer_XUI_FILES}) - -set_source_files_properties(${viewer_XUI_FILES} +file(GLOB_RECURSE viewer_XUI_FILES LIST_DIRECTORIES FALSE + ${CMAKE_CURRENT_SOURCE_DIR}/skins/*.xml) +source_group(TREE ${CMAKE_CURRENT_SOURCE_DIR}/skins PREFIX "XUI Files" FILES ${viewer_XUI_FILES}) +set_source_files_properties(${viewer_XUI_FILES} PROPERTIES HEADER_FILE_ONLY TRUE) - list(APPEND viewer_SOURCE_FILES ${viewer_XUI_FILES}) -file(GLOB_RECURSE viewer_SHADER_FILES LIST_DIRECTORIES TRUE +# Add the shader sources +file(GLOB_RECURSE viewer_SHADER_FILES LIST_DIRECTORIES FALSE ${CMAKE_CURRENT_SOURCE_DIR}/app_settings/shaders/*.glsl) source_group(TREE ${CMAKE_CURRENT_SOURCE_DIR}/app_settings/shaders PREFIX "Shaders" FILES ${viewer_SHADER_FILES}) set_source_files_properties(${viewer_SHADER_FILES} @@ -1614,6 +1597,7 @@ list(APPEND viewer_SOURCE_FILES ${viewer_SHADER_FILES}) set(viewer_APPSETTINGS_FILES app_settings/anim.ini + app_settings/autoreplace.xml app_settings/cmd_line.xml app_settings/commands.xml app_settings/emoji_groups.xml diff --git a/indra/newview/VIEWER_VERSION.txt b/indra/newview/VIEWER_VERSION.txt index 14627a7c8c..2380dcfd47 100644 --- a/indra/newview/VIEWER_VERSION.txt +++ b/indra/newview/VIEWER_VERSION.txt @@ -1 +1 @@ -7.1.6 +7.1.7 diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp index 3853aaa8fd..13501833b2 100644 --- a/indra/newview/llagent.cpp +++ b/indra/newview/llagent.cpp @@ -95,7 +95,6 @@ #include "llworld.h" #include "llworldmap.h" #include "stringize.h" -#include "boost/foreach.hpp" #include "llcorehttputil.h" #include "lluiusage.h" @@ -1469,23 +1468,27 @@ void LLAgent::pitch(F32 angle) LLVector3 skyward = getReferenceUpVector(); - // SL-19286 Avatar is upside down when viewed from below - // after left-clicking the mouse on the avatar and dragging down - // - // The issue is observed on angle below 10 degrees - const F32 look_down_limit = 179.f * DEG_TO_RAD; - const F32 look_up_limit = 10.f * DEG_TO_RAD; - - F32 angle_from_skyward = acos(mFrameAgent.getAtAxis() * skyward); - // clamp pitch to limits - if ((angle >= 0.f) && (angle_from_skyward + angle > look_down_limit)) + if (angle >= 0.f) { - angle = look_down_limit - angle_from_skyward; + const F32 look_down_limit = 179.f * DEG_TO_RAD; + F32 angle_from_skyward = acos(mFrameAgent.getAtAxis() * skyward); + if (angle_from_skyward + angle > look_down_limit) + { + angle = look_down_limit - angle_from_skyward; + } } - else if ((angle < 0.f) && (angle_from_skyward + angle < look_up_limit)) + else if (angle < 0.f) { - angle = look_up_limit - angle_from_skyward; + const F32 look_up_limit = 5.f * DEG_TO_RAD; + const LLVector3& viewer_camera_pos = LLViewerCamera::getInstance()->getOrigin(); + LLVector3 agent_focus_pos = getPosAgentFromGlobal(gAgentCamera.calcFocusPositionTargetGlobal()); + LLVector3 look_dir = agent_focus_pos - viewer_camera_pos; + F32 angle_from_skyward = angle_between(look_dir, skyward); + if (angle_from_skyward + angle < look_up_limit) + { + angle = look_up_limit - angle_from_skyward; + } } if (fabs(angle) > 1e-4) @@ -2329,7 +2332,7 @@ void LLAgent::endAnimationUpdateUI() LLFloaterIMContainer* im_box = LLFloaterReg::getTypedInstance<LLFloaterIMContainer>("im_container"); LLFloaterIMContainer::floater_list_t conversations; im_box->getDetachedConversationFloaters(conversations); - BOOST_FOREACH(LLFloater* conversation, conversations) + for (LLFloater* conversation : conversations) { LL_INFOS() << "skip_list.insert(session_floater): " << conversation->getTitle() << LL_ENDL; skip_list.insert(conversation); @@ -4333,6 +4336,10 @@ void LLAgent::teleportRequest( // Landmark ID = LLUUID::null means teleport home void LLAgent::teleportViaLandmark(const LLUUID& landmark_asset_id) { + if (landmark_asset_id.isNull()) + { + gAgentCamera.resetView(); + } mTeleportRequest = LLTeleportRequestPtr(new LLTeleportRequestViaLandmark(landmark_asset_id)); startTeleportRequest(); } diff --git a/indra/newview/llagent.h b/indra/newview/llagent.h index fd3a9b1d7b..43b4457bf5 100644 --- a/indra/newview/llagent.h +++ b/indra/newview/llagent.h @@ -61,7 +61,7 @@ class LLTeleportRequest; -typedef boost::shared_ptr<LLTeleportRequest> LLTeleportRequestPtr; +typedef std::shared_ptr<LLTeleportRequest> LLTeleportRequestPtr; //-------------------------------------------------------------------- // Types @@ -131,7 +131,7 @@ public: private: bool mInitialized; bool mFirstLogin; - boost::shared_ptr<LLAgentListener> mListener; + std::shared_ptr<LLAgentListener> mListener; //-------------------------------------------------------------------- // Session diff --git a/indra/newview/llagentcamera.cpp b/indra/newview/llagentcamera.cpp index b51bf132f4..8289fb9c62 100644 --- a/indra/newview/llagentcamera.cpp +++ b/indra/newview/llagentcamera.cpp @@ -1779,7 +1779,7 @@ LLVector3d LLAgentCamera::calcCameraPositionTargetGlobal(BOOL *hit_limit) head_offset.clearVec(); F32 fixup; - if (gAgentAvatarp->hasPelvisFixup(fixup)) + if (gAgentAvatarp->hasPelvisFixup(fixup) && !gAgentAvatarp->isSitting()) { head_offset[VZ] -= fixup; } diff --git a/indra/newview/llaisapi.cpp b/indra/newview/llaisapi.cpp index 17e1a27934..f23ce13608 100644 --- a/indra/newview/llaisapi.cpp +++ b/indra/newview/llaisapi.cpp @@ -1738,10 +1738,6 @@ void AISUpdate::doUpdate() LL_DEBUGS("Inventory") << "cat version update " << cat->getName() << " to version " << cat->getVersion() << LL_ENDL; if (cat->getVersion() != version) { - LL_WARNS() << "Possible version mismatch for category " << cat->getName() - << ", viewer version " << cat->getVersion() - << " AIS version " << version << " !!!Adjusting local version!!!" << LL_ENDL; - // the AIS version should be considered the true version. Adjust // our local category model to reflect this version number. Otherwise // it becomes possible to get stuck with the viewer being out of @@ -1751,13 +1747,23 @@ void AISUpdate::doUpdate() // is performed. This occasionally gets out of sync however. if (version != LLViewerInventoryCategory::VERSION_UNKNOWN) { + LL_WARNS() << "Possible version mismatch for category " << cat->getName() + << ", viewer version " << cat->getVersion() + << " AIS version " << version << " !!!Adjusting local version!!!" << LL_ENDL; cat->setVersion(version); } else { // We do not account for update if version is UNKNOWN, so we shouldn't rise version // either or viewer will get stuck on descendants count -1, try to refetch folder instead - cat->fetch(); + // + // Todo: proper backoff? + + LL_WARNS() << "Possible version mismatch for category " << cat->getName() + << ", viewer version " << cat->getVersion() + << " AIS version " << version << " !!!Rerequesting category!!!" << LL_ENDL; + const S32 LONG_EXPIRY = 360; + cat->fetch(LONG_EXPIRY); } } } diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp index fa0dee3ef9..adf53c78ce 100644 --- a/indra/newview/llappearancemgr.cpp +++ b/indra/newview/llappearancemgr.cpp @@ -27,7 +27,6 @@ #include "llviewerprecompiledheaders.h" #include <boost/lexical_cast.hpp> -#include <boost/foreach.hpp> #include "llaccordionctrltab.h" #include "llagent.h" #include "llagentcamera.h" @@ -1652,7 +1651,7 @@ void LLAppearanceMgr::removeOutfitPhoto(const LLUUID& outfit_id) sub_cat_array, outfit_item_array, LLInventoryModel::EXCLUDE_TRASH); - BOOST_FOREACH(LLViewerInventoryItem* outfit_item, outfit_item_array) + for (LLViewerInventoryItem* outfit_item : outfit_item_array) { LLViewerInventoryItem* linked_item = outfit_item->getLinkedItem(); if (linked_item != NULL) @@ -3443,7 +3442,7 @@ void update_base_outfit_after_ordering() sub_cat_array, outfit_item_array, LLInventoryModel::EXCLUDE_TRASH); - BOOST_FOREACH(LLViewerInventoryItem* outfit_item, outfit_item_array) + for (LLViewerInventoryItem* outfit_item : outfit_item_array) { LLViewerInventoryItem* linked_item = outfit_item->getLinkedItem(); if (linked_item != NULL) @@ -3747,7 +3746,7 @@ LLSD LLAppearanceMgr::dumpCOF() const LLUUID linked_asset_id(linked_item->getAssetUUID()); md5.update((unsigned char*)linked_asset_id.mData, 16); U32 flags = linked_item->getFlags(); - md5.update(boost::lexical_cast<std::string>(flags)); + md5.update(std::to_string(flags)); } else if (LLAssetType::AT_LINK_FOLDER != inv_item->getActualType()) { diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index fc6153defd..a189e531da 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -143,7 +143,6 @@ // Third party library includes #include <boost/bind.hpp> -#include <boost/foreach.hpp> #include <boost/algorithm/string.hpp> #include <boost/regex.hpp> #include <boost/throw_exception.hpp> @@ -1199,7 +1198,7 @@ bool LLAppViewer::init() LLSD item(LeapCommand); LeapCommand.append(item); } - BOOST_FOREACH(const std::string& leap, llsd::inArray(LeapCommand)) + for (const auto& leap : llsd::inArray(LeapCommand)) { LL_INFOS("InitInfo") << "processing --leap \"" << leap << '"' << LL_ENDL; // We don't have any better description of this plugin than the @@ -1704,7 +1703,7 @@ bool LLAppViewer::cleanup() LLNotifications::instance().clear(); // workaround for DEV-35406 crash on shutdown - LLEventPumps::instance().reset(); + LLEventPumps::instance().reset(true); //dump scene loading monitor results if (LLSceneMonitor::instanceExists()) @@ -2361,7 +2360,7 @@ bool LLAppViewer::loadSettingsFromDirectory(const std::string& location_key, LL_ERRS() << "Invalid settings location list" << LL_ENDL; } - BOOST_FOREACH(const SettingsGroup& group, mSettingsLocationList->groups) + for (const SettingsGroup& group : mSettingsLocationList->groups) { // skip settings groups that aren't the one we requested if (group.name() != location_key) continue; @@ -2373,7 +2372,7 @@ bool LLAppViewer::loadSettingsFromDirectory(const std::string& location_key, return false; } - BOOST_FOREACH(const SettingsFile& file, group.files) + for (const SettingsFile& file : group.files) { LL_INFOS("Settings") << "Attempting to load settings for the group " << file.name() << " - from location " << location_key << LL_ENDL; @@ -2438,11 +2437,11 @@ bool LLAppViewer::loadSettingsFromDirectory(const std::string& location_key, std::string LLAppViewer::getSettingsFilename(const std::string& location_key, const std::string& file) { - BOOST_FOREACH(const SettingsGroup& group, mSettingsLocationList->groups) + for (const SettingsGroup& group : mSettingsLocationList->groups) { if (group.name() == location_key) { - BOOST_FOREACH(const SettingsFile& settings_file, group.files) + for (const SettingsFile& settings_file : group.files) { if (settings_file.name() == file) { @@ -3028,7 +3027,7 @@ void LLAppViewer::initStrings() // Now that we've set "[sourceid]", have to go back through // default_trans_args and reinitialize all those other keys because some // of them, in turn, reference "[sourceid]". - BOOST_FOREACH(std::string key, default_trans_args) + for (const std::string& key : default_trans_args) { std::string brackets(key), nobrackets(key); // Invalid to inspect key[0] if key is empty(). But then, the entire @@ -4694,16 +4693,23 @@ void LLAppViewer::idle() // When appropriate, update agent location to the simulator. F32 agent_update_time = agent_update_timer.getElapsedTimeF32(); F32 agent_force_update_time = mLastAgentForceUpdate + agent_update_time; - BOOL force_update = gAgent.controlFlagsDirty() - || (mLastAgentControlFlags != gAgent.getControlFlags()) - || (agent_force_update_time > (1.0f / (F32) AGENT_FORCE_UPDATES_PER_SECOND)); - if (force_update || (agent_update_time > (1.0f / (F32) AGENT_UPDATES_PER_SECOND))) + bool timed_out = agent_update_time > (1.0f / (F32)AGENT_UPDATES_PER_SECOND); + BOOL force_send = + // if there is something to send + (gAgent.controlFlagsDirty() && timed_out) + // if something changed + || (mLastAgentControlFlags != gAgent.getControlFlags()) + // keep alive + || (agent_force_update_time > (1.0f / (F32) AGENT_FORCE_UPDATES_PER_SECOND)); + // timing out doesn't warranty that an update will be sent, + // just that it will be checked. + if (force_send || timed_out) { LL_PROFILE_ZONE_SCOPED_CATEGORY_NETWORK; // Send avatar and camera info mLastAgentControlFlags = gAgent.getControlFlags(); - mLastAgentForceUpdate = force_update ? 0 : agent_force_update_time; - send_agent_update(force_update); + mLastAgentForceUpdate = force_send ? 0 : agent_force_update_time; + send_agent_update(force_send); agent_update_timer.reset(); } } diff --git a/indra/newview/llchiclet.cpp b/indra/newview/llchiclet.cpp index cc4f4536a4..3444f50e52 100644 --- a/indra/newview/llchiclet.cpp +++ b/indra/newview/llchiclet.cpp @@ -177,6 +177,11 @@ LLNotificationChiclet::LLNotificationChiclet(const Params& p) LLFloaterNotificationsTabbed::getInstance()->setSysWellChiclet(this); } +LLNotificationChiclet::~LLNotificationChiclet() +{ + mNotificationChannel.reset(); +} + void LLNotificationChiclet::onMenuItemClicked(const LLSD& user_data) { std::string action = user_data.asString(); diff --git a/indra/newview/llchiclet.h b/indra/newview/llchiclet.h index 58a797218f..1698fa269a 100644 --- a/indra/newview/llchiclet.h +++ b/indra/newview/llchiclet.h @@ -531,8 +531,9 @@ public: struct Params : public LLInitParam::Block<Params, LLSysWellChiclet::Params>{}; protected: - struct ChicletNotificationChannel : public LLNotificationChannel + class ChicletNotificationChannel : public LLNotificationChannel { + public: ChicletNotificationChannel(LLNotificationChiclet* chiclet) : LLNotificationChannel(LLNotificationChannel::Params().filter(filterNotification).name(chiclet->getSessionId().asString())) , mChiclet(chiclet) @@ -542,6 +543,7 @@ protected: connectToChannel("Offer"); connectToChannel("Notifications"); } + virtual ~ChicletNotificationChannel() {} static bool filterNotification(LLNotificationPtr notify); // connect counter updaters to the corresponding signals @@ -553,9 +555,10 @@ protected: }; boost::scoped_ptr<ChicletNotificationChannel> mNotificationChannel; - - LLNotificationChiclet(const Params& p); - + + LLNotificationChiclet(const Params& p); + ~LLNotificationChiclet(); + /** * Processes clicks on chiclet menu. */ diff --git a/indra/newview/llcompilequeue.cpp b/indra/newview/llcompilequeue.cpp index 320806d78d..a3dcea5410 100644 --- a/indra/newview/llcompilequeue.cpp +++ b/indra/newview/llcompilequeue.cpp @@ -74,7 +74,7 @@ namespace class ObjectInventoryFetcher: public LLVOInventoryListener { public: - typedef boost::shared_ptr<ObjectInventoryFetcher> ptr_t; + typedef std::shared_ptr<ObjectInventoryFetcher> ptr_t; ObjectInventoryFetcher(LLEventPump &pump, LLViewerObject* object, void* user_data) : mPump(pump), diff --git a/indra/newview/llconversationlog.cpp b/indra/newview/llconversationlog.cpp index a696c99a82..3c59ca046d 100644 --- a/indra/newview/llconversationlog.cpp +++ b/indra/newview/llconversationlog.cpp @@ -32,7 +32,6 @@ #include "llnotificationsutil.h" #include "lltrans.h" -#include <boost/foreach.hpp> #include "boost/lexical_cast.hpp" const S32Days CONVERSATION_LIFETIME = (S32Days)30; // lifetime of LLConversation is 30 days by spec @@ -392,7 +391,7 @@ void LLConversationLog::deleteBackupLogs() std::vector<std::string> backup_logs; getListOfBackupLogs(backup_logs); - BOOST_FOREACH(const std::string& fullpath, backup_logs) + for (const std::string& fullpath : backup_logs) { LLFile::remove(fullpath); } @@ -434,7 +433,7 @@ bool LLConversationLog::moveLog(const std::string &originDirectory, const std::s while(LLFile::isfile(backupFileName)) { ++backupFileCount; - backupFileName = targetDirectory + ".backup" + boost::lexical_cast<std::string>(backupFileCount); + backupFileName = targetDirectory + ".backup" + std::to_string(backupFileCount); } //Rename the file to its backup name so it is not overwritten diff --git a/indra/newview/llconversationmodel.cpp b/indra/newview/llconversationmodel.cpp index 9e043dbac0..f152e36cf5 100644 --- a/indra/newview/llconversationmodel.cpp +++ b/indra/newview/llconversationmodel.cpp @@ -37,8 +37,6 @@ #include "llimview.h" //For LLIMModel #include "lltrans.h" -#include <boost/foreach.hpp> - // // Conversation items : common behaviors // @@ -300,8 +298,7 @@ void LLConversationItemSession::updateName(LLConversationItemParticipant* partic // In the case of a P2P conversation, we need to grab the name of the other participant in the session instance itself // as we do not create participants for such a session. - LLFolderViewModelItem * itemp; - BOOST_FOREACH(itemp, mChildren) + for (auto itemp : mChildren) { LLConversationItem* current_participant = dynamic_cast<LLConversationItem*>(itemp); // Add the avatar uuid to the list (except if it's the own agent uuid) diff --git a/indra/newview/llexternaleditor.cpp b/indra/newview/llexternaleditor.cpp index b66eb754a4..b0d88159c1 100644 --- a/indra/newview/llexternaleditor.cpp +++ b/indra/newview/llexternaleditor.cpp @@ -32,7 +32,6 @@ #include "llprocess.h" #include "llsdutil.h" #include "llstring.h" -#include <boost/foreach.hpp> // static const std::string LLExternalEditor::sFilenameMarker = "%s"; @@ -93,7 +92,7 @@ LLExternalEditor::EErrorCode LLExternalEditor::run(const std::string& file_path) params.executable = mProcessParams.executable; // Substitute the filename marker in the command with the actual passed file name. - BOOST_FOREACH(const std::string& arg, mProcessParams.args) + for (const std::string& arg : mProcessParams.args) { std::string fixed(arg); LLStringUtil::replaceString(fixed, sFilenameMarker, file_path); diff --git a/indra/newview/llfloatercamera.cpp b/indra/newview/llfloatercamera.cpp index 1c69b9d60b..7985ce447f 100644 --- a/indra/newview/llfloatercamera.cpp +++ b/indra/newview/llfloatercamera.cpp @@ -44,6 +44,7 @@ #include "llfirstuse.h" #include "llhints.h" #include "lltabcontainer.h" +#include "llviewercamera.h" #include "llvoavatarself.h" static LLDefaultChildRegistry::Register<LLPanelCameraItem> r("panel_camera_item"); @@ -65,13 +66,19 @@ class LLPanelCameraZoom : public LLPanel { LOG_CLASS(LLPanelCameraZoom); + public: - LLPanelCameraZoom(); + struct Params : public LLInitParam::Block<Params, LLPanel::Params> {}; + + LLPanelCameraZoom() { onCreate(); } /* virtual */ BOOL postBuild(); /* virtual */ void draw(); protected: + LLPanelCameraZoom(const Params& p) { onCreate(); } + + void onCreate(); void onZoomPlusHeldDown(); void onZoomMinusHeldDown(); void onSliderValueChanged(); @@ -80,9 +87,11 @@ protected: F32 getOrbitRate(F32 time); private: - LLButton* mPlusBtn; - LLButton* mMinusBtn; - LLSlider* mSlider; + LLButton* mPlusBtn { nullptr }; + LLButton* mMinusBtn{ nullptr }; + LLSlider* mSlider{ nullptr }; + + friend class LLUICtrlFactory; }; LLPanelCameraItem::Params::Params() @@ -158,10 +167,7 @@ static LLPanelInjector<LLPanelCameraZoom> t_camera_zoom_panel("camera_zoom_panel // LLPanelCameraZoom //------------------------------------------------------------------------------- -LLPanelCameraZoom::LLPanelCameraZoom() -: mPlusBtn( NULL ), - mMinusBtn( NULL ), - mSlider( NULL ) +void LLPanelCameraZoom::onCreate() { mCommitCallbackRegistrar.add("Zoom.minus", boost::bind(&LLPanelCameraZoom::onZoomMinusHeldDown, this)); mCommitCallbackRegistrar.add("Zoom.plus", boost::bind(&LLPanelCameraZoom::onZoomPlusHeldDown, this)); @@ -172,9 +178,9 @@ LLPanelCameraZoom::LLPanelCameraZoom() BOOL LLPanelCameraZoom::postBuild() { - mPlusBtn = getChild <LLButton> ("zoom_plus_btn"); - mMinusBtn = getChild <LLButton> ("zoom_minus_btn"); - mSlider = getChild <LLSlider> ("zoom_slider"); + mPlusBtn = getChild<LLButton>("zoom_plus_btn"); + mMinusBtn = getChild<LLButton>("zoom_minus_btn"); + mSlider = getChild<LLSlider>("zoom_slider"); return LLPanel::postBuild(); } @@ -240,11 +246,80 @@ void activate_camera_tool() LLToolMgr::getInstance()->setTransientTool(LLToolCamera::getInstance()); }; +class LLCameraInfoPanel : public LLPanel +{ +public: + typedef std::function<LLVector3()> get_vector_t; + + LLCameraInfoPanel( + const LLView* parent, + const char* title, + const LLCoordFrame& camera, + const get_vector_t get_focus + ) + : LLPanel([&]() -> LLPanel::Params + { + LLPanel::Params params; + params.rect = LLRect(parent->getLocalRect()); + return params; + }()) + , mTitle(title) + , mCamera(camera) + , mGetFocus(get_focus) + , mFont(LLFontGL::getFontSansSerifBig()) + { + } + + virtual void draw() override + { + LLPanel::draw(); + + static const U32 HPADDING = 10; + static const U32 VPADDING = 5; + LLVector3 focus = mGetFocus(); + LLVector3 sight = focus - mCamera.mOrigin; + std::pair<const char*, const LLVector3&> const data[] = + { + { "Origin:", mCamera.mOrigin }, + { "X Axis:", mCamera.mXAxis }, + { "Y Axis:", mCamera.mYAxis }, + { "Z Axis:", mCamera.mZAxis }, + { "Focus:", focus }, + { "Sight:", sight } + }; + S32 width = getRect().getWidth(); + S32 height = getRect().getHeight(); + S32 row_count = 1 + sizeof(data) / sizeof(*data); + S32 row_height = (height - VPADDING * 2) / row_count; + S32 top = height - VPADDING - row_height / 2; + mFont->renderUTF8(mTitle, 0, HPADDING, top, LLColor4::white, LLFontGL::LEFT, LLFontGL::VCENTER); + for (const auto& row : data) + { + top -= row_height; + mFont->renderUTF8(row.first, 0, HPADDING, top, LLColor4::white, LLFontGL::LEFT, LLFontGL::VCENTER); + const LLVector3& vector = row.second; + for (S32 i = 0; i < 3; ++i) + { + std::string text = llformat("%.6f", vector[i]); + S32 right = width / 4 * (i + 2) - HPADDING; + mFont->renderUTF8(text, 0, right, top, LLColor4::white, LLFontGL::RIGHT, LLFontGL::VCENTER); + } + } + } + +private: + const char* mTitle; + const LLCoordFrame& mCamera; + const get_vector_t mGetFocus; + const LLFontGL* mFont; +}; + // // Member functions // -/*static*/ bool LLFloaterCamera::inFreeCameraMode() +// static +bool LLFloaterCamera::inFreeCameraMode() { LLFloaterCamera* floater_camera = LLFloaterCamera::findInstance(); if (floater_camera && floater_camera->mCurrMode == CAMERA_CTRL_MODE_FREE_CAMERA && gAgentCamera.getCameraMode() != CAMERA_MODE_MOUSELOOK) @@ -254,6 +329,7 @@ void activate_camera_tool() return false; } +// static void LLFloaterCamera::resetCameraMode() { LLFloaterCamera* floater_camera = LLFloaterCamera::findInstance(); @@ -261,6 +337,7 @@ void LLFloaterCamera::resetCameraMode() floater_camera->switchMode(CAMERA_CTRL_MODE_PAN); } +// static void LLFloaterCamera::onAvatarEditingAppearance(bool editing) { sAppearanceEditing = editing; @@ -269,15 +346,46 @@ void LLFloaterCamera::onAvatarEditingAppearance(bool editing) floater_camera->handleAvatarEditingAppearance(editing); } -void LLFloaterCamera::handleAvatarEditingAppearance(bool editing) +// static +void LLFloaterCamera::onDebugCameraToggled() { + if (LLFloaterCamera* instance = LLFloaterCamera::findInstance()) + { + instance->showDebugInfo(LLView::sDebugCamera); + } + if (LLView::sDebugCamera) + { + LLFloaterReg::showInstanceOrBringToFront("camera"); + } +} + +void LLFloaterCamera::showDebugInfo(bool show) +{ + // Initially LLPanel contains 1 child "view_border" + if (show && mViewerCameraInfo->getChildCount() < 2) + { + mViewerCameraInfo->addChild(new LLCameraInfoPanel(mViewerCameraInfo, "Viewer Camera", *LLViewerCamera::getInstance(), + []() { return LLViewerCamera::getInstance()->getPointOfInterest(); })); + mAgentCameraInfo->addChild(new LLCameraInfoPanel(mAgentCameraInfo, "Agent Camera", gAgent.getFrameAgent(), + []() { return gAgent.getPosAgentFromGlobal(gAgentCamera.calcFocusPositionTargetGlobal()); })); + } + + mAgentCameraInfo->setVisible(show); + mViewerCameraInfo->setVisible(show); +} + +void LLFloaterCamera::handleAvatarEditingAppearance(bool editing) +{ } void LLFloaterCamera::update() { ECameraControlMode mode = determineMode(); - if (mode != mCurrMode) setMode(mode); + if (mode != mCurrMode) + { + setMode(mode); + } } @@ -286,7 +394,8 @@ void LLFloaterCamera::toPrevMode() switchMode(mPrevMode); } -/*static*/ void LLFloaterCamera::onLeavingMouseLook() +// static +void LLFloaterCamera::onLeavingMouseLook() { LLFloaterCamera* floater_camera = LLFloaterCamera::findInstance(); if (floater_camera) @@ -320,12 +429,14 @@ void LLFloaterCamera::onOpen(const LLSD& key) mClosed = FALSE; populatePresetCombo(); + + showDebugInfo(LLView::sDebugCamera); } void LLFloaterCamera::onClose(bool app_quitting) { //We don't care of camera mode if app is quitting - if(app_quitting) + if (app_quitting) return; // It is necessary to reset mCurrMode to CAMERA_CTRL_MODE_PAN so // to avoid seeing an empty floater when reopening the control. @@ -360,14 +471,18 @@ BOOL LLFloaterCamera::postBuild() { updateTransparency(TT_ACTIVE); // force using active floater transparency (STORM-730) + mControls = getChild<LLPanel>("controls"); + mAgentCameraInfo = getChild<LLPanel>("agent_camera_info"); + mViewerCameraInfo = getChild<LLPanel>("viewer_camera_info"); mRotate = getChild<LLJoystickCameraRotate>(ORBIT); - mZoom = findChild<LLPanelCameraZoom>(ZOOM); + mZoom = getChild<LLPanelCameraZoom>(ZOOM); mTrack = getChild<LLJoystickCameraTrack>(PAN); mPresetCombo = getChild<LLComboBox>("preset_combo"); + mPreciseCtrls = getChild<LLTextBox>("precise_ctrs_label"); - getChild<LLTextBox>("precise_ctrs_label")->setShowCursorHand(false); - getChild<LLTextBox>("precise_ctrs_label")->setSoundFlags(LLView::MOUSE_UP); - getChild<LLTextBox>("precise_ctrs_label")->setClickedCallback(boost::bind(&LLFloaterReg::showInstance, "prefs_view_advanced", LLSD(), FALSE)); + mPreciseCtrls->setShowCursorHand(false); + mPreciseCtrls->setSoundFlags(LLView::MOUSE_UP); + mPreciseCtrls->setClickedCallback(boost::bind(&LLFloaterReg::showInstance, "prefs_view_advanced", LLSD(), FALSE)); mPresetCombo->setCommitCallback(boost::bind(&LLFloaterCamera::onCustomPresetSelected, this)); LLPresetsManager::getInstance()->setPresetListChangeCameraCallback(boost::bind(&LLFloaterCamera::populatePresetCombo, this)); @@ -507,6 +622,7 @@ void LLFloaterCamera::updateItemsSelection() getChild<LLPanelCameraItem>("object_view")->setValue(argument); } +// static void LLFloaterCamera::onClickCameraItem(const LLSD& param) { std::string name = param.asString(); @@ -533,7 +649,7 @@ void LLFloaterCamera::onClickCameraItem(const LLSD& param) } } -/*static*/ +// static void LLFloaterCamera::switchToPreset(const std::string& name) { sFreeCamera = false; diff --git a/indra/newview/llfloatercamera.h b/indra/newview/llfloatercamera.h index a69b87ad16..f31bc5486b 100644 --- a/indra/newview/llfloatercamera.h +++ b/indra/newview/llfloatercamera.h @@ -63,6 +63,9 @@ public: /** Called when Avatar is entered/exited editing appearance mode */ static void onAvatarEditingAppearance(bool editing); + /** Called when opening and when "Advanced | Debug Camera" menu item is toggled */ + static void onDebugCameraToggled(); + /* determines actual mode and updates ui */ void update(); @@ -77,9 +80,9 @@ public: void populatePresetCombo(); - LLJoystickCameraRotate* mRotate; - LLPanelCameraZoom* mZoom; - LLJoystickCameraTrack* mTrack; + LLJoystickCameraRotate* mRotate { nullptr }; + LLPanelCameraZoom* mZoom { nullptr }; + LLJoystickCameraTrack* mTrack { nullptr }; private: @@ -117,6 +120,8 @@ private: void handleAvatarEditingAppearance(bool editing); + void showDebugInfo(bool show); + // set to true when free camera mode is selected in modes list // remains true until preset camera mode is chosen, or pan button is clicked, or escape pressed static bool sFreeCamera; @@ -126,7 +131,11 @@ private: ECameraControlMode mCurrMode; std::map<ECameraControlMode, LLButton*> mMode2Button; - LLComboBox* mPresetCombo; + LLPanel* mControls { nullptr }; + LLPanel* mViewerCameraInfo { nullptr }; + LLPanel* mAgentCameraInfo { nullptr }; + LLComboBox* mPresetCombo { nullptr }; + LLTextBox* mPreciseCtrls { nullptr }; }; /** diff --git a/indra/newview/llfloatereditsky.cpp b/indra/newview/llfloatereditsky.cpp index 2d5e86869d..fa51143f3a 100644 --- a/indra/newview/llfloatereditsky.cpp +++ b/indra/newview/llfloatereditsky.cpp @@ -84,7 +84,7 @@ BOOL LLFloaterEditSky::postBuild() mSkyPresetCombo = getChild<LLComboBox>("sky_preset_combo"); mMakeDefaultCheckBox = getChild<LLCheckBoxCtrl>("make_default_cb"); mSaveButton = getChild<LLButton>("save"); - mSkyAdapter = boost::make_shared<LLSkySettingsAdapter>(); + mSkyAdapter = std::make_shared<LLSkySettingsAdapter>(); LLEnvironment::instance().setSkyListChange(boost::bind(&LLFloaterEditSky::onSkyPresetListChange, this)); diff --git a/indra/newview/llfloatereditwater.cpp b/indra/newview/llfloatereditwater.cpp index c44ae7faca..4a6268435b 100644 --- a/indra/newview/llfloatereditwater.cpp +++ b/indra/newview/llfloatereditwater.cpp @@ -71,7 +71,7 @@ BOOL LLFloaterEditWater::postBuild() mMakeDefaultCheckBox = getChild<LLCheckBoxCtrl>("make_default_cb"); mSaveButton = getChild<LLButton>("save"); - mWaterAdapter = boost::make_shared<LLWatterSettingsAdapter>(); + mWaterAdapter = std::make_shared<LLWatterSettingsAdapter>(); LLEnvironment::instance().setWaterListChange(boost::bind(&LLFloaterEditWater::onWaterPresetListChange, this)); diff --git a/indra/newview/llfloaterimcontainer.cpp b/indra/newview/llfloaterimcontainer.cpp index 635aee64ff..44938d5509 100644 --- a/indra/newview/llfloaterimcontainer.cpp +++ b/indra/newview/llfloaterimcontainer.cpp @@ -57,7 +57,6 @@ #include "llsdserialize.h" #include "llviewermenu.h" // is_agent_mappable #include "llviewerobjectlist.h" -#include "boost/foreach.hpp" const S32 EVENTS_PER_IDLE_LOOP_CURRENT_SESSION = 80; @@ -805,12 +804,11 @@ void LLFloaterIMContainer::setVisible(BOOL visible) void LLFloaterIMContainer::getDetachedConversationFloaters(floater_list_t& floaters) { - typedef conversations_widgets_map::value_type conv_pair; LLFloaterIMNearbyChat *nearby_chat = LLFloaterReg::findTypedInstance<LLFloaterIMNearbyChat>("nearby_chat"); - BOOST_FOREACH(conv_pair item, mConversationsWidgets) + for (const auto& [key, fvi] : mConversationsWidgets) { - LLConversationViewSession* widget = dynamic_cast<LLConversationViewSession*>(item.second); + LLConversationViewSession* widget = dynamic_cast<LLConversationViewSession*>(fvi); if (widget) { LLFloater* session_floater = widget->getSessionFloater(); diff --git a/indra/newview/llfloaterimnearbychathandler.cpp b/indra/newview/llfloaterimnearbychathandler.cpp index 76bb10d149..e201417786 100644 --- a/indra/newview/llfloaterimnearbychathandler.cpp +++ b/indra/newview/llfloaterimnearbychathandler.cpp @@ -453,7 +453,7 @@ void LLFloaterIMNearbyChatScreenChannel::arrangeToasts() //----------------------------------------------------------------------------------------------- //LLFloaterIMNearbyChatHandler //----------------------------------------------------------------------------------------------- -boost::scoped_ptr<LLEventPump> LLFloaterIMNearbyChatHandler::sChatWatcher(new LLEventStream("LLChat")); +std::unique_ptr<LLEventPump> LLFloaterIMNearbyChatHandler::sChatWatcher(new LLEventStream("LLChat")); LLFloaterIMNearbyChatHandler::LLFloaterIMNearbyChatHandler() { diff --git a/indra/newview/llfloaterimnearbychathandler.h b/indra/newview/llfloaterimnearbychathandler.h index 5e6f8cde30..1849604470 100644 --- a/indra/newview/llfloaterimnearbychathandler.h +++ b/indra/newview/llfloaterimnearbychathandler.h @@ -46,7 +46,7 @@ public: protected: virtual void initChannel(); - static boost::scoped_ptr<LLEventPump> sChatWatcher; + static std::unique_ptr<LLEventPump> sChatWatcher; }; } diff --git a/indra/newview/llfloaterinventorythumbnailshelper.cpp b/indra/newview/llfloaterinventorythumbnailshelper.cpp new file mode 100644 index 0000000000..814f88e9b9 --- /dev/null +++ b/indra/newview/llfloaterinventorythumbnailshelper.cpp @@ -0,0 +1,543 @@ +/** + * @file llfloaterinventorythumbnailshelper.cpp + * @author Callum Prentice + * @brief LLFloaterInventoryThumbnailsHelper class implementation + * + * Usage instructions and some brief notes can be found in Confluence here: + * https://lindenlab.atlassian.net/wiki/spaces/~174746736/pages/2928672843/Inventory+Thumbnail+Helper+Tool + * + * $LicenseInfo:firstyear=2008&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2010, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + +#include "llviewerprecompiledheaders.h" + +#include "llaisapi.h" +#include "llclipboard.h" +#include "llinventoryfunctions.h" +#include "llinventorymodel.h" +#include "llnotifications.h" +#include "llnotificationsutil.h" +#include "llscrolllistctrl.h" +#include "lltexteditor.h" +#include "lluictrlfactory.h" +#include "lluuid.h" + +#include "llfloaterinventorythumbnailshelper.h" + +LLFloaterInventoryThumbnailsHelper::LLFloaterInventoryThumbnailsHelper(const LLSD& key) + : LLFloater("floater_inventory_thumbnails_helper") +{ +} + +LLFloaterInventoryThumbnailsHelper::~LLFloaterInventoryThumbnailsHelper() +{ +} + +BOOL LLFloaterInventoryThumbnailsHelper::postBuild() +{ + mInventoryThumbnailsList = getChild<LLScrollListCtrl>("inventory_thumbnails_list"); + mInventoryThumbnailsList->setAllowMultipleSelection(true); + + mOutputLog = getChild<LLTextEditor>("output_log"); + mOutputLog->setMaxTextLength(0xffff * 0x10); + + mPasteItemsBtn = getChild<LLUICtrl>("paste_items_btn"); + mPasteItemsBtn->setCommitCallback(boost::bind(&LLFloaterInventoryThumbnailsHelper::onPasteItems, this)); + mPasteItemsBtn->setEnabled(true); + + mPasteTexturesBtn = getChild<LLUICtrl>("paste_textures_btn"); + mPasteTexturesBtn->setCommitCallback(boost::bind(&LLFloaterInventoryThumbnailsHelper::onPasteTextures, this)); + mPasteTexturesBtn->setEnabled(true); + + mWriteThumbnailsBtn = getChild<LLUICtrl>("write_thumbnails_btn"); + mWriteThumbnailsBtn->setCommitCallback(boost::bind(&LLFloaterInventoryThumbnailsHelper::onWriteThumbnails, this)); + mWriteThumbnailsBtn->setEnabled(false); + + mLogMissingThumbnailsBtn = getChild<LLUICtrl>("log_missing_thumbnails_btn"); + mLogMissingThumbnailsBtn->setCommitCallback(boost::bind(&LLFloaterInventoryThumbnailsHelper::onLogMissingThumbnails, this)); + mLogMissingThumbnailsBtn->setEnabled(false); + + mClearThumbnailsBtn = getChild<LLUICtrl>("clear_thumbnails_btn"); + mClearThumbnailsBtn->setCommitCallback(boost::bind(&LLFloaterInventoryThumbnailsHelper::onClearThumbnails, this)); + mClearThumbnailsBtn->setEnabled(false); + + return true; +} + +// Records an entry in the pasted items - saves it to a map and writes it to the log +// window for later confirmation/validation - since it uses a map, duplicates (based on +// the name) are discarded +void LLFloaterInventoryThumbnailsHelper::recordInventoryItemEntry(LLViewerInventoryItem* item) +{ + const std::string name = item->getName(); + + std::map<std::string, LLViewerInventoryItem*>::iterator iter = mItemNamesItems.find(name); + if (iter == mItemNamesItems.end()) + { + mItemNamesItems.insert({name, item}); + + writeToLog( + STRINGIZE( + "ITEM " << mItemNamesItems.size() << "> " << + name << + std::endl + ), false); + } + else + { + // dupe - do not save + } +} + +// Called when the user has copied items from their inventory and selects the Paste Items button +// in the UI - iterates over items and folders and saves details of each one. +// The first use of this tool is for updating NUX items and as such, only looks for OBJECTS, +// CLOTHING and BODYPARTS - later versions of this tool should make that selection editable. +void LLFloaterInventoryThumbnailsHelper::onPasteItems() +{ + if (!LLClipboard::instance().hasContents()) + { + return; + } + + writeToLog( + STRINGIZE( + "\n==== Pasting items from inventory ====" << + std::endl + ), false); + + std::vector<LLUUID> objects; + LLClipboard::instance().pasteFromClipboard(objects); + size_t count = objects.size(); + + for (size_t i = 0; i < count; i++) + { + const LLUUID& entry = objects.at(i); + + // Check for a folder + const LLInventoryCategory* cat = gInventory.getCategory(entry); + if (cat) + { + LLInventoryModel::cat_array_t cat_array; + LLInventoryModel::item_array_t item_array; + + LLIsType is_object(LLAssetType::AT_OBJECT); + gInventory.collectDescendentsIf(cat->getUUID(), + cat_array, + item_array, + LLInventoryModel::EXCLUDE_TRASH, + is_object); + + LLIsType is_bodypart(LLAssetType::AT_BODYPART); + gInventory.collectDescendentsIf(cat->getUUID(), + cat_array, + item_array, + LLInventoryModel::EXCLUDE_TRASH, + is_bodypart); + + LLIsType is_clothing(LLAssetType::AT_CLOTHING); + gInventory.collectDescendentsIf(cat->getUUID(), + cat_array, + item_array, + LLInventoryModel::EXCLUDE_TRASH, + is_clothing); + + for (size_t i = 0; i < item_array.size(); i++) + { + LLViewerInventoryItem* item = item_array.at(i); + recordInventoryItemEntry(item); + } + } + + // Check for an item + LLViewerInventoryItem* item = gInventory.getItem(entry); + if (item) + { + const LLAssetType::EType item_type = item->getType(); + if (item_type == LLAssetType::AT_OBJECT || item_type == LLAssetType::AT_BODYPART || item_type == LLAssetType::AT_CLOTHING) + { + recordInventoryItemEntry(item); + } + } + } + + // update the main list view based on what we found + updateDisplayList(); + + // update the buttons enabled state based on what we found/saved + updateButtonStates(); +} + +// Records a entry in the pasted textures - saves it to a map and writes it to the log +// window for later confirmation/validation - since it uses a map, duplicates (based on +// the name) are discarded +void LLFloaterInventoryThumbnailsHelper::recordTextureItemEntry(LLViewerInventoryItem* item) +{ + const std::string name = item->getName(); + + std::map<std::string, LLUUID>::iterator iter = mTextureNamesIDs.find(name); + if (iter == mTextureNamesIDs.end()) + { + LLUUID id = item->getAssetUUID(); + mTextureNamesIDs.insert({name, id}); + + writeToLog( + STRINGIZE( + "TEXTURE " << mTextureNamesIDs.size() << "> " << + name << + //" | " << + //id.asString() << + std::endl + ), false); + } + else + { + // dupe - do not save + } +} + +// Called when the user has copied textures from their inventory and selects the Paste Textures +// button in the UI - iterates over textures and folders and saves details of each one. +void LLFloaterInventoryThumbnailsHelper::onPasteTextures() +{ + if (!LLClipboard::instance().hasContents()) + { + return; + } + + writeToLog( + STRINGIZE( + "\n==== Pasting textures from inventory ====" << + std::endl + ), false); + + std::vector<LLUUID> objects; + LLClipboard::instance().pasteFromClipboard(objects); + size_t count = objects.size(); + + for (size_t i = 0; i < count; i++) + { + const LLUUID& entry = objects.at(i); + + const LLInventoryCategory* cat = gInventory.getCategory(entry); + if (cat) + { + LLInventoryModel::cat_array_t cat_array; + LLInventoryModel::item_array_t item_array; + + LLIsType is_object(LLAssetType::AT_TEXTURE); + gInventory.collectDescendentsIf(cat->getUUID(), + cat_array, + item_array, + LLInventoryModel::EXCLUDE_TRASH, + is_object); + + for (size_t i = 0; i < item_array.size(); i++) + { + LLViewerInventoryItem* item = item_array.at(i); + recordTextureItemEntry(item); + } + } + + LLViewerInventoryItem* item = gInventory.getItem(entry); + if (item) + { + const LLAssetType::EType item_type = item->getType(); + if (item_type == LLAssetType::AT_TEXTURE) + { + recordTextureItemEntry(item); + } + } + } + + // update the main list view based on what we found + updateDisplayList(); + + // update the buttons enabled state based on what we found/saved + updateButtonStates(); +} + +// Updates the main list of entries in the UI based on what is in the maps/storage +void LLFloaterInventoryThumbnailsHelper::updateDisplayList() +{ + mInventoryThumbnailsList->deleteAllItems(); + + std::map<std::string, LLViewerInventoryItem*>::iterator item_iter = mItemNamesItems.begin(); + while (item_iter != mItemNamesItems.end()) + { + std::string item_name = (*item_iter).first; + + std::string existing_texture_name = std::string(); + LLUUID existing_thumbnail_id = (*item_iter).second->getThumbnailUUID(); + if (existing_thumbnail_id != LLUUID::null) + { + existing_texture_name = existing_thumbnail_id.asString(); + } + else + { + existing_texture_name = "none"; + } + + std::string new_texture_name = std::string(); + std::map<std::string, LLUUID>::iterator texture_iter = mTextureNamesIDs.find(item_name); + if (texture_iter != mTextureNamesIDs.end()) + { + new_texture_name = (*texture_iter).first; + } + else + { + new_texture_name = "missing"; + } + + LLSD row; + row["columns"][EListColumnNum::NAME]["column"] = "item_name"; + row["columns"][EListColumnNum::NAME]["type"] = "text"; + row["columns"][EListColumnNum::NAME]["value"] = item_name; + row["columns"][EListColumnNum::NAME]["font"]["name"] = "Monospace"; + + row["columns"][EListColumnNum::EXISTING_TEXTURE]["column"] = "existing_texture"; + row["columns"][EListColumnNum::EXISTING_TEXTURE]["type"] = "text"; + row["columns"][EListColumnNum::EXISTING_TEXTURE]["font"]["name"] = "Monospace"; + row["columns"][EListColumnNum::EXISTING_TEXTURE]["value"] = existing_texture_name; + + row["columns"][EListColumnNum::NEW_TEXTURE]["column"] = "new_texture"; + row["columns"][EListColumnNum::NEW_TEXTURE]["type"] = "text"; + row["columns"][EListColumnNum::NEW_TEXTURE]["font"]["name"] = "Monospace"; + row["columns"][EListColumnNum::NEW_TEXTURE]["value"] = new_texture_name; + + mInventoryThumbnailsList->addElement(row); + + ++item_iter; + } +} + +#if 1 +// *TODO$: LLInventoryCallback should be deprecated to conform to the new boost::bind/coroutine model. +// temp code in transition +void inventoryThumbnailsHelperCb(LLPointer<LLInventoryCallback> cb, LLUUID id) +{ + if (cb.notNull()) + { + cb->fire(id); + } +} +#endif + +// Makes calls to the AIS v3 API to record the local changes made to the thumbnails. +// If this is not called, the operations (e.g. set thumbnail or clear thumbnail) +// appear to work but do not push the changes back to the inventory (local cache view only) +bool writeInventoryThumbnailID(LLUUID item_id, LLUUID thumbnail_asset_id) +{ + if (AISAPI::isAvailable()) + { + + LLSD updates; + updates["thumbnail"] = LLSD().with("asset_id", thumbnail_asset_id.asString()); + + LLPointer<LLInventoryCallback> cb; + + AISAPI::completion_t cr = boost::bind(&inventoryThumbnailsHelperCb, cb, _1); + AISAPI::UpdateItem(item_id, updates, cr); + + return true; + } + else + { + LL_WARNS() << "Unable to write inventory thumbnail because the AIS API is not available" << LL_ENDL; + return false; + } +} + +// Called when the Write Thumbanils button is pushed. Iterates over the name/item and +// name/.texture maps and where it finds a common name, extracts what is needed and +// writes the thumbnail accordingly. +void LLFloaterInventoryThumbnailsHelper::onWriteThumbnails() +{ + // create and show confirmation (Yes/No) textbox since this is a destructive operation + LLNotificationsUtil::add("WriteInventoryThumbnailsWarning", LLSD(), LLSD(), + [&](const LLSD & notif, const LLSD & resp) + { + S32 opt = LLNotificationsUtil::getSelectedOption(notif, resp); + if (opt == 0) + { + std::map<std::string, LLViewerInventoryItem*>::iterator item_iter = mItemNamesItems.begin(); + while (item_iter != mItemNamesItems.end()) + { + std::string item_name = (*item_iter).first; + + std::map<std::string, LLUUID>::iterator texture_iter = mTextureNamesIDs.find(item_name); + if (texture_iter != mTextureNamesIDs.end()) + { + LLUUID item_id = (*item_iter).second->getUUID(); + + LLUUID thumbnail_asset_id = (*texture_iter).second; + + writeToLog( + STRINGIZE( + "WRITING THUMB " << + (*item_iter).first << + "\n" << + "item ID: " << + item_id << + "\n" << + "thumbnail texture ID: " << + thumbnail_asset_id << + "\n" + ), true); + + + (*item_iter).second->setThumbnailUUID(thumbnail_asset_id); + + // This additional step (notifying AIS API) is required + // to make the changes persist outside of the local cache + writeInventoryThumbnailID(item_id, thumbnail_asset_id); + } + + ++item_iter; + } + + updateDisplayList(); + } + else + { + LL_INFOS() << "Writing new thumbnails was canceled" << LL_ENDL; + } + }); +} + +// Called when the Log Items with Missing Thumbnails is selected. This merely writes +// a list of all the items for which the thumbnail ID is Null. Typical use case is to +// copy from the log window, pasted to Slack to illustrate which items are missing +// a thumbnail +void LLFloaterInventoryThumbnailsHelper::onLogMissingThumbnails() +{ + std::map<std::string, LLViewerInventoryItem*>::iterator item_iter = mItemNamesItems.begin(); + while (item_iter != mItemNamesItems.end()) + { + LLUUID thumbnail_id = (*item_iter).second->getThumbnailUUID(); + + if (thumbnail_id == LLUUID::null) + { + writeToLog( + STRINGIZE( + "Missing thumbnail: " << + (*item_iter).first << + std::endl + ), true); + } + + ++item_iter; + } +} + +// Called when the Clear Thumbnail button is selected. Code to perform the clear (really +// just writing a NULL UUID into the thumbnail field) is behind an "Are you Sure?" dialog +// since it cannot be undone and potentinally, you could remove the thumbnails from your +// whole inventory this way. +void LLFloaterInventoryThumbnailsHelper::onClearThumbnails() +{ + // create and show confirmation (Yes/No) textbox since this is a destructive operation + LLNotificationsUtil::add("ClearInventoryThumbnailsWarning", LLSD(), LLSD(), + [&](const LLSD & notif, const LLSD & resp) + { + S32 opt = LLNotificationsUtil::getSelectedOption(notif, resp); + if (opt == 0) + { + std::map<std::string, LLViewerInventoryItem*>::iterator item_iter = mItemNamesItems.begin(); + while (item_iter != mItemNamesItems.end()) + { + (*item_iter).second->setThumbnailUUID(LLUUID::null); + + // This additional step (notifying AIS API) is required + // to make the changes persist outside of the local cache + const LLUUID item_id = (*item_iter).second->getUUID(); + writeInventoryThumbnailID(item_id, LLUUID::null); + + ++item_iter; + } + + updateDisplayList(); + } + else + { + LL_INFOS() << "Clearing on thumbnails was canceled" << LL_ENDL; + } + }); +} + +// Update the endabled state of some of the UI buttons based on what has +// been recorded so far. For example, if there are no valid item/texture pairs, +// then the Write Thumbnails button is not enabled. +void LLFloaterInventoryThumbnailsHelper::updateButtonStates() +{ + size_t found_count = 0; + + std::map<std::string, LLViewerInventoryItem*>::iterator item_iter = mItemNamesItems.begin(); + while (item_iter != mItemNamesItems.end()) + { + std::string item_name = (*item_iter).first; + + std::map<std::string, LLUUID>::iterator texture_iter = mTextureNamesIDs.find(item_name); + if (texture_iter != mTextureNamesIDs.end()) + { + found_count++; + } + + ++item_iter; + } + + // the "Write Thumbnails" button is only enabled when there is at least one + // item with a matching texture ready to be written to the thumbnail field + if (found_count > 0) + { + mWriteThumbnailsBtn->setEnabled(true); + } + else + { + mWriteThumbnailsBtn->setEnabled(false); + } + + // The "Log Missing Items" and "Clear Thumbnails" buttons are only enabled + // when there is at least 1 item that was pasted from inventory (doesn't need + // to have a matching texture for these operations) + if (mItemNamesItems.size() > 0) + { + mLogMissingThumbnailsBtn->setEnabled(true); + mClearThumbnailsBtn->setEnabled(true); + } + else + { + mLogMissingThumbnailsBtn->setEnabled(false); + mClearThumbnailsBtn->setEnabled(false); + } +} + +// Helper function for writing a line to the log window. Currently the only additional +// feature is that it scrolls to the bottom each time a line is written but it +// is envisaged that other common actions will be added here eventually - E.G. write eavh +// line to the Second Life log too for example. +void LLFloaterInventoryThumbnailsHelper::writeToLog(std::string logline, bool prepend_newline) +{ + mOutputLog->appendText(logline, prepend_newline); + + mOutputLog->setCursorAndScrollToEnd(); +} diff --git a/indra/newview/llfloaterinventorythumbnailshelper.h b/indra/newview/llfloaterinventorythumbnailshelper.h new file mode 100644 index 0000000000..b42a85d1a5 --- /dev/null +++ b/indra/newview/llfloaterinventorythumbnailshelper.h @@ -0,0 +1,82 @@ +/** + * @file llfloaterinventorythumbnailshelper.h + * @author Callum Prentice + * @brief Helper floater for bulk processing of inventory thumbnails tool + * + * $LicenseInfo:firstyear=2008&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2010, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + +#ifndef LL_LLFLOATERINVENTORYTHUMBNAILSHELPER_H +#define LL_LLFLOATERINVENTORYTHUMBNAILSHELPER_H + +#include "llfloater.h" +class LLTextEditor; +class LLScrollListCtrl; +class LLViewerInventoryItem; +class LLUUID; + +class LLFloaterInventoryThumbnailsHelper: + public LLFloater +{ + friend class LLFloaterReg; + private: + LLFloaterInventoryThumbnailsHelper(const LLSD& key); + BOOL postBuild() override; + ~LLFloaterInventoryThumbnailsHelper(); + + LLScrollListCtrl* mInventoryThumbnailsList; + + LLTextEditor* mOutputLog; + + LLUICtrl* mPasteItemsBtn; + void onPasteItems(); + + LLUICtrl* mPasteTexturesBtn; + void onPasteTextures(); + + LLUICtrl* mWriteThumbnailsBtn; + void onWriteThumbnails(); + + LLUICtrl* mLogMissingThumbnailsBtn; + void onLogMissingThumbnails(); + + LLUICtrl* mClearThumbnailsBtn; + void onClearThumbnails(); + + void recordInventoryItemEntry(LLViewerInventoryItem* item); + void recordTextureItemEntry(LLViewerInventoryItem* item); + void updateButtonStates(); + void updateDisplayList(); + void writeToLog(std::string logline, bool prepend_newline); + + std::map<std::string, LLViewerInventoryItem*> mItemNamesItems; + std::map<std::string, LLUUID> mTextureNamesIDs; + + enum EListColumnNum + { + NAME = 0, + EXISTING_TEXTURE = 1, + NEW_TEXTURE = 2 + }; +}; + +#endif // LL_LLFLOATERINVENTORYTHUMBNAILSHELPER_H diff --git a/indra/newview/llfloatermarketplacelistings.cpp b/indra/newview/llfloatermarketplacelistings.cpp index 71b3b16809..6216f4e39a 100644 --- a/indra/newview/llfloatermarketplacelistings.cpp +++ b/indra/newview/llfloatermarketplacelistings.cpp @@ -183,7 +183,8 @@ void LLPanelMarketplaceListings::draw() // Get the audit button enabled only after the whole inventory is fetched if (!mAuditBtn->getEnabled()) { - mAuditBtn->setEnabled(LLInventoryModelBackgroundFetch::instance().isEverythingFetched()); + LLInventoryModelBackgroundFetch* inst = LLInventoryModelBackgroundFetch::getInstance(); + mAuditBtn->setEnabled(inst->isEverythingFetched() && !inst->folderFetchActive()); } LLPanel::draw(); @@ -410,8 +411,14 @@ BOOL LLFloaterMarketplaceListings::postBuild() mCategoryAddedObserver = new LLMarketplaceListingsAddedObserver(this); gInventory.addObserver(mCategoryAddedObserver); - // Fetch aggressively so we can interact with listings right onOpen() - fetchContents(); + + // Fetch aggressively so we can interact with listings as soon as possible + if (!fetchContents()) + { + const LLUUID& marketplacelistings_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_MARKETPLACE_LISTINGS); + LLInventoryModelBackgroundFetch::instance().start(marketplacelistings_id, true); + } + return TRUE; } @@ -440,17 +447,19 @@ void LLFloaterMarketplaceListings::onFocusReceived() updateView(); } -void LLFloaterMarketplaceListings::fetchContents() +bool LLFloaterMarketplaceListings::fetchContents() { - if (mRootFolderId.notNull() && + if (mRootFolderId.notNull() && (LLMarketplaceData::instance().getSLMDataFetched() != MarketplaceFetchCodes::MARKET_FETCH_LOADING) && (LLMarketplaceData::instance().getSLMDataFetched() != MarketplaceFetchCodes::MARKET_FETCH_DONE)) - { + { LLMarketplaceData::instance().setDataFetchedSignal(boost::bind(&LLFloaterMarketplaceListings::updateView, this)); LLMarketplaceData::instance().setSLMDataFetched(MarketplaceFetchCodes::MARKET_FETCH_LOADING); - LLInventoryModelBackgroundFetch::instance().start(mRootFolderId, true); + LLInventoryModelBackgroundFetch::instance().start(mRootFolderId, true); LLMarketplaceData::instance().getSLMListings(); - } + return true; + } + return false; } void LLFloaterMarketplaceListings::setRootFolder() diff --git a/indra/newview/llfloatermarketplacelistings.h b/indra/newview/llfloatermarketplacelistings.h index 085e517a9d..78d43f97a9 100644 --- a/indra/newview/llfloatermarketplacelistings.h +++ b/indra/newview/llfloatermarketplacelistings.h @@ -114,8 +114,8 @@ public: protected: void setRootFolder(); void setPanels(); - void fetchContents(); - + bool fetchContents(); + void setStatusString(const std::string& statusString); void onClose(bool app_quitting); diff --git a/indra/newview/llfloaterpreference.cpp b/indra/newview/llfloaterpreference.cpp index 168106f1d2..96b3a669ce 100644 --- a/indra/newview/llfloaterpreference.cpp +++ b/indra/newview/llfloaterpreference.cpp @@ -1014,7 +1014,6 @@ void LLFloaterPreference::onBtnCancel(const LLSD& userdata) if (userdata.asString() == "closeadvanced") { LLFloaterReg::hideInstance("prefs_graphics_advanced"); - updateMaxComplexity(); } else { diff --git a/indra/newview/llfloateruipreview.cpp b/indra/newview/llfloateruipreview.cpp index db69c3e2c3..553d09bec2 100644 --- a/indra/newview/llfloateruipreview.cpp +++ b/indra/newview/llfloateruipreview.cpp @@ -158,7 +158,7 @@ public: // typedef std::map<std::string,std::pair<std::list<std::string>,std::list<std::string> > > DiffMap; // this version copies the lists etc., and thus is bad memory-wise typedef std::list<std::string> StringList; - typedef boost::shared_ptr<StringList> StringListPtr; + typedef std::shared_ptr<StringList> StringListPtr; typedef std::map<std::string, std::pair<StringListPtr,StringListPtr> > DiffMap; DiffMap mDiffsMap; // map, of filename to pair of list of changed element paths and list of errors diff --git a/indra/newview/llfloaterworldmap.cpp b/indra/newview/llfloaterworldmap.cpp index 5d72f8e3bf..14ff0da12f 100755 --- a/indra/newview/llfloaterworldmap.cpp +++ b/indra/newview/llfloaterworldmap.cpp @@ -315,6 +315,7 @@ void* LLFloaterWorldMap::createWorldMapView(void* data) BOOL LLFloaterWorldMap::postBuild() { mMapView = dynamic_cast<LLWorldMapView*>(getChild<LLPanel>("objects_mapview")); + mMapView->setPan(0, 0, true); LLComboBox *avatar_combo = getChild<LLComboBox>("friend combo"); avatar_combo->selectFirstItem(); diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp index 17a28e84bb..03e7b6e4f5 100644 --- a/indra/newview/llimview.cpp +++ b/indra/newview/llimview.cpp @@ -3168,9 +3168,11 @@ void LLIMMgr::addMessage( // Fetch group chat history, enabled by default. if (gSavedPerAccountSettings.getBOOL("FetchGroupChatHistory")) { - std::string chat_url = gAgent.getRegion()->getCapability("ChatSessionRequest"); - LLCoros::instance().launch("chatterBoxHistoryCoro", - boost::bind(&chatterBoxHistoryCoro, chat_url, session_id, from, msg, timestamp)); + std::string chat_url = gAgent.getRegionCapability("ChatSessionRequest"); + if (!chat_url.empty()) + { + LLCoros::instance().launch("chatterBoxHistoryCoro", boost::bind(&chatterBoxHistoryCoro, chat_url, session_id, from, msg, timestamp)); + } } //Play sound for new conversations diff --git a/indra/newview/llinspecttexture.cpp b/indra/newview/llinspecttexture.cpp index da4e3c0949..76e428b7d0 100644 --- a/indra/newview/llinspecttexture.cpp +++ b/indra/newview/llinspecttexture.cpp @@ -84,7 +84,10 @@ LLToolTip* LLInspectTextureUtil::createInventoryToolTip(LLToolTip::Params p) } } } - + if ((!p.message.isProvided() || p.message().empty())) + { + return NULL; + } // No or more than one texture found => show default tooltip return LLUICtrlFactory::create<LLToolTip>(p); } diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 988dffc8a5..4580fb7af4 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -2292,8 +2292,11 @@ BOOL LLFolderBridge::isItemMovable() const void LLFolderBridge::selectItem() { - // Have no fear: the first thing start() does is to test if everything for that folder has been fetched... - LLInventoryModelBackgroundFetch::instance().start(getUUID(), true); + LLViewerInventoryCategory* cat = gInventory.getCategory(getUUID()); + if (cat) + { + cat->fetch(); + } } void LLFolderBridge::buildDisplayName() const @@ -2789,7 +2792,7 @@ BOOL LLFolderBridge::dragCategoryIntoFolder(LLInventoryCategory* inv_cat, is_movable = can_move_folder_to_marketplace(master_folder, dest_folder, inv_cat, tooltip_msg, bundle_size); } - if (is_movable) + if (is_movable && !move_is_into_landmarks) { LLInventoryPanel* active_panel = LLInventoryPanel::getActiveInventoryPanel(FALSE); is_movable = active_panel != NULL; @@ -3006,7 +3009,7 @@ BOOL LLFolderBridge::dragCategoryIntoFolder(LLInventoryCategory* inv_cat, return accept; } -void warn_move_inventory(LLViewerObject* object, boost::shared_ptr<LLMoveInv> move_inv) +void warn_move_inventory(LLViewerObject* object, std::shared_ptr<LLMoveInv> move_inv) { const char* dialog = NULL; if (object->flagScripted()) @@ -3019,7 +3022,7 @@ void warn_move_inventory(LLViewerObject* object, boost::shared_ptr<LLMoveInv> mo } static LLNotificationPtr notification_ptr; - static boost::shared_ptr<LLMoveInv> inv_ptr; + static std::shared_ptr<LLMoveInv> inv_ptr; // Notification blocks user from interacting with inventories so everything that comes after first message // is part of this message - don'r show it again @@ -3132,7 +3135,7 @@ BOOL move_inv_category_world_to_agent(const LLUUID& object_id, if(drop && accept) { it = inventory_objects.begin(); - boost::shared_ptr<LLMoveInv> move_inv(new LLMoveInv); + std::shared_ptr<LLMoveInv> move_inv(new LLMoveInv); move_inv->mObjectID = object_id; move_inv->mCategoryID = category_id; move_inv->mCallback = callback; @@ -5179,7 +5182,7 @@ LLFontGL::StyleFlags LLMarketplaceFolderBridge::getLabelStyle() const // helper stuff -bool move_task_inventory_callback(const LLSD& notification, const LLSD& response, boost::shared_ptr<LLMoveInv> move_inv) +bool move_task_inventory_callback(const LLSD& notification, const LLSD& response, std::shared_ptr<LLMoveInv> move_inv) { LLFloaterOpenObject::LLCatAndWear* cat_and_wear = (LLFloaterOpenObject::LLCatAndWear* )move_inv->mUserData; LLViewerObject* object = gObjectList.findObject(move_inv->mObjectID); @@ -5674,7 +5677,7 @@ BOOL LLFolderBridge::dragItemIntoFolder(LLInventoryItem* inv_item, if (accept && drop) { LLUUID item_id = inv_item->getUUID(); - boost::shared_ptr<LLMoveInv> move_inv (new LLMoveInv()); + std::shared_ptr<LLMoveInv> move_inv (new LLMoveInv()); move_inv->mObjectID = inv_item->getParentUUID(); two_uuids_t item_pair(mUUID, item_id); move_inv->mMoveList.push_back(item_pair); diff --git a/indra/newview/llinventorybridge.h b/indra/newview/llinventorybridge.h index 8bdb76cdef..6fb7a56559 100644 --- a/indra/newview/llinventorybridge.h +++ b/indra/newview/llinventorybridge.h @@ -820,7 +820,7 @@ struct LLMoveInv void* mUserData; }; -void warn_move_inventory(LLViewerObject* object, boost::shared_ptr<LLMoveInv> move_inv); -bool move_task_inventory_callback(const LLSD& notification, const LLSD& response, boost::shared_ptr<LLMoveInv>); +void warn_move_inventory(LLViewerObject* object, std::shared_ptr<LLMoveInv> move_inv); +bool move_task_inventory_callback(const LLSD& notification, const LLSD& response, std::shared_ptr<LLMoveInv>); #endif // LL_LLINVENTORYBRIDGE_H diff --git a/indra/newview/llinventoryfilter.cpp b/indra/newview/llinventoryfilter.cpp index 7b4283e94d..332c6d3085 100644 --- a/indra/newview/llinventoryfilter.cpp +++ b/indra/newview/llinventoryfilter.cpp @@ -202,12 +202,18 @@ bool LLInventoryFilter::checkFolder(const LLUUID& folder_id) const && !LLInventoryModelBackgroundFetch::instance().inventoryFetchInProgress()) { LLViewerInventoryCategory* cat = gInventory.getCategory(folder_id); - if ((!cat && folder_id.notNull()) || (cat && cat->getVersion() == LLViewerInventoryCategory::VERSION_UNKNOWN)) + if ((!cat && folder_id.notNull())) { - // At the moment background fetch only cares about VERSION_UNKNOWN, - // so do not check isCategoryComplete that compares descendant count + // Shouldn't happen? Server provides full list of folders on startup LLInventoryModelBackgroundFetch::instance().start(folder_id, false); } + else if (cat && cat->getVersion() == LLViewerInventoryCategory::VERSION_UNKNOWN) + { + // At the moment background fetch only cares about VERSION_UNKNOWN, + // so do not check isCategoryComplete that compares descendant count, + // but if that is nesesary, do a forced scheduleFolderFetch. + cat->fetch(); + } } if (!checkAgainstFilterThumbnails(folder_id)) diff --git a/indra/newview/llinventoryfunctions.cpp b/indra/newview/llinventoryfunctions.cpp index 8a15281e78..4173510cb9 100644 --- a/indra/newview/llinventoryfunctions.cpp +++ b/indra/newview/llinventoryfunctions.cpp @@ -91,8 +91,6 @@ #include "llvoavatarself.h" #include "llwearablelist.h" -#include <boost/foreach.hpp> - BOOL LLInventoryState::sWearNewClothing = FALSE; LLUUID LLInventoryState::sWearNewClothingTransactionID; std::list<LLUUID> LLInventoryAction::sMarketplaceFolders; @@ -462,6 +460,13 @@ void copy_inventory_category(LLInventoryModel* model, gInventory.createNewCategory(parent_id, LLFolderType::FT_NONE, cat->getName(), func, cat->getThumbnailUUID()); } +void copy_cb(const LLUUID& dest_folder, const LLUUID& root_id) +{ + // Decrement the count in root_id since that one item won't be copied over + LLMarketplaceData::instance().decrementValidationWaiting(root_id); + update_folder_cb(dest_folder); +}; + void copy_inventory_category_content(const LLUUID& new_cat_uuid, LLInventoryModel* model, LLViewerInventoryCategory* cat, const LLUUID& root_copy_id, bool move_no_copy_items) { model->notifyObservers(); @@ -480,12 +485,21 @@ void copy_inventory_category_content(const LLUUID& new_cat_uuid, LLInventoryMode LLMarketplaceData::instance().setValidationWaiting(root_id, count_descendants_items(cat->getUUID())); } + LLPointer<LLInventoryCallback> cb; + if (root_copy_id.isNull()) + { + cb = new LLBoostFuncInventoryCallback(boost::bind(copy_cb, new_cat_uuid, root_id)); + } + else + { + cb = new LLBoostFuncInventoryCallback(boost::bind(update_folder_cb, new_cat_uuid)); + } + // Copy all the items LLInventoryModel::item_array_t item_array_copy = *item_array; for (LLInventoryModel::item_array_t::iterator iter = item_array_copy.begin(); iter != item_array_copy.end(); iter++) { LLInventoryItem* item = *iter; - LLPointer<LLInventoryCallback> cb = new LLBoostFuncInventoryCallback(boost::bind(update_folder_cb, new_cat_uuid)); if (item->getIsLinkType()) { @@ -500,8 +514,11 @@ void copy_inventory_category_content(const LLUUID& new_cat_uuid, LLInventoryMode LLViewerInventoryItem * viewer_inv_item = (LLViewerInventoryItem *)item; gInventory.changeItemParent(viewer_inv_item, new_cat_uuid, true); } - // Decrement the count in root_id since that one item won't be copied over - LLMarketplaceData::instance().decrementValidationWaiting(root_id); + if (root_copy_id.isNull()) + { + // Decrement the count in root_id since that one item won't be copied over + LLMarketplaceData::instance().decrementValidationWaiting(root_id); + } } else { @@ -3055,6 +3072,23 @@ bool get_selection_object_uuids(LLFolderView *root, uuid_vec_t& ids) void LLInventoryAction::doToSelected(LLInventoryModel* model, LLFolderView* root, const std::string& action, BOOL user_confirm) { std::set<LLFolderViewItem*> selected_items = root->getSelectionList(); + if (selected_items.empty() + && action != "wear" + && action != "wear_add" + && !isRemoveAction(action)) + { + // Was item removed while user was checking menu? + // "wear" and removal exlusions are due to use of + // getInventorySelectedUUIDs() below + LL_WARNS("Inventory") << "Menu tried to operate on empty selection" << LL_ENDL; + + if (("copy" == action) || ("cut" == action)) + { + LLClipboard::instance().reset(); + } + + return; + } // Prompt the user and check for authorization for some marketplace active listing edits if (user_confirm && (("delete" == action) || ("cut" == action) || ("rename" == action) || ("properties" == action) || ("task_properties" == action) || ("open" == action))) diff --git a/indra/newview/llinventorygallery.cpp b/indra/newview/llinventorygallery.cpp index 3c3da253d3..329c0d751a 100644 --- a/indra/newview/llinventorygallery.cpp +++ b/indra/newview/llinventorygallery.cpp @@ -2565,17 +2565,22 @@ void LLInventoryGallery::startDrag() } const LLViewerInventoryCategory* cat = gInventory.getCategory(selected_id); - if (cat && gInventory.isObjectDescendentOf(selected_id, gInventory.getRootFolderID()) - && !LLFolderType::lookupIsProtectedType((cat)->getPreferredType())) + if (cat) { - if (cat->getOwnerID() == ALEXANDRIA_LINDEN_ID) + if (gInventory.isObjectDescendentOf(selected_id, gInventory.getLibraryRootFolderID())) { src = LLToolDragAndDrop::SOURCE_LIBRARY; + EDragAndDropType type = LLViewerAssetType::lookupDragAndDropType(cat->getType()); + types.push_back(type); + ids.push_back(selected_id); + } + else if (gInventory.isObjectDescendentOf(selected_id, gInventory.getRootFolderID()) + && !LLFolderType::lookupIsProtectedType((cat)->getPreferredType())) + { + EDragAndDropType type = LLViewerAssetType::lookupDragAndDropType(cat->getType()); + types.push_back(type); + ids.push_back(selected_id); } - - EDragAndDropType type = LLViewerAssetType::lookupDragAndDropType(cat->getType()); - types.push_back(type); - ids.push_back(selected_id); } } LLToolDragAndDrop::getInstance()->beginMultiDrag(types, ids, src); @@ -3480,7 +3485,7 @@ BOOL dragItemIntoFolder(LLUUID folder_id, LLInventoryItem* inv_item, BOOL drop, if (accept && drop) { - boost::shared_ptr<LLMoveInv> move_inv (new LLMoveInv()); + std::shared_ptr<LLMoveInv> move_inv (new LLMoveInv()); move_inv->mObjectID = inv_item->getParentUUID(); std::pair<LLUUID, LLUUID> item_pair(folder_id, inv_item->getUUID()); move_inv->mMoveList.push_back(item_pair); diff --git a/indra/newview/llinventorymodel.cpp b/indra/newview/llinventorymodel.cpp index 10feb16346..35ee650618 100644 --- a/indra/newview/llinventorymodel.cpp +++ b/indra/newview/llinventorymodel.cpp @@ -3560,6 +3560,9 @@ void LLInventoryModel::processUpdateCreateInventoryItem(LLMessageSystem* msg, vo gInventoryCallbacks.fire(callback_id, item_id); + // Message system at the moment doesn't support Thumbnails and potential + // newer features so just rerequest whole item + // // todo: instead of unpacking message fully, // grab only an item_id, then fetch LLInventoryModelBackgroundFetch::instance().scheduleItemFetch(item_id, true); @@ -3922,19 +3925,22 @@ void LLInventoryModel::processBulkUpdateInventory(LLMessageSystem* msg, void**) for (cat_array_t::iterator cit = folders.begin(); cit != folders.end(); ++cit) { - gInventory.updateCategory(*cit); - - // Temporary workaround: just fetch the item using AIS to get missing fields. - // If this works fine we might want to extract ids only from the message - // then use AIS as a primary fetcher - LLInventoryModelBackgroundFetch::instance().scheduleFolderFetch((*cit)->getUUID(), true /*force, since it has changes*/); + gInventory.updateCategory(*cit); + if ((*cit)->getVersion() != LLViewerInventoryCategory::VERSION_UNKNOWN) + { + // Temporary workaround: just fetch the item using AIS to get missing fields. + // If this works fine we might want to extract 'ids only' from the message + // then use AIS as a primary fetcher + LLInventoryModelBackgroundFetch::instance().scheduleFolderFetch((*cit)->getUUID(), true /*force, since it has changes*/); + } + // else already called fetch() above } for (item_array_t::iterator iit = items.begin(); iit != items.end(); ++iit) { gInventory.updateItem(*iit); // Temporary workaround: just fetch the item using AIS to get missing fields. - // If this works fine we might want to extract ids only from the message + // If this works fine we might want to extract 'ids only' from the message // then use AIS as a primary fetcher LLInventoryModelBackgroundFetch::instance().scheduleItemFetch((*iit)->getUUID(), true); } diff --git a/indra/newview/llinventorymodelbackgroundfetch.cpp b/indra/newview/llinventorymodelbackgroundfetch.cpp index 1f410bea10..722447b5d7 100644 --- a/indra/newview/llinventorymodelbackgroundfetch.cpp +++ b/indra/newview/llinventorymodelbackgroundfetch.cpp @@ -193,13 +193,16 @@ LLInventoryModelBackgroundFetch::LLInventoryModelBackgroundFetch(): mLastFetchCount(0), mFetchFolderCount(0), mAllRecursiveFoldersFetched(false), - mRecursiveInventoryFetchStarted(false), - mRecursiveLibraryFetchStarted(false), - mMinTimeBetweenFetches(0.3f) + mRecursiveInventoryFetchStarted(false), + mRecursiveLibraryFetchStarted(false), + mRecursiveMarketplaceFetchStarted(false), + mMinTimeBetweenFetches(0.3f) {} LLInventoryModelBackgroundFetch::~LLInventoryModelBackgroundFetch() -{} +{ + gIdleCallbacks.deleteFunction(&LLInventoryModelBackgroundFetch::backgroundFetchCB, NULL); +} bool LLInventoryModelBackgroundFetch::isBulkFetchProcessingComplete() const { @@ -314,6 +317,23 @@ void LLInventoryModelBackgroundFetch::start(const LLUUID& id, bool recursive) gIdleCallbacks.addFunction(&LLInventoryModelBackgroundFetch::backgroundFetchCB, NULL); } } + else if (recursive && cat && cat->getPreferredType() == LLFolderType::FT_MARKETPLACE_LISTINGS) + { + if (mFetchFolderQueue.empty() || mFetchFolderQueue.back().mUUID != id) + { + if (recursive && AISAPI::isAvailable()) + { + // Request marketplace folder and content separately + mFetchFolderQueue.push_front(FetchQueueInfo(id, FT_FOLDER_AND_CONTENT)); + } + else + { + mFetchFolderQueue.push_front(FetchQueueInfo(id, recursion_type)); + } + gIdleCallbacks.addFunction(&LLInventoryModelBackgroundFetch::backgroundFetchCB, NULL); + mRecursiveMarketplaceFetchStarted = true; + } + } else { if (AISAPI::isAvailable()) @@ -359,8 +379,22 @@ void LLInventoryModelBackgroundFetch::scheduleFolderFetch(const LLUUID& cat_id, mBackgroundFetchActive = true; mFolderFetchActive = true; - // Specific folder requests go to front of queue. - mFetchFolderQueue.push_front(FetchQueueInfo(cat_id, forced ? FT_FORCED : FT_DEFAULT)); + if (forced) + { + // check if already requested + if (mForceFetchSet.find(cat_id) == mForceFetchSet.end()) + { + mForceFetchSet.insert(cat_id); + mFetchItemQueue.push_front(FetchQueueInfo(cat_id, FT_FORCED)); + } + } + else + { + // Specific folder requests go to front of queue. + // version presence acts as dupplicate prevention for normal fetches + mFetchItemQueue.push_front(FetchQueueInfo(cat_id, FT_DEFAULT)); + } + gIdleCallbacks.addFunction(&LLInventoryModelBackgroundFetch::backgroundFetchCB, NULL); } } @@ -370,8 +404,21 @@ void LLInventoryModelBackgroundFetch::scheduleItemFetch(const LLUUID& item_id, b if (mFetchItemQueue.empty() || mFetchItemQueue.front().mUUID != item_id) { mBackgroundFetchActive = true; + if (forced) + { + // check if already requested + if (mForceFetchSet.find(item_id) == mForceFetchSet.end()) + { + mForceFetchSet.insert(item_id); + mFetchItemQueue.push_front(FetchQueueInfo(item_id, FT_FORCED, false)); + } + } + else + { + // 'isFinished' being set acts as dupplicate prevention for normal fetches + mFetchItemQueue.push_front(FetchQueueInfo(item_id, FT_DEFAULT, false)); + } - mFetchItemQueue.push_front(FetchQueueInfo(item_id, forced ? FT_FORCED : FT_DEFAULT, false)); gIdleCallbacks.addFunction(&LLInventoryModelBackgroundFetch::backgroundFetchCB, NULL); } } @@ -591,6 +638,7 @@ void LLInventoryModelBackgroundFetch::onAISFolderCalback(const LLUUID &request_i return; } + LLViewerInventoryCategory::EFetchType new_state = LLViewerInventoryCategory::FETCH_NONE; bool request_descendants = false; if (response_id.isNull()) // Failure { @@ -608,10 +656,12 @@ void LLInventoryModelBackgroundFetch::onAISFolderCalback(const LLUUID &request_i // set folder's version to prevent viewer from trying to request folder indefinetely LLViewerInventoryCategory* cat(gInventory.getCategory(request_id)); - if (cat->getVersion() == LLViewerInventoryCategory::VERSION_UNKNOWN) + if (cat && cat->getVersion() == LLViewerInventoryCategory::VERSION_UNKNOWN) { cat->setVersion(0); } + // back off for a bit in case something tries to force-request immediately + new_state = LLViewerInventoryCategory::FETCH_FAILED; } } else @@ -664,7 +714,7 @@ void LLInventoryModelBackgroundFetch::onAISFolderCalback(const LLUUID &request_i LLViewerInventoryCategory * cat(gInventory.getCategory(request_id)); if (cat) { - cat->setFetching(LLViewerInventoryCategory::FETCH_NONE); + cat->setFetching(new_state); } } @@ -753,7 +803,26 @@ void LLInventoryModelBackgroundFetch::bulkFetchViaAis() if (isFolderFetchProcessingComplete() && mFolderFetchActive) { - setAllFoldersFetched(); + if (!mRecursiveInventoryFetchStarted || mRecursiveMarketplaceFetchStarted) + { + setAllFoldersFetched(); + } + else + { + // Intent is for marketplace request to happen after + // main inventory is done, unless requested by floater + mRecursiveMarketplaceFetchStarted = true; + const LLUUID& marketplacelistings_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_MARKETPLACE_LISTINGS); + if (marketplacelistings_id.notNull()) + { + mFetchFolderQueue.push_front(FetchQueueInfo(marketplacelistings_id, FT_FOLDER_AND_CONTENT)); + } + else + { + setAllFoldersFetched(); + } + } + } if (isBulkFetchProcessingComplete()) @@ -813,22 +882,8 @@ void LLInventoryModelBackgroundFetch::bulkFetchViaAis(const FetchQueueInfo& fetc if (child_cat->getPreferredType() == LLFolderType::FT_MARKETPLACE_LISTINGS) { - // special case - content_done = false; - if (children.empty()) - { - // fetch marketplace alone - // Should it actually be fetched as FT_FOLDER_AND_CONTENT? - children.push_back(child_cat->getUUID()); - mExpectedFolderIds.push_back(child_cat->getUUID()); - child_cat->setFetching(target_state); - break; - } - else - { - // fetch marketplace alone next run - continue; - } + // special case, marketplace will fetch that as needed + continue; } children.push_back(child_cat->getUUID()); @@ -902,10 +957,10 @@ void LLInventoryModelBackgroundFetch::bulkFetchViaAis(const FetchQueueInfo& fetc mExpectedFolderIds.push_back(cat_id); EFetchType type = fetch_info.mFetchType; - LLUUID cat_id = cat->getUUID(); - AISAPI::completion_t cb = [cat_id , type](const LLUUID& response_id) + LLUUID cat_cb_id = cat_id; + AISAPI::completion_t cb = [cat_cb_id, type](const LLUUID& response_id) { - LLInventoryModelBackgroundFetch::instance().onAISFolderCalback(cat_id , response_id , type); + LLInventoryModelBackgroundFetch::instance().onAISFolderCalback(cat_cb_id, response_id , type); }; AISAPI::ITEM_TYPE item_type = AISAPI::INVENTORY; @@ -964,6 +1019,11 @@ void LLInventoryModelBackgroundFetch::bulkFetchViaAis(const FetchQueueInfo& fetc AISAPI::FetchItem(fetch_info.mUUID, AISAPI::INVENTORY, ais_simple_item_callback); } } + + if (fetch_info.mFetchType == FT_FORCED) + { + mForceFetchSet.erase(fetch_info.mUUID); + } } // Bundle up a bunch of requests to send all at once. diff --git a/indra/newview/llinventorymodelbackgroundfetch.h b/indra/newview/llinventorymodelbackgroundfetch.h index a712fc7604..989968be53 100644 --- a/indra/newview/llinventorymodelbackgroundfetch.h +++ b/indra/newview/llinventorymodelbackgroundfetch.h @@ -76,7 +76,6 @@ public: void incrFetchFolderCount(S32 fetching); bool isBulkFetchProcessingComplete() const; - bool isFolderFetchProcessingComplete() const; void setAllFoldersFetched(); typedef boost::function<void()> folders_fetched_callback_t; @@ -86,6 +85,7 @@ public: void addRequestAtBack(const LLUUID & id, bool recursive, bool is_category); protected: + bool isFolderFetchProcessingComplete() const; typedef enum { FT_DEFAULT = 0, @@ -122,6 +122,7 @@ protected: private: bool mRecursiveInventoryFetchStarted; bool mRecursiveLibraryFetchStarted; + bool mRecursiveMarketplaceFetchStarted; // AIS3 specific bool mAllRecursiveFoldersFetched; typedef boost::signals2::signal<void()> folders_fetched_signal_t; folders_fetched_signal_t mFoldersFetchedSignal; @@ -136,6 +137,7 @@ private: F32 mMinTimeBetweenFetches; fetch_queue_t mFetchFolderQueue; fetch_queue_t mFetchItemQueue; + uuid_set_t mForceFetchSet; std::list<LLUUID> mExpectedFolderIds; // for debug, should this track time? }; diff --git a/indra/newview/llinventoryobserver.cpp b/indra/newview/llinventoryobserver.cpp index e1eaa18206..15cd7957a2 100644 --- a/indra/newview/llinventoryobserver.cpp +++ b/indra/newview/llinventoryobserver.cpp @@ -356,7 +356,6 @@ void LLInventoryFetchItemsObserver::startFetch() { // Start fetching whole folder since we need all items LLInventoryModelBackgroundFetch::getInstance()->scheduleFolderFetch(folder.first, true); - } else { diff --git a/indra/newview/lllogchat.cpp b/indra/newview/lllogchat.cpp index 5f3ad7c58f..9774f75fa6 100644 --- a/indra/newview/lllogchat.cpp +++ b/indra/newview/lllogchat.cpp @@ -42,7 +42,6 @@ #include <boost/algorithm/string/trim.hpp> #include <boost/algorithm/string/replace.hpp> #include <boost/regex.hpp> -#include <boost/foreach.hpp> #if LL_MSVC #pragma warning(push) @@ -730,7 +729,7 @@ bool LLLogChat::moveTranscripts(const std::string originDirectory, std::string backupFileName; unsigned backupFileCount; - BOOST_FOREACH(const std::string& fullpath, listOfFilesToMove) + for (const std::string& fullpath : listOfFilesToMove) { backupFileCount = 0; newFullPath = targetDirectory + fullpath.substr(originDirectory.length(), std::string::npos); @@ -744,7 +743,7 @@ bool LLLogChat::moveTranscripts(const std::string originDirectory, while(LLFile::isfile(backupFileName)) { ++backupFileCount; - backupFileName = newFullPath + ".backup" + boost::lexical_cast<std::string>(backupFileCount); + backupFileName = newFullPath + ".backup" + std::to_string(backupFileCount); } //Rename the file to its backup name so it is not overwritten @@ -801,7 +800,7 @@ void LLLogChat::deleteTranscripts() getListOfTranscriptFiles(list_of_transcriptions); getListOfTranscriptBackupFiles(list_of_transcriptions); - BOOST_FOREACH(const std::string& fullpath, list_of_transcriptions) + for (const std::string& fullpath : list_of_transcriptions) { S32 retry_count = 0; while (retry_count < 5) diff --git a/indra/newview/lllogininstance.h b/indra/newview/lllogininstance.h index 2e9aab7c00..74d6890d1d 100644 --- a/indra/newview/lllogininstance.h +++ b/indra/newview/lllogininstance.h @@ -90,7 +90,7 @@ private: void attemptComplete() { mAttemptComplete = true; } // In the future an event? - boost::scoped_ptr<LLLogin> mLoginModule; + std::unique_ptr<LLLogin> mLoginModule; LLNotificationsInterface* mNotifications; std::string mLoginState; diff --git a/indra/newview/llmachineid.cpp b/indra/newview/llmachineid.cpp index 583742f970..1f4418f119 100644 --- a/indra/newview/llmachineid.cpp +++ b/indra/newview/llmachineid.cpp @@ -85,11 +85,11 @@ void LLWMIMethods::initCOMObjects() // Step 1: -------------------------------------------------- // Initialize COM. ------------------------------------------ - mHR = CoInitializeEx(0, COINIT_MULTITHREADED); + mHR = CoInitializeEx(0, COINIT_APARTMENTTHREADED); if (FAILED(mHR)) { + // if result S_FALSE, it's already initialized LL_DEBUGS("AppInit") << "Failed to initialize COM library. Error code = 0x" << std::hex << mHR << LL_ENDL; - return; } // Step 2: -------------------------------------------------- diff --git a/indra/newview/llmarketplacefunctions.cpp b/indra/newview/llmarketplacefunctions.cpp index 8784f403cb..d27ee941a6 100644 --- a/indra/newview/llmarketplacefunctions.cpp +++ b/indra/newview/llmarketplacefunctions.cpp @@ -611,27 +611,17 @@ private: static void onIdleProcessQueue(void *userdata); // doesn't hold just marketplace related ids - static std::set<LLUUID> sAddQueue; static std::set<LLUUID> sStructureQueue; static bool sProcessingQueue; }; -std::set<LLUUID> LLMarketplaceInventoryObserver::sAddQueue; std::set<LLUUID> LLMarketplaceInventoryObserver::sStructureQueue; bool LLMarketplaceInventoryObserver::sProcessingQueue = false; void LLMarketplaceInventoryObserver::changed(U32 mask) { - if (mask & LLInventoryObserver::ADD && LLMarketplaceData::instance().hasValidationWaiting()) - { - // When things are added to the marketplace, we might need to re-validate and fix the containing listings - // just add whole list even if it contains items and non-marketplace folders - const std::set<LLUUID>& changed_items = gInventory.getChangedIDs(); - sAddQueue.insert(changed_items.begin(), changed_items.end()); - } - - if (mask & (LLInventoryObserver::INTERNAL | LLInventoryObserver::STRUCTURE)) - { + if (mask & (LLInventoryObserver::INTERNAL | LLInventoryObserver::STRUCTURE)) + { // When things are changed in the inventory, this can trigger a host of changes in the marketplace listings folder: // * stock counts changing : no copy items coming in and out will change the stock count on folders // * version and listing folders : moving those might invalidate the marketplace data itself @@ -641,7 +631,7 @@ void LLMarketplaceInventoryObserver::changed(U32 mask) sStructureQueue.insert(changed_items.begin(), changed_items.end()); } - if (!sProcessingQueue && (!sAddQueue.empty() || !sStructureQueue.empty())) + if (!sProcessingQueue && !sStructureQueue.empty()) { gIdleCallbacks.addFunction(onIdleProcessQueue, NULL); // can do without sProcessingQueue, but it's usufull for simplicity and reliability @@ -655,40 +645,6 @@ void LLMarketplaceInventoryObserver::onIdleProcessQueue(void *userdata) const U64 MAX_PROCESSING_TIME = 1000; U64 stop_time = start_time + MAX_PROCESSING_TIME; - if (!sAddQueue.empty()) - { - // Make a copy of sAddQueue since decrementValidationWaiting - // can theoretically add more items - std::set<LLUUID> add_queue(sAddQueue); - sAddQueue.clear(); - - std::set<LLUUID>::const_iterator id_it = add_queue.begin(); - std::set<LLUUID>::const_iterator id_end = add_queue.end(); - // First, count the number of items in this list... - S32 count = 0; - for (; id_it != id_end; ++id_it) - { - LLInventoryObject* obj = gInventory.getObject(*id_it); - if (obj && (LLAssetType::AT_CATEGORY != obj->getType())) - { - count++; - } - } - // Then, decrement the folders of that amount - // Note that of all of those, only one folder will be a listing folder (if at all). - // The other will be ignored by the decrement method. - id_it = add_queue.begin(); - for (; id_it != id_end; ++id_it) - { - LLInventoryObject* obj = gInventory.getObject(*id_it); - if (obj && (LLAssetType::AT_CATEGORY == obj->getType())) - { - // can trigger notifyObservers - LLMarketplaceData::instance().decrementValidationWaiting(obj->getUUID(), count); - } - } - } - while (!sStructureQueue.empty() && LLTimer::getTotalTime() < stop_time) { std::set<LLUUID>::const_iterator id_it = sStructureQueue.begin(); @@ -722,7 +678,7 @@ void LLMarketplaceInventoryObserver::onIdleProcessQueue(void *userdata) sStructureQueue.erase(id_it); } - if (LLApp::isExiting() || (sAddQueue.empty() && sStructureQueue.empty())) + if (LLApp::isExiting() || sStructureQueue.empty()) { // Nothing to do anymore gIdleCallbacks.deleteFunction(onIdleProcessQueue, NULL); diff --git a/indra/newview/llmarketplacenotifications.cpp b/indra/newview/llmarketplacenotifications.cpp index 0886f9a990..02bd9e1f34 100644 --- a/indra/newview/llmarketplacenotifications.cpp +++ b/indra/newview/llmarketplacenotifications.cpp @@ -33,7 +33,6 @@ #include "llerror.h" -#include <boost/foreach.hpp> #include <boost/signals2.hpp> @@ -54,7 +53,7 @@ namespace LLMarketplaceInventoryNotifications llassert(!no_copy_payloads.empty()); llassert(no_copy_cb_action != NULL); - BOOST_FOREACH(const LLSD& payload, no_copy_payloads) + for (const LLSD& payload : no_copy_payloads) { (*no_copy_cb_action)(payload); } diff --git a/indra/newview/llmaterialmgr.cpp b/indra/newview/llmaterialmgr.cpp index 3b59b2f05e..577ab0048f 100644 --- a/indra/newview/llmaterialmgr.cpp +++ b/indra/newview/llmaterialmgr.cpp @@ -68,7 +68,7 @@ class LLMaterialHttpHandler : public LLHttpSDHandler { public: typedef boost::function<void(bool, const LLSD&)> CallbackFunction; - typedef boost::shared_ptr<LLMaterialHttpHandler> ptr_t; + typedef std::shared_ptr<LLMaterialHttpHandler> ptr_t; LLMaterialHttpHandler(const std::string& method, CallbackFunction cback); diff --git a/indra/newview/llmediadataclient.h b/indra/newview/llmediadataclient.h index 58f8bad3e4..8cd4793106 100644 --- a/indra/newview/llmediadataclient.h +++ b/indra/newview/llmediadataclient.h @@ -116,10 +116,10 @@ protected: // Request (pure virtual base class for requests in the queue) class Request: - public boost::enable_shared_from_this<Request> + public std::enable_shared_from_this<Request> { public: - typedef boost::shared_ptr<Request> ptr_t; + typedef std::shared_ptr<Request> ptr_t; // Subclasses must implement this to build a payload for their request type. virtual LLSD getPayload() const = 0; diff --git a/indra/newview/llmeshrepository.cpp b/indra/newview/llmeshrepository.cpp index 48fd946a21..a5601dafbe 100644 --- a/indra/newview/llmeshrepository.cpp +++ b/indra/newview/llmeshrepository.cpp @@ -411,7 +411,7 @@ namespace { static S32 dump_num = 0; std::string make_dump_name(std::string prefix, S32 num) { - return prefix + boost::lexical_cast<std::string>(num) + std::string(".xml"); + return prefix + std::to_string(num) + std::string(".xml"); } void dump_llsd_to_file(const LLSD& content, std::string filename); LLSD llsd_from_file(std::string filename); @@ -572,10 +572,10 @@ S32 LLMeshRepoThread::sRequestWaterLevel = 0; // LLMeshUploadThread class LLMeshHandlerBase : public LLCore::HttpHandler, - public boost::enable_shared_from_this<LLMeshHandlerBase> + public std::enable_shared_from_this<LLMeshHandlerBase> { public: - typedef boost::shared_ptr<LLMeshHandlerBase> ptr_t; + typedef std::shared_ptr<LLMeshHandlerBase> ptr_t; LOG_CLASS(LLMeshHandlerBase); LLMeshHandlerBase(U32 offset, U32 requested_bytes) diff --git a/indra/newview/llmodelpreview.cpp b/indra/newview/llmodelpreview.cpp index ddfaa9b23f..dba6e1ff46 100644 --- a/indra/newview/llmodelpreview.cpp +++ b/indra/newview/llmodelpreview.cpp @@ -220,6 +220,16 @@ LLModelPreview::~LLModelPreview() mPreviewAvatar->markDead(); mPreviewAvatar = NULL; } + + mUploadData.clear(); + mTextureSet.clear(); + + for (U32 i = 0; i < LLModel::NUM_LODS; i++) + { + clearModel(i); + } + mBaseModel.clear(); + mBaseScene.clear(); } void LLModelPreview::updateDimentionsAndOffsets() diff --git a/indra/newview/llmodelpreview.h b/indra/newview/llmodelpreview.h index f68cec4441..a62c3a5ab0 100644 --- a/indra/newview/llmodelpreview.h +++ b/indra/newview/llmodelpreview.h @@ -310,7 +310,6 @@ protected: vv_LLVolumeFace_t mBaseModelFacesCopy; U32 mGroup; - std::map<LLPointer<LLModel>, U32> mObject; // Amount of triangles in original(base) model U32 mMaxTriangleLimit; diff --git a/indra/newview/llnotificationmanager.cpp b/indra/newview/llnotificationmanager.cpp index b06131cf38..3f6a86106a 100644 --- a/indra/newview/llnotificationmanager.cpp +++ b/indra/newview/llnotificationmanager.cpp @@ -34,9 +34,6 @@ #include "llfloaterimnearbychathandler.h" #include "llnotifications.h" -#include <boost/bind.hpp> -#include <boost/foreach.hpp> - using namespace LLNotificationsUI; //-------------------------------------------------------------------------- @@ -53,15 +50,15 @@ LLNotificationManager::~LLNotificationManager() //-------------------------------------------------------------------------- void LLNotificationManager::init() { - mChannels.push_back(new LLScriptHandler()); - mChannels.push_back(new LLTipHandler()); - mChannels.push_back(new LLGroupHandler()); - mChannels.push_back(new LLAlertHandler("Alerts", "alert", false)); - mChannels.push_back(new LLAlertHandler("AlertModal", "alertmodal", true)); - mChannels.push_back(new LLOfferHandler()); - mChannels.push_back(new LLHintHandler()); - mChannels.push_back(new LLBrowserNotification()); - mChannels.push_back(new LLIMHandler()); + mChannels.emplace_back(new LLScriptHandler()); + mChannels.emplace_back(new LLTipHandler()); + mChannels.emplace_back(new LLGroupHandler()); + mChannels.emplace_back(new LLAlertHandler("Alerts", "alert", false)); + mChannels.emplace_back(new LLAlertHandler("AlertModal", "alertmodal", true)); + mChannels.emplace_back(new LLOfferHandler()); + mChannels.emplace_back(new LLHintHandler()); + mChannels.emplace_back(new LLBrowserNotification()); + mChannels.emplace_back(new LLIMHandler()); mChatHandler = std::shared_ptr<LLFloaterIMNearbyChatHandler>(new LLFloaterIMNearbyChatHandler()); } diff --git a/indra/newview/lloutfitgallery.cpp b/indra/newview/lloutfitgallery.cpp index 65ec38a41d..efffcefc4a 100644 --- a/indra/newview/lloutfitgallery.cpp +++ b/indra/newview/lloutfitgallery.cpp @@ -28,8 +28,6 @@ #include "llviewerprecompiledheaders.h" // must be first include #include "lloutfitgallery.h" -#include <boost/foreach.hpp> - // llcommon #include "llcommonutils.h" #include "llfilesystem.h" @@ -1151,22 +1149,13 @@ LLContextMenu* LLOutfitGalleryContextMenu::createMenu() registrar.add("Outfit.Delete", boost::bind(LLOutfitGallery::onRemoveOutfit, selected_id)); registrar.add("Outfit.Create", boost::bind(&LLOutfitGalleryContextMenu::onCreate, this, _2)); registrar.add("Outfit.Thumbnail", boost::bind(&LLOutfitGalleryContextMenu::onThumbnail, this, selected_id)); + registrar.add("Outfit.Save", boost::bind(&LLOutfitGalleryContextMenu::onSave, this, selected_id)); enable_registrar.add("Outfit.OnEnable", boost::bind(&LLOutfitGalleryContextMenu::onEnable, this, _2)); enable_registrar.add("Outfit.OnVisible", boost::bind(&LLOutfitGalleryContextMenu::onVisible, this, _2)); return createFromFile("menu_gallery_outfit_tab.xml"); } -void LLOutfitGalleryContextMenu::onThumbnail(const LLUUID& outfit_cat_id) -{ - LLOutfitGallery* gallery = dynamic_cast<LLOutfitGallery*>(mOutfitList); - if (gallery && outfit_cat_id.notNull()) - { - LLSD data(outfit_cat_id); - LLFloaterReg::showInstance("change_item_thumbnail", data); - } -} - void LLOutfitGalleryContextMenu::onCreate(const LLSD& data) { LLWearableType::EType type = LLWearableType::getInstance()->typeNameToType(data.asString()); @@ -1201,7 +1190,6 @@ void LLOutfitGalleryGearMenu::onUpdateItemsVisibility() mMenu->setItemVisible("expand", FALSE); mMenu->setItemVisible("collapse", FALSE); mMenu->setItemVisible("thumbnail", have_selection); - mMenu->setItemVisible("sepatator3", TRUE); mMenu->setItemVisible("sort_folders_by_name", TRUE); LLOutfitListGearMenuBase::onUpdateItemsVisibility(); } @@ -1249,7 +1237,7 @@ void LLOutfitGallery::refreshOutfit(const LLUUID& category_id) sub_cat_array, outfit_item_array, LLInventoryModel::EXCLUDE_TRASH); - BOOST_FOREACH(LLViewerInventoryItem* outfit_item, outfit_item_array) + for (LLViewerInventoryItem* outfit_item : outfit_item_array) { LLViewerInventoryItem* linked_item = outfit_item->getLinkedItem(); LLUUID asset_id, inv_id; diff --git a/indra/newview/lloutfitgallery.h b/indra/newview/lloutfitgallery.h index f2366e6494..99371b1cec 100644 --- a/indra/newview/lloutfitgallery.h +++ b/indra/newview/lloutfitgallery.h @@ -193,17 +193,13 @@ public: friend class LLOutfitGallery; LLOutfitGalleryContextMenu(LLOutfitListBase* outfit_list) - : LLOutfitContextMenu(outfit_list), - mOutfitList(outfit_list){} + : LLOutfitContextMenu(outfit_list){} protected: /* virtual */ LLContextMenu* createMenu(); bool onEnable(LLSD::String param); bool onVisible(LLSD::String param); - void onThumbnail(const LLUUID& outfit_cat_id); void onCreate(const LLSD& data); -private: - LLOutfitListBase* mOutfitList; }; diff --git a/indra/newview/lloutfitslist.cpp b/indra/newview/lloutfitslist.cpp index 352d59a9c2..d6d222153c 100644 --- a/indra/newview/lloutfitslist.cpp +++ b/indra/newview/lloutfitslist.cpp @@ -37,6 +37,7 @@ #include "llappearancemgr.h" #include "llfloaterreg.h" #include "llfloatersidepanelcontainer.h" +#include "llinspecttexture.h" #include "llinventoryfunctions.h" #include "llinventorymodel.h" #include "llmenubutton.h" @@ -62,7 +63,7 @@ bool LLOutfitTabNameComparator::compare(const LLAccordionCtrlTab* tab1, const LL return (LLStringUtil::compareDict(name1, name2) < 0); } -struct outfit_accordion_tab_params : public LLInitParam::Block<outfit_accordion_tab_params, LLAccordionCtrlTab::Params> +struct outfit_accordion_tab_params : public LLInitParam::Block<outfit_accordion_tab_params, LLOutfitAccordionCtrlTab::Params> { Mandatory<LLWearableItemsList::Params> wearable_list; @@ -144,7 +145,8 @@ void LLOutfitsList::updateAddedCategory(LLUUID cat_id) std::string name = cat->getName(); outfit_accordion_tab_params tab_params(get_accordion_tab_params()); - LLAccordionCtrlTab* tab = LLUICtrlFactory::create<LLAccordionCtrlTab>(tab_params); + tab_params.cat_id = cat_id; + LLOutfitAccordionCtrlTab *tab = LLUICtrlFactory::create<LLOutfitAccordionCtrlTab>(tab_params); if (!tab) return; LLWearableItemsList* wearable_list = LLUICtrlFactory::create<LLWearableItemsList>(tab_params.wearable_list); wearable_list->setShape(tab->getLocalRect()); @@ -1064,6 +1066,8 @@ LLContextMenu* LLOutfitContextMenu::createMenu() registrar.add("Outfit.Edit", boost::bind(editOutfit)); registrar.add("Outfit.Rename", boost::bind(renameOutfit, selected_id)); registrar.add("Outfit.Delete", boost::bind(&LLOutfitListBase::removeSelected, mOutfitList)); + registrar.add("Outfit.Thumbnail", boost::bind(&LLOutfitContextMenu::onThumbnail, this, selected_id)); + registrar.add("Outfit.Save", boost::bind(&LLOutfitContextMenu::onSave, this, selected_id)); enable_registrar.add("Outfit.OnEnable", boost::bind(&LLOutfitContextMenu::onEnable, this, _2)); enable_registrar.add("Outfit.OnVisible", boost::bind(&LLOutfitContextMenu::onVisible, this, _2)); @@ -1128,6 +1132,31 @@ void LLOutfitContextMenu::renameOutfit(const LLUUID& outfit_cat_id) LLAppearanceMgr::instance().renameOutfit(outfit_cat_id); } +void LLOutfitContextMenu::onThumbnail(const LLUUID &outfit_cat_id) +{ + if (outfit_cat_id.notNull()) + { + LLSD data(outfit_cat_id); + LLFloaterReg::showInstance("change_item_thumbnail", data); + } +} + +void LLOutfitContextMenu::onSave(const LLUUID &outfit_cat_id) +{ + if (outfit_cat_id.notNull()) + { + LLNotificationsUtil::add("ConfirmOverwriteOutfit", LLSD(), LLSD(), + [outfit_cat_id](const LLSD ¬if, const LLSD &resp) + { + S32 opt = LLNotificationsUtil::getSelectedOption(notif, resp); + if (opt == 0) + { + LLAppearanceMgr::getInstance()->onOutfitFolderCreated(outfit_cat_id, true); + } + }); + } +} + LLOutfitListGearMenuBase::LLOutfitListGearMenuBase(LLOutfitListBase* olist) : mOutfitList(olist), mMenu(NULL) @@ -1146,6 +1175,7 @@ LLOutfitListGearMenuBase::LLOutfitListGearMenuBase(LLOutfitListBase* olist) registrar.add("Gear.Expand", boost::bind(&LLOutfitListBase::onExpandAllFolders, mOutfitList)); registrar.add("Gear.WearAdd", boost::bind(&LLOutfitListGearMenuBase::onAdd, this)); + registrar.add("Gear.Save", boost::bind(&LLOutfitListGearMenuBase::onSave, this)); registrar.add("Gear.Thumbnail", boost::bind(&LLOutfitListGearMenuBase::onThumbnail, this)); registrar.add("Gear.SortByName", boost::bind(&LLOutfitListGearMenuBase::onChangeSortOrder, this)); @@ -1171,8 +1201,7 @@ void LLOutfitListGearMenuBase::onUpdateItemsVisibility() if (!mMenu) return; bool have_selection = getSelectedOutfitID().notNull(); - mMenu->setItemVisible("sepatator1", have_selection); - mMenu->setItemVisible("sepatator2", have_selection); + mMenu->setItemVisible("wear_separator", have_selection); mMenu->arrangeAndClear(); // update menu height } @@ -1217,6 +1246,20 @@ void LLOutfitListGearMenuBase::onAdd() } } +void LLOutfitListGearMenuBase::onSave() +{ + const LLUUID &selected_id = getSelectedOutfitID(); + LLNotificationsUtil::add("ConfirmOverwriteOutfit", LLSD(), LLSD(), + [selected_id](const LLSD ¬if, const LLSD &resp) + { + S32 opt = LLNotificationsUtil::getSelectedOption(notif, resp); + if (opt == 0) + { + LLAppearanceMgr::getInstance()->onOutfitFolderCreated(selected_id, true); + } + }); +} + void LLOutfitListGearMenuBase::onTakeOff() { // Take off selected outfit. @@ -1270,15 +1313,6 @@ bool LLOutfitListGearMenuBase::onVisible(LLSD::String param) return false; } - // *TODO This condition leads to menu item behavior inconsistent with - // "Wear" button behavior and should be modified or removed. - bool is_worn = LLAppearanceMgr::instance().getBaseOutfitUUID() == selected_outfit_id; - - if ("wear" == param) - { - return !is_worn; - } - return true; } @@ -1306,10 +1340,29 @@ void LLOutfitListGearMenu::onUpdateItemsVisibility() if (!mMenu) return; mMenu->setItemVisible("expand", TRUE); mMenu->setItemVisible("collapse", TRUE); - mMenu->setItemVisible("thumbnail", FALSE); // Never visible? - mMenu->setItemVisible("sepatator3", FALSE); + mMenu->setItemVisible("thumbnail", getSelectedOutfitID().notNull()); mMenu->setItemVisible("sort_folders_by_name", FALSE); LLOutfitListGearMenuBase::onUpdateItemsVisibility(); } +BOOL LLOutfitAccordionCtrlTab::handleToolTip(S32 x, S32 y, MASK mask) +{ + if (y >= getLocalRect().getHeight() - getHeaderHeight()) + { + LLSD params; + params["inv_type"] = LLInventoryType::IT_CATEGORY; + params["thumbnail_id"] = gInventory.getCategory(mFolderID)->getThumbnailUUID(); + params["item_id"] = mFolderID; + + LLToolTipMgr::instance().show(LLToolTip::Params() + .message(getToolTip()) + .sticky_rect(calcScreenRect()) + .delay_time(LLView::getTooltipTimeout()) + .create_callback(boost::bind(&LLInspectTextureUtil::createInventoryToolTip, _1)) + .create_params(params)); + return TRUE; + } + + return LLAccordionCtrlTab::handleToolTip(x, y, mask); +} // EOF diff --git a/indra/newview/lloutfitslist.h b/indra/newview/lloutfitslist.h index 980b9c3970..6b7f4bafad 100644 --- a/indra/newview/lloutfitslist.h +++ b/indra/newview/lloutfitslist.h @@ -31,6 +31,7 @@ #include "llpanel.h" // newview +#include "llaccordionctrltab.h" #include "llinventorymodel.h" #include "lllistcontextmenu.h" #include "llpanelappearancetab.h" @@ -161,6 +162,9 @@ protected: static void renameOutfit(const LLUUID& outfit_cat_id); + void onThumbnail(const LLUUID &outfit_cat_id); + void onSave(const LLUUID &outfit_cat_id); + private: LLOutfitListBase* mOutfitList; }; @@ -192,6 +196,7 @@ private: void onAdd(); void onTakeOff(); void onRename(); + void onSave(); void onCreate(const LLSD& data); bool onEnable(LLSD::String param); bool onVisible(LLSD::String param); @@ -207,7 +212,27 @@ protected: /*virtual*/ void onUpdateItemsVisibility(); }; -/** +class LLOutfitAccordionCtrlTab : public LLAccordionCtrlTab +{ +public: + struct Params : public LLInitParam::Block<Params, LLAccordionCtrlTab::Params> + { + Optional<LLUUID> cat_id; + Params() : cat_id("cat_id") {} + }; + + virtual BOOL handleToolTip(S32 x, S32 y, MASK mask); + + protected: + LLOutfitAccordionCtrlTab(const LLOutfitAccordionCtrlTab::Params &p) + : LLAccordionCtrlTab(p), + mFolderID(p.cat_id) + {} + friend class LLUICtrlFactory; + + LLUUID mFolderID; +}; + /** * @class LLOutfitsList * * A list of agents's outfits from "My Outfits" inventory category diff --git a/indra/newview/llpanelexperiencelisteditor.cpp b/indra/newview/llpanelexperiencelisteditor.cpp index 0fdb9a57f3..854a32621a 100644 --- a/indra/newview/llpanelexperiencelisteditor.cpp +++ b/indra/newview/llpanelexperiencelisteditor.cpp @@ -40,7 +40,6 @@ #include "lltextbox.h" #include "lltrans.h" #include "llsdutil.h" -#include <boost/foreach.hpp> static LLPanelInjector<LLPanelExperienceListEditor> t_panel_experience_list_editor("panel_experience_list_editor"); @@ -96,7 +95,7 @@ void LLPanelExperienceListEditor::addExperienceIds( const uuid_vec_t& experience void LLPanelExperienceListEditor::setExperienceIds( const LLSD& experience_ids ) { mExperienceIds.clear(); - BOOST_FOREACH(LLSD uuid, llsd::inArray(experience_ids)) + for (LLSD uuid : llsd::inArray(experience_ids)) { // Using insert(range) doesn't work here because the conversion from // LLSD to LLUUID is ambiguous: have to specify asUUID() for each entry. diff --git a/indra/newview/llpanelgroupbulkban.cpp b/indra/newview/llpanelgroupbulkban.cpp index cf1f0bc32f..2b6bf1bcd6 100644 --- a/indra/newview/llpanelgroupbulkban.cpp +++ b/indra/newview/llpanelgroupbulkban.cpp @@ -49,8 +49,6 @@ #include "lluictrlfactory.h" #include "llviewerwindow.h" -#include <boost/foreach.hpp> - LLPanelGroupBulkBan::LLPanelGroupBulkBan(const LLUUID& group_id) : LLPanelGroupBulk(group_id) { // Pass on construction of this panel to the control factory. @@ -163,8 +161,8 @@ void LLPanelGroupBulkBan::submit() // remove already banned users and yourself from request. std::vector<LLAvatarName> banned_avatar_names; std::vector<LLAvatarName> out_of_limit_names; - bool banning_self = FALSE; - std::vector<LLUUID>::iterator conflict = std::find(banned_agent_list.begin(), banned_agent_list.end(), gAgent.getID()); + bool banning_self{ false }; + std::vector<LLUUID>::iterator conflict = std::find(banned_agent_list.begin(), banned_agent_list.end(), gAgentID); if (conflict != banned_agent_list.end()) { banned_agent_list.erase(conflict); @@ -172,18 +170,17 @@ void LLPanelGroupBulkBan::submit() } if (group_datap) { - BOOST_FOREACH(const LLGroupMgrGroupData::ban_list_t::value_type& group_ban_pair, group_datap->mBanList) + for (const auto& [group_ban_agent_id, group_ban_data] : group_datap->mBanList) { - const LLUUID& group_ban_agent_id = group_ban_pair.first; std::vector<LLUUID>::iterator conflict = std::find(banned_agent_list.begin(), banned_agent_list.end(), group_ban_agent_id); if (conflict != banned_agent_list.end()) { LLAvatarName av_name; LLAvatarNameCache::get(group_ban_agent_id, &av_name); - banned_avatar_names.push_back(av_name); + banned_avatar_names.emplace_back(av_name); banned_agent_list.erase(conflict); - if (banned_agent_list.size() == 0) + if (banned_agent_list.empty()) { break; } diff --git a/indra/newview/llpanellogin.h b/indra/newview/llpanellogin.h index c6254f72cf..5c4f8e9135 100644 --- a/indra/newview/llpanellogin.h +++ b/indra/newview/llpanellogin.h @@ -112,7 +112,7 @@ private: static void updateServerCombo(); private: - boost::scoped_ptr<LLPanelLoginListener> mListener; + std::unique_ptr<LLPanelLoginListener> mListener; void updateLoginButtons(); void populateUserList(LLPointer<LLCredential> credential); diff --git a/indra/newview/llpaneloutfitsinventory.h b/indra/newview/llpaneloutfitsinventory.h index 91873a427a..63f9f599f1 100644 --- a/indra/newview/llpaneloutfitsinventory.h +++ b/indra/newview/llpaneloutfitsinventory.h @@ -61,6 +61,8 @@ public: void openApearanceTab(const std::string& tab_name); + bool isCOFPanelActive() const; + protected: void updateVerbs(); @@ -72,7 +74,6 @@ private: protected: void initTabPanels(); void onTabChange(); - bool isCOFPanelActive() const; bool isOutfitsListPanelActive() const; bool isOutfitsGalleryPanelActive() const; diff --git a/indra/newview/llpanelprofileclassifieds.cpp b/indra/newview/llpanelprofileclassifieds.cpp index 3fbaad4dee..307935f45f 100644 --- a/indra/newview/llpanelprofileclassifieds.cpp +++ b/indra/newview/llpanelprofileclassifieds.cpp @@ -650,6 +650,8 @@ BOOL LLPanelProfileClassified::postBuild() mSnapshotCtrl->setOnSelectCallback(boost::bind(&LLPanelProfileClassified::onTextureSelected, this)); mSnapshotCtrl->setMouseEnterCallback(boost::bind(&LLPanelProfileClassified::onTexturePickerMouseEnter, this)); mSnapshotCtrl->setMouseLeaveCallback(boost::bind(&LLPanelProfileClassified::onTexturePickerMouseLeave, this)); + mSnapshotCtrl->setAllowLocalTexture(FALSE); + mSnapshotCtrl->setBakeTextureEnabled(FALSE); mEditIcon->setVisible(false); mMapButton->setCommitCallback(boost::bind(&LLPanelProfileClassified::onMapClick, this)); @@ -667,7 +669,7 @@ BOOL LLPanelProfileClassified::postBuild() mCategoryCombo->add(LLTrans::getString(iter->second)); } - mClassifiedNameEdit->setKeystrokeCallback(boost::bind(&LLPanelProfileClassified::onChange, this), NULL); + mClassifiedNameEdit->setKeystrokeCallback(boost::bind(&LLPanelProfileClassified::onTitleChange, this), NULL); mClassifiedDescEdit->setKeystrokeCallback(boost::bind(&LLPanelProfileClassified::onChange, this)); mCategoryCombo->setCommitCallback(boost::bind(&LLPanelProfileClassified::onChange, this)); mContentTypeCombo->setCommitCallback(boost::bind(&LLPanelProfileClassified::onChange, this)); @@ -935,6 +937,8 @@ void LLPanelProfileClassified::onCancelClick() } else { + updateTabLabel(mClassifiedNameText->getValue()); + // Reload data to undo changes to forms LLAvatarPropertiesProcessor::getInstance()->sendClassifiedInfoRequest(getClassifiedId()); } @@ -955,7 +959,7 @@ void LLPanelProfileClassified::onSaveClick() } if(isNew() || isNewWithErrors()) { - if(gStatusBar->getBalance() < getPriceForListing()) + if(gStatusBar->getBalance() < MINIMUM_PRICE_FOR_LISTING) { LLNotificationsUtil::add("ClassifiedInsufficientFunds"); return; @@ -1403,6 +1407,12 @@ void LLPanelProfileClassified::onChange() enableSave(isDirty()); } +void LLPanelProfileClassified::onTitleChange() +{ + updateTabLabel(getClassifiedName()); + onChange(); +} + void LLPanelProfileClassified::doSave() { //*TODO: Fix all of this @@ -1428,6 +1438,14 @@ void LLPanelProfileClassified::doSave() void LLPanelProfileClassified::onPublishFloaterPublishClicked() { + if (mPublishFloater->getPrice() < MINIMUM_PRICE_FOR_LISTING) + { + LLSD args; + args["MIN_PRICE"] = MINIMUM_PRICE_FOR_LISTING; + LLNotificationsUtil::add("MinClassifiedPrice", args); + return; + } + setPriceForListing(mPublishFloater->getPrice()); doSave(); diff --git a/indra/newview/llpanelprofileclassifieds.h b/indra/newview/llpanelprofileclassifieds.h index 912819e86b..d1aa5f55e3 100644 --- a/indra/newview/llpanelprofileclassifieds.h +++ b/indra/newview/llpanelprofileclassifieds.h @@ -257,6 +257,7 @@ protected: void onSetLocationClick(); void onChange(); + void onTitleChange(); void onPublishFloaterPublishClicked(); diff --git a/indra/newview/llpanelprofilepicks.cpp b/indra/newview/llpanelprofilepicks.cpp index 9a228a1f40..b097e637a4 100644 --- a/indra/newview/llpanelprofilepicks.cpp +++ b/indra/newview/llpanelprofilepicks.cpp @@ -486,6 +486,8 @@ LLPanelProfilePick::LLPanelProfilePick() , mLocationChanged(false) , mNewPick(false) , mIsEditing(false) + , mRegionCallbackConnection() + , mParcelCallbackConnection() { } @@ -503,6 +505,15 @@ LLPanelProfilePick::~LLPanelProfilePick() { LLRemoteParcelInfoProcessor::getInstance()->removeObserver(mParcelId, this); } + + if (mRegionCallbackConnection.connected()) + { + mRegionCallbackConnection.disconnect(); + } + if (mParcelCallbackConnection.connected()) + { + mParcelCallbackConnection.disconnect(); + } } void LLPanelProfilePick::setAvatarId(const LLUUID& avatar_id) @@ -577,6 +588,8 @@ BOOL LLPanelProfilePick::postBuild() mSnapshotCtrl = getChild<LLTextureCtrl>("pick_snapshot"); mSnapshotCtrl->setCommitCallback(boost::bind(&LLPanelProfilePick::onSnapshotChanged, this)); + mSnapshotCtrl->setAllowLocalTexture(FALSE); + mSnapshotCtrl->setBakeTextureEnabled(FALSE); childSetAction("teleport_btn", boost::bind(&LLPanelProfilePick::onClickTeleport, this)); childSetAction("show_on_map_btn", boost::bind(&LLPanelProfilePick::onClickMap, this)); @@ -665,6 +678,7 @@ void LLPanelProfilePick::setSnapshotId(const LLUUID& id) void LLPanelProfilePick::setPickName(const std::string& name) { mPickName->setValue(name); + mPickNameStr = name; } const std::string LLPanelProfilePick::getPickName() @@ -747,6 +761,14 @@ BOOL LLPanelProfilePick::isDirty() const void LLPanelProfilePick::onClickSave() { + if (mRegionCallbackConnection.connected()) + { + mRegionCallbackConnection.disconnect(); + } + if (mParcelCallbackConnection.connected()) + { + mParcelCallbackConnection.disconnect(); + } sendUpdate(); mLocationChanged = false; @@ -754,6 +776,7 @@ void LLPanelProfilePick::onClickSave() void LLPanelProfilePick::onClickCancel() { + updateTabLabel(mPickNameStr); LLAvatarPropertiesProcessor::getInstance()->sendPickInfoRequest(getAvatarId(), getPickId()); mLocationChanged = false; enableSaveButton(FALSE); diff --git a/indra/newview/llpanelprofilepicks.h b/indra/newview/llpanelprofilepicks.h index 956b4c7850..90c527e0f3 100644 --- a/indra/newview/llpanelprofilepicks.h +++ b/indra/newview/llpanelprofilepicks.h @@ -138,7 +138,7 @@ public: void setParcelID(const LLUUID& parcel_id) override { mParcelId = parcel_id; } void setErrorStatus(S32 status, const std::string& reason) override {}; -protected: + protected: /** * Sends remote parcel info request to resolve parcel name from its ID. @@ -229,6 +229,10 @@ protected: LLUUID mParcelId; LLUUID mPickId; LLUUID mRequestedId; + std::string mPickNameStr; + + boost::signals2::connection mRegionCallbackConnection; + boost::signals2::connection mParcelCallbackConnection; bool mLocationChanged; bool mNewPick; diff --git a/indra/newview/llpanelteleporthistory.cpp b/indra/newview/llpanelteleporthistory.cpp index b938b30479..3ed444a5af 100644 --- a/indra/newview/llpanelteleporthistory.cpp +++ b/indra/newview/llpanelteleporthistory.cpp @@ -1067,6 +1067,12 @@ void LLTeleportHistoryPanel::onGearMenuAction(const LLSD& userdata) LLLandmarkActions::getSLURLfromPosGlobal(globalPos, boost::bind(&LLTeleportHistoryPanel::gotSLURLCallback, _1)); } + else if ("remove" == command_name) + { + LLTeleportHistoryStorage::getInstance()->removeItem(index); + LLTeleportHistoryStorage::getInstance()->save(); + showTeleportHistory(); + } } bool LLTeleportHistoryPanel::isActionEnabled(const LLSD& userdata) const @@ -1121,7 +1127,8 @@ bool LLTeleportHistoryPanel::isActionEnabled(const LLSD& userdata) const if ("teleport" == command_name || "view" == command_name || "show_on_map" == command_name - || "copy_slurl" == command_name) + || "copy_slurl" == command_name + || "remove" == command_name) { if (!mLastSelectedFlatlList) { diff --git a/indra/newview/llpathfindingmanager.cpp b/indra/newview/llpathfindingmanager.cpp index 17b8ec0683..664e240484 100644 --- a/indra/newview/llpathfindingmanager.cpp +++ b/indra/newview/llpathfindingmanager.cpp @@ -114,7 +114,7 @@ public: void handleTerrainLinksetsResult(const LLSD &pContent); void handleTerrainLinksetsError(); - typedef boost::shared_ptr<LinksetsResponder> ptr_t; + typedef std::shared_ptr<LinksetsResponder> ptr_t; protected: @@ -139,7 +139,7 @@ private: LLPathfindingObjectPtr mTerrainLinksetPtr; }; -typedef boost::shared_ptr<LinksetsResponder> LinksetsResponderPtr; +typedef std::shared_ptr<LinksetsResponder> LinksetsResponderPtr; //--------------------------------------------------------------------------- // LLPathfindingManager diff --git a/indra/newview/llpathfindingmanager.h b/indra/newview/llpathfindingmanager.h index bb44f780c8..258d0fdef7 100644 --- a/indra/newview/llpathfindingmanager.h +++ b/indra/newview/llpathfindingmanager.h @@ -107,8 +107,8 @@ private: void navMeshStatusRequestCoro(std::string url, U64 regionHandle, bool isGetStatusOnly); void navAgentStateRequestCoro(std::string url); void navMeshRebakeCoro(std::string url, rebake_navmesh_callback_t rebakeNavMeshCallback); - void linksetObjectsCoro(std::string url, boost::shared_ptr<LinksetsResponder> linksetsResponsderPtr, LLSD putData) const; - void linksetTerrainCoro(std::string url, boost::shared_ptr<LinksetsResponder> linksetsResponsderPtr, LLSD putData) const; + void linksetObjectsCoro(std::string url, std::shared_ptr<LinksetsResponder> linksetsResponsderPtr, LLSD putData) const; + void linksetTerrainCoro(std::string url, std::shared_ptr<LinksetsResponder> linksetsResponsderPtr, LLSD putData) const; void charactersCoro(std::string url, request_id_t requestId, object_request_callback_t callback) const; //void handleNavMeshStatusRequest(const LLPathfindingNavMeshStatus &pNavMeshStatus, LLViewerRegion *pRegion, bool pIsGetStatusOnly); diff --git a/indra/newview/llpathfindingnavmesh.h b/indra/newview/llpathfindingnavmesh.h index 87f32b8d56..ddc886f01c 100644 --- a/indra/newview/llpathfindingnavmesh.h +++ b/indra/newview/llpathfindingnavmesh.h @@ -39,7 +39,7 @@ class LLPathfindingNavMesh; class LLUUID; -typedef boost::shared_ptr<LLPathfindingNavMesh> LLPathfindingNavMeshPtr; +typedef std::shared_ptr<LLPathfindingNavMesh> LLPathfindingNavMeshPtr; class LLPathfindingNavMesh { diff --git a/indra/newview/llpathfindingnavmeshzone.h b/indra/newview/llpathfindingnavmeshzone.h index baa1cc5979..b76f4421a6 100644 --- a/indra/newview/llpathfindingnavmeshzone.h +++ b/indra/newview/llpathfindingnavmeshzone.h @@ -114,7 +114,7 @@ private: LLPathfindingNavMesh::navmesh_slot_t mNavMeshSlot; }; - typedef boost::shared_ptr<NavMeshLocation> NavMeshLocationPtr; + typedef std::shared_ptr<NavMeshLocation> NavMeshLocationPtr; typedef std::vector<NavMeshLocationPtr> NavMeshLocationPtrs; void handleNavMeshLocation(); diff --git a/indra/newview/llpathfindingobject.h b/indra/newview/llpathfindingobject.h index b8d3ca2364..0114cce3f1 100644 --- a/indra/newview/llpathfindingobject.h +++ b/indra/newview/llpathfindingobject.h @@ -41,7 +41,7 @@ class LLPathfindingObject; class LLSD; -typedef boost::shared_ptr<LLPathfindingObject> LLPathfindingObjectPtr; +typedef std::shared_ptr<LLPathfindingObject> LLPathfindingObjectPtr; class LLPathfindingObject { diff --git a/indra/newview/llpathfindingobjectlist.h b/indra/newview/llpathfindingobjectlist.h index 61580582d3..e2e0dce4da 100644 --- a/indra/newview/llpathfindingobjectlist.h +++ b/indra/newview/llpathfindingobjectlist.h @@ -36,7 +36,7 @@ class LLPathfindingObjectList; -typedef boost::shared_ptr<LLPathfindingObjectList> LLPathfindingObjectListPtr; +typedef std::shared_ptr<LLPathfindingObjectList> LLPathfindingObjectListPtr; typedef std::map<std::string, LLPathfindingObjectPtr> LLPathfindingObjectMap; class LLPathfindingObjectList diff --git a/indra/newview/llperfstats.cpp b/indra/newview/llperfstats.cpp index 64e66d520b..8718f7e7b0 100644 --- a/indra/newview/llperfstats.cpp +++ b/indra/newview/llperfstats.cpp @@ -69,7 +69,7 @@ namespace LLPerfStats { assert_main_thread(); // these following variables are proxies for pipeline statics we do not need a two way update (no llviewercontrol handler) - if( tuningFlag & NonImpostors ){ gSavedSettings.setU32("IndirectMaxNonImpostors", nonImpostors); }; + if( tuningFlag & NonImpostors ){ gSavedSettings.setU32("RenderAvatarMaxNonImpostors", nonImpostors); }; if( tuningFlag & ReflectionDetail ){ gSavedSettings.setS32("RenderReflectionDetail", reflectionDetail); }; if( tuningFlag & FarClip ){ gSavedSettings.setF32("RenderFarClip", farClip); }; if( tuningFlag & UserMinDrawDistance ){ gSavedSettings.setF32("AutoTuneRenderFarClipMin", userMinDrawDistance); }; @@ -378,7 +378,7 @@ namespace LLPerfStats auto count = countNearbyAvatars(std::min(LLPipeline::RenderFarClip, tunables.userImpostorDistance)); if( count != tunables.nonImpostors ) { - tunables.updateNonImposters( (count < LLVOAvatar::NON_IMPOSTORS_MAX_SLIDER)?count : LLVOAvatar::NON_IMPOSTORS_MAX_SLIDER ); + tunables.updateNonImposters( (count < LLVOAvatar::NON_IMPOSTORS_MAX_SLIDER)?count : 0 ); LL_DEBUGS("AutoTune") << "There are " << count << "avatars within " << std::min(LLPipeline::RenderFarClip, tunables.userImpostorDistance) << "m of the camera" << LL_ENDL; } } diff --git a/indra/newview/llplacesinventorypanel.cpp b/indra/newview/llplacesinventorypanel.cpp index 1c14acd843..f3455bb4f0 100644 --- a/indra/newview/llplacesinventorypanel.cpp +++ b/indra/newview/llplacesinventorypanel.cpp @@ -120,3 +120,13 @@ S32 LLPlacesInventoryPanel::notify(const LLSD& info) } return 0; } + +BOOL LLPlacesInventoryPanel::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, EDragAndDropType cargo_type, void *cargo_data, + EAcceptance *accept, std::string &tooltip_msg) +{ + if (mAcceptsDragAndDrop) + { + return LLInventoryPanel::handleDragAndDrop(x, y, mask, drop, cargo_type, cargo_data, accept, tooltip_msg); + } + return FALSE; +} diff --git a/indra/newview/llplacesinventorypanel.h b/indra/newview/llplacesinventorypanel.h index 3c27964ec5..81b623b045 100644 --- a/indra/newview/llplacesinventorypanel.h +++ b/indra/newview/llplacesinventorypanel.h @@ -47,11 +47,14 @@ public: LLPlacesInventoryPanel(const Params& p); ~LLPlacesInventoryPanel(); - LLFolderView * createFolderRoot(LLUUID root_id ); + LLFolderView * createFolderRoot(LLUUID root_id ) override; void saveFolderState(); void restoreFolderState(); - virtual S32 notify(const LLSD& info) ; + virtual S32 notify(const LLSD& info) override; + + BOOL handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, EDragAndDropType cargo_type, void *cargo_data, + EAcceptance *accept, std::string &tooltip_msg) override; private: LLSaveFolderState* mSavedFolderState; diff --git a/indra/newview/llpreviewtexture.cpp b/indra/newview/llpreviewtexture.cpp index 975e2bb910..ea7d4800e0 100644 --- a/indra/newview/llpreviewtexture.cpp +++ b/indra/newview/llpreviewtexture.cpp @@ -653,7 +653,7 @@ void LLPreviewTexture::adjustAspectRatio() { // No existing ratio found, create an element that will show image at original ratio populateRatioList(); // makes sure previous custom ratio is cleared - std::string ratio = boost::lexical_cast<std::string>(num)+":" + boost::lexical_cast<std::string>(denom); + std::string ratio = std::to_string(num)+":" + std::to_string(denom); mRatiosList.push_back(ratio); combo->add(ratio); combo->setCurrentByIndex(mRatiosList.size()- 1); diff --git a/indra/newview/llsculptidsize.cpp b/indra/newview/llsculptidsize.cpp index 5d051d0ebf..bedee32213 100644 --- a/indra/newview/llsculptidsize.cpp +++ b/indra/newview/llsculptidsize.cpp @@ -66,7 +66,7 @@ void LLSculptIDSize::inc(const LLDrawable *pdrawable, int sz) if (itLU.first == itLU.second) { //register //llassert(mSizeInfo.get<tag_BY_DRAWABLE>().end() == mSizeInfo.get<tag_BY_DRAWABLE>().find(pdrawable)); - mSizeInfo.get<tag_BY_DRAWABLE>().insert(Info(pdrawable, sz, boost::make_shared<SizeSum>(sz), sculptId)); + mSizeInfo.get<tag_BY_DRAWABLE>().insert(Info(pdrawable, sz, std::make_shared<SizeSum>(sz), sculptId)); total_size = sz; } else diff --git a/indra/newview/llsculptidsize.h b/indra/newview/llsculptidsize.h index 87ee417b86..679fcbd44c 100644 --- a/indra/newview/llsculptidsize.h +++ b/indra/newview/llsculptidsize.h @@ -52,7 +52,7 @@ public: struct Info { - typedef boost::shared_ptr<SizeSum> PtrSizeSum; + typedef std::shared_ptr<SizeSum> PtrSizeSum; Info(const LLDrawable *drawable, int size, PtrSizeSum sizeInfo, LLUUID sculptId) : mDrawable(drawable) diff --git a/indra/newview/llsearchableui.h b/indra/newview/llsearchableui.h index 31f11eb8ef..84fcefb835 100644 --- a/indra/newview/llsearchableui.h +++ b/indra/newview/llsearchableui.h @@ -93,7 +93,7 @@ namespace ll { struct SearchableItem; - typedef boost::shared_ptr< SearchableItem > SearchableItemPtr; + typedef std::shared_ptr< SearchableItem > SearchableItemPtr; typedef std::vector< SearchableItemPtr > tSearchableItemList; diff --git a/indra/newview/llsidepanelappearance.cpp b/indra/newview/llsidepanelappearance.cpp index aed9dba7ef..7571d361a4 100644 --- a/indra/newview/llsidepanelappearance.cpp +++ b/indra/newview/llsidepanelappearance.cpp @@ -361,6 +361,15 @@ void LLSidepanelAppearance::toggleMyOutfitsPanel(BOOL visible, const std::string } } +bool LLSidepanelAppearance::isCOFPanelVisible() +{ + if (mPanelOutfitsInventory && mPanelOutfitsInventory->getVisible()) + { + return mPanelOutfitsInventory->isCOFPanelActive(); + } + return false; +} + void LLSidepanelAppearance::toggleOutfitEditPanel(BOOL visible, BOOL disable_camera_switch) { if (!mOutfitEdit || mOutfitEdit->getVisible() == visible) diff --git a/indra/newview/llsidepanelappearance.h b/indra/newview/llsidepanelappearance.h index bb9709a2b8..e67652d6f7 100644 --- a/indra/newview/llsidepanelappearance.h +++ b/indra/newview/llsidepanelappearance.h @@ -66,6 +66,8 @@ public: void updateToVisibility( const LLSD& new_visibility ); LLPanelEditWearable* getWearable(){ return mEditWearable; } + bool isCOFPanelVisible(); + private: void onFilterEdit(const std::string& search_string); void onVisibilityChanged ( const LLSD& new_visibility ); diff --git a/indra/newview/lltoolbarview.cpp b/indra/newview/lltoolbarview.cpp index f6628293ee..9157d20f98 100644 --- a/indra/newview/lltoolbarview.cpp +++ b/indra/newview/lltoolbarview.cpp @@ -46,8 +46,6 @@ #include "llviewercontrol.h" // HACK for destinations guide on startup #include "llinventorymodel.h" // HACK to disable starter avatars button for NUX -#include <boost/foreach.hpp> - LLToolBarView* gToolBarView = NULL; static LLDefaultChildRegistry::Register<LLToolBarView> r("toolbar_view"); @@ -282,7 +280,7 @@ bool LLToolBarView::loadToolbars(bool force_default) LLToolBarEnums::ButtonType button_type = toolbar_set.left_toolbar.button_display_mode; mToolbars[LLToolBarEnums::TOOLBAR_LEFT]->setButtonType(button_type); } - BOOST_FOREACH(const LLCommandId::Params& command_params, toolbar_set.left_toolbar.commands) + for (const LLCommandId::Params& command_params : toolbar_set.left_toolbar.commands) { if (!addCommandInternal(LLCommandId(command_params), mToolbars[LLToolBarEnums::TOOLBAR_LEFT])) { @@ -297,7 +295,7 @@ bool LLToolBarView::loadToolbars(bool force_default) LLToolBarEnums::ButtonType button_type = toolbar_set.right_toolbar.button_display_mode; mToolbars[LLToolBarEnums::TOOLBAR_RIGHT]->setButtonType(button_type); } - BOOST_FOREACH(const LLCommandId::Params& command_params, toolbar_set.right_toolbar.commands) + for (const LLCommandId::Params& command_params : toolbar_set.right_toolbar.commands) { if (!addCommandInternal(LLCommandId(command_params), mToolbars[LLToolBarEnums::TOOLBAR_RIGHT])) { @@ -312,7 +310,7 @@ bool LLToolBarView::loadToolbars(bool force_default) LLToolBarEnums::ButtonType button_type = toolbar_set.bottom_toolbar.button_display_mode; mToolbars[LLToolBarEnums::TOOLBAR_BOTTOM]->setButtonType(button_type); } - BOOST_FOREACH(const LLCommandId::Params& command_params, toolbar_set.bottom_toolbar.commands) + for (const LLCommandId::Params& command_params : toolbar_set.bottom_toolbar.commands) { if (!addCommandInternal(LLCommandId(command_params), mToolbars[LLToolBarEnums::TOOLBAR_BOTTOM])) { diff --git a/indra/newview/llviewerfloaterreg.cpp b/indra/newview/llviewerfloaterreg.cpp index 8353d4d1d7..1b34bed2da 100644 --- a/indra/newview/llviewerfloaterreg.cpp +++ b/indra/newview/llviewerfloaterreg.cpp @@ -87,6 +87,7 @@ #include "llfloaterimsession.h" #include "llfloaterinspect.h" #include "llfloaterinventorysettings.h" +#include "llfloaterinventorythumbnailshelper.h" #include "llfloaterjoystick.h" #include "llfloaterlagmeter.h" #include "llfloaterland.h" @@ -249,6 +250,7 @@ public: "group_picker", "hud", "incoming_call", + "inventory_thumbnails_helper", "linkreplace", "mem_leaking", "marketplace_validation", @@ -335,7 +337,7 @@ void LLViewerFloaterReg::registerFloaters() LLFloaterReg::add("build", "floater_tools.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterTools>); LLFloaterReg::add("build_options", "floater_build_options.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterBuildOptions>); LLFloaterReg::add("bumps", "floater_bumps.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterBump>); - + LLFloaterReg::add("camera", "floater_camera.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterCamera>); LLFloaterReg::add("camera_presets", "floater_camera_presets.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterCameraPresets>); LLFloaterReg::add("chat_voice", "floater_voice_chat_volume.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterChatVoiceVolume>); @@ -384,6 +386,7 @@ void LLViewerFloaterReg::registerFloaters() LLFloaterReg::add("incoming_call", "floater_incoming_call.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLIncomingCallDialog>); LLFloaterReg::add("inventory", "floater_my_inventory.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterSidePanelContainer>); LLFloaterReg::add("inspect", "floater_inspect.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterInspect>); + LLFloaterReg::add("inventory_thumbnails_helper", "floater_inventory_thumbnails_helper.xml", (LLFloaterBuildFunc) &LLFloaterReg::build<LLFloaterInventoryThumbnailsHelper>); LLFloaterReg::add("item_properties", "floater_item_properties.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterItemProperties>); LLFloaterReg::add("task_properties", "floater_task_properties.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterItemProperties>); LLFloaterReg::add("inventory_settings", "floater_inventory_settings.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterInventorySettings>); diff --git a/indra/newview/llviewerinventory.cpp b/indra/newview/llviewerinventory.cpp index 0a0a19d095..b9a7c9448f 100644 --- a/indra/newview/llviewerinventory.cpp +++ b/indra/newview/llviewerinventory.cpp @@ -668,15 +668,14 @@ void LLViewerInventoryCategory::setVersion(S32 version) mVersion = version; } -bool LLViewerInventoryCategory::fetch() +bool LLViewerInventoryCategory::fetch(S32 expiry_seconds) { if((VERSION_UNKNOWN == getVersion()) && mDescendentsRequested.hasExpired()) //Expired check prevents multiple downloads. { LL_DEBUGS(LOG_INV) << "Fetching category children: " << mName << ", UUID: " << mUUID << LL_ENDL; - const F32 FETCH_TIMER_EXPIRY = 10.0f; mDescendentsRequested.reset(); - mDescendentsRequested.setTimerExpirySec(FETCH_TIMER_EXPIRY); + mDescendentsRequested.setTimerExpirySec(expiry_seconds); std::string url; if (gAgent.getRegion()) @@ -685,7 +684,7 @@ bool LLViewerInventoryCategory::fetch() } else { - LL_WARNS(LOG_INV) << "agent region is null" << LL_ENDL; + LL_WARNS_ONCE(LOG_INV) << "agent region is null" << LL_ENDL; } if (!url.empty() || AISAPI::isAvailable()) { @@ -709,7 +708,13 @@ LLViewerInventoryCategory::EFetchType LLViewerInventoryCategory::getFetching() void LLViewerInventoryCategory::setFetching(LLViewerInventoryCategory::EFetchType fetching) { - if (fetching > mFetching) // allow a switch from normal to recursive + if (fetching == FETCH_FAILED) + { + const F32 FETCH_FAILURE_EXPIRY = 60.0f; + mDescendentsRequested.setTimerExpirySec(FETCH_FAILURE_EXPIRY); + mFetching = fetching; + } + else if (fetching > mFetching) // allow a switch from normal to recursive { if (mDescendentsRequested.hasExpired() || (mFetching == FETCH_NONE)) { diff --git a/indra/newview/llviewerinventory.h b/indra/newview/llviewerinventory.h index e043285ffb..0d0ccc6643 100644 --- a/indra/newview/llviewerinventory.h +++ b/indra/newview/llviewerinventory.h @@ -209,13 +209,15 @@ public: S32 getVersion() const; void setVersion(S32 version); - // Returns true if a fetch was issued (not nessesary in progress). - bool fetch(); + // Returns true if a fetch was issued (not nessesary in progress). + // no requests will happen during expiry_seconds even if fetch completed + bool fetch(S32 expiry_seconds = 10); typedef enum { FETCH_NONE = 0, FETCH_NORMAL, FETCH_RECURSIVE, + FETCH_FAILED, // back off } EFetchType; EFetchType getFetching(); // marks as fetch being in progress or as done diff --git a/indra/newview/llviewermedia.h b/indra/newview/llviewermedia.h index ad7c4bcefa..03899b6b8f 100644 --- a/indra/newview/llviewermedia.h +++ b/indra/newview/llviewermedia.h @@ -431,7 +431,7 @@ private: private: // a single media url with some data and an impl. - boost::shared_ptr<LLPluginClassMedia> mMediaSource; + std::shared_ptr<LLPluginClassMedia> mMediaSource; LLMutex mLock; F64 mZoomFactor; LLUUID mTextureId; diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index c8dd65941a..e4a3bf6336 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -102,6 +102,7 @@ #include "llsceneview.h" #include "llscenemonitor.h" #include "llselectmgr.h" +#include "llsidepanelappearance.h" #include "llspellcheckmenuhandler.h" #include "llstatusbar.h" #include "lltextureview.h" @@ -1463,6 +1464,31 @@ class LLAdvancedCheckDebugUnicode : public view_listener_t +////////////////// +// DEBUG CAMERA // +////////////////// + + +class LLAdvancedToggleDebugCamera : public view_listener_t +{ + bool handleEvent(const LLSD& userdata) + { + LLView::sDebugCamera = !(LLView::sDebugCamera); + LLFloaterCamera::onDebugCameraToggled(); + return true; + } +}; + +class LLAdvancedCheckDebugCamera : public view_listener_t +{ + bool handleEvent(const LLSD& userdata) + { + return LLView::sDebugCamera; + } +}; + + + /////////////////////// // XUI NAME TOOLTIPS // /////////////////////// @@ -6709,6 +6735,13 @@ void handle_edit_outfit() void handle_now_wearing() { + LLSidepanelAppearance *panel_appearance = dynamic_cast<LLSidepanelAppearance *>(LLFloaterSidePanelContainer::getPanel("appearance")); + if (panel_appearance && panel_appearance->isInVisibleChain() && panel_appearance->isCOFPanelVisible()) + { + LLFloaterReg::findInstance("appearance")->closeFloater(); + return; + } + LLFloaterSidePanelContainer::showPanel("appearance", LLSD().with("type", "now_wearing")); } @@ -9608,6 +9641,8 @@ void initialize_menus() view_listener_t::addMenu(new LLAdvancedToggleDebugViews(), "Advanced.ToggleDebugViews"); view_listener_t::addMenu(new LLAdvancedCheckDebugUnicode(), "Advanced.CheckDebugUnicode"); view_listener_t::addMenu(new LLAdvancedToggleDebugUnicode(), "Advanced.ToggleDebugUnicode"); + view_listener_t::addMenu(new LLAdvancedCheckDebugCamera(), "Advanced.CheckDebugCamera"); + view_listener_t::addMenu(new LLAdvancedToggleDebugCamera(), "Advanced.ToggleDebugCamera"); view_listener_t::addMenu(new LLAdvancedToggleXUINameTooltips(), "Advanced.ToggleXUINameTooltips"); view_listener_t::addMenu(new LLAdvancedCheckXUINameTooltips(), "Advanced.CheckXUINameTooltips"); view_listener_t::addMenu(new LLAdvancedToggleDebugMouseEvents(), "Advanced.ToggleDebugMouseEvents"); diff --git a/indra/newview/llviewermenufile.h b/indra/newview/llviewermenufile.h index ff2ee693fd..6b9df6df28 100644 --- a/indra/newview/llviewermenufile.h +++ b/indra/newview/llviewermenufile.h @@ -145,7 +145,7 @@ public: virtual void notify(const std::vector<std::string>& filenames); private: - boost::shared_ptr<LLPluginClassMedia> mPlugin; + std::shared_ptr<LLPluginClassMedia> mPlugin; }; diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index ed96e11c6b..bba9c0235e 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -119,8 +119,6 @@ #include "llviewerregion.h" #include "llfloaterregionrestarting.h" -#include <boost/foreach.hpp> - #include "llnotificationmanager.h" // #include "llexperiencecache.h" @@ -5634,7 +5632,7 @@ void notify_cautioned_script_question(const LLSD& notification, const LLSD& resp BOOL caution = FALSE; S32 count = 0; std::string perms; - BOOST_FOREACH(script_perm_t script_perm, SCRIPT_PERMISSIONS) + for (const script_perm_t& script_perm : SCRIPT_PERMISSIONS) { if ((orig_questions & script_perm.permbit) && script_perm.caution) @@ -5879,7 +5877,7 @@ void process_script_question(LLMessageSystem *msg, void **user_data) S32 known_questions = 0; bool has_not_only_debit = questions ^ SCRIPT_PERMISSIONS[SCRIPT_PERMISSION_DEBIT].permbit; // check the received permission flags against each permission - BOOST_FOREACH(script_perm_t script_perm, SCRIPT_PERMISSIONS) + for (const script_perm_t& script_perm : SCRIPT_PERMISSIONS) { if (questions & script_perm.permbit) { diff --git a/indra/newview/llviewerobjectlist.cpp b/indra/newview/llviewerobjectlist.cpp index 5bc7523be1..a53bd982d4 100644 --- a/indra/newview/llviewerobjectlist.cpp +++ b/indra/newview/llviewerobjectlist.cpp @@ -2043,6 +2043,7 @@ void LLViewerObjectList::findOrphans(LLViewerObject* objectp, U32 ip, U32 port) { LL_WARNS() << objectp->mID << " has self as parent, skipping!" << LL_ENDL; + ++iter; continue; } diff --git a/indra/newview/llviewerparcelaskplay.cpp b/indra/newview/llviewerparcelaskplay.cpp index afbe2c94de..aea06834b2 100644 --- a/indra/newview/llviewerparcelaskplay.cpp +++ b/indra/newview/llviewerparcelaskplay.cpp @@ -287,7 +287,7 @@ void LLViewerParcelAskPlay::saveSettings() if ((iter_parcel->second.mDate.secondsSinceEpoch() + (F64SecondsImplicit)U32Days(30)) > LLTimer::getTotalSeconds()) { // write unexpired parcels - std::string parcel_id = boost::lexical_cast<std::string>(iter_parcel->first); + std::string parcel_id = std::to_string(iter_parcel->first); write_llsd[key][parcel_id] = LLSD(); write_llsd[key][parcel_id]["mode"] = (LLSD::Integer)iter_parcel->second.mMode; write_llsd[key][parcel_id]["date"] = iter_parcel->second.mDate; diff --git a/indra/newview/llviewershadermgr.cpp b/indra/newview/llviewershadermgr.cpp index 3225299493..2bab50300b 100644 --- a/indra/newview/llviewershadermgr.cpp +++ b/indra/newview/llviewershadermgr.cpp @@ -592,7 +592,7 @@ std::string LLViewerShaderMgr::loadBasicShaders() std::map<std::string, std::string> attribs; attribs["MAX_JOINTS_PER_MESH_OBJECT"] = - boost::lexical_cast<std::string>(LLSkinningUtil::getMaxJointCount()); + std::to_string(LLSkinningUtil::getMaxJointCount()); BOOL ssr = gSavedSettings.getBOOL("RenderScreenSpaceReflections"); diff --git a/indra/newview/llviewerwindow.h b/indra/newview/llviewerwindow.h index ccef006a07..346073b8a1 100644 --- a/indra/newview/llviewerwindow.h +++ b/indra/newview/llviewerwindow.h @@ -538,8 +538,8 @@ private: bool mStatesDirty; U32 mCurrResolutionIndex; - boost::scoped_ptr<LLWindowListener> mWindowListener; - boost::scoped_ptr<LLViewerWindowListener> mViewerWindowListener; + std::unique_ptr<LLWindowListener> mWindowListener; + std::unique_ptr<LLViewerWindowListener> mViewerWindowListener; // Object temporarily hovered over while dragging LLPointer<LLViewerObject> mDragHoveredObject; diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 957ce32302..e35c090a96 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -4291,6 +4291,15 @@ void LLVOAvatar::updateOrientation(LLAgent& agent, F32 speed, F32 delta_time) if (mTurning) { pelvis_rot_threshold *= 0.4f; + // account for fps, assume that above value is for ~60fps + constexpr F32 default_frame_sec = 0.016f; + F32 prev_frame_sec = LLFrameTimer::getFrameDeltaTimeF32(); + if (default_frame_sec > prev_frame_sec) + { + // reduce threshold since turn rate per second is constant, + // shorter frame means shorter turn. + pelvis_rot_threshold *= prev_frame_sec/default_frame_sec; + } } // am I done turning? diff --git a/indra/newview/llvoicevivox.cpp b/indra/newview/llvoicevivox.cpp index 1b9aef193c..310c9ee297 100644 --- a/indra/newview/llvoicevivox.cpp +++ b/indra/newview/llvoicevivox.cpp @@ -5971,7 +5971,7 @@ void LLVivoxVoiceClient::filePlaybackSetMode(bool vox, float speed) } //------------------------------------------------------------------------ -std::set<LLVivoxVoiceClient::sessionState::wptr_t> LLVivoxVoiceClient::sessionState::mSession; +std::set<LLVivoxVoiceClient::sessionState::wptr_t, std::owner_less<LLVivoxVoiceClient::sessionState::wptr_t>> LLVivoxVoiceClient::sessionState::mSession; LLVivoxVoiceClient::sessionState::sessionState() : diff --git a/indra/newview/llvoicevivox.h b/indra/newview/llvoicevivox.h index ae2aec0e9c..7e1835d876 100644 --- a/indra/newview/llvoicevivox.h +++ b/indra/newview/llvoicevivox.h @@ -294,8 +294,8 @@ protected: bool mAvatarIDValid; bool mIsSelf; }; - typedef boost::shared_ptr<participantState> participantStatePtr_t; - typedef boost::weak_ptr<participantState> participantStateWptr_t; + typedef std::shared_ptr<participantState> participantStatePtr_t; + typedef std::weak_ptr<participantState> participantStateWptr_t; typedef std::map<const std::string, participantStatePtr_t> participantMap; typedef std::map<const LLUUID, participantStatePtr_t> participantUUIDMap; @@ -303,10 +303,10 @@ protected: struct sessionState { public: - typedef boost::shared_ptr<sessionState> ptr_t; - typedef boost::weak_ptr<sessionState> wptr_t; + typedef std::shared_ptr<sessionState> ptr_t; + typedef std::weak_ptr<sessionState> wptr_t; - typedef boost::function<void(const ptr_t &)> sessionFunc_t; + typedef std::function<void(const ptr_t &)> sessionFunc_t; static ptr_t createSession(); ~sessionState(); @@ -370,7 +370,7 @@ protected: private: sessionState(); - static std::set<wptr_t> mSession; // canonical list of outstanding sessions. + static std::set<wptr_t, std::owner_less<wptr_t>> mSession; // canonical list of outstanding sessions. std::set<wptr_t>::iterator mMyIterator; // used for delete static void for_eachPredicate(const wptr_t &a, sessionFunc_t func); @@ -381,7 +381,7 @@ protected: static bool testByCallerId(const LLVivoxVoiceClient::sessionState::wptr_t &a, LLUUID participantId); }; - typedef boost::shared_ptr<sessionState> sessionStatePtr_t; + typedef std::shared_ptr<sessionState> sessionStatePtr_t; typedef std::map<std::string, sessionStatePtr_t> sessionMap; diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index 57a7d6a90b..e3f2afadc5 100644 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -4575,6 +4575,11 @@ BOOL LLVOVolume::lineSegmentIntersect(const LLVector4a& start, const LLVector4a& } } + if (getClickAction() == CLICK_ACTION_IGNORE && !LLFloater::isVisible(gFloaterTools)) + { + return FALSE; + } + BOOL ret = FALSE; LLVolume* volume = getVolume(); diff --git a/indra/newview/llwindowlistener.cpp b/indra/newview/llwindowlistener.cpp index aa8c79b0d2..0edabf358f 100644 --- a/indra/newview/llwindowlistener.cpp +++ b/indra/newview/llwindowlistener.cpp @@ -388,7 +388,7 @@ static void mouseEvent(const MouseFunc& func, const LLSD& request) LLCoordGL pos(request["x"].asInteger(), request["y"].asInteger()); bool has_pos(request.has("x") && request.has("y")); - boost::scoped_ptr<LLView::TemporaryDrilldownFunc> tempfunc; + std::unique_ptr<LLView::TemporaryDrilldownFunc> tempfunc; // Documentation for mouseDown(), mouseUp() and mouseMove() claims you // must either specify ["path"], or both of ["x"] and ["y"]. You MAY diff --git a/indra/newview/llxmlrpclistener.cpp b/indra/newview/llxmlrpclistener.cpp index b816f9a3b5..3c2c6d15c4 100644 --- a/indra/newview/llxmlrpclistener.cpp +++ b/indra/newview/llxmlrpclistener.cpp @@ -544,7 +544,7 @@ private: const std::string mMethod; const std::string mReplyPump; LLTempBoundListener mBoundListener; - boost::scoped_ptr<LLXMLRPCTransaction> mTransaction; + std::unique_ptr<LLXMLRPCTransaction> mTransaction; LLXMLRPCTransaction::EStatus mPreviousStatus; // To detect state changes. }; diff --git a/indra/newview/llxmlrpctransaction.cpp b/indra/newview/llxmlrpctransaction.cpp index ba7e8d7298..a77c31eee3 100644 --- a/indra/newview/llxmlrpctransaction.cpp +++ b/indra/newview/llxmlrpctransaction.cpp @@ -188,7 +188,7 @@ public: virtual void onCompleted(LLCore::HttpHandle handle, LLCore::HttpResponse * response); - typedef boost::shared_ptr<LLXMLRPCTransaction::Handler> ptr_t; + typedef std::shared_ptr<LLXMLRPCTransaction::Handler> ptr_t; private: diff --git a/indra/newview/skins/default/xui/en/floater_camera.xml b/indra/newview/skins/default/xui/en/floater_camera.xml index 4655a4d394..93b306d7d7 100644 --- a/indra/newview/skins/default/xui/en/floater_camera.xml +++ b/indra/newview/skins/default/xui/en/floater_camera.xml @@ -138,13 +138,13 @@ </panel> </panel> <panel - follows="all" + follows="left|top" height="102" layout="topleft" left_pad="2" + right="-2" name="buttons_panel" - top="22" - width="212"> + top="22"> <panel_camera_item name="front_view" tool_tip="Front View" @@ -253,4 +253,22 @@ function="CameraPresets.Save"/> </button> </panel> + <panel + name="viewer_camera_info" + left="0" + top="135" + width="400" + height="150" + border="true" + visible="false" + background_visible="true"/> + <panel + name="agent_camera_info" + left="0" + top="285" + width="400" + height="150" + border="true" + visible="false" + background_visible="true"/> </floater> diff --git a/indra/newview/skins/default/xui/en/floater_inventory_thumbnails_helper.xml b/indra/newview/skins/default/xui/en/floater_inventory_thumbnails_helper.xml new file mode 100644 index 0000000000..aa3500bac2 --- /dev/null +++ b/indra/newview/skins/default/xui/en/floater_inventory_thumbnails_helper.xml @@ -0,0 +1,99 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<floater + legacy_header_height="18" + can_resize="false" + height="600" + layout="topleft" + min_height="175" + min_width="500" + name="contents" + help_topic="contents" + title="Inventory Thumbnails Helper" + width="800"> + <scroll_list + top="20" + height="350" + draw_stripes="true" + draw_heading="true" + follows="all" + layout="topleft" + left="8" + multi_select="true" + name="inventory_thumbnails_list" + right="-8" + tool_tip="Paste items from your inventory"> + <scroll_list.columns + dynamic_width="true" + label="Inventory Item" + name="item_name" + relative_width="0.4" /> + <scroll_list.columns + dynamic_width="true" + label="Existing Texture" + name="existing_texture" + relative_width="0.3" /> + <scroll_list.columns + dynamic_width="true" + label="New Texture" + name="new_texture" + relative_width="0.3" /> + </scroll_list> + <text_editor + top="375" + height="140" + follows="all" + left="8" + right="-8" + name="output_log" + font="Monospace" + text_color="0.1 0.5 0.1 1.0" + width="480"> + </text_editor> + <button + follows="left|bottom" + height="20" + label="Paste items from Inventory" + layout="topleft" + left="10" + name="paste_items_btn" + bottom="-60" + width="235" /> + <button + follows="left|bottom" + height="20" + label="Paste textures from Inventory" + layout="topleft" + left_delta="0" + name="paste_textures_btn" + top_delta="26 " + width="235" /> + <button + follows="left|bottom" + height="20" + label="Write Thumbnails" + layout="topleft" + left_delta="0" + name="write_thumbnails_btn" + top_delta="26 " + width="235" /> + <button + follows="left|bottom" + height="20" + label="Log items with no thumbnail" + layout="bottomleft" + right="-10" + name="log_missing_thumbnails_btn" + bottom="60" + width="235" /> + <button + follows="left|bottom" + height="20" + label="Clear thumbnails from pasted items" + layout="bottomleft" + right="-10" + name="clear_thumbnails_btn" + top_delta="26" + width="235" /> + + +</floater>
\ No newline at end of file diff --git a/indra/newview/skins/default/xui/en/floater_publish_classified.xml b/indra/newview/skins/default/xui/en/floater_publish_classified.xml index 2d7d03f7a0..04840e1c64 100644 --- a/indra/newview/skins/default/xui/en/floater_publish_classified.xml +++ b/indra/newview/skins/default/xui/en/floater_publish_classified.xml @@ -25,6 +25,7 @@ Remember, Classified fees are non-refundable. </text> <spinner decimal_digits="0" + allow_digits_only="true" follows="left|top" font="SansSerif" halign="left" @@ -36,7 +37,6 @@ Remember, Classified fees are non-refundable. layout="topleft" left="15" value="50" - min_val="50" max_val="999999" name="price_for_listing" top_pad="10" diff --git a/indra/newview/skins/default/xui/en/menu_gallery_inventory.xml b/indra/newview/skins/default/xui/en/menu_gallery_inventory.xml index 41e0183370..c11f1c88cb 100644 --- a/indra/newview/skins/default/xui/en/menu_gallery_inventory.xml +++ b/indra/newview/skins/default/xui/en/menu_gallery_inventory.xml @@ -35,7 +35,7 @@ layout="topleft" name="Folder Wearables Separator" /> <menu_item_call - label="Replace Current Outfit" + label="Replace current outfit" layout="topleft" name="Replace Outfit"> <menu_item_call.on_click @@ -43,7 +43,7 @@ parameter="replaceoutfit" /> </menu_item_call> <menu_item_call - label="Add To Current Outfit" + label="Add folder items" layout="topleft" name="Add To Outfit"> <menu_item_call.on_click @@ -51,7 +51,7 @@ parameter="addtooutfit" /> </menu_item_call> <menu_item_call - label="Remove From Current Outfit" + label="Take off folder items" layout="topleft" name="Remove From Outfit"> <menu_item_call.on_click diff --git a/indra/newview/skins/default/xui/en/menu_gallery_outfit_tab.xml b/indra/newview/skins/default/xui/en/menu_gallery_outfit_tab.xml index 25d64ba74d..99cee83f4e 100755 --- a/indra/newview/skins/default/xui/en/menu_gallery_outfit_tab.xml +++ b/indra/newview/skins/default/xui/en/menu_gallery_outfit_tab.xml @@ -3,7 +3,7 @@ layout="topleft" name="Outfit"> <menu_item_call - label="Wear - Replace Current Outfit" + label="Replace current outfit" layout="topleft" name="wear_replace"> <on_click @@ -16,7 +16,7 @@ parameter="wear_replace" /> </menu_item_call> <menu_item_call - label="Wear - Add to Current Outfit" + label="Add outfit items" layout="topleft" name="wear_add"> <on_click @@ -29,7 +29,7 @@ parameter="wear_add" /> </menu_item_call> <menu_item_call - label="Take Off - Remove from Current Outfit" + label="Take off outfit items" layout="topleft" name="take_off"> <on_click @@ -41,17 +41,60 @@ function="Outfit.OnVisible" parameter="take_off" /> </menu_item_call> + <menu_item_separator/> <menu_item_call - label="Image..." - layout="topleft" - name="thumbnail"> + label="Image..." + layout="topleft" + name="thumbnail"> + <on_click + function="Outfit.Thumbnail" /> + </menu_item_call> + <menu_item_call + label="Edit outfit" + layout="topleft" + name="edit"> + <on_click + function="Outfit.Edit" /> + <on_visible + function="Outfit.OnVisible" + parameter="edit" /> + </menu_item_call> + <menu_item_call + label="Rename outfit" + layout="topleft" + name="rename"> + <on_click + function="Outfit.Rename" /> + <on_enable + function="Outfit.OnEnable" + parameter="rename" /> + </menu_item_call> + <menu_item_call + label="Save to this outfit" + layout="topleft" + name="save"> + <on_click + function="Outfit.Save" /> + </menu_item_call> + <menu_item_separator> + <on_visible + function="Outfit.OnVisible" + parameter="delete" /> + </menu_item_separator> + <menu_item_call + label="Delete outfit" + layout="topleft" + name="delete"> <on_click - function="Outfit.Thumbnail" /> + function="Outfit.Delete" /> + <on_visible + function="Outfit.OnVisible" + parameter="delete" /> </menu_item_call> - <menu_item_separator name="sepatator1" /> + <menu_item_separator/> <menu height="175" - label="New Clothes" + label="New clothes" layout="topleft" left_delta="0" mouse_opaque="false" @@ -157,7 +200,7 @@ </menu> <menu height="85" - label="New Body Parts" + label="New body parts" layout="topleft" left_delta="0" mouse_opaque="false" @@ -197,35 +240,4 @@ parameter="eyes" /> </menu_item_call> </menu> - <menu_item_separator name="sepatator2" /> - <menu_item_call - label="Edit Outfit" - layout="topleft" - name="edit"> - <on_click - function="Outfit.Edit" /> - <on_visible - function="Outfit.OnVisible" - parameter="edit" /> - </menu_item_call> - <menu_item_call - label="Rename Outfit" - layout="topleft" - name="rename"> - <on_click - function="Outfit.Rename" /> - <on_enable - function="Outfit.OnEnable" - parameter="rename" /> - </menu_item_call> - <menu_item_call - label="Delete Outfit" - layout="topleft" - name="delete"> - <on_click - function="Outfit.Delete" /> - <on_visible - function="Outfit.OnVisible" - parameter="delete" /> - </menu_item_call> </context_menu> diff --git a/indra/newview/skins/default/xui/en/menu_inventory.xml b/indra/newview/skins/default/xui/en/menu_inventory.xml index d5c0a427fb..d8aac71dd5 100644 --- a/indra/newview/skins/default/xui/en/menu_inventory.xml +++ b/indra/newview/skins/default/xui/en/menu_inventory.xml @@ -272,7 +272,7 @@ layout="topleft" name="Folder Wearables Separator" /> <menu_item_call - label="Replace Current Outfit" + label="Replace current outfit" layout="topleft" name="Replace Outfit"> <menu_item_call.on_click @@ -280,7 +280,7 @@ parameter="replaceoutfit" /> </menu_item_call> <menu_item_call - label="Add To Current Outfit" + label="Add folder items" layout="topleft" name="Add To Outfit"> <menu_item_call.on_click @@ -288,7 +288,7 @@ parameter="addtooutfit" /> </menu_item_call> <menu_item_call - label="Remove From Current Outfit" + label="Take off folder items" layout="topleft" name="Remove From Outfit"> <menu_item_call.on_click diff --git a/indra/newview/skins/default/xui/en/menu_outfit_gear.xml b/indra/newview/skins/default/xui/en/menu_outfit_gear.xml index 85eb941e31..8f36c7a00a 100644 --- a/indra/newview/skins/default/xui/en/menu_outfit_gear.xml +++ b/indra/newview/skins/default/xui/en/menu_outfit_gear.xml @@ -4,7 +4,7 @@ visible="false" name="Gear Outfit"> <menu_item_call - label="Wear - Replace Current Outfit" + label="Replace current outfit" layout="topleft" name="wear"> <on_click @@ -17,7 +17,7 @@ parameter="wear" /> </menu_item_call> <menu_item_call - label="Wear - Add to Current Outfit" + label="Add outfit items" layout="topleft" name="wear_add"> <on_click @@ -25,9 +25,11 @@ <on_enable function="Gear.OnEnable" parameter="wear_add" /> + <on_visible + function="Gear.OnVisible"/> </menu_item_call> <menu_item_call - label="Take Off - Remove from Current Outfit" + label="Take off outfit items" layout="topleft" name="take_off"> <on_click @@ -39,19 +41,88 @@ function="Gear.OnVisible" parameter="take_off" /> </menu_item_call> + <menu_item_separator name="wear_separator" /> <menu_item_call label="Image..." layout="topleft" name="thumbnail"> + <on_click + function="Gear.Thumbnail" /> + </menu_item_call> + <menu_item_call + label="Rename outfit" + layout="topleft" + name="rename"> + <on_click + function="Gear.Rename" /> + <on_enable + function="Gear.OnEnable" + parameter="rename" /> + <on_visible + function="Gear.OnVisible" + parameter="rename" /> + </menu_item_call> + <menu_item_call + label="Save to this outfit" + layout="topleft" + name="save"> + <on_click + function="Gear.Save" /> + <on_visible + function="Gear.OnVisible"/> + </menu_item_call> + <menu_item_separator> + <on_visible + function="Gear.OnVisible" + parameter="delete" /> + </menu_item_separator> + <menu_item_call + label="Delete outfit" + layout="topleft" + name="delete_outfit"> + <on_click + function="Gear.Delete" /> + <on_enable + function="Gear.OnEnable" + parameter="delete" /> + <on_visible + function="Gear.OnVisible" + parameter="delete" /> + </menu_item_call> + <menu_item_separator> + <on_visible + function="Gear.OnVisible"/> + </menu_item_separator> + <menu_item_check + label="Sort folders always by name" + layout="topleft" + name="sort_folders_by_name"> + <on_click + function="Gear.SortByName" /> + <on_check + function="CheckControl" + parameter="OutfitGallerySortByName" /> + </menu_item_check> + <menu_item_call + label="Expand all folders" + layout="topleft" + name="expand"> + <on_click + function="Gear.Expand" /> + </menu_item_call> + <menu_item_call + label="Collapse all folders" + layout="topleft" + name="collapse"> <on_click - function="Gear.Thumbnail" /> + function="Gear.Collapse" /> </menu_item_call> - <menu_item_separator name="sepatator1" /> + <menu_item_separator/> <!-- copied (with minor modifications) from menu_inventory_add.xml --> <!-- *TODO: generate dynamically? --> <menu height="175" - label="New Clothes" + label="New clothes" layout="topleft" left_delta="0" mouse_opaque="false" @@ -165,7 +236,7 @@ </menu> <menu height="85" - label="New Body Parts" + label="New body parts" layout="topleft" left_delta="0" mouse_opaque="false" @@ -206,57 +277,4 @@ </menu_item_call> </menu> <!-- copied from menu_inventory_add.xml --> - - <menu_item_separator name="sepatator2" /> - <menu_item_call - label="Expand all folders" - layout="topleft" - name="expand"> - <on_click - function="Gear.Expand" /> - </menu_item_call> - <menu_item_call - label="Collapse all folders" - layout="topleft" - name="collapse"> - <on_click - function="Gear.Collapse" /> - </menu_item_call> - <menu_item_call - label="Rename Outfit" - layout="topleft" - name="rename"> - <on_click - function="Gear.Rename" /> - <on_enable - function="Gear.OnEnable" - parameter="rename" /> - <on_visible - function="Gear.OnVisible" - parameter="rename" /> - </menu_item_call> - <menu_item_call - label="Delete Outfit" - layout="topleft" - name="delete_outfit"> - <on_click - function="Gear.Delete" /> - <on_enable - function="Gear.OnEnable" - parameter="delete" /> - <on_visible - function="Gear.OnVisible" - parameter="delete" /> - </menu_item_call> - <menu_item_separator name="sepatator3" /> - <menu_item_check - label="Sort Folders Always by Name" - layout="topleft" - name="sort_folders_by_name"> - <on_click - function="Gear.SortByName" /> - <on_check - function="CheckControl" - parameter="OutfitGallerySortByName" /> - </menu_item_check> </toggleable_menu> diff --git a/indra/newview/skins/default/xui/en/menu_outfit_tab.xml b/indra/newview/skins/default/xui/en/menu_outfit_tab.xml index ae5fae864d..c6805edd63 100644 --- a/indra/newview/skins/default/xui/en/menu_outfit_tab.xml +++ b/indra/newview/skins/default/xui/en/menu_outfit_tab.xml @@ -3,7 +3,7 @@ layout="topleft" name="Outfit"> <menu_item_call - label="Wear - Replace Current Outfit" + label="Replace current outfit" layout="topleft" name="wear_replace"> <on_click @@ -16,7 +16,7 @@ parameter="wear_replace" /> </menu_item_call> <menu_item_call - label="Wear - Add to Current Outfit" + label="Add outfit items" layout="topleft" name="wear_add"> <on_click @@ -29,7 +29,7 @@ parameter="wear_add" /> </menu_item_call> <menu_item_call - label="Take Off - Remove from Current Outfit" + label="Take off outfit items" layout="topleft" name="take_off"> <on_click @@ -41,19 +41,26 @@ function="Outfit.OnVisible" parameter="take_off" /> </menu_item_call> + <menu_item_separator /> <menu_item_call - label="Edit Outfit" - layout="topleft" - name="edit"> + label="Image..." + layout="topleft" + name="thumbnail"> + <on_click + function="Outfit.Thumbnail" /> + </menu_item_call> + <menu_item_call + label="Edit outfit" + layout="topleft" + name="edit"> <on_click function="Outfit.Edit" /> <on_visible function="Outfit.OnVisible" parameter="edit" /> </menu_item_call> - <menu_item_separator /> <menu_item_call - label="Rename Outfit" + label="Rename outfit" layout="topleft" name="rename"> <on_click @@ -63,7 +70,19 @@ parameter="rename" /> </menu_item_call> <menu_item_call - label="Delete Outfit" + label="Save to this outfit" + layout="topleft" + name="save"> + <on_click + function="Outfit.Save" /> + </menu_item_call> + <menu_item_separator> + <on_visible + function="Outfit.OnVisible" + parameter="delete" /> + </menu_item_separator> + <menu_item_call + label="Delete outfit" layout="topleft" name="delete"> <on_click diff --git a/indra/newview/skins/default/xui/en/menu_teleport_history_item.xml b/indra/newview/skins/default/xui/en/menu_teleport_history_item.xml index 910a0adc28..e4e86bb911 100644 --- a/indra/newview/skins/default/xui/en/menu_teleport_history_item.xml +++ b/indra/newview/skins/default/xui/en/menu_teleport_history_item.xml @@ -49,4 +49,17 @@ function="TeleportHistory.GearMenu.Enable" parameter="copy_slurl" /> </menu_item_call> + <menu_item_separator + layout="topleft" /> + <menu_item_call + label="Remove from history" + layout="topleft" + name="remove_from_history"> + <on_click + function="TeleportHistory.GearMenu.Action" + parameter="remove" /> + <on_enable + function="TeleportHistory.GearMenu.Enable" + parameter="remove" /> + </menu_item_call> </toggleable_menu> diff --git a/indra/newview/skins/default/xui/en/menu_viewer.xml b/indra/newview/skins/default/xui/en/menu_viewer.xml index 3bf4015bc5..5b0ebf1110 100644 --- a/indra/newview/skins/default/xui/en/menu_viewer.xml +++ b/indra/newview/skins/default/xui/en/menu_viewer.xml @@ -3566,6 +3566,21 @@ function="World.EnvPreset" function="Advanced.WebContentTest" parameter="http://duckduckgo.com"/> </menu_item_call> + <menu_item_call + label="Inventory Thumbnails Helper" + name="Inventory Thumbnails Helper" + shortcut="control|alt|shift|X"> + <menu_item_call.on_click + function="Floater.Show" + parameter="inventory_thumbnails_helper" /> + </menu_item_call> + <menu_item_call + label="FB Connect Test" + name="FB Connect Test"> + <menu_item_call.on_click + function="Advanced.WebContentTest" + parameter="https://cryptic-ridge-1632.herokuapp.com/"/> + </menu_item_call> <menu_item_call label="Dump Fonts" name="Dump Fonts"> @@ -3655,6 +3670,14 @@ function="World.EnvPreset" function="Advanced.ToggleDebugUnicode" /> </menu_item_check> <menu_item_check + label="Debug Camera Controls" + name="Debug Camera Controls"> + <menu_item_check.on_check + function="Advanced.CheckDebugCamera" /> + <menu_item_check.on_click + function="Advanced.ToggleDebugCamera" /> + </menu_item_check> + <menu_item_check label="Debug Name Tooltips" name="Debug Name Tooltips"> <menu_item_check.on_check diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml index a9d13dfd06..7d237c6edd 100644 --- a/indra/newview/skins/default/xui/en/notifications.xml +++ b/indra/newview/skins/default/xui/en/notifications.xml @@ -12296,6 +12296,50 @@ Would you like to save them first? notext="No" yestext="Yes"/> </notification> + + <notification + icon="alertmodal.tga" + name="ConfirmOverwriteOutfit" + type="alertmodal"> + <unique/> +This will replace the items in the +selected outfit with the items you +are wearing now. + <tag>confirm</tag> + <usetemplate + ignoretext="Confirm before overwriting outfit" + name="okcancelignore" + notext="Cancel" + yestext="Save"/> + </notification> + + <notification + icon="alertmodal.tga" + name="ClearInventoryThumbnailsWarning" + type="alertmodal"> + You are about to remove thumbnail images from the inventory items in the list. This change cannot be undone. + + Would you like to proceed? + <tag>confirm</tag> + <usetemplate + name="okcancelbuttons" + notext="No" + yestext="Yes"/> + </notification> + + <notification + icon="alertmodal.tga" + name="WriteInventoryThumbnailsWarning" + type="alertmodal"> + You are about to overwrite thumbnail images for some or all of the inventory items in the list. This change cannot be undone. + + Would you like to proceed? + <tag>confirm</tag> + <usetemplate + name="okcancelbuttons" + notext="No" + yestext="Yes"/> + </notification> <notification icon="notifytip.tga" diff --git a/indra/newview/skins/default/xui/en/panel_settings_water.xml b/indra/newview/skins/default/xui/en/panel_settings_water.xml index bec4f7852f..5e65b0e8a2 100644 --- a/indra/newview/skins/default/xui/en/panel_settings_water.xml +++ b/indra/newview/skins/default/xui/en/panel_settings_water.xml @@ -65,7 +65,7 @@ Density Exponent: </text> <slider - decimal_digits="1" + decimal_digits="2" follows="left|top" height="16" increment="0.01" diff --git a/indra/newview/tests/llremoteparcelrequest_test.cpp b/indra/newview/tests/llremoteparcelrequest_test.cpp index 4f7f87b6b0..4eddfb46e1 100644 --- a/indra/newview/tests/llremoteparcelrequest_test.cpp +++ b/indra/newview/tests/llremoteparcelrequest_test.cpp @@ -49,7 +49,7 @@ void LLCurl::Responder::failureResult(S32 status, const std::string& reason, con void LLCurl::Responder::successResult(const LLSD& content) { } void LLCurl::Responder::completeResult(S32 status, const std::string& reason, const LLSD& content) { } std::string LLCurl::Responder::dumpResponse() const { return "(failure)"; } -void LLCurl::Responder::completedRaw(LLChannelDescriptors const &,boost::shared_ptr<LLBufferArray> const &) { } +void LLCurl::Responder::completedRaw(LLChannelDescriptors const &,std::shared_ptr<LLBufferArray> const &) { } void LLMessageSystem::getF32(char const *,char const *,F32 &,S32) { } void LLMessageSystem::getU8(char const *,char const *,U8 &,S32) { } void LLMessageSystem::getS32(char const *,char const *,S32 &,S32) { } @@ -110,7 +110,7 @@ namespace tut { set_test_name("observer pointer"); - boost::scoped_ptr<TestObserver> observer(new TestObserver()); + std::unique_ptr<TestObserver> observer(new TestObserver()); LLRemoteParcelInfoProcessor & processor = LLRemoteParcelInfoProcessor::instance(); processor.addObserver(LLUUID(TEST_PARCEL_ID), observer.get()); |