From 42e1a9ed870c537b5684cd15a7acc524a3672685 Mon Sep 17 00:00:00 2001 From: maxim_productengine Date: Mon, 27 Jan 2020 17:54:02 +0200 Subject: SL-12475 add Inventory Favorites tab # Conflicts: # indra/newview/llinventorybridge.cpp # indra/newview/llinventorypanel.cpp --- indra/llui/llfolderview.h | 2 + .../newview/app_settings/settings_per_account.xml | 11 +++ indra/newview/llinventorybridge.cpp | 52 ++++++++++-- indra/newview/llinventorymodel.cpp | 5 ++ indra/newview/llinventorypanel.cpp | 96 ++++++++++++++++++++++ indra/newview/llinventorypanel.h | 21 +++++ indra/newview/llpanelmaininventory.cpp | 12 ++- indra/newview/llpanelmaininventory.h | 2 + .../skins/default/xui/en/menu_inventory.xml | 7 ++ .../skins/default/xui/en/panel_main_inventory.xml | 40 +++++---- indra/newview/skins/default/xui/en/strings.xml | 1 + 11 files changed, 225 insertions(+), 24 deletions(-) diff --git a/indra/llui/llfolderview.h b/indra/llui/llfolderview.h index 6bb5e6c02e..c175034d75 100644 --- a/indra/llui/llfolderview.h +++ b/indra/llui/llfolderview.h @@ -241,6 +241,8 @@ public: void dumpSelectionInformation(); virtual S32 notify(const LLSD& info) ; + + void setShowEmptyMessage(bool show_msg) { mShowEmptyMessage = show_msg; } bool useLabelSuffix() { return mUseLabelSuffix; } virtual void updateMenu(); diff --git a/indra/newview/app_settings/settings_per_account.xml b/indra/newview/app_settings/settings_per_account.xml index 8f4ca6c633..5eecf1b9f5 100644 --- a/indra/newview/app_settings/settings_per_account.xml +++ b/indra/newview/app_settings/settings_per_account.xml @@ -392,6 +392,17 @@ Value + FavoritesFolder + + Comment + User's chosen folder which will be shown in the Favorites tab (UUID) + Persist + 1 + Type + String + Value + + SnapshotBaseDir Comment diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 657c65c68d..03123689c5 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -138,6 +138,35 @@ bool isMarketplaceSendAction(const std::string& action) return ("send_to_marketplace" == action); } +bool isPanelActive(const std::string& panel_name) +{ + LLInventoryPanel *active_panel = LLInventoryPanel::getActiveInventoryPanel(FALSE); + return (active_panel && (active_panel->getName() == panel_name)); +} + +bool isParentSystemFolder(const LLInventoryModel* model, const LLUUID& folder_id) +{ + if (!model || folder_id.isNull()) return false; + + LLViewerInventoryCategory* cat = model->getCategory(folder_id); + if (cat) + { + if (cat->getPreferredType() == LLFolderType::FT_ROOT_INVENTORY) + { + return false; + } + if (LLFolderType::lookupIsProtectedType(cat->getPreferredType())) + { + return true; + } + else + { + return isParentSystemFolder(model, cat->getParentUUID()); + } + } + return false; +} + // Used by LLFolderBridge as callback for directory fetching recursion class LLRightClickInventoryFetchDescendentsObserver : public LLInventoryFetchDescendentsObserver { @@ -888,8 +917,7 @@ void LLInvFVBridge::getClipboardEntries(bool show_asset_id, disabled_items.push_back(std::string("Properties")); } - LLInventoryPanel *active_panel = LLInventoryPanel::getActiveInventoryPanel(FALSE); - if (active_panel && (active_panel->getName() != "All Items")) + if (!isPanelActive("All Items")) { items.push_back(std::string("Show in Main Panel")); } @@ -980,7 +1008,7 @@ void LLInvFVBridge::addDeleteContextMenuOptions(menuentry_vec_t &items, items.push_back(std::string("Delete")); - if (!isItemRemovable()) + if (!isItemRemovable() || isPanelActive("Favorite Items")) { disabled_items.push_back(std::string("Delete")); } @@ -4010,6 +4038,7 @@ void LLFolderBridge::buildContextMenuOptions(U32 flags, menuentry_vec_t& items disabled_items.push_back(std::string("New Clothes")); disabled_items.push_back(std::string("New Body Parts")); disabled_items.push_back(std::string("upload_def")); + disabled_items.push_back(std::string("Set Favorites folder")); } if (favorites == mUUID) { @@ -4037,6 +4066,7 @@ void LLFolderBridge::buildContextMenuOptions(U32 flags, menuentry_vec_t& items disabled_items.push_back(std::string("New Clothes")); disabled_items.push_back(std::string("New Body Parts")); disabled_items.push_back(std::string("upload_def")); + disabled_items.push_back(std::string("Set Favorites folder")); } if (marketplace_listings_id == mUUID) { @@ -4045,14 +4075,14 @@ void LLFolderBridge::buildContextMenuOptions(U32 flags, menuentry_vec_t& items disabled_items.push_back(std::string("Cut")); disabled_items.push_back(std::string("Delete")); } + + if (isPanelActive("Favorite Items")) + { + disabled_items.push_back(std::string("Delete")); + } if(trash_id == mUUID) { - bool is_recent_panel = false; - LLInventoryPanel *active_panel = LLInventoryPanel::getActiveInventoryPanel(FALSE); - if (active_panel && (active_panel->getName() == "Recent Items")) - { - is_recent_panel = true; - } + bool is_recent_panel = isPanelActive("Recent Items"); // This is the trash. items.push_back(std::string("Empty Trash")); @@ -4102,6 +4132,10 @@ void LLFolderBridge::buildContextMenuOptions(U32 flags, menuentry_vec_t& items items.push_back(std::string("New Settings")); items.push_back(std::string("upload_def")); + if (!LLFolderType::lookupIsProtectedType(getPreferredType()) && !isParentSystemFolder(model, mUUID)) + { + items.push_back(std::string("Set Favorites folder")); + } if (!LLEnvironment::instance().isInventoryEnabled()) { disabled_items.push_back("New Settings"); diff --git a/indra/newview/llinventorymodel.cpp b/indra/newview/llinventorymodel.cpp index 17e80dca89..a44a54632c 100644 --- a/indra/newview/llinventorymodel.cpp +++ b/indra/newview/llinventorymodel.cpp @@ -542,6 +542,11 @@ const LLUUID LLInventoryModel::findUserDefinedCategoryUUIDForType(LLFolderType:: cat_id = LLUUID(gSavedPerAccountSettings.getString("AnimationUploadFolder")); break; } + case LLFolderType::FT_FAVORITE: + { + cat_id = LLUUID(gSavedPerAccountSettings.getString("FavoritesFolder")); + break; + } default: break; } diff --git a/indra/newview/llinventorypanel.cpp b/indra/newview/llinventorypanel.cpp index c6075b4066..8e814916ad 100644 --- a/indra/newview/llinventorypanel.cpp +++ b/indra/newview/llinventorypanel.cpp @@ -179,6 +179,7 @@ LLInventoryPanel::LLInventoryPanel(const LLInventoryPanel::Params& p) : mCommitCallbackRegistrar.add("Inventory.BeginIMSession", boost::bind(&LLInventoryPanel::beginIMSession, this)); mCommitCallbackRegistrar.add("Inventory.Share", boost::bind(&LLAvatarActions::shareWithAvatars, this)); mCommitCallbackRegistrar.add("Inventory.FileUploadLocation", boost::bind(&LLInventoryPanel::fileUploadLocation, this, _2)); + mCommitCallbackRegistrar.add("Inventory.SetFavoritesFolder", boost::bind(&LLInventoryPanel::setFavoritesFolder, this, _2)); } LLFolderView * LLInventoryPanel::createFolderRoot(LLUUID root_id ) @@ -1374,6 +1375,11 @@ void LLInventoryPanel::fileUploadLocation(const LLSD& userdata) } } +void LLInventoryPanel::setFavoritesFolder(const LLSD& userdata) +{ + gSavedPerAccountSettings.setString("FavoritesFolder", LLFolderBridge::sSelf.get()->getUUID().asString()); +} + void LLInventoryPanel::purgeSelectedItems() { if (!mFolderRoot.get()) return; @@ -1753,6 +1759,96 @@ LLInventoryRecentItemsPanel::LLInventoryRecentItemsPanel( const Params& params) mInvFVBridgeBuilder = &RECENT_ITEMS_BUILDER; } +static LLDefaultChildRegistry::Register t_favorites_inventory_panel("favorites_inventory_panel"); + +LLInventoryFavoriteItemsPanel::LLInventoryFavoriteItemsPanel(const Params& params) + : LLInventoryPanel(params) +{ + std::string ctrl_name = "FavoritesFolder"; + if (gSavedPerAccountSettings.controlExists(ctrl_name)) + { + LLPointer cntrl_ptr = gSavedPerAccountSettings.getControl(ctrl_name); + if (cntrl_ptr.notNull()) + { + mFolderChangedSignal = cntrl_ptr->getCommitSignal()->connect(boost::bind(&LLInventoryFavoriteItemsPanel::updateFavoritesRootFolder, this)); + } + } +} + +void LLInventoryFavoriteItemsPanel::setSelectCallback(const boost::function& items, BOOL user_action)>& cb) +{ + if (mFolderRoot.get()) + { + mFolderRoot.get()->setSelectCallback(cb); + mSelectionCallback = cb; + } +} + +void LLInventoryFavoriteItemsPanel::initFromParams(const Params& p) +{ + Params fav_params(p); + fav_params.start_folder.id = gInventory.findUserDefinedCategoryUUIDForType(LLFolderType::FT_FAVORITE); + LLInventoryPanel::initFromParams(fav_params); + updateFavoritesRootFolder(); +} + +void LLInventoryFavoriteItemsPanel::updateFavoritesRootFolder() +{ + const LLUUID& folder_id = gInventory.findUserDefinedCategoryUUIDForType(LLFolderType::FT_FAVORITE); + + bool is_favorites_set = (folder_id != gInventory.findCategoryUUIDForTypeInRoot(LLFolderType::FT_FAVORITE, true, gInventory.getRootFolderID())); + + if (!is_favorites_set || folder_id != getRootFolderID()) + { + LLUUID root_id = folder_id; + if (mFolderRoot.get()) + { + removeItemID(getRootFolderID()); + mFolderRoot.get()->destroyView(); + } + + mCommitCallbackRegistrar.pushScope(); + { + LLFolderView* folder_view = createFolderRoot(root_id); + mFolderRoot = folder_view->getHandle(); + + addItemID(root_id, mFolderRoot.get()); + + + LLRect scroller_view_rect = getRect(); + scroller_view_rect.translate(-scroller_view_rect.mLeft, -scroller_view_rect.mBottom); + LLScrollContainer::Params scroller_params(mParams.scroll()); + scroller_params.rect(scroller_view_rect); + + if (mScroller) + { + removeChild(mScroller); + delete mScroller; + mScroller = NULL; + } + mScroller = LLUICtrlFactory::create(scroller_params); + addChild(mScroller); + mScroller->addChild(mFolderRoot.get()); + mFolderRoot.get()->setScrollContainer(mScroller); + mFolderRoot.get()->setFollowsAll(); + mFolderRoot.get()->addChild(mFolderRoot.get()->mStatusTextBox); + + if (!mSelectionCallback.empty()) + { + mFolderRoot.get()->setSelectCallback(mSelectionCallback); + } + } + mCommitCallbackRegistrar.popScope(); + mFolderRoot.get()->setCallbackRegistrar(&mCommitCallbackRegistrar); + + if (is_favorites_set) + { + buildNewViews(folder_id); + } + mFolderRoot.get()->setShowEmptyMessage(!is_favorites_set); + } +} + /************************************************************************/ /* Asset Pre-Filtered Inventory Panel related class */ /* Exchanges filter's flexibility for speed of generation and */ diff --git a/indra/newview/llinventorypanel.h b/indra/newview/llinventorypanel.h index b55eb2b828..d1c0b35e21 100644 --- a/indra/newview/llinventorypanel.h +++ b/indra/newview/llinventorypanel.h @@ -214,6 +214,7 @@ public: void doCreate(const LLSD& userdata); bool beginIMSession(); void fileUploadLocation(const LLSD& userdata); + void setFavoritesFolder(const LLSD& userdata); void purgeSelectedItems(); bool attachObject(const LLSD& userdata); static void idle(void* user_data); @@ -338,4 +339,24 @@ private: bool mViewsInitialized; // Views have been generated }; + +class LLInventoryFavoriteItemsPanel : public LLInventoryPanel +{ +public: + struct Params : public LLInitParam::Block + {}; + + void initFromParams(const Params& p); + bool isSelectionRemovable() { return false; } + void setSelectCallback(const boost::function& items, BOOL user_action)>& cb); + +protected: + LLInventoryFavoriteItemsPanel::LLInventoryFavoriteItemsPanel(const Params& params); + ~LLInventoryFavoriteItemsPanel() { mFolderChangedSignal.disconnect(); } + void updateFavoritesRootFolder(); + + boost::signals2::connection mFolderChangedSignal; + boost::function& items, BOOL user_action)> mSelectionCallback; + friend class LLUICtrlFactory; +}; #endif // LL_LLINVENTORYPANEL_H diff --git a/indra/newview/llpanelmaininventory.cpp b/indra/newview/llpanelmaininventory.cpp index 02cd22c307..89682d9576 100644 --- a/indra/newview/llpanelmaininventory.cpp +++ b/indra/newview/llpanelmaininventory.cpp @@ -188,6 +188,16 @@ BOOL LLPanelMainInventory::postBuild() worn_filter.markDefault(); mWornItemsPanel->setSelectCallback(boost::bind(&LLPanelMainInventory::onSelectionChange, this, mWornItemsPanel, _1, _2)); } + + mFavoriteItemsPanel = getChild("Favorite Items"); + if (mFavoriteItemsPanel) + { + LLInventoryFilter& recent_filter = mFavoriteItemsPanel->getFilter(); + recent_filter.setEmptyLookupMessage("InventoryFavoritItemsNotSelected"); + recent_filter.markDefault(); + mFavoriteItemsPanel->setSelectCallback(boost::bind(&LLPanelMainInventory::onSelectionChange, this, mFavoriteItemsPanel, _1, _2)); + } + mSearchTypeCombo = getChild("search_type"); if(mSearchTypeCombo) { @@ -1403,7 +1413,7 @@ BOOL LLPanelMainInventory::isActionEnabled(const LLSD& userdata) } if (command_name == "delete") { - return getActivePanel()->isSelectionRemovable(); + return getActivePanel()->isSelectionRemovable() && (getActivePanel() != mFavoriteItemsPanel); } if (command_name == "save_texture") { diff --git a/indra/newview/llpanelmaininventory.h b/indra/newview/llpanelmaininventory.h index a6bdee233d..c0b4a7b6fc 100644 --- a/indra/newview/llpanelmaininventory.h +++ b/indra/newview/llpanelmaininventory.h @@ -37,6 +37,7 @@ class LLComboBox; class LLFolderViewItem; class LLInventoryPanel; +class LLInventoryFavoriteItemsPanel; class LLSaveFolderState; class LLFilterEditor; class LLTabContainer; @@ -136,6 +137,7 @@ private: LLHandle mFinderHandle; LLInventoryPanel* mActivePanel; LLInventoryPanel* mWornItemsPanel; + LLInventoryFavoriteItemsPanel* mFavoriteItemsPanel; bool mResortActivePanel; LLSaveFolderState* mSavedFolderState; std::string mFilterText; diff --git a/indra/newview/skins/default/xui/en/menu_inventory.xml b/indra/newview/skins/default/xui/en/menu_inventory.xml index 9aa84c1bac..adefa261aa 100644 --- a/indra/newview/skins/default/xui/en/menu_inventory.xml +++ b/indra/newview/skins/default/xui/en/menu_inventory.xml @@ -393,6 +393,13 @@ parameter="model" /> + + + - - + + Didn't find what you're looking for? Try [secondlife:///app/search/all/[SEARCH_TERM] Search]. Didn't find what you're looking for? Try [secondlife:///app/inventory/filters Show filters]. + Click "Use as Favorites folder" on a folder of your choice. You can choose a different folder at any time. System folders cannot be used for Favorites. Didn't find what you're looking for? Try [secondlife:///app/search/places/[SEARCH_TERM] Search]. Drag a landmark here to add it to your favorites. No items found. Check the spelling of your search string and try again. -- cgit v1.2.3 From ae1e7c1231861aab49ddf348f914eba1b8993bbb Mon Sep 17 00:00:00 2001 From: Andrey Lihatskiy Date: Tue, 28 Jan 2020 14:50:32 +0200 Subject: SL-12475 Mac buildfix --- indra/newview/llinventorypanel.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/newview/llinventorypanel.h b/indra/newview/llinventorypanel.h index d1c0b35e21..32d122cab8 100644 --- a/indra/newview/llinventorypanel.h +++ b/indra/newview/llinventorypanel.h @@ -351,7 +351,7 @@ public: void setSelectCallback(const boost::function& items, BOOL user_action)>& cb); protected: - LLInventoryFavoriteItemsPanel::LLInventoryFavoriteItemsPanel(const Params& params); + LLInventoryFavoriteItemsPanel(const Params& params); ~LLInventoryFavoriteItemsPanel() { mFolderChangedSignal.disconnect(); } void updateFavoritesRootFolder(); -- cgit v1.2.3 From 980cb570162f5f4e48a2de99726d83336e3d5f59 Mon Sep 17 00:00:00 2001 From: Mnikolenko Productengine Date: Fri, 21 Aug 2020 15:20:23 +0300 Subject: SL-13823 FIXED "Settings" are not shown in Inventory filter message --- indra/newview/llinventoryfilter.cpp | 12 ++++++++++++ indra/newview/skins/default/xui/en/strings.xml | 1 + 2 files changed, 13 insertions(+) diff --git a/indra/newview/llinventoryfilter.cpp b/indra/newview/llinventoryfilter.cpp index 745b953996..8f18de0210 100644 --- a/indra/newview/llinventoryfilter.cpp +++ b/indra/newview/llinventoryfilter.cpp @@ -1230,6 +1230,18 @@ const std::string& LLInventoryFilter::getFilterText() filtered_by_all_types = FALSE; } + if (isFilterObjectTypesWith(LLInventoryType::IT_SETTINGS)) + { + filtered_types += LLTrans::getString("Settings"); + filtered_by_type = TRUE; + num_filter_types++; + } + else + { + not_filtered_types += LLTrans::getString("Settings"); + filtered_by_all_types = FALSE; + } + if (!LLInventoryModelBackgroundFetch::instance().folderFetchActive() && filtered_by_type && !filtered_by_all_types) diff --git a/indra/newview/skins/default/xui/en/strings.xml b/indra/newview/skins/default/xui/en/strings.xml index b26ae0ebf8..8a87199551 100644 --- a/indra/newview/skins/default/xui/en/strings.xml +++ b/indra/newview/skins/default/xui/en/strings.xml @@ -2416,6 +2416,7 @@ If you continue to receive this message, please contact Second Life support for + -- cgit v1.2.3 From 0e829d2ecca9454f4d4bcced0fe9049b0f91465d Mon Sep 17 00:00:00 2001 From: Mnikolenko Productengine Date: Fri, 21 Aug 2020 16:40:53 +0300 Subject: SL-13824 Remove notification when joining a group --- indra/newview/llviewermessage.cpp | 1 - indra/newview/skins/default/xui/en/notifications.xml | 12 ------------ 2 files changed, 13 deletions(-) diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index 06a8ebbe89..e78ace061e 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -777,7 +777,6 @@ void response_group_invitation_coro(std::string url, LLUUID group_id, bool notif LL_DEBUGS("GroupInvite") << "Successfully sent response to group " << group_id << " invitation" << LL_ENDL; if (notify_and_update) { - LLNotificationsUtil::add("JoinGroupSuccess"); gAgent.sendAgentDataUpdateRequest(); LLGroupMgr::getInstance()->clearGroupData(group_id); diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml index 32ae56e3af..fa1c15c411 100644 --- a/indra/newview/skins/default/xui/en/notifications.xml +++ b/indra/newview/skins/default/xui/en/notifications.xml @@ -1022,18 +1022,6 @@ The group no longer has open enrollment. yestext="OK"/> - -You have been added to the group - group_id - success - - - Date: Wed, 26 Aug 2020 12:26:07 +0300 Subject: SL-13824 Remove notification when both joining a group and leaving a group --- indra/newview/llviewermessage.cpp | 9 +++++++++ indra/newview/skins/default/xui/en/notifications.xml | 7 ------- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index e78ace061e..9c56766d0d 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -5036,6 +5036,15 @@ bool attempt_standard_notification(LLMessageSystem* msgsystem) // notification was specified using the new mechanism, so we can just handle it here std::string notificationID; msgsystem->getStringFast(_PREHASH_AlertInfo, _PREHASH_Message, notificationID); + + //SL-13824 skip notification when both joining a group and leaving a group + //remove this after server stops sending these messages + if (notificationID == "JoinGroupSuccess" || + notificationID == "GroupDepart") + { + return true; + } + if (!LLNotifications::getInstance()->templateExists(notificationID)) { return false; diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml index fa1c15c411..d141cfc313 100644 --- a/indra/newview/skins/default/xui/en/notifications.xml +++ b/indra/newview/skins/default/xui/en/notifications.xml @@ -4214,13 +4214,6 @@ Leave Group? yestext="OK"/> - -You have left the group '<nolink>[group_name]</nolink>'. - group - Date: Mon, 31 Aug 2020 21:27:37 +0300 Subject: SL-13852 Add visibility options to inventory search results --- indra/llui/lllineeditor.h | 3 + indra/llui/llsearcheditor.cpp | 22 +++++- indra/llui/llsearcheditor.h | 20 ++++- indra/newview/llfolderviewmodelinventory.h | 1 + indra/newview/llinventoryfilter.cpp | 85 ++++++++++++++++++++- indra/newview/llinventoryfilter.h | 17 ++++- indra/newview/llpanelmaininventory.cpp | 35 +++++++++ indra/newview/llpanelmaininventory.h | 2 + .../icons/Inv_Toolbar_SearchVisibility.png | Bin 0 -> 756 bytes indra/newview/skins/default/textures/textures.xml | 3 + .../widgets/TextField_Search_Highlight.png | Bin 0 -> 16287 bytes .../xui/en/menu_inventory_search_visibility.xml | 44 +++++++++++ .../skins/default/xui/en/panel_main_inventory.xml | 40 ++++++---- .../skins/default/xui/en/widgets/filter_editor.xml | 4 +- .../skins/default/xui/en/widgets/search_editor.xml | 4 +- 15 files changed, 258 insertions(+), 22 deletions(-) create mode 100644 indra/newview/skins/default/textures/icons/Inv_Toolbar_SearchVisibility.png create mode 100644 indra/newview/skins/default/textures/widgets/TextField_Search_Highlight.png create mode 100644 indra/newview/skins/default/xui/en/menu_inventory_search_visibility.xml diff --git a/indra/llui/lllineeditor.h b/indra/llui/lllineeditor.h index aa5779d45f..f84625bea7 100644 --- a/indra/llui/lllineeditor.h +++ b/indra/llui/lllineeditor.h @@ -283,6 +283,9 @@ public: void resetContextMenu() { setContextMenu(NULL); }; + void setBgImage(LLPointer image) { mBgImage = image; } + void setBgImageFocused(LLPointer image) { mBgImageFocused = image; } + private: // private helper methods diff --git a/indra/llui/llsearcheditor.cpp b/indra/llui/llsearcheditor.cpp index 1fdd05a11c..bafeef41fb 100644 --- a/indra/llui/llsearcheditor.cpp +++ b/indra/llui/llsearcheditor.cpp @@ -34,7 +34,11 @@ LLSearchEditor::LLSearchEditor(const LLSearchEditor::Params& p) : LLUICtrl(p), mSearchButton(NULL), - mClearButton(NULL) + mClearButton(NULL), + mEditorImage(p.background_image), + mEditorImageFocused(p.background_image_focused), + mEditorSearchImage(p.background_image_highlight), + mHighlightTextField(p.highlight_text_field) { S32 srch_btn_top = p.search_button.top_pad + p.search_button.rect.height; S32 srch_btn_right = p.search_button.rect.width + p.search_button.left_pad; @@ -57,6 +61,8 @@ LLSearchEditor::LLSearchEditor(const LLSearchEditor::Params& p) // Set up line editor. LLLineEditor::Params line_editor_params(p); line_editor_params.name("filter edit box"); + line_editor_params.background_image(p.background_image); + line_editor_params.background_image_focused(p.background_image_focused); line_editor_params.rect(getLocalRect()); line_editor_params.follows.flags(FOLLOWS_ALL); line_editor_params.text_pad_left(text_pad_left); @@ -104,6 +110,20 @@ void LLSearchEditor::draw() if (mClearButton) mClearButton->setVisible(!mSearchEditor->getWText().empty()); + if (mHighlightTextField) + { + if (!mSearchEditor->getWText().empty()) + { + mSearchEditor->setBgImage(mEditorSearchImage); + mSearchEditor->setBgImageFocused(mEditorSearchImage); + } + else + { + mSearchEditor->setBgImage(mEditorImage); + mSearchEditor->setBgImageFocused(mEditorImageFocused); + } + } + LLUICtrl::draw(); } diff --git a/indra/llui/llsearcheditor.h b/indra/llui/llsearcheditor.h index 3b12868225..c0f3c1d60c 100644 --- a/indra/llui/llsearcheditor.h +++ b/indra/llui/llsearcheditor.h @@ -47,14 +47,23 @@ public: Optional search_button, clear_button; Optional search_button_visible, - clear_button_visible; + clear_button_visible, + highlight_text_field; Optional keystroke_callback; + Optional background_image, + background_image_focused, + background_image_highlight; + Params() : search_button("search_button"), search_button_visible("search_button_visible"), clear_button("clear_button"), - clear_button_visible("clear_button_visible") + clear_button_visible("clear_button_visible"), + highlight_text_field("highlight_text_field"), + background_image("background_image"), + background_image_focused("background_image_focused"), + background_image_highlight("background_image_highlight") {} }; @@ -93,6 +102,13 @@ protected: LLLineEditor* mSearchEditor; LLButton* mSearchButton; LLButton* mClearButton; + + LLPointer mEditorImage; + LLPointer mEditorImageFocused; + LLPointer mEditorSearchImage; + LLPointer mEditorSearchImageFocused; + + bool mHighlightTextField; }; #endif // LL_SEARCHEDITOR_H diff --git a/indra/newview/llfolderviewmodelinventory.h b/indra/newview/llfolderviewmodelinventory.h index 06a908cccc..51b98339c4 100644 --- a/indra/newview/llfolderviewmodelinventory.h +++ b/indra/newview/llfolderviewmodelinventory.h @@ -45,6 +45,7 @@ public: virtual LLFolderType::EType getPreferredType() const = 0; virtual void showProperties(void) = 0; virtual BOOL isItemInTrash( void) const { return FALSE; } // TODO: make into pure virtual. + virtual BOOL isAgentInventory() const { return FALSE; } virtual BOOL isUpToDate() const = 0; virtual bool hasChildren() const = 0; virtual LLInventoryType::EType getInventoryType() const = 0; diff --git a/indra/newview/llinventoryfilter.cpp b/indra/newview/llinventoryfilter.cpp index 8f18de0210..1b99c90d5c 100644 --- a/indra/newview/llinventoryfilter.cpp +++ b/indra/newview/llinventoryfilter.cpp @@ -63,7 +63,8 @@ LLInventoryFilter::FilterOps::FilterOps(const Params& p) mPermissions(p.permissions), mFilterTypes(p.types), mFilterUUID(p.uuid), - mFilterLinks(p.links) + mFilterLinks(p.links), + mSearchVisibility(0xffffFFFFffffFFFFULL) { } @@ -154,6 +155,7 @@ bool LLInventoryFilter::check(const LLFolderViewModelItem* item) passed = passed && checkAgainstPermissions(listener); passed = passed && checkAgainstFilterLinks(listener); passed = passed && checkAgainstCreator(listener); + passed = passed && checkAgainstSearchVisibility(listener); return passed; } @@ -550,6 +552,27 @@ bool LLInventoryFilter::checkAgainstCreator(const LLFolderViewModelItemInventory } } +bool LLInventoryFilter::checkAgainstSearchVisibility(const LLFolderViewModelItemInventory* listener) const +{ + if (!listener || !hasFilterString()) return TRUE; + + const LLUUID object_id = listener->getUUID(); + const LLInventoryObject *object = gInventory.getObject(object_id); + if (!object) return TRUE; + + const BOOL is_link = object->getIsLinkType(); + if (is_link && ((mFilterOps.mSearchVisibility & VISIBILITY_LINKS) == 0)) + return FALSE; + + if (listener->isItemInTrash() && ((mFilterOps.mSearchVisibility & VISIBILITY_TRASH) == 0)) + return FALSE; + + if (!listener->isAgentInventory() && ((mFilterOps.mSearchVisibility & VISIBILITY_LIBRARY) == 0)) + return FALSE; + + return TRUE; +} + const std::string& LLInventoryFilter::getFilterSubString(BOOL trim) const { return mFilterSubString; @@ -718,6 +741,61 @@ void LLInventoryFilter::setFilterMarketplaceListingFolders(bool select_only_list } } + +void LLInventoryFilter::toggleSearchVisibilityLinks() +{ + bool hide_links = mFilterOps.mSearchVisibility & VISIBILITY_LINKS; + if (hide_links) + { + mFilterOps.mSearchVisibility &= ~VISIBILITY_LINKS; + } + else + { + mFilterOps.mSearchVisibility |= VISIBILITY_LINKS; + } + + if (hasFilterString()) + { + setModified(hide_links ? FILTER_MORE_RESTRICTIVE : FILTER_LESS_RESTRICTIVE); + } +} + +void LLInventoryFilter::toggleSearchVisibilityTrash() +{ + bool hide_trash = mFilterOps.mSearchVisibility & VISIBILITY_TRASH; + if (hide_trash) + { + mFilterOps.mSearchVisibility &= ~VISIBILITY_TRASH; + } + else + { + mFilterOps.mSearchVisibility |= VISIBILITY_TRASH; + } + + if (hasFilterString()) + { + setModified(hide_trash ? FILTER_MORE_RESTRICTIVE : FILTER_LESS_RESTRICTIVE); + } +} + +void LLInventoryFilter::toggleSearchVisibilityLibrary() +{ + bool hide_library = mFilterOps.mSearchVisibility & VISIBILITY_LIBRARY; + if (hide_library) + { + mFilterOps.mSearchVisibility &= ~VISIBILITY_LIBRARY; + } + else + { + mFilterOps.mSearchVisibility |= VISIBILITY_LIBRARY; + } + + if (hasFilterString()) + { + setModified(hide_library ? FILTER_MORE_RESTRICTIVE : FILTER_LESS_RESTRICTIVE); + } +} + void LLInventoryFilter::setFilterNoMarketplaceFolder() { mFilterOps.mFilterTypes |= FILTERTYPE_NO_MARKETPLACE_ITEMS; @@ -1349,6 +1427,11 @@ U64 LLInventoryFilter::getFilterSettingsTypes() const return mFilterOps.mFilterSettingsTypes; } +U64 LLInventoryFilter::getSearchVisibilityTypes() const +{ + return mFilterOps.mSearchVisibility; +} + bool LLInventoryFilter::hasFilterString() const { return mFilterSubString.size() > 0; diff --git a/indra/newview/llinventoryfilter.h b/indra/newview/llinventoryfilter.h index be02ee3623..caba8315c4 100644 --- a/indra/newview/llinventoryfilter.h +++ b/indra/newview/llinventoryfilter.h @@ -99,6 +99,14 @@ public: FILTERCREATOR_OTHERS }; + enum ESearchVisibility + { + VISIBILITY_NONE = 0, + VISIBILITY_TRASH = 0x1 << 0, + VISIBILITY_LIBRARY = 0x1 << 1, + VISIBILITY_LINKS = 0x1 << 2 + }; + struct FilterOps { struct DateRange : public LLInitParam::Block @@ -154,6 +162,7 @@ public: mFilterWearableTypes, mFilterSettingsTypes, // for _SETTINGS mFilterLinks, + mSearchVisibility, mFilterCategoryTypes; // For _CATEGORY LLUUID mFilterUUID; // for UUID @@ -193,7 +202,8 @@ public: U64 getFilterObjectTypes() const; U64 getFilterCategoryTypes() const; U64 getFilterWearableTypes() const; - U64 getFilterSettingsTypes() const; + U64 getFilterSettingsTypes() const; + U64 getSearchVisibilityTypes() const; bool isFilterObjectTypesWith(LLInventoryType::EType t) const; void setFilterObjectTypes(U64 types); @@ -213,6 +223,10 @@ public: ESearchType getSearchType() { return mSearchType; } void setFilterCreator(EFilterCreatorType type); + void toggleSearchVisibilityLinks(); + void toggleSearchVisibilityTrash(); + void toggleSearchVisibilityLibrary(); + void setFilterSubString(const std::string& string); const std::string& getFilterSubString(BOOL trim = FALSE) const; const std::string& getFilterSubStringOrig() const { return mFilterSubStringOrig; } @@ -309,6 +323,7 @@ private: bool checkAgainstPermissions(const LLInventoryItem* item) const; bool checkAgainstFilterLinks(const class LLFolderViewModelItemInventory* listener) const; bool checkAgainstCreator(const class LLFolderViewModelItemInventory* listener) const; + bool checkAgainstSearchVisibility(const class LLFolderViewModelItemInventory* listener) const; bool checkAgainstClipboard(const LLUUID& object_id) const; FilterOps mFilterOps; diff --git a/indra/newview/llpanelmaininventory.cpp b/indra/newview/llpanelmaininventory.cpp index 89682d9576..f845e9b056 100644 --- a/indra/newview/llpanelmaininventory.cpp +++ b/indra/newview/llpanelmaininventory.cpp @@ -115,6 +115,7 @@ LLPanelMainInventory::LLPanelMainInventory(const LLPanel::Params& p) mSavedFolderState(NULL), mFilterText(""), mMenuGearDefault(NULL), + mMenuVisibility(NULL), mMenuAddHandle(), mNeedUploadCost(true) { @@ -238,6 +239,7 @@ BOOL LLPanelMainInventory::postBuild() } mGearMenuButton = getChild("options_gear_btn"); + mVisibilityMenuButton = getChild("options_visibility_btn"); initListCommandsHandlers(); @@ -1174,6 +1176,9 @@ void LLPanelMainInventory::initListCommandsHandlers() LLMenuGL* menu = LLUICtrlFactory::getInstance()->createFromFile("menu_inventory_add.xml", gMenuHolder, LLViewerMenuHolderGL::child_registry_t::instance()); mMenuAddHandle = menu->getHandle(); + mMenuVisibility = LLUICtrlFactory::getInstance()->createFromFile("menu_inventory_search_visibility.xml", gMenuHolder, LLViewerMenuHolderGL::child_registry_t::instance()); + mVisibilityMenuButton->setMenu(mMenuVisibility); + // Update the trash button when selected item(s) get worn or taken off. LLOutfitObserver::instance().addCOFChangedCallback(boost::bind(&LLPanelMainInventory::updateListCommands, this)); } @@ -1363,6 +1368,21 @@ void LLPanelMainInventory::onCustomAction(const LLSD& userdata) } LLFloaterReg::showInstance("linkreplace", params); } + + if (command_name == "toggle_search_trash") + { + mActivePanel->getFilter().toggleSearchVisibilityTrash(); + } + + if (command_name == "toggle_search_library") + { + mActivePanel->getFilter().toggleSearchVisibilityLibrary(); + } + + if (command_name == "include_links") + { + mActivePanel->getFilter().toggleSearchVisibilityLinks(); + } } void LLPanelMainInventory::onVisibilityChange( BOOL new_visibility ) @@ -1508,6 +1528,21 @@ BOOL LLPanelMainInventory::isActionChecked(const LLSD& userdata) return sort_order_mask & LLInventoryFilter::SO_SYSTEM_FOLDERS_TO_TOP; } + if (command_name == "toggle_search_trash") + { + return (mActivePanel->getFilter().getSearchVisibilityTypes() & LLInventoryFilter::VISIBILITY_TRASH) != 0; + } + + if (command_name == "toggle_search_library") + { + return (mActivePanel->getFilter().getSearchVisibilityTypes() & LLInventoryFilter::VISIBILITY_LIBRARY) != 0; + } + + if (command_name == "include_links") + { + return (mActivePanel->getFilter().getSearchVisibilityTypes() & LLInventoryFilter::VISIBILITY_LINKS) != 0; + } + return FALSE; } diff --git a/indra/newview/llpanelmaininventory.h b/indra/newview/llpanelmaininventory.h index c0b4a7b6fc..903b33bdbf 100644 --- a/indra/newview/llpanelmaininventory.h +++ b/indra/newview/llpanelmaininventory.h @@ -171,7 +171,9 @@ protected: private: LLDragAndDropButton* mTrashButton; LLToggleableMenu* mMenuGearDefault; + LLToggleableMenu* mMenuVisibility; LLMenuButton* mGearMenuButton; + LLMenuButton* mVisibilityMenuButton; LLHandle mMenuAddHandle; bool mNeedUploadCost; diff --git a/indra/newview/skins/default/textures/icons/Inv_Toolbar_SearchVisibility.png b/indra/newview/skins/default/textures/icons/Inv_Toolbar_SearchVisibility.png new file mode 100644 index 0000000000..048da25c92 Binary files /dev/null and b/indra/newview/skins/default/textures/icons/Inv_Toolbar_SearchVisibility.png differ diff --git a/indra/newview/skins/default/textures/textures.xml b/indra/newview/skins/default/textures/textures.xml index 7325d836d2..1302edda7a 100644 --- a/indra/newview/skins/default/textures/textures.xml +++ b/indra/newview/skins/default/textures/textures.xml @@ -333,6 +333,8 @@ with the same filename but different name + + @@ -648,6 +650,7 @@ with the same filename but different name + diff --git a/indra/newview/skins/default/textures/widgets/TextField_Search_Highlight.png b/indra/newview/skins/default/textures/widgets/TextField_Search_Highlight.png new file mode 100644 index 0000000000..e3944289c6 Binary files /dev/null and b/indra/newview/skins/default/textures/widgets/TextField_Search_Highlight.png differ diff --git a/indra/newview/skins/default/xui/en/menu_inventory_search_visibility.xml b/indra/newview/skins/default/xui/en/menu_inventory_search_visibility.xml new file mode 100644 index 0000000000..46193f4a7a --- /dev/null +++ b/indra/newview/skins/default/xui/en/menu_inventory_search_visibility.xml @@ -0,0 +1,44 @@ + + + + + + + + + + + + + + + + diff --git a/indra/newview/skins/default/xui/en/panel_main_inventory.xml b/indra/newview/skins/default/xui/en/panel_main_inventory.xml index 2745b9d302..7bd5c9b548 100644 --- a/indra/newview/skins/default/xui/en/panel_main_inventory.xml +++ b/indra/newview/skins/default/xui/en/panel_main_inventory.xml @@ -32,30 +32,20 @@ left="12" name="ItemcountText" font="SansSerifMedium" - text_color="EmphasisColor" + text_color="InventoryItemLinkColor" use_ellipses="true" top_pad="0" width="300"> Items: - - + follows="top|left" + width="88"> - + + + + background_image_focused="TextField_Search_Active" + background_image_highlight="TextField_Search_Highlight"> + background_image_focused="TextField_Search_Active" + background_image_highlight="TextField_Search_Highlight"> Date: Tue, 1 Sep 2020 20:03:03 +0300 Subject: SL-13852 Show menu below the button --- indra/newview/llpanelmaininventory.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/indra/newview/llpanelmaininventory.cpp b/indra/newview/llpanelmaininventory.cpp index f845e9b056..7d04c1dc67 100644 --- a/indra/newview/llpanelmaininventory.cpp +++ b/indra/newview/llpanelmaininventory.cpp @@ -1178,6 +1178,7 @@ void LLPanelMainInventory::initListCommandsHandlers() mMenuVisibility = LLUICtrlFactory::getInstance()->createFromFile("menu_inventory_search_visibility.xml", gMenuHolder, LLViewerMenuHolderGL::child_registry_t::instance()); mVisibilityMenuButton->setMenu(mMenuVisibility); + mVisibilityMenuButton->setMenuPosition(LLMenuButton::MP_BOTTOM_LEFT); // Update the trash button when selected item(s) get worn or taken off. LLOutfitObserver::instance().addCOFChangedCallback(boost::bind(&LLPanelMainInventory::updateListCommands, this)); -- cgit v1.2.3 From 73ece917247d550140c0ae193746ebf66cca1081 Mon Sep 17 00:00:00 2001 From: maxim_productengine Date: Mon, 17 Feb 2020 17:43:00 +0200 Subject: =?UTF-8?q?SL-11867=20Show=20=E2=80=9CUnable=20to=20buy=E2=80=9D?= =?UTF-8?q?=20message=20via=20notification?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- indra/newview/llfloaterbuycurrency.cpp | 37 +++---------------- .../skins/default/xui/da/floater_buy_currency.xml | 5 ++- .../skins/default/xui/de/floater_buy_currency.xml | 5 ++- .../skins/default/xui/en/floater_buy_currency.xml | 42 +++------------------- .../newview/skins/default/xui/en/notifications.xml | 12 +++++++ .../skins/default/xui/es/floater_buy_currency.xml | 5 ++- .../skins/default/xui/fr/floater_buy_currency.xml | 5 ++- .../skins/default/xui/it/floater_buy_currency.xml | 5 ++- .../skins/default/xui/ja/floater_buy_currency.xml | 5 ++- .../skins/default/xui/pl/floater_buy_currency.xml | 5 ++- .../skins/default/xui/pt/floater_buy_currency.xml | 5 ++- .../skins/default/xui/ru/floater_buy_currency.xml | 5 ++- .../skins/default/xui/tr/floater_buy_currency.xml | 5 ++- .../skins/default/xui/zh/floater_buy_currency.xml | 5 ++- 14 files changed, 43 insertions(+), 103 deletions(-) diff --git a/indra/newview/llfloaterbuycurrency.cpp b/indra/newview/llfloaterbuycurrency.cpp index 91436e52fe..25348474a1 100644 --- a/indra/newview/llfloaterbuycurrency.cpp +++ b/indra/newview/llfloaterbuycurrency.cpp @@ -74,7 +74,6 @@ public: void onClickBuy(); void onClickCancel(); - void onClickErrorWeb(); }; LLFloater* LLFloaterBuyCurrency::buildFloater(const LLSD& key) @@ -132,7 +131,6 @@ BOOL LLFloaterBuyCurrencyUI::postBuild() getChild("buy_btn")->setCommitCallback( boost::bind(&LLFloaterBuyCurrencyUI::onClickBuy, this)); getChild("cancel_btn")->setCommitCallback( boost::bind(&LLFloaterBuyCurrencyUI::onClickCancel, this)); - getChild("error_web")->setCommitCallback( boost::bind(&LLFloaterBuyCurrencyUI::onClickErrorWeb, this)); center(); @@ -173,7 +171,6 @@ void LLFloaterBuyCurrencyUI::updateUI() // hide most widgets - we'll turn them on as needed next getChildView("info_buying")->setVisible(FALSE); - getChildView("info_cannot_buy")->setVisible(FALSE); getChildView("info_need_more")->setVisible(FALSE); getChildView("purchase_warning_repurchase")->setVisible(FALSE); getChildView("purchase_warning_notenough")->setVisible(FALSE); @@ -183,32 +180,16 @@ void LLFloaterBuyCurrencyUI::updateUI() if (hasError) { // display an error from the server - getChildView("normal_background")->setVisible(FALSE); - getChildView("error_background")->setVisible(TRUE); - getChildView("info_cannot_buy")->setVisible(TRUE); - getChildView("cannot_buy_message")->setVisible(TRUE); - getChildView("balance_label")->setVisible(FALSE); - getChildView("balance_amount")->setVisible(FALSE); - getChildView("buying_label")->setVisible(FALSE); - getChildView("buying_amount")->setVisible(FALSE); - getChildView("total_label")->setVisible(FALSE); - getChildView("total_amount")->setVisible(FALSE); - - LLTextBox* message = getChild("cannot_buy_message"); - if (message) - { - message->setText(mManager.errorMessage()); - } - - getChildView("error_web")->setVisible( !mManager.errorURI().empty()); + LLSD args; + args["TITLE"] = getString("info_cannot_buy"); + args["MESSAGE"] = mManager.errorMessage(); + LLNotificationsUtil::add("CouldNotBuyCurrency", args); + closeFloater(); } else { // display the main Buy L$ interface getChildView("normal_background")->setVisible(TRUE); - getChildView("error_background")->setVisible(FALSE); - getChildView("cannot_buy_message")->setVisible(FALSE); - getChildView("error_web")->setVisible(FALSE); if (mHasTarget) { @@ -278,14 +259,6 @@ void LLFloaterBuyCurrencyUI::onClickCancel() LLStatusBar::sendMoneyBalanceRequest(); } -void LLFloaterBuyCurrencyUI::onClickErrorWeb() -{ - LLWeb::loadURL(mManager.errorURI()); - closeFloater(); - // Update L$ balance - LLStatusBar::sendMoneyBalanceRequest(); -} - // static void LLFloaterBuyCurrency::buyCurrency() { diff --git a/indra/newview/skins/default/xui/da/floater_buy_currency.xml b/indra/newview/skins/default/xui/da/floater_buy_currency.xml index 3c0428b2b0..b7ac181dd4 100644 --- a/indra/newview/skins/default/xui/da/floater_buy_currency.xml +++ b/indra/newview/skins/default/xui/da/floater_buy_currency.xml @@ -60,8 +60,7 @@ objektet. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - Editing Shape + Shape diff --git a/indra/newview/skins/default/xui/en/panel_outfit_edit.xml b/indra/newview/skins/default/xui/en/panel_outfit_edit.xml index afce9f6eb5..adbeb09935 100644 --- a/indra/newview/skins/default/xui/en/panel_outfit_edit.xml +++ b/indra/newview/skins/default/xui/en/panel_outfit_edit.xml @@ -81,7 +81,7 @@ name="title" text_color="LtGray" top="0" - value="Edit Outfit" + value="Current Outfit" use_ellipses="true" width="275" /> -- cgit v1.2.3 From 94cd34cc1762fbcc88930f095fb89b9ae4292928 Mon Sep 17 00:00:00 2001 From: Mnikolenko Productengine Date: Wed, 8 Jul 2020 20:29:44 +0300 Subject: SL-13479 Avatar menu tweaks --- indra/llui/llmenugl.cpp | 4 +- indra/newview/llviewermenu.cpp | 10 + indra/newview/llviewermenu.h | 4 + indra/newview/llvoavatarself.cpp | 8 +- .../skins/default/xui/en/menu_attachment_self.xml | 210 +++++++++++++++++++-- .../skins/default/xui/en/menu_avatar_self.xml | 2 +- indra/newview/skins/default/xui/en/menu_viewer.xml | 186 +++++++++++++++++- 7 files changed, 404 insertions(+), 20 deletions(-) diff --git a/indra/llui/llmenugl.cpp b/indra/llui/llmenugl.cpp index 5568a84494..c2698fa648 100644 --- a/indra/llui/llmenugl.cpp +++ b/indra/llui/llmenugl.cpp @@ -79,7 +79,7 @@ const U32 LEFT_PAD_PIXELS = 3; const U32 LEFT_WIDTH_PIXELS = 15; const U32 LEFT_PLAIN_PIXELS = LEFT_PAD_PIXELS + LEFT_WIDTH_PIXELS; -const U32 RIGHT_PAD_PIXELS = 2; +const U32 RIGHT_PAD_PIXELS = 7; const U32 RIGHT_WIDTH_PIXELS = 15; const U32 RIGHT_PLAIN_PIXELS = RIGHT_PAD_PIXELS + RIGHT_WIDTH_PIXELS; @@ -95,7 +95,7 @@ const std::string SEPARATOR_NAME("separator"); const std::string VERTICAL_SEPARATOR_LABEL( "|" ); const std::string LLMenuGL::BOOLEAN_TRUE_PREFIX( "\xE2\x9C\x94" ); // U+2714 HEAVY CHECK MARK -const std::string LLMenuGL::BRANCH_SUFFIX( "\xE2\x96\xB6" ); // U+25B6 BLACK RIGHT-POINTING TRIANGLE +const std::string LLMenuGL::BRANCH_SUFFIX( "\xe2\x96\xb8" ); // U+25B6 BLACK RIGHT-POINTING TRIANGLE const std::string LLMenuGL::ARROW_UP ("^^^^^^^"); const std::string LLMenuGL::ARROW_DOWN("vvvvvvv"); diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index 34b4d7f3b3..12d13a78a2 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -186,11 +186,15 @@ const std::string SAVE_INTO_TASK_INVENTORY("Save Object Back to Object Contents" LLMenuGL* gAttachSubMenu = NULL; LLMenuGL* gDetachSubMenu = NULL; LLMenuGL* gTakeOffClothes = NULL; +LLMenuGL* gDetachAvatarMenu = NULL; +LLMenuGL* gDetachHUDAvatarMenu = NULL; LLContextMenu* gAttachScreenPieMenu = NULL; LLContextMenu* gAttachPieMenu = NULL; LLContextMenu* gAttachBodyPartPieMenus[9]; LLContextMenu* gDetachPieMenu = NULL; LLContextMenu* gDetachScreenPieMenu = NULL; +LLContextMenu* gDetachAttSelfMenu = NULL; +LLContextMenu* gDetachHUDAttSelfMenu = NULL; LLContextMenu* gDetachBodyPartPieMenus[9]; // @@ -445,6 +449,9 @@ void init_menus() gMenuAttachmentOther = LLUICtrlFactory::createFromFile( "menu_attachment_other.xml", gMenuHolder, registry); + gDetachHUDAttSelfMenu = gMenuHolder->getChild("Detach Self HUD", true); + gDetachAttSelfMenu = gMenuHolder->getChild("Detach Self", true); + gMenuLand = LLUICtrlFactory::createFromFile( "menu_land.xml", gMenuHolder, registry); @@ -501,6 +508,9 @@ void init_menus() gAttachSubMenu = gMenuBarView->findChildMenuByName("Attach Object", TRUE); gDetachSubMenu = gMenuBarView->findChildMenuByName("Detach Object", TRUE); + gDetachAvatarMenu = gMenuHolder->getChild("Avatar Detach", true); + gDetachHUDAvatarMenu = gMenuHolder->getChild("Avatar Detach HUD", true); + // Don't display the Memory console menu if the feature is turned off LLMenuItemCheckGL *memoryMenu = gMenuBarView->getChild("Memory", TRUE); if (memoryMenu) diff --git a/indra/newview/llviewermenu.h b/indra/newview/llviewermenu.h index 0f63c8cf58..36b6971c81 100644 --- a/indra/newview/llviewermenu.h +++ b/indra/newview/llviewermenu.h @@ -188,10 +188,14 @@ extern LLContextMenu *gMenuMuteParticle; extern LLMenuGL* gAttachSubMenu; extern LLMenuGL* gDetachSubMenu; extern LLMenuGL* gTakeOffClothes; +extern LLMenuGL* gDetachAvatarMenu; +extern LLMenuGL* gDetachHUDAvatarMenu; extern LLContextMenu* gAttachScreenPieMenu; extern LLContextMenu* gDetachScreenPieMenu; +extern LLContextMenu* gDetachHUDAttSelfMenu; extern LLContextMenu* gAttachPieMenu; extern LLContextMenu* gDetachPieMenu; +extern LLContextMenu* gDetachAttSelfMenu; extern LLContextMenu* gAttachBodyPartPieMenus[9]; extern LLContextMenu* gDetachBodyPartPieMenus[9]; diff --git a/indra/newview/llvoavatarself.cpp b/indra/newview/llvoavatarself.cpp index aea12380e8..d2dc139d4b 100644 --- a/indra/newview/llvoavatarself.cpp +++ b/indra/newview/llvoavatarself.cpp @@ -465,6 +465,8 @@ BOOL LLVOAvatarSelf::buildMenus() if (gDetachBodyPartPieMenus[i]) { gDetachPieMenu->appendContextSubMenu( gDetachBodyPartPieMenus[i] ); + gDetachAttSelfMenu->appendContextSubMenu(gDetachBodyPartPieMenus[i]); + gDetachAvatarMenu->appendContextSubMenu(gDetachBodyPartPieMenus[i]); } else { @@ -493,12 +495,14 @@ BOOL LLVOAvatarSelf::buildMenus() LLMenuItemCallGL* item = LLUICtrlFactory::create(item_params); gDetachPieMenu->addChild(item); - + gDetachAttSelfMenu->addChild(LLUICtrlFactory::create(item_params)); + gDetachAvatarMenu->addChild(LLUICtrlFactory::create(item_params)); break; } } } } + // add screen attachments for (attachment_map_t::iterator iter = mAttachmentPoints.begin(); @@ -532,6 +536,8 @@ BOOL LLVOAvatarSelf::buildMenus() item_params.on_enable.parameter = iter->first; item = LLUICtrlFactory::create(item_params); gDetachScreenPieMenu->addChild(item); + gDetachHUDAttSelfMenu->addChild(LLUICtrlFactory::create(item_params)); + gDetachHUDAvatarMenu->addChild(LLUICtrlFactory::create(item_params)); } } diff --git a/indra/newview/skins/default/xui/en/menu_attachment_self.xml b/indra/newview/skins/default/xui/en/menu_attachment_self.xml index 03c05e6591..856bf4ce73 100644 --- a/indra/newview/skins/default/xui/en/menu_attachment_self.xml +++ b/indra/newview/skins/default/xui/en/menu_attachment_self.xml @@ -2,17 +2,6 @@ - - - - - + + + + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -293,7 +475,7 @@ name="Help with avatars"> + parameter="https://community.secondlife.com/search/?type=cms_records3&tags=avatar&nodes=30&search_and_or=or"/> Date: Wed, 15 Jul 2020 18:35:59 +0300 Subject: SL-13612 Dedicated Avatar menu -- Revise toolbar button labels --- indra/newview/skins/default/xui/en/strings.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/indra/newview/skins/default/xui/en/strings.xml b/indra/newview/skins/default/xui/en/strings.xml index 0b95b43f39..db9d3bfa83 100644 --- a/indra/newview/skins/default/xui/en/strings.xml +++ b/indra/newview/skins/default/xui/en/strings.xml @@ -4113,8 +4113,8 @@ Try enclosing path to the editor with double quotes. About land - Appearance - Avatar + Outfits + Complete avatars Build Chat Conversations -- cgit v1.2.3 From 6ec194154be3d40f897d728925d1a565c6f8be78 Mon Sep 17 00:00:00 2001 From: Mnikolenko Productengine Date: Thu, 10 Dec 2020 17:43:21 +0200 Subject: SL-13826 Show result of "Find original" and "Show original" in Main Inventory floater and reset the filters to guarantee success --- indra/newview/llinventorybridge.cpp | 41 +++++++------------ indra/newview/llinventoryfunctions.cpp | 73 +++++++++++++++++----------------- indra/newview/llinventorypanel.cpp | 36 ++++------------- indra/newview/llinventorypanel.h | 6 +-- indra/newview/llpanelmaininventory.cpp | 15 ++----- indra/newview/llpanelmaininventory.h | 6 +-- 6 files changed, 67 insertions(+), 110 deletions(-) diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index ae96963b2a..27e222237e 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -1863,29 +1863,11 @@ void LLItemBridge::restoreToWorld() void LLItemBridge::gotoItem() { - LLInventoryObject *obj = getInventoryObject(); - if (obj && obj->getIsLinkType()) - { - const LLUUID inbox_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_INBOX); - if (gInventory.isObjectDescendentOf(obj->getLinkedUUID(), inbox_id)) - { - LLSidepanelInventory *sidepanel_inventory = LLFloaterSidePanelContainer::getPanel("inventory"); - if (sidepanel_inventory && sidepanel_inventory->getInboxPanel()) - { - sidepanel_inventory->getInboxPanel()->setSelection(obj->getLinkedUUID(), TAKE_FOCUS_NO); - } - } - else - { - LLInventoryPanel *active_panel = LLInventoryPanel::getActiveInventoryPanel(); - if (active_panel) - { - active_panel->setSelection(obj->getLinkedUUID(), TAKE_FOCUS_NO); - active_panel->setFocus(TRUE); - } - } - - } + LLInventoryObject *obj = getInventoryObject(); + if (obj && obj->getIsLinkType()) + { + show_item_original(obj->getUUID()); + } } LLUIImagePtr LLItemBridge::getIcon() const @@ -7251,13 +7233,20 @@ void LLLinkFolderBridge::performAction(LLInventoryModel* model, std::string acti } LLItemBridge::performAction(model,action); } - void LLLinkFolderBridge::gotoItem() { LLItemBridge::gotoItem(); - LLInventoryPanel::getActiveInventoryPanel()->openFolderByID(getFolderID()); -} + const LLUUID &cat_uuid = getFolderID(); + if (!cat_uuid.isNull()) + { + LLFolderViewItem *base_folder = LLInventoryPanel::getActiveInventoryPanel()->getItemByID(cat_uuid); + if (base_folder) + { + base_folder->setOpen(TRUE); + } + } +} const LLUUID &LLLinkFolderBridge::getFolderID() const { if (LLViewerInventoryItem *link_item = getItem()) diff --git a/indra/newview/llinventoryfunctions.cpp b/indra/newview/llinventoryfunctions.cpp index 628363a47e..181bc48571 100644 --- a/indra/newview/llinventoryfunctions.cpp +++ b/indra/newview/llinventoryfunctions.cpp @@ -774,35 +774,45 @@ void show_item_profile(const LLUUID& item_uuid) void show_item_original(const LLUUID& item_uuid) { - LLFloater* floater_inventory = LLFloaterReg::getInstance("inventory"); - if (!floater_inventory) - { - LL_WARNS() << "Could not find My Inventory floater" << LL_ENDL; - return; - } - - //sidetray inventory panel - LLSidepanelInventory *sidepanel_inventory = LLPanelMainInventory::newWindow()->LLFloaterSidePanelContainer::getPanel("inventory"); - + LLFloater* floater_inventory = LLFloaterReg::getInstance("inventory"); + if (!floater_inventory) + { + LL_WARNS() << "Could not find My Inventory floater" << LL_ENDL; + return; + } + LLSidepanelInventory *sidepanel_inventory = LLFloaterSidePanelContainer::getPanel("inventory"); + if (sidepanel_inventory) + { + LLPanelMainInventory* main_inventory = sidepanel_inventory->getMainInventoryPanel(); + if (main_inventory) + { + main_inventory->resetFilters(); + } + reset_inventory_filter(); - LLInventoryPanel* active_panel = LLInventoryPanel::getActiveInventoryPanel(); - if (!active_panel) - { - //this may happen when there is no floatera and other panel is active in inventory tab + if (!LLFloaterReg::getTypedInstance("inventory")->isInVisibleChain()) + { + LLFloaterReg::toggleInstanceOrBringToFront("inventory"); + } - if (sidepanel_inventory) - { - sidepanel_inventory->showInventoryPanel(); - } - } - - active_panel = LLInventoryPanel::getActiveInventoryPanel(); - if (!active_panel) - { - return; - } - active_panel->setSelection(gInventory.getLinkedItemID(item_uuid), TAKE_FOCUS_YES); - active_panel->setFocus(TRUE); + const LLUUID inbox_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_INBOX); + if (gInventory.isObjectDescendentOf(gInventory.getLinkedItemID(item_uuid), inbox_id)) + { + if (sidepanel_inventory->getInboxPanel()) + { + sidepanel_inventory->openInbox(); + sidepanel_inventory->getInboxPanel()->setSelection(gInventory.getLinkedItemID(item_uuid), TAKE_FOCUS_YES); + } + } + else + { + sidepanel_inventory->selectAllItemsPanel(); + if (sidepanel_inventory->getActivePanel()) + { + sidepanel_inventory->getActivePanel()->setSelection(gInventory.getLinkedItemID(item_uuid), TAKE_FOCUS_YES); + } + } + } } @@ -2486,15 +2496,6 @@ void LLInventoryAction::doToSelected(LLInventoryModel* model, LLFolderView* root } else { - if (action == "goto") - { - LLSidepanelInventory *sidepanel_inventory = LLPanelMainInventory::newWindow()->LLFloaterSidePanelContainer::getPanel("inventory"); - if (sidepanel_inventory && sidepanel_inventory->getMainInventoryPanel()) - { - model = sidepanel_inventory->getMainInventoryPanel()->getActivePanel()->getModel(); - } - } - std::set::iterator set_iter; for (set_iter = selected_items.begin(); set_iter != selected_items.end(); ++set_iter) { diff --git a/indra/newview/llinventorypanel.cpp b/indra/newview/llinventorypanel.cpp index 0246878ab6..1f5dfa6d5c 100644 --- a/indra/newview/llinventorypanel.cpp +++ b/indra/newview/llinventorypanel.cpp @@ -157,7 +157,8 @@ LLInventoryPanel::LLInventoryPanel(const LLInventoryPanel::Params& p) : mViewsInitialized(false), mInvFVBridgeBuilder(NULL), mInventoryViewModel(p.name), - mGroupedItemBridge(new LLFolderViewGroupedItemBridge) + mGroupedItemBridge(new LLFolderViewGroupedItemBridge), + mFocusSelection(false) { mInvFVBridgeBuilder = &INVENTORY_BRIDGE_BUILDER; @@ -339,7 +340,6 @@ void LLInventoryPanel::draw() { // Select the desired item (in case it wasn't loaded when the selection was requested) updateSelection(); - updateFolderState(); LLPanel::draw(); } @@ -1222,7 +1222,7 @@ void LLInventoryPanel::setSelectCallback(const boost::functiongetViewModelItem()) + if(itemp && itemp->getViewModelItem() && itemp->passedFilter()) { itemp->arrangeAndSet(TRUE, take_keyboard_focus); mSelectThisID.setNull(); + mFocusSelection = false; return; } else { // save the desired item to be selected later (if/when ready) + mFocusSelection = take_keyboard_focus; mSelectThisID = obj_id; } } @@ -1719,34 +1721,10 @@ void LLInventoryPanel::updateSelection() { if (mSelectThisID.notNull()) { - setSelectionByID(mSelectThisID, false); + setSelectionByID(mSelectThisID, mFocusSelection); } } -void LLInventoryPanel::openFolderByID( const LLUUID& folder_id) -{ - LLFolderViewItem* itemp = getItemByID(folder_id); - if(itemp && itemp->getViewModelItem()) - { - itemp->setOpen(TRUE); - mOpenFolderID.setNull(); - return; - } - else - { - // save the desired folder to be open later (if/when ready) - mOpenFolderID = folder_id; - } -} - -void LLInventoryPanel::updateFolderState() -{ - if (mOpenFolderID.notNull()) - { - openFolderByID(mOpenFolderID); - } -} - void LLInventoryPanel::doToSelected(const LLSD& userdata) { if (("purge" == userdata.asString())) diff --git a/indra/newview/llinventorypanel.h b/indra/newview/llinventorypanel.h index 2bcc3f3c0b..447d24b959 100644 --- a/indra/newview/llinventorypanel.h +++ b/indra/newview/llinventorypanel.h @@ -244,9 +244,7 @@ public: LLFolderViewItem* getItemByID(const LLUUID& id); LLFolderViewFolder* getFolderByID(const LLUUID& id); void setSelectionByID(const LLUUID& obj_id, BOOL take_keyboard_focus); - void openFolderByID(const LLUUID& folder_id); void updateSelection(); - void updateFolderState(); void setSuppressOpenItemAction(bool supress_open_item) { mSuppressOpenItemAction = supress_open_item; } @@ -262,11 +260,11 @@ protected: void openStartFolderOrMyInventory(); // open the first level of inventory void onItemsCompletion(); // called when selected items are complete - LLUUID mSelectThisID; - LLUUID mOpenFolderID; + LLUUID mSelectThisID; LLInventoryModel* mInventory; LLInventoryObserver* mInventoryObserver; LLInvPanelComplObserver* mCompletionObserver; + bool mFocusSelection; bool mAcceptsDragAndDrop; bool mAllowMultiSelect; bool mAllowDrag; diff --git a/indra/newview/llpanelmaininventory.cpp b/indra/newview/llpanelmaininventory.cpp index 813a5b3c20..4691ee3849 100644 --- a/indra/newview/llpanelmaininventory.cpp +++ b/indra/newview/llpanelmaininventory.cpp @@ -383,16 +383,15 @@ void LLPanelMainInventory::closeAllFolders() getPanel()->getRootFolder()->closeAllFolders(); } -LLFloaterSidePanelContainer* LLPanelMainInventory::newWindow() +void LLPanelMainInventory::newWindow() { static S32 instance_num = 0; instance_num = (instance_num + 1) % S32_MAX; if (!gAgentCamera.cameraMouselook()) { - return LLFloaterReg::showTypedInstance("inventory", LLSD(instance_num)); + LLFloaterReg::showTypedInstance("inventory", LLSD(instance_num)); } - return NULL; } void LLPanelMainInventory::doCreate(const LLSD& userdata) @@ -1344,15 +1343,7 @@ void LLPanelMainInventory::onCustomAction(const LLSD& userdata) { return; } - LLSidepanelInventory *sidepanel_inventory = newWindow()->LLFloaterSidePanelContainer::getPanel("inventory"); - if (sidepanel_inventory) - { - LLPanelMainInventory* new_inventory = sidepanel_inventory->getMainInventoryPanel(); - if (new_inventory) - { - static_cast(current_item->getViewModelItem())->performAction(new_inventory->getActivePanel()->getModel(), "goto"); - } - } + static_cast(current_item->getViewModelItem())->performAction(getActivePanel()->getModel(), "goto"); } if (command_name == "find_links") diff --git a/indra/newview/llpanelmaininventory.h b/indra/newview/llpanelmaininventory.h index 40f04da6e9..313e478bfe 100644 --- a/indra/newview/llpanelmaininventory.h +++ b/indra/newview/llpanelmaininventory.h @@ -46,7 +46,6 @@ class LLMenuButton; class LLMenuGL; class LLToggleableMenu; class LLFloater; -class LLFloaterSidePanelContainer; //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // Class LLPanelMainInventory @@ -91,10 +90,12 @@ public: void setFocusFilterEditor(); - static LLFloaterSidePanelContainer* newWindow(); + static void newWindow(); void toggleFindOptions(); + void resetFilters(); + protected: // // Misc functions @@ -119,7 +120,6 @@ protected: void doToSelected(const LLSD& userdata); void closeAllFolders(); void doCreate(const LLSD& userdata); - void resetFilters(); void setSortBy(const LLSD& userdata); void saveTexture(const LLSD& userdata); bool isSaveTextureEnabled(const LLSD& userdata); -- cgit v1.2.3 From ba47d9315470049bc19a7c07b6a333f56b490bad Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Mon, 4 Jan 2021 20:26:23 +0200 Subject: SL-14491 llDialog spacing inconsistent between string and buttons --- doc/contributions.txt | 2 ++ indra/newview/lltoastnotifypanel.cpp | 6 +++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/doc/contributions.txt b/doc/contributions.txt index bbdfaf655d..c33bc2607f 100755 --- a/doc/contributions.txt +++ b/doc/contributions.txt @@ -358,6 +358,8 @@ Chaser Zaks BUG-227485 Cherry Cheevers ChickyBabes Zuzu +Chorazin Allen + BUG-229753 Christopher Organiser Ciaran Laval Cinder Roxley diff --git a/indra/newview/lltoastnotifypanel.cpp b/indra/newview/lltoastnotifypanel.cpp index bccf88128d..024f25bc98 100644 --- a/indra/newview/lltoastnotifypanel.cpp +++ b/indra/newview/lltoastnotifypanel.cpp @@ -387,9 +387,9 @@ void LLToastNotifyPanel::init( LLRect rect, bool show_images ) if (mIsScriptDialog) { // we are using default width for script buttons so we can determinate button_rows - //to get a number of rows we divide the required width of the buttons to button_panel_width - S32 button_rows = llceil(F32(buttons.size() - 1) * (BUTTON_WIDTH + h_pad) / button_panel_width); - //S32 button_rows = (buttons.size() - 1) * (BUTTON_WIDTH + h_pad) / button_panel_width; + // to get a number of rows we divide the required width of the buttons to button_panel_width + // buttons.size() is reduced by -2 due to presence of ignore button which is calculated independently a bit lower + S32 button_rows = llceil(F32(buttons.size() - 2) * (BUTTON_WIDTH + h_pad) / (button_panel_width + h_pad)); //reserve one row for the ignore_btn button_rows++; //calculate required panel height for scripdialog notification. -- cgit v1.2.3 From 8c41c00888bbfe7b1c6501e995554a39a8bf944b Mon Sep 17 00:00:00 2001 From: Mnikolenko Productengine Date: Tue, 5 Jan 2021 17:43:14 +0200 Subject: SL-14632 FIXED The viewer is crashed after deleting the new favorite folder --- indra/newview/llviewerinventory.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/indra/newview/llviewerinventory.cpp b/indra/newview/llviewerinventory.cpp index bbed741a33..ed1d726528 100644 --- a/indra/newview/llviewerinventory.cpp +++ b/indra/newview/llviewerinventory.cpp @@ -1422,6 +1422,11 @@ void remove_inventory_category( LLNotificationsUtil::add("CannotRemoveProtectedCategories"); return; } + const LLUUID fav_id = gInventory.findUserDefinedCategoryUUIDForType(LLFolderType::FT_FAVORITE); + if ((cat_id == fav_id) || gInventory.isObjectDescendentOf(fav_id, cat_id)) + { + gSavedPerAccountSettings.setString("FavoritesFolder", ""); + } AISAPI::completion_t cr = boost::bind(&doInventoryCb, cb, _1); AISAPI::RemoveCategory(cat_id, cr); } -- cgit v1.2.3 From 1087c26de7ba89465618518ba93dc7161f075f47 Mon Sep 17 00:00:00 2001 From: Mnikolenko Productengine Date: Wed, 6 Jan 2021 12:08:21 +0200 Subject: SL-14633 FIXED The item from the favorite tab in the inventory floater can be purged --- indra/newview/llinventorybridge.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 27e222237e..34e2dc7904 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -987,7 +987,7 @@ void LLInvFVBridge::addTrashContextMenuOptions(menuentry_vec_t &items, } } items.push_back(std::string("Purge Item")); - if (!isItemRemovable()) + if (!isItemRemovable() || isPanelActive("Favorite Items")) { disabled_items.push_back(std::string("Purge Item")); } -- cgit v1.2.3 From 1dd32bb772bb2f0d6d4f3180965a8bdcf9c1000d Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Tue, 2 Feb 2021 23:47:48 +0200 Subject: SL-14796 After teleporting, add notation into Nearby Chat --- indra/llui/llchat.h | 6 ++- indra/newview/llagent.cpp | 60 +++++++++++++++++++++++++ indra/newview/llagent.h | 3 ++ indra/newview/llchathistory.cpp | 62 +++++++++++++++++++------- indra/newview/llviewerdisplay.cpp | 1 + indra/newview/skins/default/colors.xml | 3 ++ indra/newview/skins/default/xui/en/strings.xml | 3 ++ 7 files changed, 120 insertions(+), 18 deletions(-) diff --git a/indra/llui/llchat.h b/indra/llui/llchat.h index f5b242fdfc..c39e44200c 100644 --- a/indra/llui/llchat.h +++ b/indra/llui/llchat.h @@ -37,7 +37,8 @@ typedef enum e_chat_source_type CHAT_SOURCE_SYSTEM = 0, CHAT_SOURCE_AGENT = 1, CHAT_SOURCE_OBJECT = 2, - CHAT_SOURCE_UNKNOWN = 3 + CHAT_SOURCE_TELEPORT = 3, + CHAT_SOURCE_UNKNOWN = 4 } EChatSourceType; typedef enum e_chat_type @@ -64,7 +65,8 @@ typedef enum e_chat_style { CHAT_STYLE_NORMAL, CHAT_STYLE_IRC, - CHAT_STYLE_HISTORY + CHAT_STYLE_HISTORY, + CHAT_STYLE_TELEPORT_SEP }EChatStyle; // A piece of chat diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp index c65bc0fa50..f31135ad4c 100644 --- a/indra/newview/llagent.cpp +++ b/indra/newview/llagent.cpp @@ -519,6 +519,10 @@ void LLAgent::cleanup() { mTeleportFailedSlot.disconnect(); } + if (mParcelMgrConnection.connected()) + { + mParcelMgrConnection.disconnect(); + } } //----------------------------------------------------------------------------- @@ -3934,6 +3938,10 @@ void LLAgent::clearTeleportRequest() LLVoiceClient::getInstance()->setHidden(FALSE); } mTeleportRequest.reset(); + if (mParcelMgrConnection.connected()) + { + mParcelMgrConnection.disconnect(); + } } void LLAgent::setMaturityRatingChangeDuringTeleport(U8 pMaturityRatingChange) @@ -3942,6 +3950,12 @@ void LLAgent::setMaturityRatingChangeDuringTeleport(U8 pMaturityRatingChange) mMaturityRatingChange = pMaturityRatingChange; } +void LLAgent::sheduleTeleportIM() +{ + // is supposed to be called during teleport so we are still waiting for parcel + mParcelMgrConnection = addParcelChangedCallback(onParcelReadyAfterTeleport); +} + bool LLAgent::hasPendingTeleportRequest() { return ((mTeleportRequest != NULL) && @@ -4051,6 +4065,52 @@ void LLAgent::handleTeleportFailed() LLNotificationsUtil::add("PreferredMaturityChanged", args); mIsMaturityRatingChangingDuringTeleport = false; } + + if (mParcelMgrConnection.connected()) + { + mParcelMgrConnection.disconnect(); + } +} + +/*static*/ +void LLAgent::onParcelReadyAfterTeleport() +{ + LLViewerRegion* agent_region = gAgent.getRegion(); + LLParcel* agent_parcel = LLViewerParcelMgr::getInstance()->getAgentParcel(); + if (!agent_region || !agent_parcel) + { + return; + } + + LLFloaterIMNearbyChat* nearby_chat = LLFloaterReg::getTypedInstance("nearby_chat"); + if (nearby_chat) + { + std::string location_name; + LLAgentUI::ELocationFormat format = LLAgentUI::LOCATION_FORMAT_NO_MATURITY; + + // Might be better to provide slurl to chat + if (!LLAgentUI::buildLocationString(location_name, format)) + { + location_name = "Teleport to new region"; // Shouldn't happen + } + + LLChat chat; + chat.mFromName = location_name; + chat.mMuted = FALSE; + chat.mFromID = LLUUID::null; + chat.mSourceType = CHAT_SOURCE_TELEPORT; + chat.mChatStyle = CHAT_STYLE_TELEPORT_SEP; + chat.mText = ""; + + LLSD args; + args["do_not_log"] = TRUE; + nearby_chat->addMessage(chat, true, args); + } + + if (gAgent.mParcelMgrConnection.connected()) + { + gAgent.mParcelMgrConnection.disconnect(); + } } /*static*/ diff --git a/indra/newview/llagent.h b/indra/newview/llagent.h index d46c99db8c..8f8c2f6007 100644 --- a/indra/newview/llagent.h +++ b/indra/newview/llagent.h @@ -653,6 +653,7 @@ public: void restartFailedTeleportRequest(); void clearTeleportRequest(); void setMaturityRatingChangeDuringTeleport(U8 pMaturityRatingChange); + void sheduleTeleportIM(); private: @@ -667,6 +668,7 @@ private: LLTeleportRequestPtr mTeleportCanceled; boost::signals2::connection mTeleportFinishedSlot; boost::signals2::connection mTeleportFailedSlot; + boost::signals2::connection mParcelMgrConnection; bool mIsMaturityRatingChangingDuringTeleport; U8 mMaturityRatingChange; @@ -685,6 +687,7 @@ private: void handleTeleportFinished(); void handleTeleportFailed(); + static void onParcelReadyAfterTeleport(); static void onCapabilitiesReceivedAfterTeleport(); //-------------------------------------------------------------------- diff --git a/indra/newview/llchathistory.cpp b/indra/newview/llchathistory.cpp index 2ba2c6d8b5..2bb68dbbbe 100644 --- a/indra/newview/llchathistory.cpp +++ b/indra/newview/llchathistory.cpp @@ -122,6 +122,7 @@ public: mUserNameFont(NULL), mUserNameTextBox(NULL), mTimeBoxTextBox(NULL), + mNeedsTimeBox(true), mAvatarNameCacheConnection() {} @@ -643,8 +644,19 @@ public: user_name->setReadOnlyColor(style_params.readonly_color()); user_name->setColor(style_params.color()); - if (chat.mFromName.empty() - || mSourceType == CHAT_SOURCE_SYSTEM) + if (mSourceType == CHAT_SOURCE_TELEPORT + && chat.mChatStyle == CHAT_STYLE_TELEPORT_SEP) + { + mFrom = chat.mFromName; + mNeedsTimeBox = false; + user_name->setValue(mFrom); + updateMinUserNameWidth(); + LLColor4 sep_color = LLUIColorTable::instance().getColor("ChatTeleportSeparatorColor"); + setTransparentColor(sep_color); + mTimeBoxTextBox->setVisible(FALSE); + } + else if (chat.mFromName.empty() + || mSourceType == CHAT_SOURCE_SYSTEM) { mFrom = LLTrans::getString("SECOND_LIFE"); if(!chat.mFromName.empty() && (mFrom != chat.mFromName)) @@ -727,6 +739,8 @@ public: break; case CHAT_SOURCE_SYSTEM: icon->setValue(LLSD("SL_Logo")); + case CHAT_SOURCE_TELEPORT: + icon->setValue(LLSD("Command_Destinations_Icon")); break; case CHAT_SOURCE_UNKNOWN: icon->setValue(LLSD("Unknown_Icon")); @@ -766,7 +780,7 @@ public: S32 user_name_width = user_name_rect.getWidth(); S32 time_box_width = time_box->getRect().getWidth(); - if (!time_box->getVisible() && user_name_width > mMinUserNameWidth) + if (mNeedsTimeBox && !time_box->getVisible() && user_name_width > mMinUserNameWidth) { user_name_rect.mRight -= time_box_width; user_name->reshape(user_name_rect.getWidth(), user_name_rect.getHeight()); @@ -968,6 +982,8 @@ protected: LLTextBox* mUserNameTextBox; LLTextBox* mTimeBoxTextBox; + bool mNeedsTimeBox; + private: boost::signals2::connection mAvatarNameCacheConnection; }; @@ -1202,6 +1218,7 @@ void LLChatHistory::appendMessage(const LLChat& chat, const LLSD &args, const LL } bool message_from_log = chat.mChatStyle == CHAT_STYLE_HISTORY; + bool teleport_separator = chat.mSourceType == CHAT_SOURCE_TELEPORT; // We graying out chat history by graying out messages that contains full date in a time string if (message_from_log) { @@ -1222,14 +1239,14 @@ void LLChatHistory::appendMessage(const LLChat& chat, const LLSD &args, const LL LLStyle::Params timestamp_style(body_message_params); // out of the timestamp - if (args["show_time"].asBoolean()) + if (args["show_time"].asBoolean() && !teleport_separator) { - if (!message_from_log) - { - LLColor4 timestamp_color = LLUIColorTable::instance().getColor("ChatTimestampColor"); - timestamp_style.color(timestamp_color); - timestamp_style.readonly_color(timestamp_color); - } + if (!message_from_log) + { + LLColor4 timestamp_color = LLUIColorTable::instance().getColor("ChatTimestampColor"); + timestamp_style.color(timestamp_color); + timestamp_style.readonly_color(timestamp_color); + } mEditor->appendText("[" + chat.mTimeStr + "] ", prependNewLineState, timestamp_style); prependNewLineState = false; } @@ -1272,6 +1289,13 @@ void LLChatHistory::appendMessage(const LLChat& chat, const LLSD &args, const LL prependNewLineState, link_params); prependNewLineState = false; } + else if (teleport_separator) + { + std::string tp_text = LLTrans::getString("teleport_preamble_compact_chat"); + mEditor->appendText(tp_text + " " + chat.mFromName + "", + prependNewLineState, body_message_params); + prependNewLineState = false; + } else { mEditor->appendText("" + chat.mFromName + "" + delimiter, @@ -1290,8 +1314,8 @@ void LLChatHistory::appendMessage(const LLChat& chat, const LLSD &args, const LL p.right_pad = mRightWidgetPad; LLDate new_message_time = LLDate::now(); - - if (mLastFromName == chat.mFromName + if (!teleport_separator + && mLastFromName == chat.mFromName && mLastFromID == chat.mFromID && mLastMessageTime.notNull() && (new_message_time.secondsSinceEpoch() - mLastMessageTime.secondsSinceEpoch()) < 60.0 @@ -1314,7 +1338,14 @@ void LLChatHistory::appendMessage(const LLChat& chat, const LLSD &args, const LL p.top_pad = 0; else p.top_pad = mTopHeaderPad; - p.bottom_pad = mBottomHeaderPad; + if (teleport_separator) + { + p.bottom_pad = mBottomSeparatorPad; + } + else + { + p.bottom_pad = mBottomHeaderPad; + } if (!view) { LL_WARNS() << "Failed to create header from " << mMessageHeaderFilename << ": can't append to history" << LL_ENDL; @@ -1392,9 +1423,8 @@ void LLChatHistory::appendMessage(const LLChat& chat, const LLSD &args, const LL } } } - // usual messages showing - else + else if(!teleport_separator) { std::string message = irc_me ? chat.mText.substr(3) : chat.mText; @@ -1427,7 +1457,7 @@ void LLChatHistory::appendMessage(const LLChat& chat, const LLSD &args, const LL if (square_brackets) { message += "]"; - } + } mEditor->appendText(message, prependNewLineState, body_message_params); prependNewLineState = false; diff --git a/indra/newview/llviewerdisplay.cpp b/indra/newview/llviewerdisplay.cpp index d314b1477a..5679c3c325 100644 --- a/indra/newview/llviewerdisplay.cpp +++ b/indra/newview/llviewerdisplay.cpp @@ -474,6 +474,7 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot) gAgent.setTeleportState( LLAgent::TELEPORT_ARRIVING ); gAgent.setTeleportMessage( LLAgent::sTeleportProgressMessages["arriving"]); + gAgent.sheduleTeleportIM(); gTextureList.mForceResetTextureStats = TRUE; gAgentCamera.resetView(TRUE, TRUE); diff --git a/indra/newview/skins/default/colors.xml b/indra/newview/skins/default/colors.xml index 034576d30c..92398857ba 100644 --- a/indra/newview/skins/default/colors.xml +++ b/indra/newview/skins/default/colors.xml @@ -850,6 +850,9 @@ + diff --git a/indra/newview/skins/default/xui/en/strings.xml b/indra/newview/skins/default/xui/en/strings.xml index db9d3bfa83..c2b5286fc3 100644 --- a/indra/newview/skins/default/xui/en/strings.xml +++ b/indra/newview/skins/default/xui/en/strings.xml @@ -3758,6 +3758,9 @@ If you continue to receive this message, contact the [SUPPORT_SITE]. [SOURCES] have said something new + + + You are now at The session initialization is timed out -- cgit v1.2.3 From 2351809b5cb71d17461a6bec2041cbc1ad2efc91 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Thu, 4 Feb 2021 18:04:42 +0200 Subject: SL-14796 Resolved encountered merge issue --- indra/newview/llviewerparcelmgr.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/indra/newview/llviewerparcelmgr.cpp b/indra/newview/llviewerparcelmgr.cpp index d5365e4ee8..06172e366d 100644 --- a/indra/newview/llviewerparcelmgr.cpp +++ b/indra/newview/llviewerparcelmgr.cpp @@ -1715,9 +1715,6 @@ void LLViewerParcelMgr::processParcelProperties(LLMessageSystem *msg, void **use // Let interesting parties know about agent parcel change. LLViewerParcelMgr* instance = LLViewerParcelMgr::getInstance(); - // Notify anything that wants to know when the agent changes parcels - gAgent.changeParcels(); - if (instance->mTeleportInProgress) { instance->mTeleportInProgress = FALSE; @@ -1733,6 +1730,7 @@ void LLViewerParcelMgr::processParcelProperties(LLMessageSystem *msg, void **use } parcel->setParcelEnvironmentVersion(parcel_environment_version); LL_DEBUGS("ENVIRONMENT") << "Parcel environment version is " << parcel->getParcelEnvironmentVersion() << LL_ENDL; + // Notify anything that wants to know when the agent changes parcels gAgent.changeParcels(); instance->mTeleportInProgress = FALSE; -- cgit v1.2.3 From ca6121979c6716aaf986fc6d0d469383471469f4 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Thu, 4 Feb 2021 18:06:17 +0200 Subject: SL-14796 Updated code accordingly to changed event order --- indra/newview/llagent.cpp | 30 +++++++++++------------------- indra/newview/llagent.h | 4 ++-- indra/newview/llchathistory.cpp | 1 + 3 files changed, 14 insertions(+), 21 deletions(-) diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp index f31135ad4c..3c50493d79 100644 --- a/indra/newview/llagent.cpp +++ b/indra/newview/llagent.cpp @@ -387,6 +387,7 @@ LLAgent::LLAgent() : mTeleportFinishedSlot(), mTeleportFailedSlot(), mIsMaturityRatingChangingDuringTeleport(false), + mTPNeedsNeabyChatSeparator(false), mMaturityRatingChange(0U), mIsDoSendMaturityPreferenceToServer(false), mMaturityPreferenceRequestId(0U), @@ -519,10 +520,6 @@ void LLAgent::cleanup() { mTeleportFailedSlot.disconnect(); } - if (mParcelMgrConnection.connected()) - { - mParcelMgrConnection.disconnect(); - } } //----------------------------------------------------------------------------- @@ -3938,10 +3935,7 @@ void LLAgent::clearTeleportRequest() LLVoiceClient::getInstance()->setHidden(FALSE); } mTeleportRequest.reset(); - if (mParcelMgrConnection.connected()) - { - mParcelMgrConnection.disconnect(); - } + mTPNeedsNeabyChatSeparator = false; } void LLAgent::setMaturityRatingChangeDuringTeleport(U8 pMaturityRatingChange) @@ -3953,7 +3947,7 @@ void LLAgent::setMaturityRatingChangeDuringTeleport(U8 pMaturityRatingChange) void LLAgent::sheduleTeleportIM() { // is supposed to be called during teleport so we are still waiting for parcel - mParcelMgrConnection = addParcelChangedCallback(onParcelReadyAfterTeleport); + mTPNeedsNeabyChatSeparator = true; } bool LLAgent::hasPendingTeleportRequest() @@ -4003,6 +3997,12 @@ void LLAgent::startTeleportRequest() void LLAgent::handleTeleportFinished() { LL_INFOS("Teleport") << "Agent handling teleport finished." << LL_ENDL; + if (mTPNeedsNeabyChatSeparator) + { + // parcel is ready at this point + addTPNearbyChatSeparator(); + mTPNeedsNeabyChatSeparator = false; + } clearTeleportRequest(); mTeleportCanceled.reset(); if (mIsMaturityRatingChangingDuringTeleport) @@ -4066,14 +4066,11 @@ void LLAgent::handleTeleportFailed() mIsMaturityRatingChangingDuringTeleport = false; } - if (mParcelMgrConnection.connected()) - { - mParcelMgrConnection.disconnect(); - } + mTPNeedsNeabyChatSeparator = false; } /*static*/ -void LLAgent::onParcelReadyAfterTeleport() +void LLAgent::addTPNearbyChatSeparator() { LLViewerRegion* agent_region = gAgent.getRegion(); LLParcel* agent_parcel = LLViewerParcelMgr::getInstance()->getAgentParcel(); @@ -4106,11 +4103,6 @@ void LLAgent::onParcelReadyAfterTeleport() args["do_not_log"] = TRUE; nearby_chat->addMessage(chat, true, args); } - - if (gAgent.mParcelMgrConnection.connected()) - { - gAgent.mParcelMgrConnection.disconnect(); - } } /*static*/ diff --git a/indra/newview/llagent.h b/indra/newview/llagent.h index 8f8c2f6007..a792d3e11f 100644 --- a/indra/newview/llagent.h +++ b/indra/newview/llagent.h @@ -668,9 +668,9 @@ private: LLTeleportRequestPtr mTeleportCanceled; boost::signals2::connection mTeleportFinishedSlot; boost::signals2::connection mTeleportFailedSlot; - boost::signals2::connection mParcelMgrConnection; bool mIsMaturityRatingChangingDuringTeleport; + bool mTPNeedsNeabyChatSeparator; U8 mMaturityRatingChange; bool hasPendingTeleportRequest(); @@ -687,7 +687,7 @@ private: void handleTeleportFinished(); void handleTeleportFailed(); - static void onParcelReadyAfterTeleport(); + static void addTPNearbyChatSeparator(); static void onCapabilitiesReceivedAfterTeleport(); //-------------------------------------------------------------------- diff --git a/indra/newview/llchathistory.cpp b/indra/newview/llchathistory.cpp index 2bb68dbbbe..c110e0d815 100644 --- a/indra/newview/llchathistory.cpp +++ b/indra/newview/llchathistory.cpp @@ -739,6 +739,7 @@ public: break; case CHAT_SOURCE_SYSTEM: icon->setValue(LLSD("SL_Logo")); + break; case CHAT_SOURCE_TELEPORT: icon->setValue(LLSD("Command_Destinations_Icon")); break; -- cgit v1.2.3 From 99278b2f6259cd6e7b48dfbccb2528d428f83ec6 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Fri, 5 Feb 2021 11:15:06 +0200 Subject: SL-14797 Normalize right-click menus on Landmarks & Picks Part#1 --- indra/newview/llpanellandmarks.cpp | 37 +++++++++++++ indra/newview/llpanelplaces.cpp | 2 +- .../default/xui/en/menu_places_gear_folder.xml | 3 ++ .../default/xui/en/menu_places_gear_landmark.xml | 62 +++++++++------------- 4 files changed, 67 insertions(+), 37 deletions(-) diff --git a/indra/newview/llpanellandmarks.cpp b/indra/newview/llpanellandmarks.cpp index ccd8497484..578485c967 100644 --- a/indra/newview/llpanellandmarks.cpp +++ b/indra/newview/llpanellandmarks.cpp @@ -40,6 +40,7 @@ #include "llagent.h" #include "llagentpicksinfo.h" #include "llagentui.h" +#include "llavataractions.h" #include "llcallbacklist.h" #include "lldndbutton.h" #include "llfloatersidepanelcontainer.h" @@ -1051,6 +1052,38 @@ bool LLLandmarksPanel::isActionEnabled(const LLSD& userdata) const } return false; } + else if ("add_landmark" == command_name) + { + bool is_single_selection = root_folder_view && root_folder_view->getSelectedCount() == 1; + if (!is_single_selection) + { + return false; + } + LLFolderViewModelItemInventory* view_model = getCurSelectedViewModelItem(); + if (!view_model || view_model->getInventoryType() != LLInventoryType::IT_CATEGORY) + { + return false; + } + LLViewerInventoryItem* landmark = LLLandmarkActions::findLandmarkForAgentPos(); + if (landmark) + { + //already exists + return false; + } + return true; + } + else if ("share" == command_name) + { + if (!mCurrentSelectedList) + { + return false; + } + if (!LLAvatarActions::canShareSelectedItems(mCurrentSelectedList)) + { + return false; + } + return true; + } else { LL_WARNS() << "Unprocessed command has come: " << command_name << LL_ENDL; @@ -1078,6 +1111,10 @@ void LLLandmarksPanel::onCustomAction(const LLSD& userdata) { doActionOnCurSelectedLandmark(boost::bind(&LLLandmarksPanel::doCreatePick, this, _1)); } + else if ("share" == command_name && mCurrentSelectedList) + { + LLAvatarActions::shareWithAvatars(mCurrentSelectedList); + } else if ("restore" == command_name && mCurrentSelectedList) { mCurrentSelectedList->doToSelected(userdata); diff --git a/indra/newview/llpanelplaces.cpp b/indra/newview/llpanelplaces.cpp index 53870fb5c7..abec3ba733 100644 --- a/indra/newview/llpanelplaces.cpp +++ b/indra/newview/llpanelplaces.cpp @@ -388,7 +388,7 @@ void LLPanelPlaces::onOpen(const LLSD& key) // Update the buttons at the bottom of the panel updateVerbs(); } - else + else // "create_landmark" { mFilterEditor->clear(); onFilterEdit("", false); diff --git a/indra/newview/skins/default/xui/en/menu_places_gear_folder.xml b/indra/newview/skins/default/xui/en/menu_places_gear_folder.xml index 1aeb166e01..4d59ab0631 100644 --- a/indra/newview/skins/default/xui/en/menu_places_gear_folder.xml +++ b/indra/newview/skins/default/xui/en/menu_places_gear_folder.xml @@ -13,6 +13,9 @@ + + + + + - + name="copy_slurl"> - + function="Places.LandmarksGear.CopyPaste.Action" + parameter="copy_slurl" /> + + + name="create_pick"> + function="Places.LandmarksGear.Custom.Action" + parameter="create_pick" /> + parameter="create_pick" /> - - - - - - - - -- cgit v1.2.3 From 74d3f9d017a424d69bfc256ecc1062fdaa3b18c3 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Fri, 5 Feb 2021 20:31:22 +0200 Subject: SL-14797 Normalize right-click menus on Landmarks & Picks Part#2 --- indra/newview/llpanellandmarkinfo.cpp | 14 +++++++++++- indra/newview/llpanellandmarkinfo.h | 16 +++++++++---- indra/newview/llpanellandmarks.cpp | 9 +++++++- indra/newview/llpanelplaces.cpp | 3 ++- indra/newview/skins/default/xui/en/menu_picks.xml | 26 +++++++++++----------- .../default/xui/en/menu_places_gear_folder.xml | 4 ++-- 6 files changed, 50 insertions(+), 22 deletions(-) diff --git a/indra/newview/llpanellandmarkinfo.cpp b/indra/newview/llpanellandmarkinfo.cpp index 6751c25fb9..069fb32a56 100644 --- a/indra/newview/llpanellandmarkinfo.cpp +++ b/indra/newview/llpanellandmarkinfo.cpp @@ -106,6 +106,18 @@ void LLPanelLandmarkInfo::resetLocation() // virtual void LLPanelLandmarkInfo::setInfoType(EInfoType type) +{ + LLUUID dest_folder; + setInfoType(type, dest_folder); +} + +// Sets CREATE_LANDMARK infotype and creates landmark at desired folder +void LLPanelLandmarkInfo::setInfoAndCreateLandmark(const LLUUID& fodler_id) +{ + setInfoType(CREATE_LANDMARK, fodler_id); +} + +void LLPanelLandmarkInfo::setInfoType(EInfoType type, const LLUUID &folder_id) { LLPanel* landmark_info_panel = getChild("landmark_info_panel"); @@ -183,7 +195,7 @@ void LLPanelLandmarkInfo::setInfoType(EInfoType type) // remote parcel request to complete. if (!LLLandmarkActions::landmarkAlreadyExists()) { - createLandmark(LLUUID()); + createLandmark(folder_id); } } break; diff --git a/indra/newview/llpanellandmarkinfo.h b/indra/newview/llpanellandmarkinfo.h index 9712736182..9a2e0c8f59 100644 --- a/indra/newview/llpanellandmarkinfo.h +++ b/indra/newview/llpanellandmarkinfo.h @@ -43,8 +43,12 @@ public: /*virtual*/ void resetLocation(); + // If landmark doesn't exists, will create it at default folder /*virtual*/ void setInfoType(EInfoType type); + // Sets CREATE_LANDMARK infotype and creates landmark at desired folder + void setInfoAndCreateLandmark(const LLUUID& fodler_id); + /*virtual*/ void processParcelInfo(const LLParcelData& parcel_data); // Displays landmark owner, creator and creation date info. @@ -59,13 +63,17 @@ public: // Select current landmark folder in combobox. BOOL setLandmarkFolder(const LLUUID& id); - // Create a landmark for the current location - // in a folder specified by folder_id. - void createLandmark(const LLUUID& folder_id); - static std::string getFullFolderName(const LLViewerInventoryCategory* cat); private: + // Create a landmark for the current location + // in a folder specified by folder_id. + // Expects title and description to be initialized + void createLandmark(const LLUUID& folder_id); + + // If landmark doesn't exists, will create it at specified folder + void setInfoType(EInfoType type, const LLUUID &folder_id); + void populateFoldersList(); LLTextBox* mOwner; diff --git a/indra/newview/llpanellandmarks.cpp b/indra/newview/llpanellandmarks.cpp index 578485c967..46c23961f4 100644 --- a/indra/newview/llpanellandmarks.cpp +++ b/indra/newview/llpanellandmarks.cpp @@ -785,7 +785,14 @@ void LLLandmarksPanel::onAddAction(const LLSD& userdata) const } else { - LLFloaterSidePanelContainer::showPanel("places", LLSD().with("type", "create_landmark")); + LLSD args; + args["type"] = "create_landmark"; + if (view_model->getInventoryType() + == LLInventoryType::IT_CATEGORY) + { + args["dest_folder"] = view_model->getUUID(); + } + LLFloaterSidePanelContainer::showPanel("places", args); } } else if ("category" == command_name) diff --git a/indra/newview/llpanelplaces.cpp b/indra/newview/llpanelplaces.cpp index abec3ba733..c038207628 100644 --- a/indra/newview/llpanelplaces.cpp +++ b/indra/newview/llpanelplaces.cpp @@ -409,7 +409,8 @@ void LLPanelPlaces::onOpen(const LLSD& key) } else if (mPlaceInfoType == CREATE_LANDMARK_INFO_TYPE) { - mLandmarkInfo->setInfoType(LLPanelPlaceInfo::CREATE_LANDMARK); + LLUUID dest_folder = key["dest_folder"]; + mLandmarkInfo->setInfoAndCreateLandmark(dest_folder); if (key.has("x") && key.has("y") && key.has("z")) { diff --git a/indra/newview/skins/default/xui/en/menu_picks.xml b/indra/newview/skins/default/xui/en/menu_picks.xml index ebb49c9004..a408e6136c 100644 --- a/indra/newview/skins/default/xui/en/menu_picks.xml +++ b/indra/newview/skins/default/xui/en/menu_picks.xml @@ -3,7 +3,17 @@ layout="topleft" name="Picks"> + + + + @@ -24,17 +34,7 @@ parameter="edit" /> - - - - Date: Tue, 9 Feb 2021 01:59:15 +0200 Subject: SL-14797 Normalize right-click menus on Landmarks & Picks Part#3 --- indra/llinventory/llparcel.h | 6 ---- indra/llinventory/llparcelflags.h | 2 +- indra/newview/lllandmarkactions.cpp | 22 ------------- indra/newview/lllandmarkactions.h | 6 ---- indra/newview/llpanelteleporthistory.cpp | 38 ++++++++++++---------- indra/newview/llpanelteleporthistory.h | 4 +-- indra/newview/llteleporthistorystorage.cpp | 22 +++++++++++++ indra/newview/llteleporthistorystorage.h | 7 ++++ .../default/xui/en/menu_teleport_history_item.xml | 19 ++++++++--- 9 files changed, 67 insertions(+), 59 deletions(-) diff --git a/indra/llinventory/llparcel.h b/indra/llinventory/llparcel.h index 3b39aeb56b..5d08c1f4c6 100644 --- a/indra/llinventory/llparcel.h +++ b/indra/llinventory/llparcel.h @@ -295,7 +295,6 @@ public: void setAllowTerraform(BOOL b){setParcelFlag(PF_ALLOW_TERRAFORM, b); } void setAllowDamage(BOOL b) { setParcelFlag(PF_ALLOW_DAMAGE, b); } void setAllowFly(BOOL b) { setParcelFlag(PF_ALLOW_FLY, b); } - void setAllowLandmark(BOOL b){ setParcelFlag(PF_ALLOW_LANDMARK, b); } void setAllowGroupScripts(BOOL b) { setParcelFlag(PF_ALLOW_GROUP_SCRIPTS, b); } void setAllowOtherScripts(BOOL b) { setParcelFlag(PF_ALLOW_OTHER_SCRIPTS, b); } void setAllowDeedToGroup(BOOL b) { setParcelFlag(PF_ALLOW_DEED_TO_GROUP, b); } @@ -476,11 +475,6 @@ public: BOOL getAllowFly() const { return (mParcelFlags & PF_ALLOW_FLY) ? TRUE : FALSE; } - // Remove permission restrictions for creating landmarks. - // We should eventually remove this flag completely. - BOOL getAllowLandmark() const - { return TRUE; } - BOOL getAllowGroupScripts() const { return (mParcelFlags & PF_ALLOW_GROUP_SCRIPTS) ? TRUE : FALSE; } diff --git a/indra/llinventory/llparcelflags.h b/indra/llinventory/llparcelflags.h index 25b27a281a..4cffa83cc1 100644 --- a/indra/llinventory/llparcelflags.h +++ b/indra/llinventory/llparcelflags.h @@ -33,7 +33,7 @@ const U32 PF_ALLOW_FLY = 1 << 0;// Can start flying const U32 PF_ALLOW_OTHER_SCRIPTS= 1 << 1;// Scripts by others can run. const U32 PF_FOR_SALE = 1 << 2;// Can buy this land const U32 PF_FOR_SALE_OBJECTS = 1 << 7;// Can buy all objects on this land -const U32 PF_ALLOW_LANDMARK = 1 << 3; +const U32 PF_ALLOW_LANDMARK = 1 << 3;// Always true/deprecated const U32 PF_ALLOW_TERRAFORM = 1 << 4; const U32 PF_ALLOW_DAMAGE = 1 << 5; const U32 PF_CREATE_OBJECTS = 1 << 6; diff --git a/indra/newview/lllandmarkactions.cpp b/indra/newview/lllandmarkactions.cpp index c243f8b4f0..a17dc674ac 100644 --- a/indra/newview/lllandmarkactions.cpp +++ b/indra/newview/lllandmarkactions.cpp @@ -228,23 +228,6 @@ LLViewerInventoryItem* LLLandmarkActions::findLandmarkForAgentPos() return findLandmarkForGlobalPos(gAgent.getPositionGlobal()); } -bool LLLandmarkActions::canCreateLandmarkHere() -{ - LLParcel* agent_parcel = LLViewerParcelMgr::getInstance()->getAgentParcel(); - if(!agent_parcel) - { - LL_WARNS() << "No agent region" << LL_ENDL; - return false; - } - if (agent_parcel->getAllowLandmark() - || LLViewerParcelMgr::isParcelOwnedByAgent(agent_parcel, GP_LAND_ALLOW_LANDMARK)) - { - return true; - } - - return false; -} - void LLLandmarkActions::createLandmarkHere( const std::string& name, const std::string& desc, @@ -261,11 +244,6 @@ void LLLandmarkActions::createLandmarkHere( LL_WARNS() << "No agent parcel" << LL_ENDL; return; } - if (!canCreateLandmarkHere()) - { - LLNotificationsUtil::add("CannotCreateLandmarkNotOwner"); - return; - } create_inventory_item(gAgent.getID(), gAgent.getSessionID(), folder_id, LLTransactionID::tnull, diff --git a/indra/newview/lllandmarkactions.h b/indra/newview/lllandmarkactions.h index 870d92811e..ae7b072fcb 100644 --- a/indra/newview/lllandmarkactions.h +++ b/indra/newview/lllandmarkactions.h @@ -72,12 +72,6 @@ public: */ static LLViewerInventoryItem* findLandmarkForAgentPos(); - - /** - * @brief Checks whether agent has rights to create landmark for current parcel. - */ - static bool canCreateLandmarkHere(); - /** * @brief Creates landmark for current parcel. */ diff --git a/indra/newview/llpanelteleporthistory.cpp b/indra/newview/llpanelteleporthistory.cpp index fe0608d544..3f5664f431 100644 --- a/indra/newview/llpanelteleporthistory.cpp +++ b/indra/newview/llpanelteleporthistory.cpp @@ -396,9 +396,7 @@ LLContextMenu* LLTeleportHistoryPanel::ContextMenu::createMenu() // (N.B. callbacks don't take const refs as mID is local scope) LLUICtrl::CommitCallbackRegistry::ScopedRegistrar registrar; - registrar.add("TeleportHistory.Teleport", boost::bind(&LLTeleportHistoryPanel::ContextMenu::onTeleport, this)); - registrar.add("TeleportHistory.MoreInformation",boost::bind(&LLTeleportHistoryPanel::ContextMenu::onInfo, this)); - registrar.add("TeleportHistory.CopyToClipboard",boost::bind(&LLTeleportHistoryPanel::ContextMenu::onCopyToClipboard, this)); + registrar.add("TeleportHistory.Action", boost::bind(&LLTeleportHistoryPanel::ContextMenu::onUserAction, this, _2)); // create the context menu from the XUI llassert(LLMenuGL::sMenuContainer != NULL); @@ -406,14 +404,27 @@ LLContextMenu* LLTeleportHistoryPanel::ContextMenu::createMenu() "menu_teleport_history_item.xml", LLMenuGL::sMenuContainer, LLViewerMenuHolderGL::child_registry_t::instance()); } -void LLTeleportHistoryPanel::ContextMenu::onTeleport() +void LLTeleportHistoryPanel::ContextMenu::onUserAction(const LLSD& userdata) { - confirmTeleport(mIndex); -} - -void LLTeleportHistoryPanel::ContextMenu::onInfo() -{ - LLTeleportHistoryFlatItem::showPlaceInfoPanel(mIndex); + std::string command_name = userdata.asString(); + if ("teleport" == command_name) + { + confirmTeleport(mIndex); + } + else if ("view" == command_name) + { + LLTeleportHistoryFlatItem::showPlaceInfoPanel(mIndex); + } + else if ("show_on_map" == command_name) + { + LLTeleportHistoryStorage::getInstance()->showItemOnMap(mIndex); + } + else if ("copy_slurl" == command_name) + { + LLVector3d globalPos = LLTeleportHistoryStorage::getInstance()->getItems()[mIndex].mGlobalPos; + LLLandmarkActions::getSLURLfromPosGlobal(globalPos, + boost::bind(&LLTeleportHistoryPanel::ContextMenu::gotSLURLCallback, _1)); + } } //static @@ -427,13 +438,6 @@ void LLTeleportHistoryPanel::ContextMenu::gotSLURLCallback(const std::string& sl LLNotificationsUtil::add("CopySLURL", args); } -void LLTeleportHistoryPanel::ContextMenu::onCopyToClipboard() -{ - LLVector3d globalPos = LLTeleportHistoryStorage::getInstance()->getItems()[mIndex].mGlobalPos; - LLLandmarkActions::getSLURLfromPosGlobal(globalPos, - boost::bind(&LLTeleportHistoryPanel::ContextMenu::gotSLURLCallback, _1)); -} - // Not yet implemented; need to remove buildPanel() from constructor when we switch //static LLRegisterPanelClassWrapper t_teleport_history("panel_teleport_history"); diff --git a/indra/newview/llpanelteleporthistory.h b/indra/newview/llpanelteleporthistory.h index b88861c5c6..e0abbc47db 100644 --- a/indra/newview/llpanelteleporthistory.h +++ b/indra/newview/llpanelteleporthistory.h @@ -52,9 +52,7 @@ public: private: LLContextMenu* createMenu(); - void onTeleport(); - void onInfo(); - void onCopyToClipboard(); + void onUserAction(const LLSD& userdata); static void gotSLURLCallback(const std::string& slurl); diff --git a/indra/newview/llteleporthistorystorage.cpp b/indra/newview/llteleporthistorystorage.cpp index 8a5704939a..93fa457bd0 100644 --- a/indra/newview/llteleporthistorystorage.cpp +++ b/indra/newview/llteleporthistorystorage.cpp @@ -33,6 +33,8 @@ #include "lldir.h" #include "llteleporthistory.h" #include "llagent.h" +#include "llfloaterreg.h" +#include "llfloaterworldmap.h" // Max offset for two global positions to consider them as equal const F64 MAX_GLOBAL_POS_OFFSET = 5.0f; @@ -253,3 +255,23 @@ void LLTeleportHistoryStorage::goToItem(S32 idx) gAgent.teleportViaLocation(mItems[idx].mGlobalPos); } +void LLTeleportHistoryStorage::showItemOnMap(S32 idx) +{ + // Validate specified index. + if (idx < 0 || idx >= (S32)mItems.size()) + { + LL_WARNS() << "Invalid teleport history index (" << idx << ") specified" << LL_ENDL; + dump(); + return; + } + + LLVector3d landmark_global_pos = mItems[idx].mGlobalPos; + + LLFloaterWorldMap* worldmap_instance = LLFloaterWorldMap::getInstance(); + if (!landmark_global_pos.isExactlyZero() && worldmap_instance) + { + worldmap_instance->trackLocation(landmark_global_pos); + LLFloaterReg::showInstance("world_map", "center"); + } +} + diff --git a/indra/newview/llteleporthistorystorage.h b/indra/newview/llteleporthistorystorage.h index 946ac0af1a..3578923fd7 100644 --- a/indra/newview/llteleporthistorystorage.h +++ b/indra/newview/llteleporthistorystorage.h @@ -107,6 +107,13 @@ public: */ void goToItem(S32 idx); + /** + * Show specific item on map. + * + * The item is specified by its index (starting from 0). + */ + void showItemOnMap(S32 idx); + private: void load(); 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 f939c3996d..52da591e35 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 @@ -7,20 +7,31 @@ layout="topleft" name="Teleport"> + function="TeleportHistory.Action" + parameter="teleport" /> + function="TeleportHistory.Action" + parameter="view" /> + + + + function="TeleportHistory.Action" + parameter="copy_slurl" /> -- cgit v1.2.3 From b23feb2c623df8a58a52afb5fd4e5806a630d3d4 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Tue, 9 Feb 2021 23:00:44 +0200 Subject: SL-14797 Do not allow creation of landmarks nor folders in library --- indra/newview/llpanellandmarks.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/indra/newview/llpanellandmarks.cpp b/indra/newview/llpanellandmarks.cpp index 46c23961f4..6e8eac19fc 100644 --- a/indra/newview/llpanellandmarks.cpp +++ b/indra/newview/llpanellandmarks.cpp @@ -1044,8 +1044,12 @@ bool LLLandmarksPanel::isActionEnabled(const LLSD& userdata) const // ... but except Received folder return !isReceivedFolderSelected(); } + if (mCurrentSelectedList == mLibraryInventoryPanel) + { + return false; + } //"Add a folder" is enabled by default (case when My Landmarks is empty) - else return true; + return true; } else if("create_pick" == command_name) { @@ -1066,6 +1070,10 @@ bool LLLandmarksPanel::isActionEnabled(const LLSD& userdata) const { return false; } + if (mCurrentSelectedList == mLibraryInventoryPanel) + { + return false; + } LLFolderViewModelItemInventory* view_model = getCurSelectedViewModelItem(); if (!view_model || view_model->getInventoryType() != LLInventoryType::IT_CATEGORY) { -- cgit v1.2.3 From 48597039b24ffbc976572d24bfc0835922bce43b Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Thu, 11 Feb 2021 15:29:20 +0000 Subject: SL-14862 - LLViewerStats logs which UI features get used --- indra/llui/CMakeLists.txt | 2 ++ indra/llui/llfloaterreg.cpp | 8 ++++++ indra/llui/lluictrl.cpp | 21 +++++++++++++- indra/llui/lluictrl.h | 4 +++ indra/llui/lluiusage.cpp | 61 +++++++++++++++++++++++++++++++++++++++++ indra/llui/lluiusage.h | 49 +++++++++++++++++++++++++++++++++ indra/newview/llviewerstats.cpp | 3 ++ 7 files changed, 147 insertions(+), 1 deletion(-) create mode 100644 indra/llui/lluiusage.cpp create mode 100644 indra/llui/lluiusage.h diff --git a/indra/llui/CMakeLists.txt b/indra/llui/CMakeLists.txt index cce618487b..f781ff4110 100644 --- a/indra/llui/CMakeLists.txt +++ b/indra/llui/CMakeLists.txt @@ -122,6 +122,7 @@ set(llui_SOURCE_FILES lluictrl.cpp lluictrlfactory.cpp lluistring.cpp + lluiusage.cpp llundo.cpp llurlaction.cpp llurlentry.cpp @@ -241,6 +242,7 @@ set(llui_HEADER_FILES llui.h lluicolor.h lluistring.h + lluiusage.h llundo.h llurlaction.h llurlentry.h diff --git a/indra/llui/llfloaterreg.cpp b/indra/llui/llfloaterreg.cpp index 85e07fc6a6..6307bf1028 100644 --- a/indra/llui/llfloaterreg.cpp +++ b/indra/llui/llfloaterreg.cpp @@ -32,6 +32,7 @@ #include "llfloater.h" #include "llmultifloater.h" #include "llfloaterreglistener.h" +#include "lluiusage.h" //******************************************************* @@ -243,6 +244,8 @@ LLFloaterReg::const_instance_list_t& LLFloaterReg::getFloaterList(const std::str //static LLFloater* LLFloaterReg::showInstance(const std::string& name, const LLSD& key, BOOL focus) { + LL_DEBUGS("UIUsage") << "floater showInstance " << name << LL_ENDL; + LLUIUsage::instance().logFloater(name); if( sBlockShowFloaters // see EXT-7090 && sAlwaysShowableList.find(name) == sAlwaysShowableList.end()) @@ -273,6 +276,9 @@ bool LLFloaterReg::hideInstance(const std::string& name, const LLSD& key) // returns true if the instance is visible when completed bool LLFloaterReg::toggleInstance(const std::string& name, const LLSD& key) { + LL_DEBUGS("UIUsage") << "floater toggleInstance " << name << LL_ENDL; + LLUIUsage::instance().logFloater(name); + LLFloater* instance = findInstance(name, key); if (LLFloater::isShown(instance)) { @@ -473,6 +479,8 @@ void LLFloaterReg::toggleInstanceOrBringToFront(const LLSD& sdname, const LLSD& LLFloater* instance = getInstance(name, key); + LL_DEBUGS("UIUsage") << "floater toggleInstanceOrBringToFront " << name << LL_ENDL; + LLUIUsage::instance().logFloater(name); if (!instance) { LL_DEBUGS() << "Unable to get instance of floater '" << name << "'" << LL_ENDL; diff --git a/indra/llui/lluictrl.cpp b/indra/llui/lluictrl.cpp index 544a76e8d5..0e1c8439ea 100644 --- a/indra/llui/lluictrl.cpp +++ b/indra/llui/lluictrl.cpp @@ -35,6 +35,7 @@ #include "lluictrlfactory.h" #include "lltabcontainer.h" #include "llaccordionctrltab.h" +#include "lluiusage.h" static LLDefaultChildRegistry::Register r("ui_ctrl"); @@ -282,6 +283,7 @@ LLUICtrl::commit_signal_t::slot_type LLUICtrl::initCommitCallback(const CommitCa else { std::string function_name = cb.function_name; + setFunctionName(function_name); commit_callback_t* func = (CommitCallbackRegistry::getValue(function_name)); if (func) { @@ -422,7 +424,18 @@ BOOL LLUICtrl::canFocusChildren() const void LLUICtrl::onCommit() { if (mCommitSignal) - (*mCommitSignal)(this, getValue()); + { + if (!mFunctionName.empty()) + { + LL_DEBUGS("UIUsage") << "calling commit function " << mFunctionName << LL_ENDL; + LLUIUsage::instance().logCommand(mFunctionName); + } + else + { + //LL_DEBUGS("UIUsage") << "calling commit function " << "UNKNOWN" << LL_ENDL; + } + (*mCommitSignal)(this, getValue()); + } } //virtual @@ -597,6 +610,12 @@ void LLUICtrl::setMakeInvisibleControlVariable(LLControlVariable* control) setVisible(!(mMakeInvisibleControlVariable->getValue().asBoolean())); } } + +void LLUICtrl::setFunctionName(const std::string& function_name) +{ + mFunctionName = function_name; +} + // static bool LLUICtrl::controlListener(const LLSD& newvalue, LLHandle handle, std::string type) { diff --git a/indra/llui/lluictrl.h b/indra/llui/lluictrl.h index 7360bd7659..67dd24341c 100644 --- a/indra/llui/lluictrl.h +++ b/indra/llui/lluictrl.h @@ -183,6 +183,8 @@ public: void setMakeVisibleControlVariable(LLControlVariable* control); void setMakeInvisibleControlVariable(LLControlVariable* control); + void setFunctionName(const std::string& function_name); + virtual void setTentative(BOOL b); virtual BOOL getTentative() const; virtual void setValue(const LLSD& value); @@ -310,6 +312,8 @@ protected: LLControlVariable* mMakeInvisibleControlVariable; boost::signals2::connection mMakeInvisibleControlConnection; + std::string mFunctionName; + static F32 sActiveControlTransparency; static F32 sInactiveControlTransparency; diff --git a/indra/llui/lluiusage.cpp b/indra/llui/lluiusage.cpp new file mode 100644 index 0000000000..e1237031cd --- /dev/null +++ b/indra/llui/lluiusage.cpp @@ -0,0 +1,61 @@ +/** +* @file lluiuisage.cpp +* @brief Source file for LLUIUsage +* +* $LicenseInfo:firstyear=2021&license=viewerlgpl$ +* Second Life Viewer Source Code +* Copyright (C) 2021, 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 "linden_common.h" +#include "lluiusage.h" + +LLUIUsage::LLUIUsage() +{ +} + +LLUIUsage::~LLUIUsage() +{ +} + +void LLUIUsage::logFloater(const std::string& floater) +{ + mFloaterCounts[floater]++; +} + +void LLUIUsage::logCommand(const std::string& command) +{ + mCommandCounts[command]++; +} + +LLSD LLUIUsage::asLLSD() const +{ + LLSD result; + for (auto const& it : mFloaterCounts) + { + result["floaters"][it.first] = LLSD::Integer(it.second); + } + for (auto const& it : mCommandCounts) + { + result["commands"][it.first] = LLSD::Integer(it.second); + } + return result; +} + diff --git a/indra/llui/lluiusage.h b/indra/llui/lluiusage.h new file mode 100644 index 0000000000..0c076c2b2c --- /dev/null +++ b/indra/llui/lluiusage.h @@ -0,0 +1,49 @@ +/** +* @file lluiuisage.h +* @brief Header file for LLUIUsage +* +* $LicenseInfo:firstyear=2021&license=viewerlgpl$ +* Second Life Viewer Source Code +* Copyright (C) 2021, 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_LLUIUSAGE_H +#define LL_LLUIUSAGE_H + +#include +#include "llsd.h" +#include "llsingleton.h" + +// UIUsage tracking to see which operations and UI elements are most popular in a session +class LLUIUsage : public LLSingleton +{ +public: + LLSINGLETON(LLUIUsage); + ~LLUIUsage(); +public: + void logFloater(const std::string& floater); + void logCommand(const std::string& command); + LLSD asLLSD() const; +private: + std::map mFloaterCounts; + std::map mCommandCounts; +}; + +#endif // LLUIUIUSAGE.h diff --git a/indra/newview/llviewerstats.cpp b/indra/newview/llviewerstats.cpp index 05f88b0a75..314c1a1f1e 100644 --- a/indra/newview/llviewerstats.cpp +++ b/indra/newview/llviewerstats.cpp @@ -63,6 +63,7 @@ #include "llsdutil.h" #include "llcorehttputil.h" #include "llvoicevivox.h" +#include "lluiusage.h" namespace LLStatViewer { @@ -577,6 +578,8 @@ void send_viewer_stats(bool include_preferences) fail["invalid"] = (S32) gMessageSystem->mInvalidOnCircuitPackets; fail["missing_updater"] = (S32) LLAppViewer::instance()->isUpdaterMissing(); + body["ui"] = LLUIUsage::instance().asLLSD(); + body["stats"]["voice"] = LLVoiceVivoxStats::getInstance()->read(); // Misc stats, two strings and two ints -- cgit v1.2.3 From 8a718a9ca28a7a544c7622a033fcd2791935909d Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Thu, 11 Feb 2021 16:05:46 +0000 Subject: SL-14862 - line endings fix, avoid period in key names --- indra/llui/lluiusage.cpp | 131 +++++++++++++++++++++++++---------------------- indra/llui/lluiusage.h | 99 +++++++++++++++++------------------ 2 files changed, 120 insertions(+), 110 deletions(-) diff --git a/indra/llui/lluiusage.cpp b/indra/llui/lluiusage.cpp index e1237031cd..50eeccd214 100644 --- a/indra/llui/lluiusage.cpp +++ b/indra/llui/lluiusage.cpp @@ -1,61 +1,70 @@ -/** -* @file lluiuisage.cpp -* @brief Source file for LLUIUsage -* -* $LicenseInfo:firstyear=2021&license=viewerlgpl$ -* Second Life Viewer Source Code -* Copyright (C) 2021, 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 "linden_common.h" -#include "lluiusage.h" - -LLUIUsage::LLUIUsage() -{ -} - -LLUIUsage::~LLUIUsage() -{ -} - -void LLUIUsage::logFloater(const std::string& floater) -{ - mFloaterCounts[floater]++; -} - -void LLUIUsage::logCommand(const std::string& command) -{ - mCommandCounts[command]++; -} - -LLSD LLUIUsage::asLLSD() const -{ - LLSD result; - for (auto const& it : mFloaterCounts) - { - result["floaters"][it.first] = LLSD::Integer(it.second); - } - for (auto const& it : mCommandCounts) - { - result["commands"][it.first] = LLSD::Integer(it.second); - } - return result; -} - +/** +* @file lluiuisage.cpp +* @brief Source file for LLUIUsage +* +* $LicenseInfo:firstyear=2021&license=viewerlgpl$ +* Second Life Viewer Source Code +* Copyright (C) 2021, 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 "linden_common.h" +#include "lluiusage.h" + +LLUIUsage::LLUIUsage() +{ +} + +LLUIUsage::~LLUIUsage() +{ +} + +// static +std::string LLUIUsage::sanitized(const std::string& s) +{ + // ViewerStats db doesn't like "." in keys + std::string result(s); + std::replace(result.begin(), result.end(), '.', '_'); + return result; +} + +void LLUIUsage::logFloater(const std::string& floater) +{ + mFloaterCounts[sanitized(floater)]++; +} + +void LLUIUsage::logCommand(const std::string& command) +{ + mCommandCounts[sanitized(command)]++; +} + +LLSD LLUIUsage::asLLSD() const +{ + LLSD result; + for (auto const& it : mFloaterCounts) + { + result["floaters"][it.first] = LLSD::Integer(it.second); + } + for (auto const& it : mCommandCounts) + { + result["commands"][it.first] = LLSD::Integer(it.second); + } + return result; +} + diff --git a/indra/llui/lluiusage.h b/indra/llui/lluiusage.h index 0c076c2b2c..bac607aa60 100644 --- a/indra/llui/lluiusage.h +++ b/indra/llui/lluiusage.h @@ -1,49 +1,50 @@ -/** -* @file lluiuisage.h -* @brief Header file for LLUIUsage -* -* $LicenseInfo:firstyear=2021&license=viewerlgpl$ -* Second Life Viewer Source Code -* Copyright (C) 2021, 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_LLUIUSAGE_H -#define LL_LLUIUSAGE_H - -#include -#include "llsd.h" -#include "llsingleton.h" - -// UIUsage tracking to see which operations and UI elements are most popular in a session -class LLUIUsage : public LLSingleton -{ -public: - LLSINGLETON(LLUIUsage); - ~LLUIUsage(); -public: - void logFloater(const std::string& floater); - void logCommand(const std::string& command); - LLSD asLLSD() const; -private: - std::map mFloaterCounts; - std::map mCommandCounts; -}; - -#endif // LLUIUIUSAGE.h +/** +* @file lluiuisage.h +* @brief Header file for LLUIUsage +* +* $LicenseInfo:firstyear=2021&license=viewerlgpl$ +* Second Life Viewer Source Code +* Copyright (C) 2021, 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_LLUIUSAGE_H +#define LL_LLUIUSAGE_H + +#include +#include "llsd.h" +#include "llsingleton.h" + +// UIUsage tracking to see which operations and UI elements are most popular in a session +class LLUIUsage : public LLSingleton +{ +public: + LLSINGLETON(LLUIUsage); + ~LLUIUsage(); +public: + static std::string sanitized(const std::string& s); + void logFloater(const std::string& floater); + void logCommand(const std::string& command); + LLSD asLLSD() const; +private: + std::map mFloaterCounts; + std::map mCommandCounts; +}; + +#endif // LLUIUIUSAGE.h -- cgit v1.2.3 From 5971c647e4abd11c4c4f055f124ac2251b720c25 Mon Sep 17 00:00:00 2001 From: Mnikolenko Productengine Date: Mon, 15 Feb 2021 16:49:08 +0200 Subject: SL-14632 FIXED The viewer is crashed after purging the trash with favorites folder --- indra/newview/llviewerinventory.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/indra/newview/llviewerinventory.cpp b/indra/newview/llviewerinventory.cpp index ed1d726528..2b200c17c1 100644 --- a/indra/newview/llviewerinventory.cpp +++ b/indra/newview/llviewerinventory.cpp @@ -1466,6 +1466,12 @@ void purge_descendents_of(const LLUUID& id, LLPointer cb) LLPointer cat = gInventory.getCategory(id); if (cat.notNull()) { + const LLUUID fav_id = gInventory.findUserDefinedCategoryUUIDForType(LLFolderType::FT_FAVORITE); + if ((id == fav_id) || gInventory.isObjectDescendentOf(fav_id, id)) + { + gSavedPerAccountSettings.setString("FavoritesFolder", ""); + } + if (LLClipboard::instance().hasContents()) { // Remove items from clipboard or it will remain active even if there is nothing to paste/copy -- cgit v1.2.3 From 58827cb2752b9a184d638ed6a4f0efa0e9740d64 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Sat, 13 Feb 2021 01:50:04 +0200 Subject: SL-14725 Rotation sliders for sun and moon panels --- indra/llui/llvirtualtrackball.cpp | 46 ++++++ indra/llui/llvirtualtrackball.h | 3 + indra/newview/llpaneleditsky.cpp | 119 +++++++++++++-- indra/newview/llpaneleditsky.h | 2 + .../default/xui/en/floater_fixedenvironment.xml | 2 +- .../skins/default/xui/en/menu_favorites.xml | 12 +- .../default/xui/en/panel_settings_sky_sunmoon.xml | 162 ++++++++++++++++----- 7 files changed, 294 insertions(+), 52 deletions(-) diff --git a/indra/llui/llvirtualtrackball.cpp b/indra/llui/llvirtualtrackball.cpp index 723643dd25..15847a7282 100644 --- a/indra/llui/llvirtualtrackball.cpp +++ b/indra/llui/llvirtualtrackball.cpp @@ -348,6 +348,52 @@ LLQuaternion LLVirtualTrackball::getRotation() const return mValue; } +// static +void LLVirtualTrackball::getAzimuthAndElevation(const LLQuaternion &quat, F32 &azimuth, F32 &elevation) +{ + // LLQuaternion has own function to get azimuth, but it doesn't appear to return correct values (meant for 2d?) + const LLVector3 VectorZero(10000.0f, 0.0f, 0.0f); + LLVector3 point = VectorZero * quat; + + if (!is_approx_zero(point.mV[VX]) || !is_approx_zero(point.mV[VY])) + { + azimuth = atan2f(point.mV[VX], point.mV[VY]); + } + else + { + azimuth = 0; + } + + azimuth -= F_PI_BY_TWO; + + if (azimuth < 0) + { + azimuth += F_PI * 2; + } + + if (abs(point.mV[VY]) > abs(point.mV[VX]) && !is_approx_zero(point.mV[VY])) // to avoid precision drop + { + elevation = atanl((F64)point.mV[VZ] / (F64)abs(point.mV[VY])); + } + else if (!is_approx_zero(point.mV[VX])) + { + elevation = atanl((F64)point.mV[VZ] / (F64)abs(point.mV[VX])); + } + else + { + // both VX and VY are near zero, VZ should be high + elevation = point.mV[VZ] > 0 ? F_PI_BY_TWO : -F_PI_BY_TWO; + } +} + +// static +void LLVirtualTrackball::getAzimuthAndElevationDeg(const LLQuaternion &quat, F32 &azimuth, F32 &elevation) +{ + getAzimuthAndElevation(quat, azimuth, elevation); + azimuth *= RAD_TO_DEG; + elevation *= RAD_TO_DEG; +} + BOOL LLVirtualTrackball::handleHover(S32 x, S32 y, MASK mask) { if (hasMouseCapture()) diff --git a/indra/llui/llvirtualtrackball.h b/indra/llui/llvirtualtrackball.h index 2d4b1ece17..c7a893877b 100644 --- a/indra/llui/llvirtualtrackball.h +++ b/indra/llui/llvirtualtrackball.h @@ -96,6 +96,9 @@ public: void setRotation(const LLQuaternion &value); LLQuaternion getRotation() const; + static void getAzimuthAndElevation(const LLQuaternion &quat, F32 &azimuth, F32 &elevation); + static void getAzimuthAndElevationDeg(const LLQuaternion &quat, F32 &azimuth, F32 &elevation); + protected: friend class LLUICtrlFactory; LLVirtualTrackball(const Params&); diff --git a/indra/newview/llpaneleditsky.cpp b/indra/newview/llpaneleditsky.cpp index 2e26b69144..06e406e2ab 100644 --- a/indra/newview/llpaneleditsky.cpp +++ b/indra/newview/llpaneleditsky.cpp @@ -69,11 +69,15 @@ namespace const std::string FIELD_SKY_GLOW_SIZE("glow_size"); const std::string FIELD_SKY_STAR_BRIGHTNESS("star_brightness"); const std::string FIELD_SKY_SUN_ROTATION("sun_rotation"); + const std::string FIELD_SKY_SUN_AZIMUTH("sun_azimuth"); + const std::string FIELD_SKY_SUN_ELEVATION("sun_elevation"); const std::string FIELD_SKY_SUN_IMAGE("sun_image"); const std::string FIELD_SKY_SUN_SCALE("sun_scale"); const std::string FIELD_SKY_SUN_BEACON("sunbeacon"); const std::string FIELD_SKY_MOON_BEACON("moonbeacon"); const std::string FIELD_SKY_MOON_ROTATION("moon_rotation"); + const std::string FIELD_SKY_MOON_AZIMUTH("moon_azimuth"); + const std::string FIELD_SKY_MOON_ELEVATION("moon_elevation"); const std::string FIELD_SKY_MOON_IMAGE("moon_image"); const std::string FIELD_SKY_MOON_SCALE("moon_scale"); const std::string FIELD_SKY_MOON_BRIGHTNESS("moon_brightness"); @@ -473,12 +477,16 @@ BOOL LLPanelSettingsSkySunMoonTab::postBuild() getChild(FIELD_SKY_GLOW_SIZE)->setCommitCallback([this](LLUICtrl *, const LLSD &) { onGlowChanged(); }); getChild(FIELD_SKY_STAR_BRIGHTNESS)->setCommitCallback([this](LLUICtrl *, const LLSD &) { onStarBrightnessChanged(); }); getChild(FIELD_SKY_SUN_ROTATION)->setCommitCallback([this](LLUICtrl *, const LLSD &) { onSunRotationChanged(); }); + getChild(FIELD_SKY_SUN_AZIMUTH)->setCommitCallback([this](LLUICtrl *, const LLSD &) { onSunAzimElevChanged(); }); + getChild(FIELD_SKY_SUN_ELEVATION)->setCommitCallback([this](LLUICtrl *, const LLSD &) { onSunAzimElevChanged(); }); getChild(FIELD_SKY_SUN_IMAGE)->setCommitCallback([this](LLUICtrl *, const LLSD &) { onSunImageChanged(); }); getChild(FIELD_SKY_SUN_SCALE)->setCommitCallback([this](LLUICtrl *, const LLSD &) { onSunScaleChanged(); }); getChild(FIELD_SKY_SUN_IMAGE)->setBlankImageAssetID(LLSettingsSky::GetBlankSunTextureId()); getChild(FIELD_SKY_SUN_IMAGE)->setDefaultImageAssetID(LLSettingsSky::GetBlankSunTextureId()); getChild(FIELD_SKY_SUN_IMAGE)->setAllowNoTexture(TRUE); getChild(FIELD_SKY_MOON_ROTATION)->setCommitCallback([this](LLUICtrl *, const LLSD &) { onMoonRotationChanged(); }); + getChild(FIELD_SKY_MOON_AZIMUTH)->setCommitCallback([this](LLUICtrl *, const LLSD &) { onMoonAzimElevChanged(); }); + getChild(FIELD_SKY_MOON_ELEVATION)->setCommitCallback([this](LLUICtrl *, const LLSD &) { onMoonAzimElevChanged(); }); getChild(FIELD_SKY_MOON_IMAGE)->setCommitCallback([this](LLUICtrl *, const LLSD &) { onMoonImageChanged(); }); getChild(FIELD_SKY_MOON_IMAGE)->setDefaultImageAssetID(LLSettingsSky::GetDefaultMoonTextureId()); getChild(FIELD_SKY_MOON_IMAGE)->setBlankImageAssetID(LLSettingsSky::GetDefaultMoonTextureId()); @@ -537,13 +545,29 @@ void LLPanelSettingsSkySunMoonTab::refresh() getChild(FIELD_SKY_GLOW_FOCUS)->setValue(glow.mV[2] / SLIDER_SCALE_GLOW_B); getChild(FIELD_SKY_STAR_BRIGHTNESS)->setValue(mSkySettings->getStarBrightness()); - getChild(FIELD_SKY_SUN_ROTATION)->setRotation(mSkySettings->getSunRotation()); getChild(FIELD_SKY_SUN_IMAGE)->setValue(mSkySettings->getSunTextureId()); getChild(FIELD_SKY_SUN_SCALE)->setValue(mSkySettings->getSunScale()); - getChild(FIELD_SKY_MOON_ROTATION)->setRotation(mSkySettings->getMoonRotation()); getChild(FIELD_SKY_MOON_IMAGE)->setValue(mSkySettings->getMoonTextureId()); getChild(FIELD_SKY_MOON_SCALE)->setValue(mSkySettings->getMoonScale()); getChild(FIELD_SKY_MOON_BRIGHTNESS)->setValue(mSkySettings->getMoonBrightness()); + + // Sun rotation values + F32 azimuth, elevation; + LLQuaternion quat = mSkySettings->getSunRotation(); + LLVirtualTrackball::getAzimuthAndElevationDeg(quat, azimuth, elevation); + + getChild(FIELD_SKY_SUN_ROTATION)->setRotation(quat); + getChild(FIELD_SKY_SUN_AZIMUTH)->setValue(azimuth); + getChild(FIELD_SKY_SUN_ELEVATION)->setValue(elevation); + + // Moon rotation values + quat = mSkySettings->getMoonRotation(); + LLVirtualTrackball::getAzimuthAndElevationDeg(quat, azimuth, elevation); + + getChild(FIELD_SKY_MOON_ROTATION)->setRotation(quat); + getChild(FIELD_SKY_MOON_AZIMUTH)->setValue(azimuth); + getChild(FIELD_SKY_MOON_ELEVATION)->setValue(elevation); + } //------------------------------------------------------------------------- @@ -583,10 +607,47 @@ void LLPanelSettingsSkySunMoonTab::onStarBrightnessChanged() void LLPanelSettingsSkySunMoonTab::onSunRotationChanged() { - if (!mSkySettings) return; - mSkySettings->setSunRotation(getChild(FIELD_SKY_SUN_ROTATION)->getRotation()); - mSkySettings->update(); - setIsDirty(); + LLQuaternion quat = getChild(FIELD_SKY_SUN_ROTATION)->getRotation(); + + F32 azimuth, elevation; + LLVirtualTrackball::getAzimuthAndElevationDeg(quat, azimuth, elevation); + getChild(FIELD_SKY_SUN_AZIMUTH)->setValue(azimuth); + getChild(FIELD_SKY_SUN_ELEVATION)->setValue(elevation); + if (mSkySettings) + { + mSkySettings->setSunRotation(quat); + mSkySettings->update(); + setIsDirty(); + } +} + +void LLPanelSettingsSkySunMoonTab::onSunAzimElevChanged() +{ + F32 azimuth = getChild(FIELD_SKY_SUN_AZIMUTH)->getValue().asReal(); + F32 elevation = getChild(FIELD_SKY_SUN_ELEVATION)->getValue().asReal(); + LLQuaternion quat = mSkySettings->getSunRotation(); + + azimuth *= DEG_TO_RAD; + elevation *= DEG_TO_RAD; + + if (is_approx_zero(elevation)) + { + elevation = F_APPROXIMATELY_ZERO; + } + + quat.setAngleAxis(-elevation, 0, 1, 0); + LLQuaternion az_quat; + az_quat.setAngleAxis(F_TWO_PI - azimuth, 0, 0, 1); + quat *= az_quat; + + getChild(FIELD_SKY_SUN_ROTATION)->setRotation(quat); + + if (mSkySettings) + { + mSkySettings->setSunRotation(quat); + mSkySettings->update(); + setIsDirty(); + } } void LLPanelSettingsSkySunMoonTab::onSunScaleChanged() @@ -607,10 +668,48 @@ void LLPanelSettingsSkySunMoonTab::onSunImageChanged() void LLPanelSettingsSkySunMoonTab::onMoonRotationChanged() { - if (!mSkySettings) return; - mSkySettings->setMoonRotation(getChild(FIELD_SKY_MOON_ROTATION)->getRotation()); - mSkySettings->update(); - setIsDirty(); + LLQuaternion quat = getChild(FIELD_SKY_MOON_ROTATION)->getRotation(); + + F32 azimuth, elevation; + LLVirtualTrackball::getAzimuthAndElevationDeg(quat, azimuth, elevation); + getChild(FIELD_SKY_MOON_AZIMUTH)->setValue(azimuth); + getChild(FIELD_SKY_MOON_ELEVATION)->setValue(elevation); + + if (mSkySettings) + { + mSkySettings->setMoonRotation(quat); + mSkySettings->update(); + setIsDirty(); + } +} + +void LLPanelSettingsSkySunMoonTab::onMoonAzimElevChanged() +{ + F32 azimuth = getChild(FIELD_SKY_MOON_AZIMUTH)->getValue().asReal(); + F32 elevation = getChild(FIELD_SKY_MOON_ELEVATION)->getValue().asReal(); + LLQuaternion quat = mSkySettings->getMoonRotation(); + + azimuth *= DEG_TO_RAD; + elevation *= DEG_TO_RAD; + + if (is_approx_zero(elevation)) + { + elevation = F_APPROXIMATELY_ZERO; + } + + quat.setAngleAxis(-elevation, 0, 1, 0); + LLQuaternion az_quat; + az_quat.setAngleAxis(F_TWO_PI- azimuth, 0, 0, 1); + quat *= az_quat; + + getChild(FIELD_SKY_MOON_ROTATION)->setRotation(quat); + + if (mSkySettings) + { + mSkySettings->setMoonRotation(quat); + mSkySettings->update(); + setIsDirty(); + } } void LLPanelSettingsSkySunMoonTab::onMoonImageChanged() diff --git a/indra/newview/llpaneleditsky.h b/indra/newview/llpaneleditsky.h index c02c9c95a0..d1c558c902 100644 --- a/indra/newview/llpaneleditsky.h +++ b/indra/newview/llpaneleditsky.h @@ -124,9 +124,11 @@ private: void onGlowChanged(); void onStarBrightnessChanged(); void onSunRotationChanged(); + void onSunAzimElevChanged(); void onSunScaleChanged(); void onSunImageChanged(); void onMoonRotationChanged(); + void onMoonAzimElevChanged(); void onMoonScaleChanged(); void onMoonBrightnessChanged(); void onMoonImageChanged(); diff --git a/indra/newview/skins/default/xui/en/floater_fixedenvironment.xml b/indra/newview/skins/default/xui/en/floater_fixedenvironment.xml index dbf91b0834..2cc73361f5 100644 --- a/indra/newview/skins/default/xui/en/floater_fixedenvironment.xml +++ b/indra/newview/skins/default/xui/en/floater_fixedenvironment.xml @@ -89,7 +89,7 @@ follows="left|top|right|bottom" auto_resize="false" user_resize="false" - height="40" + height="35" visible="true"> + name="Show On Map"> + parameter="show_on_map" /> + name="Copy slurl"> + parameter="copy_slurl" /> Position: @@ -93,7 +93,7 @@ follows="left|top" height="10" layout="topleft" - left_delta="-5" + left_delta="65" top_delta="20" width="80"> Color: @@ -108,12 +108,58 @@ name="sun_moon_color" top_pad="5" width="60" /> + + Azimuth: + + + + Elevation: + + Glow Focus: @@ -128,8 +174,8 @@ min_val="-2" max_val="2" name="glow_focus" - top_delta="15" - width="250" + top_delta="13" + width="215" can_edit_text="true"/> Position: @@ -278,30 +324,76 @@ top_delta="15" width="130" can_edit_text="true"/> - - Brightness: - - - + Azimuth: + + + + Elevation: + + + + Brightness: + + + Date: Mon, 15 Feb 2021 18:08:55 +0200 Subject: SL-14725 Move environment editors' ok and cancel buttons to center --- indra/newview/skins/default/xui/en/floater_edit_ext_day_cycle.xml | 2 +- indra/newview/skins/default/xui/en/floater_fixedenvironment.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/indra/newview/skins/default/xui/en/floater_edit_ext_day_cycle.xml b/indra/newview/skins/default/xui/en/floater_edit_ext_day_cycle.xml index 30e9002230..c609e3bd3a 100644 --- a/indra/newview/skins/default/xui/en/floater_edit_ext_day_cycle.xml +++ b/indra/newview/skins/default/xui/en/floater_edit_ext_day_cycle.xml @@ -616,7 +616,7 @@ follows="top|left" height="23" label="Save" - left="5" + left="200" top_pad="0" name="save_btn" width="156" /> diff --git a/indra/newview/skins/default/xui/en/floater_fixedenvironment.xml b/indra/newview/skins/default/xui/en/floater_fixedenvironment.xml index 2cc73361f5..37c56d3235 100644 --- a/indra/newview/skins/default/xui/en/floater_fixedenvironment.xml +++ b/indra/newview/skins/default/xui/en/floater_fixedenvironment.xml @@ -97,7 +97,7 @@ layout="topleft" mouse_opaque="false" name="button_bar_ls" - left="0" + left="212" orientation="horizontal" top="0" width="313"> -- cgit v1.2.3 From fa35eeecd7854b92e52f7bac2dc31bfc07ce012b Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Mon, 15 Feb 2021 22:53:54 +0200 Subject: SL-14725 Add elevation and azimuth to local lighting --- indra/llui/llvirtualtrackball.cpp | 15 +-- indra/newview/llfloaterenvironmentadjust.cpp | 113 +++++++++++++++++++-- indra/newview/llfloaterenvironmentadjust.h | 2 + indra/newview/llpaneleditsky.cpp | 4 +- .../default/xui/en/floater_adjust_environment.xml | 96 +++++++++++++++-- 5 files changed, 194 insertions(+), 36 deletions(-) diff --git a/indra/llui/llvirtualtrackball.cpp b/indra/llui/llvirtualtrackball.cpp index 15847a7282..728e86af08 100644 --- a/indra/llui/llvirtualtrackball.cpp +++ b/indra/llui/llvirtualtrackball.cpp @@ -352,7 +352,6 @@ LLQuaternion LLVirtualTrackball::getRotation() const void LLVirtualTrackball::getAzimuthAndElevation(const LLQuaternion &quat, F32 &azimuth, F32 &elevation) { // LLQuaternion has own function to get azimuth, but it doesn't appear to return correct values (meant for 2d?) - const LLVector3 VectorZero(10000.0f, 0.0f, 0.0f); LLVector3 point = VectorZero * quat; if (!is_approx_zero(point.mV[VX]) || !is_approx_zero(point.mV[VY])) @@ -371,19 +370,7 @@ void LLVirtualTrackball::getAzimuthAndElevation(const LLQuaternion &quat, F32 &a azimuth += F_PI * 2; } - if (abs(point.mV[VY]) > abs(point.mV[VX]) && !is_approx_zero(point.mV[VY])) // to avoid precision drop - { - elevation = atanl((F64)point.mV[VZ] / (F64)abs(point.mV[VY])); - } - else if (!is_approx_zero(point.mV[VX])) - { - elevation = atanl((F64)point.mV[VZ] / (F64)abs(point.mV[VX])); - } - else - { - // both VX and VY are near zero, VZ should be high - elevation = point.mV[VZ] > 0 ? F_PI_BY_TWO : -F_PI_BY_TWO; - } + elevation = asin(point.mV[VZ]); // because VectorZero is '1' } // static diff --git a/indra/newview/llfloaterenvironmentadjust.cpp b/indra/newview/llfloaterenvironmentadjust.cpp index 4eb5e03603..95d6a2d652 100644 --- a/indra/newview/llfloaterenvironmentadjust.cpp +++ b/indra/newview/llfloaterenvironmentadjust.cpp @@ -53,11 +53,15 @@ namespace const std::string FIELD_SKY_CLOUD_SCALE("cloud_scale"); const std::string FIELD_SKY_SCENE_GAMMA("scene_gamma"); const std::string FIELD_SKY_SUN_ROTATION("sun_rotation"); + const std::string FIELD_SKY_SUN_AZIMUTH("sun_azimuth"); + const std::string FIELD_SKY_SUN_ELEVATION("sun_elevation"); const std::string FIELD_SKY_SUN_SCALE("sun_scale"); const std::string FIELD_SKY_GLOW_FOCUS("glow_focus"); const std::string FIELD_SKY_GLOW_SIZE("glow_size"); const std::string FIELD_SKY_STAR_BRIGHTNESS("star_brightness"); const std::string FIELD_SKY_MOON_ROTATION("moon_rotation"); + const std::string FIELD_SKY_MOON_AZIMUTH("moon_azimuth"); + const std::string FIELD_SKY_MOON_ELEVATION("moon_elevation"); const std::string BTN_RESET("btn_reset"); const F32 SLIDER_SCALE_SUN_AMBIENT(3.0f); @@ -96,9 +100,13 @@ BOOL LLFloaterEnvironmentAdjust::postBuild() getChild(FIELD_SKY_GLOW_SIZE)->setCommitCallback([this](LLUICtrl *, const LLSD &) { onGlowChanged(); }); getChild(FIELD_SKY_STAR_BRIGHTNESS)->setCommitCallback([this](LLUICtrl *, const LLSD &) { onStarBrightnessChanged(); }); getChild(FIELD_SKY_SUN_ROTATION)->setCommitCallback([this](LLUICtrl *, const LLSD &) { onSunRotationChanged(); }); + getChild(FIELD_SKY_SUN_AZIMUTH)->setCommitCallback([this](LLUICtrl *, const LLSD &) { onSunAzimElevChanged(); }); + getChild(FIELD_SKY_SUN_ELEVATION)->setCommitCallback([this](LLUICtrl *, const LLSD &) { onSunAzimElevChanged(); }); getChild(FIELD_SKY_SUN_SCALE)->setCommitCallback([this](LLUICtrl *, const LLSD &) { onSunScaleChanged(); }); getChild(FIELD_SKY_MOON_ROTATION)->setCommitCallback([this](LLUICtrl *, const LLSD &) { onMoonRotationChanged(); }); + getChild(FIELD_SKY_MOON_AZIMUTH)->setCommitCallback([this](LLUICtrl *, const LLSD &) { onMoonAzimElevChanged(); }); + getChild(FIELD_SKY_MOON_ELEVATION)->setCommitCallback([this](LLUICtrl *, const LLSD &) { onMoonAzimElevChanged(); }); getChild(BTN_RESET)->setCommitCallback([this](LLUICtrl *, const LLSD &) { onButtonReset(); }); getChild(FIELD_SKY_CLOUD_MAP)->setCommitCallback([this](LLUICtrl *, const LLSD &) { onCloudMapChanged(); }); @@ -169,10 +177,25 @@ void LLFloaterEnvironmentAdjust::refresh() getChild(FIELD_SKY_GLOW_SIZE)->setValue(2.0 - (glow.mV[0] / SLIDER_SCALE_GLOW_R)); getChild(FIELD_SKY_GLOW_FOCUS)->setValue(glow.mV[2] / SLIDER_SCALE_GLOW_B); getChild(FIELD_SKY_STAR_BRIGHTNESS)->setValue(mLiveSky->getStarBrightness()); - getChild(FIELD_SKY_SUN_ROTATION)->setRotation(mLiveSky->getSunRotation()); getChild(FIELD_SKY_SUN_SCALE)->setValue(mLiveSky->getSunScale()); - getChild(FIELD_SKY_MOON_ROTATION)->setRotation(mLiveSky->getMoonRotation()); + // Sun rotation + LLQuaternion quat = mLiveSky->getSunRotation(); + F32 azimuth; + F32 elevation; + LLVirtualTrackball::getAzimuthAndElevationDeg(quat, azimuth, elevation); + + getChild(FIELD_SKY_SUN_AZIMUTH)->setValue(azimuth); + getChild(FIELD_SKY_SUN_ELEVATION)->setValue(elevation); + getChild(FIELD_SKY_SUN_ROTATION)->setRotation(quat); + + // Moon rotation + quat = mLiveSky->getMoonRotation(); + LLVirtualTrackball::getAzimuthAndElevationDeg(quat, azimuth, elevation); + + getChild(FIELD_SKY_MOON_AZIMUTH)->setValue(azimuth); + getChild(FIELD_SKY_MOON_ELEVATION)->setValue(elevation); + getChild(FIELD_SKY_MOON_ROTATION)->setRotation(quat); } @@ -325,10 +348,45 @@ void LLFloaterEnvironmentAdjust::onStarBrightnessChanged() void LLFloaterEnvironmentAdjust::onSunRotationChanged() { - if (!mLiveSky) - return; - mLiveSky->setSunRotation(getChild(FIELD_SKY_SUN_ROTATION)->getRotation()); - mLiveSky->update(); + LLQuaternion quat = getChild(FIELD_SKY_SUN_ROTATION)->getRotation(); + F32 azimuth; + F32 elevation; + LLVirtualTrackball::getAzimuthAndElevationDeg(quat, azimuth, elevation); + getChild(FIELD_SKY_SUN_AZIMUTH)->setValue(azimuth); + getChild(FIELD_SKY_SUN_ELEVATION)->setValue(elevation); + if (mLiveSky) + { + mLiveSky->setSunRotation(quat); + mLiveSky->update(); + } +} + +void LLFloaterEnvironmentAdjust::onSunAzimElevChanged() +{ + F32 azimuth = getChild(FIELD_SKY_SUN_AZIMUTH)->getValue().asReal(); + F32 elevation = getChild(FIELD_SKY_SUN_ELEVATION)->getValue().asReal(); + LLQuaternion quat; + + azimuth *= DEG_TO_RAD; + elevation *= DEG_TO_RAD; + + if (is_approx_zero(elevation)) + { + elevation = F_APPROXIMATELY_ZERO; + } + + quat.setAngleAxis(-elevation, 0, 1, 0); + LLQuaternion az_quat; + az_quat.setAngleAxis(F_TWO_PI - azimuth, 0, 0, 1); + quat *= az_quat; + + getChild(FIELD_SKY_SUN_ROTATION)->setRotation(quat); + + if (mLiveSky) + { + mLiveSky->setSunRotation(quat); + mLiveSky->update(); + } } void LLFloaterEnvironmentAdjust::onSunScaleChanged() @@ -341,10 +399,45 @@ void LLFloaterEnvironmentAdjust::onSunScaleChanged() void LLFloaterEnvironmentAdjust::onMoonRotationChanged() { - if (!mLiveSky) - return; - mLiveSky->setMoonRotation(getChild(FIELD_SKY_MOON_ROTATION)->getRotation()); - mLiveSky->update(); + LLQuaternion quat = getChild(FIELD_SKY_MOON_ROTATION)->getRotation(); + F32 azimuth; + F32 elevation; + LLVirtualTrackball::getAzimuthAndElevationDeg(quat, azimuth, elevation); + getChild(FIELD_SKY_MOON_AZIMUTH)->setValue(azimuth); + getChild(FIELD_SKY_MOON_ELEVATION)->setValue(elevation); + if (mLiveSky) + { + mLiveSky->setMoonRotation(quat); + mLiveSky->update(); + } +} + +void LLFloaterEnvironmentAdjust::onMoonAzimElevChanged() +{ + F32 azimuth = getChild(FIELD_SKY_MOON_AZIMUTH)->getValue().asReal(); + F32 elevation = getChild(FIELD_SKY_MOON_ELEVATION)->getValue().asReal(); + LLQuaternion quat; + + azimuth *= DEG_TO_RAD; + elevation *= DEG_TO_RAD; + + if (is_approx_zero(elevation)) + { + elevation = F_APPROXIMATELY_ZERO; + } + + quat.setAngleAxis(-elevation, 0, 1, 0); + LLQuaternion az_quat; + az_quat.setAngleAxis(F_TWO_PI - azimuth, 0, 0, 1); + quat *= az_quat; + + getChild(FIELD_SKY_MOON_ROTATION)->setRotation(quat); + + if (mLiveSky) + { + mLiveSky->setMoonRotation(quat); + mLiveSky->update(); + } } void LLFloaterEnvironmentAdjust::onCloudMapChanged() diff --git a/indra/newview/llfloaterenvironmentadjust.h b/indra/newview/llfloaterenvironmentadjust.h index cb38dbcfa8..05ff011be5 100644 --- a/indra/newview/llfloaterenvironmentadjust.h +++ b/indra/newview/llfloaterenvironmentadjust.h @@ -73,9 +73,11 @@ private: void onGlowChanged(); void onStarBrightnessChanged(); void onSunRotationChanged(); + void onSunAzimElevChanged(); void onSunScaleChanged(); void onMoonRotationChanged(); + void onMoonAzimElevChanged(); void onCloudMapChanged(); void onWaterMapChanged(); diff --git a/indra/newview/llpaneleditsky.cpp b/indra/newview/llpaneleditsky.cpp index 06e406e2ab..a169712bd8 100644 --- a/indra/newview/llpaneleditsky.cpp +++ b/indra/newview/llpaneleditsky.cpp @@ -625,7 +625,7 @@ void LLPanelSettingsSkySunMoonTab::onSunAzimElevChanged() { F32 azimuth = getChild(FIELD_SKY_SUN_AZIMUTH)->getValue().asReal(); F32 elevation = getChild(FIELD_SKY_SUN_ELEVATION)->getValue().asReal(); - LLQuaternion quat = mSkySettings->getSunRotation(); + LLQuaternion quat; azimuth *= DEG_TO_RAD; elevation *= DEG_TO_RAD; @@ -687,7 +687,7 @@ void LLPanelSettingsSkySunMoonTab::onMoonAzimElevChanged() { F32 azimuth = getChild(FIELD_SKY_MOON_AZIMUTH)->getValue().asReal(); F32 elevation = getChild(FIELD_SKY_MOON_ELEVATION)->getValue().asReal(); - LLQuaternion quat = mSkySettings->getMoonRotation(); + LLQuaternion quat; azimuth *= DEG_TO_RAD; elevation *= DEG_TO_RAD; diff --git a/indra/newview/skins/default/xui/en/floater_adjust_environment.xml b/indra/newview/skins/default/xui/en/floater_adjust_environment.xml index 59589e3665..f4a686bae1 100644 --- a/indra/newview/skins/default/xui/en/floater_adjust_environment.xml +++ b/indra/newview/skins/default/xui/en/floater_adjust_environment.xml @@ -5,14 +5,14 @@ save_rect="false" title="Personal Lighting" width="845" - height="240" + height="280" min_width="500" - min_height="235" + min_height="275" single_instance="true" can_resize="false"> + Azimuth: + + Elevation: + + left_delta="-5" + top_pad="8" + follows="left|top"/> Scale: + Azimuth: + + Elevation: + + left_delta="0" + top_pad="8"/> -- cgit v1.2.3 From 9eae41e5825662564125b9f5edf87e1aa3c0c508 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Tue, 16 Feb 2021 21:47:34 +0200 Subject: SL-14725 Validate trackball elevation --- indra/llui/llvirtualtrackball.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/indra/llui/llvirtualtrackball.cpp b/indra/llui/llvirtualtrackball.cpp index 728e86af08..6e0aef740d 100644 --- a/indra/llui/llvirtualtrackball.cpp +++ b/indra/llui/llvirtualtrackball.cpp @@ -370,7 +370,10 @@ void LLVirtualTrackball::getAzimuthAndElevation(const LLQuaternion &quat, F32 &a azimuth += F_PI * 2; } - elevation = asin(point.mV[VZ]); // because VectorZero is '1' + // while vector is '1', F32 is not sufficiently precise and we can get + // values like 1.0000012 which will result in -90deg angle instead of 90deg + F32 z = llclamp(point.mV[VZ], -1.f, 1.f); + elevation = asin(z); // because VectorZero's length is '1' } // static @@ -442,6 +445,10 @@ BOOL LLVirtualTrackball::handleHover(S32 x, S32 y, MASK mask) mValue *= az_quat; } + // we are doing a lot of F32 mathematical operations with loss of precision, + // re-normalize to compensate + mValue.normalize(); + mPrevX = x; mPrevY = y; onCommit(); -- cgit v1.2.3 From d15156d4e091ee7a095df70cfda04fea4ee2935a Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Thu, 18 Feb 2021 14:24:54 +0000 Subject: SL-14862 - catching more commands in LLUIUsage --- indra/llui/lltoolbar.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/indra/llui/lltoolbar.cpp b/indra/llui/lltoolbar.cpp index e6f466ec78..4868c66d1b 100644 --- a/indra/llui/lltoolbar.cpp +++ b/indra/llui/lltoolbar.cpp @@ -967,6 +967,8 @@ LLToolBarButton* LLToolBar::createButton(const LLCommandId& id) executeStopParam.function_name = executeStopFunction; executeStopParam.parameter = commandp->executeStopParameters(); LLUICtrl::commit_callback_t execute_func = initCommitCallback(executeParam); + button->setFunctionName(commandp->executeFunctionName()); + LL_DEBUGS("UIUsage") << "button function name a -> " << commandp->executeFunctionName() << LL_ENDL; LLUICtrl::commit_callback_t stop_func = initCommitCallback(executeStopParam); button->setMouseDownCallback(boost::bind(&LLToolBarButton::callIfEnabled, button, execute_func, _1, _2)); @@ -974,6 +976,8 @@ LLToolBarButton* LLToolBar::createButton(const LLCommandId& id) } else { + button->setFunctionName(commandp->executeFunctionName()); + LL_DEBUGS("UIUsage") << "button function name b -> " << commandp->executeFunctionName() << LL_ENDL; button->setCommitCallback(executeParam); } -- cgit v1.2.3 From 53343bc708339b95f18804e11d6a130b542e0c5b Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Wed, 17 Feb 2021 01:20:24 +0200 Subject: SL-14797 Normalize right-click - favorites panel, part #4 --- indra/newview/llfavoritesbar.cpp | 44 ++++++++++++++++++++++ indra/newview/llfavoritesbar.h | 1 + indra/newview/llpanellandmarks.cpp | 33 ++++++++++------ indra/newview/llpanellandmarks.h | 6 ++- indra/newview/llpanelplaces.cpp | 16 ++++++++ .../skins/default/xui/en/menu_favorites.xml | 23 +++++++++-- .../newview/skins/default/xui/en/notifications.xml | 25 +++++++++++- 7 files changed, 130 insertions(+), 18 deletions(-) diff --git a/indra/newview/llfavoritesbar.cpp b/indra/newview/llfavoritesbar.cpp index 347997a69a..2394a763ee 100644 --- a/indra/newview/llfavoritesbar.cpp +++ b/indra/newview/llfavoritesbar.cpp @@ -38,6 +38,7 @@ #include "lltooltip.h" #include "llagent.h" +#include "llagentpicksinfo.h" #include "llavatarnamecache.h" #include "llclipboard.h" #include "llinventorybridge.h" @@ -1194,6 +1195,10 @@ bool LLFavoritesBarCtrl::enableSelected(const LLSD& userdata) { return isClipboardPasteable(); } + else if (param == "create_pick") + { + return !LLAgentPicksInfo::getInstance()->isPickLimitReached(); + } return false; } @@ -1242,6 +1247,13 @@ void LLFavoritesBarCtrl::doToSelected(const LLSD& userdata) LLFloaterReg::showInstance("world_map", "center"); } } + else if (action == "create_pick") + { + LLSD args; + args["type"] = "create_pick"; + args["item_id"] = item->getUUID(); + LLFloaterSidePanelContainer::showPanel("places", args); + } else if (action == "cut") { } @@ -1257,6 +1269,16 @@ void LLFavoritesBarCtrl::doToSelected(const LLSD& userdata) { gInventory.removeItem(mSelectedItemID); } + else if (action == "rename") + { + LLSD args; + args["NAME"] = item->getName(); + + LLSD payload; + payload["id"] = mSelectedItemID; + + LLNotificationsUtil::add("RenameLandmark", args, payload, boost::bind(onRenameCommit, _1, _2)); + } // Pop-up the overflow menu again (it gets hidden whenever the user clicks a context menu item). // See EXT-4217 and STORM-207. @@ -1269,6 +1291,28 @@ void LLFavoritesBarCtrl::doToSelected(const LLSD& userdata) } } +bool LLFavoritesBarCtrl::onRenameCommit(const LLSD& notification, const LLSD& response) +{ + S32 option = LLNotificationsUtil::getSelectedOption(notification, response); + if (0 == option) + { + LLUUID id = notification["payload"]["id"].asUUID(); + LLInventoryItem *item = gInventory.getItem(id); + std::string landmark_name = response["new_name"].asString(); + LLStringUtil::trim(landmark_name); + + if (!landmark_name.empty() && item && item->getName() != landmark_name) + { + LLPointer new_item = new LLViewerInventoryItem(item); + new_item->rename(landmark_name); + new_item->updateServer(FALSE); + gInventory.updateItem(new_item); + } + } + + return false; +} + BOOL LLFavoritesBarCtrl::isClipboardPasteable() const { if (!LLClipboard::instance().hasContents()) diff --git a/indra/newview/llfavoritesbar.h b/indra/newview/llfavoritesbar.h index 571208aa31..147308c0ba 100644 --- a/indra/newview/llfavoritesbar.h +++ b/indra/newview/llfavoritesbar.h @@ -91,6 +91,7 @@ protected: bool enableSelected(const LLSD& userdata); void doToSelected(const LLSD& userdata); + static bool onRenameCommit(const LLSD& notification, const LLSD& response); BOOL isClipboardPasteable() const; void pasteFromClipboard() const; diff --git a/indra/newview/llpanellandmarks.cpp b/indra/newview/llpanellandmarks.cpp index 6e8eac19fc..7eda9c1aa7 100644 --- a/indra/newview/llpanellandmarks.cpp +++ b/indra/newview/llpanellandmarks.cpp @@ -512,14 +512,20 @@ void LLLandmarksPanel::processParcelInfo(const LLParcelData& parcel_data) { //this function will be called after user will try to create a pick for selected landmark. // We have to make request to sever to get parcel_id and snaption_id. - if(isLandmarkSelected()) + if(mCreatePickItemId.notNull()) { - LLFolderViewModelItemInventory* cur_item = getCurSelectedViewModelItem(); - if (!cur_item) return; - LLUUID id = cur_item->getUUID(); - LLInventoryItem* inv_item = mCurrentSelectedList->getModel()->getItem(id); - doActionOnCurSelectedLandmark(boost::bind( - &LLLandmarksPanel::doProcessParcelInfo, this, _1, getCurSelectedItem(), inv_item, parcel_data)); + LLInventoryItem* inv_item = gInventory.getItem(mCreatePickItemId); + + if (inv_item && inv_item->getInventoryType() == LLInventoryType::IT_LANDMARK) + { + // we are processing response for doCreatePick, landmark should be already loaded + LLLandmark* landmark = LLLandmarkActions::getLandmark(inv_item->getUUID()); + if (landmark) + { + doProcessParcelInfo(landmark, inv_item, parcel_data); + } + } + mCreatePickItemId.setNull(); } } @@ -1124,7 +1130,11 @@ void LLLandmarksPanel::onCustomAction(const LLSD& userdata) } else if ("create_pick" == command_name) { - doActionOnCurSelectedLandmark(boost::bind(&LLLandmarksPanel::doCreatePick, this, _1)); + LLFolderViewModelItemInventory* cur_item = getCurSelectedViewModelItem(); + if (cur_item) + { + doActionOnCurSelectedLandmark(boost::bind(&LLLandmarksPanel::doCreatePick, this, _1, cur_item->getUUID())); + } } else if ("share" == command_name && mCurrentSelectedList) { @@ -1344,7 +1354,6 @@ void LLLandmarksPanel::doShowOnMap(LLLandmark* landmark) } void LLLandmarksPanel::doProcessParcelInfo(LLLandmark* landmark, - LLFolderViewItem* cur_item, LLInventoryItem* inv_item, const LLParcelData& parcel_data) { @@ -1373,7 +1382,7 @@ void LLLandmarksPanel::doProcessParcelInfo(LLLandmark* landmark, LLPickData data; data.pos_global = landmark_global_pos; - data.name = cur_item->getName(); + data.name = inv_item->getName(); data.desc = inv_item->getDescription(); data.snapshot_id = parcel_data.snapshot_id; data.parcel_id = parcel_data.parcel_id; @@ -1393,11 +1402,13 @@ void LLLandmarksPanel::doProcessParcelInfo(LLLandmark* landmark, panel_pick, panel_places,params)); } -void LLLandmarksPanel::doCreatePick(LLLandmark* landmark) +void LLLandmarksPanel::doCreatePick(LLLandmark* landmark, const LLUUID &item_id) { LLViewerRegion* region = gAgent.getRegion(); if (!region) return; + mCreatePickItemId = item_id; + LLGlobalVec pos_global; LLUUID region_id; landmark->getGlobalPos(pos_global); diff --git a/indra/newview/llpanellandmarks.h b/indra/newview/llpanellandmarks.h index c11cbe05ae..e8fb62e0e8 100644 --- a/indra/newview/llpanellandmarks.h +++ b/indra/newview/llpanellandmarks.h @@ -82,6 +82,8 @@ public: void updateMenuVisibility(LLUICtrl* menu); + void doCreatePick(LLLandmark* landmark, const LLUUID &item_id ); + protected: /** * @return true - if current selected panel is not null and selected item is a landmark @@ -160,10 +162,8 @@ private: */ void doShowOnMap(LLLandmark* landmark); void doProcessParcelInfo(LLLandmark* landmark, - LLFolderViewItem* cur_item, LLInventoryItem* inv_item, const LLParcelData& parcel_data); - void doCreatePick(LLLandmark* landmark); private: LLPlacesInventoryPanel* mFavoritesInventoryPanel; @@ -183,6 +183,8 @@ private: accordion_tabs_t mAccordionTabs; LLAccordionCtrlTab* mMyLandmarksAccordionTab; + + LLUUID mCreatePickItemId; // item we requested a pick for }; #endif //LL_LLPANELLANDMARKS_H diff --git a/indra/newview/llpanelplaces.cpp b/indra/newview/llpanelplaces.cpp index c038207628..427b3fbf57 100644 --- a/indra/newview/llpanelplaces.cpp +++ b/indra/newview/llpanelplaces.cpp @@ -79,6 +79,7 @@ static const F32 PLACE_INFO_UPDATE_INTERVAL = 3.0; static const std::string AGENT_INFO_TYPE = "agent"; static const std::string CREATE_LANDMARK_INFO_TYPE = "create_landmark"; +static const std::string CREATE_PICK_TYPE = "create_pick"; static const std::string LANDMARK_INFO_TYPE = "landmark"; static const std::string REMOTE_PLACE_INFO_TYPE = "remote_place"; static const std::string TELEPORT_HISTORY_INFO_TYPE = "teleport_history"; @@ -388,6 +389,21 @@ void LLPanelPlaces::onOpen(const LLSD& key) // Update the buttons at the bottom of the panel updateVerbs(); } + else if (key_type == CREATE_PICK_TYPE) + { + LLUUID item_id = key["item_id"]; + + LLLandmarksPanel* landmarks_panel = + dynamic_cast(mTabContainer->getPanelByName("Landmarks")); + if (landmarks_panel && item_id.notNull()) + { + LLLandmark* landmark = LLLandmarkActions::getLandmark(item_id, boost::bind(&LLLandmarksPanel::doCreatePick, landmarks_panel, _1, item_id)); + if (landmark) + { + landmarks_panel->doCreatePick(landmark, item_id); + } + } + } else // "create_landmark" { mFilterEditor->clear(); diff --git a/indra/newview/skins/default/xui/en/menu_favorites.xml b/indra/newview/skins/default/xui/en/menu_favorites.xml index 082f2f9670..6c28032e3f 100644 --- a/indra/newview/skins/default/xui/en/menu_favorites.xml +++ b/indra/newview/skins/default/xui/en/menu_favorites.xml @@ -36,6 +36,17 @@ function="Favorites.DoToSelected" parameter="copy_slurl" /> + + + + @@ -59,10 +70,14 @@ function="Favorites.EnableSelected" parameter="can_paste" /> - - - + + + - + + + Choose a new name for [NAME] + confirm +
+ + [NAME] + +
+ width="268"> Date: Thu, 25 Feb 2021 22:41:18 +0200 Subject: SL-14916 Warn user about detailed logging slowing down model imports --- indra/newview/skins/default/xui/en/floater_model_preview.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/newview/skins/default/xui/en/floater_model_preview.xml b/indra/newview/skins/default/xui/en/floater_model_preview.xml index 02a21764ce..7f863756eb 100644 --- a/indra/newview/skins/default/xui/en/floater_model_preview.xml +++ b/indra/newview/skins/default/xui/en/floater_model_preview.xml @@ -1362,7 +1362,7 @@ top_pad="9" left="6" width="70" - label="Enable detailed logging" + label="Enable detailed logging (can be very slow)" name="verbose_logging"/> -- cgit v1.2.3 From 14826e17dccb3a12fe7551effc60a2a3c62a4946 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Thu, 25 Feb 2021 23:48:48 +0200 Subject: SL-14654 [EEP] Aplying settings locally now is instant The 1 second fade makes it harder to compare different settings. --- indra/newview/llenvironment.cpp | 25 +++++++------------------ indra/newview/llenvironment.h | 3 +-- indra/newview/llinventorybridge.cpp | 4 ++-- indra/newview/llviewermenu.cpp | 18 +++++++++--------- 4 files changed, 19 insertions(+), 31 deletions(-) diff --git a/indra/newview/llenvironment.cpp b/indra/newview/llenvironment.cpp index a1b27e48ce..90d22c57b0 100644 --- a/indra/newview/llenvironment.cpp +++ b/indra/newview/llenvironment.cpp @@ -1217,33 +1217,24 @@ void LLEnvironment::setEnvironment(LLEnvironment::EnvSelection_t env, const LLSe void LLEnvironment::setEnvironment(EnvSelection_t env, const LLUUID &assetId, S32 env_version) { - setEnvironment(env, assetId, LLSettingsDay::DEFAULT_DAYLENGTH, LLSettingsDay::DEFAULT_DAYOFFSET, TRANSITION_DEFAULT, env_version); -} - -void LLEnvironment::setEnvironment(EnvSelection_t env, const LLUUID &assetId, LLSettingsBase::Seconds transition, S32 env_version) -{ - setEnvironment(env, assetId, LLSettingsDay::DEFAULT_DAYLENGTH, LLSettingsDay::DEFAULT_DAYOFFSET, transition, env_version); + setEnvironment(env, assetId, TRANSITION_DEFAULT, env_version); } void LLEnvironment::setEnvironment(EnvSelection_t env, const LLUUID &assetId, - LLSettingsDay::Seconds daylength, - LLSettingsDay::Seconds dayoffset, LLSettingsBase::Seconds transition, S32 env_version) { LLSettingsVOBase::getSettingsAsset(assetId, - [this, env, daylength, dayoffset, env_version, transition](LLUUID asset_id, LLSettingsBase::ptr_t settings, S32 status, LLExtStat) + [this, env, env_version, transition](LLUUID asset_id, LLSettingsBase::ptr_t settings, S32 status, LLExtStat) { - onSetEnvAssetLoaded(env, asset_id, settings, daylength, dayoffset, transition, status, env_version); + onSetEnvAssetLoaded(env, asset_id, settings, transition, status, env_version); }); } void LLEnvironment::onSetEnvAssetLoaded(EnvSelection_t env, LLUUID asset_id, LLSettingsBase::ptr_t settings, - LLSettingsDay::Seconds daylength, - LLSettingsDay::Seconds dayoffset, LLSettingsBase::Seconds transition, S32 status, S32 env_version) @@ -1690,7 +1681,7 @@ void LLEnvironment::recordEnvironment(S32 parcel_id, LLEnvironment::EnvironmentI if (!envinfo->mDayCycle) { clearEnvironment(ENV_PARCEL); - setEnvironment(ENV_REGION, LLSettingsDay::GetDefaultAssetId(), LLSettingsDay::DEFAULT_DAYLENGTH, LLSettingsDay::DEFAULT_DAYOFFSET, TRANSITION_DEFAULT, envinfo->mEnvVersion); + setEnvironment(ENV_REGION, LLSettingsDay::GetDefaultAssetId(), TRANSITION_DEFAULT, envinfo->mEnvVersion); updateEnvironment(); } else if (envinfo->mDayCycle->isTrackEmpty(LLSettingsDay::TRACK_WATER) @@ -1698,7 +1689,7 @@ void LLEnvironment::recordEnvironment(S32 parcel_id, LLEnvironment::EnvironmentI { LL_WARNS("ENVIRONMENT") << "Invalid day cycle for region" << LL_ENDL; clearEnvironment(ENV_PARCEL); - setEnvironment(ENV_REGION, LLSettingsDay::GetDefaultAssetId(), LLSettingsDay::DEFAULT_DAYLENGTH, LLSettingsDay::DEFAULT_DAYOFFSET, TRANSITION_DEFAULT, envinfo->mEnvVersion); + setEnvironment(ENV_REGION, LLSettingsDay::GetDefaultAssetId(), TRANSITION_DEFAULT, envinfo->mEnvVersion); updateEnvironment(); } else @@ -2944,17 +2935,15 @@ bool LLEnvironment::loadFromSettings() if (env_data.has("day_id")) { - LLSettingsDay::Seconds length = LLSettingsDay::Seconds(env_data["day_length"].asInteger()); - LLSettingsDay::Seconds offset = LLSettingsDay::Seconds(env_data["day_offset"].asInteger()); LLUUID assetId = env_data["day_id"].asUUID(); LLSettingsVOBase::getSettingsAsset(assetId, - [this, length, offset, env_data](LLUUID asset_id, LLSettingsBase::ptr_t settings, S32 status, LLExtStat) + [this, env_data](LLUUID asset_id, LLSettingsBase::ptr_t settings, S32 status, LLExtStat) { // Day should be always applied first, // otherwise it will override sky or water that was set earlier // so wait for asset to load before applying sky/water - onSetEnvAssetLoaded(ENV_LOCAL, asset_id, settings, length, offset, TRANSITION_DEFAULT, status, NO_VERSION); + onSetEnvAssetLoaded(ENV_LOCAL, asset_id, settings, TRANSITION_DEFAULT, status, NO_VERSION); bool valid = false, has_assets = false; loadSkyWaterFromSettings(env_data, valid, has_assets); if (!has_assets && valid) diff --git a/indra/newview/llenvironment.h b/indra/newview/llenvironment.h index 5c1a62d0ab..7cbf2d25bb 100644 --- a/indra/newview/llenvironment.h +++ b/indra/newview/llenvironment.h @@ -144,7 +144,6 @@ public: void setEnvironment(EnvSelection_t env, const LLSettingsSky::ptr_t & fixed, S32 env_version = NO_VERSION) { setEnvironment(env, fixedEnvironment_t(fixed, LLSettingsWater::ptr_t()), env_version); } void setEnvironment(EnvSelection_t env, const LLSettingsWater::ptr_t & fixed, S32 env_version = NO_VERSION) { setEnvironment(env, fixedEnvironment_t(LLSettingsSky::ptr_t(), fixed), env_version); } void setEnvironment(EnvSelection_t env, const LLSettingsSky::ptr_t & fixeds, const LLSettingsWater::ptr_t & fixedw, S32 env_version = NO_VERSION) { setEnvironment(env, fixedEnvironment_t(fixeds, fixedw), env_version); } - void setEnvironment(EnvSelection_t env, const LLUUID &assetId, LLSettingsDay::Seconds daylength, LLSettingsDay::Seconds dayoffset, LLSettingsBase::Seconds transition, S32 env_version); void setEnvironment(EnvSelection_t env, const LLUUID &assetId, S32 env_version); void setEnvironment(EnvSelection_t env, const LLUUID &assetId, LLSettingsBase::Seconds transition = TRANSITION_DEFAULT, S32 env_version = NO_VERSION); @@ -435,7 +434,7 @@ private: void onAgentPositionHasChanged(const LLVector3 &localpos); - void onSetEnvAssetLoaded(EnvSelection_t env, LLUUID asset_id, LLSettingsBase::ptr_t settings, LLSettingsDay::Seconds daylength, LLSettingsDay::Seconds dayoffset, LLSettingsBase::Seconds transition, S32 status, S32 env_version); + void onSetEnvAssetLoaded(EnvSelection_t env, LLUUID asset_id, LLSettingsBase::ptr_t settings, LLSettingsBase::Seconds transition, S32 status, S32 env_version); void onUpdateParcelAssetLoaded(LLUUID asset_id, LLSettingsBase::ptr_t settings, S32 status, S32 parcel_id, S32 day_length, S32 day_offset, altitudes_vect_t altitudes); void handleEnvironmentPushClear(LLUUID experience_id, LLSD &message, F32 transition); diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 065a3cb9ae..a0c3608107 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -7064,8 +7064,8 @@ void LLSettingsBridge::performAction(LLInventoryModel* model, std::string action if (!item) return; LLUUID asset_id = item->getAssetUUID(); - LLEnvironment::instance().setEnvironment(LLEnvironment::ENV_LOCAL, asset_id, LLEnvironment::TRANSITION_FAST); - LLEnvironment::instance().setSelectedEnvironment(LLEnvironment::ENV_LOCAL, LLEnvironment::TRANSITION_FAST); + LLEnvironment::instance().setEnvironment(LLEnvironment::ENV_LOCAL, asset_id, LLEnvironment::TRANSITION_INSTANT); + LLEnvironment::instance().setSelectedEnvironment(LLEnvironment::ENV_LOCAL, LLEnvironment::TRANSITION_INSTANT); } else if ("apply_settings_parcel" == action) { diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index 7d7fdf53e2..c09654236c 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -8608,32 +8608,32 @@ class LLWorldEnvSettings : public view_listener_t if (event_name == "sunrise") { - LLEnvironment::instance().setEnvironment(LLEnvironment::ENV_LOCAL, LLEnvironment::KNOWN_SKY_SUNRISE, LLEnvironment::TRANSITION_FAST); - LLEnvironment::instance().setSelectedEnvironment(LLEnvironment::ENV_LOCAL, LLEnvironment::TRANSITION_FAST); + LLEnvironment::instance().setEnvironment(LLEnvironment::ENV_LOCAL, LLEnvironment::KNOWN_SKY_SUNRISE, LLEnvironment::TRANSITION_INSTANT); + LLEnvironment::instance().setSelectedEnvironment(LLEnvironment::ENV_LOCAL, LLEnvironment::TRANSITION_INSTANT); defocusEnvFloaters(); } else if (event_name == "noon") { - LLEnvironment::instance().setEnvironment(LLEnvironment::ENV_LOCAL, LLEnvironment::KNOWN_SKY_MIDDAY, LLEnvironment::TRANSITION_FAST); - LLEnvironment::instance().setSelectedEnvironment(LLEnvironment::ENV_LOCAL, LLEnvironment::TRANSITION_FAST); + LLEnvironment::instance().setEnvironment(LLEnvironment::ENV_LOCAL, LLEnvironment::KNOWN_SKY_MIDDAY, LLEnvironment::TRANSITION_INSTANT); + LLEnvironment::instance().setSelectedEnvironment(LLEnvironment::ENV_LOCAL, LLEnvironment::TRANSITION_INSTANT); defocusEnvFloaters(); } else if (event_name == "sunset") { - LLEnvironment::instance().setEnvironment(LLEnvironment::ENV_LOCAL, LLEnvironment::KNOWN_SKY_SUNSET, LLEnvironment::TRANSITION_FAST); - LLEnvironment::instance().setSelectedEnvironment(LLEnvironment::ENV_LOCAL, LLEnvironment::TRANSITION_FAST); + LLEnvironment::instance().setEnvironment(LLEnvironment::ENV_LOCAL, LLEnvironment::KNOWN_SKY_SUNSET, LLEnvironment::TRANSITION_INSTANT); + LLEnvironment::instance().setSelectedEnvironment(LLEnvironment::ENV_LOCAL, LLEnvironment::TRANSITION_INSTANT); defocusEnvFloaters(); } else if (event_name == "midnight") { - LLEnvironment::instance().setEnvironment(LLEnvironment::ENV_LOCAL, LLEnvironment::KNOWN_SKY_MIDNIGHT, LLEnvironment::TRANSITION_FAST); - LLEnvironment::instance().setSelectedEnvironment(LLEnvironment::ENV_LOCAL, LLEnvironment::TRANSITION_FAST); + LLEnvironment::instance().setEnvironment(LLEnvironment::ENV_LOCAL, LLEnvironment::KNOWN_SKY_MIDNIGHT, LLEnvironment::TRANSITION_INSTANT); + LLEnvironment::instance().setSelectedEnvironment(LLEnvironment::ENV_LOCAL, LLEnvironment::TRANSITION_INSTANT); defocusEnvFloaters(); } else if (event_name == "region") { LLEnvironment::instance().clearEnvironment(LLEnvironment::ENV_LOCAL); - LLEnvironment::instance().setSelectedEnvironment(LLEnvironment::ENV_LOCAL, LLEnvironment::TRANSITION_FAST); + LLEnvironment::instance().setSelectedEnvironment(LLEnvironment::ENV_LOCAL, LLEnvironment::TRANSITION_INSTANT); defocusEnvFloaters(); } else if (event_name == "pause_clouds") -- cgit v1.2.3 From 34b971150835872eb04fcd08af6f485601c79b54 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Fri, 26 Feb 2021 19:44:58 +0200 Subject: SL-14725 Adjust "Show Beacon" position --- .../skins/default/xui/en/floater_fixedenvironment.xml | 2 +- .../default/xui/en/panel_settings_sky_sunmoon.xml | 18 +++++++++--------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/indra/newview/skins/default/xui/en/floater_fixedenvironment.xml b/indra/newview/skins/default/xui/en/floater_fixedenvironment.xml index 37c56d3235..a6e20880a9 100644 --- a/indra/newview/skins/default/xui/en/floater_fixedenvironment.xml +++ b/indra/newview/skins/default/xui/en/floater_fixedenvironment.xml @@ -89,7 +89,7 @@ follows="left|top|right|bottom" auto_resize="false" user_resize="false" - height="35" + height="29" visible="true"> + name="sunbeacon" + top_pad="5" + left_delta="-8"/> + top_pad="5" + left_delta="-8"/> -- cgit v1.2.3 From 4a2f7c82cc6c9628f6be6b4e322b172478d65b9c Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Fri, 26 Feb 2021 21:38:13 +0200 Subject: SL-14612 Wording improvement for hitting TP throttle Teleport uses teleport_strings.xml, updating noifications.xml as well in case it can be triggered by server directly. --- indra/newview/skins/default/xui/en/notifications.xml | 5 ++--- indra/newview/skins/default/xui/en/teleport_strings.xml | 3 +-- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml index 23bf3191ae..cdde9d2107 100644 --- a/indra/newview/skins/default/xui/en/notifications.xml +++ b/indra/newview/skins/default/xui/en/notifications.xml @@ -2431,9 +2431,8 @@ Teleport failed. icon="alertmodal.tga" name="invalid_tport" type="alertmodal"> -Problem encountered processing your teleport request. You may need to log back in before you can teleport. -If you continue to get this message, please check the [SUPPORT_SITE]. - fail +Teleport attempts are limited to 6 per minute. If you are having trouble, wait one minute and try teleporting again. If the problem persists, log out and log in again. + fail
- Problem encountered processing your teleport request. You may need to log back in before you can teleport. -If you continue to get this message, please check the [SUPPORT_SITE]. + Teleport attempts are limited to 6 per minute. If you are having trouble, wait one minute and try teleporting again. If the problem persists, log out and log in again. Problem encountered processing your region crossing. You may need to log back in before you can cross regions. -- cgit v1.2.3 From dd89dec893411c22d4916de14593a56f87d3a284 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Mon, 1 Mar 2021 21:38:46 +0000 Subject: SL-14862 - more types of UI usage logs --- indra/llui/llbutton.cpp | 8 ++++++++ indra/llui/lluictrl.cpp | 1 + indra/llui/lluiusage.cpp | 12 ++++++++++++ indra/llui/lluiusage.h | 2 ++ indra/newview/llchatbar.cpp | 3 +++ indra/newview/llfloaterimnearbychat.cpp | 2 ++ indra/newview/llworldmipmap.cpp | 2 ++ 7 files changed, 30 insertions(+) diff --git a/indra/llui/llbutton.cpp b/indra/llui/llbutton.cpp index 9682c3bc10..3a3d9254fd 100644 --- a/indra/llui/llbutton.cpp +++ b/indra/llui/llbutton.cpp @@ -47,6 +47,7 @@ #include "llnotificationsutil.h" #include "llrender.h" #include "lluictrlfactory.h" +#include "lluiusage.h" #include "llhelp.h" #include "lldockablefloater.h" #include "llviewereventrecorder.h" @@ -437,6 +438,13 @@ BOOL LLButton::handleMouseDown(S32 x, S32 y, MASK mask) setFocus(TRUE); } + if (!mFunctionName.empty()) + { + LL_DEBUGS("UIUsage") << "calling mouse down function " << mFunctionName << LL_ENDL; + LLUIUsage::instance().logCommand(mFunctionName); + LLUIUsage::instance().logWidget(getPathname()); + } + /* * ATTENTION! This call fires another mouse down callback. * If you wish to remove this call emit that signal directly diff --git a/indra/llui/lluictrl.cpp b/indra/llui/lluictrl.cpp index 0e1c8439ea..426c931d07 100644 --- a/indra/llui/lluictrl.cpp +++ b/indra/llui/lluictrl.cpp @@ -429,6 +429,7 @@ void LLUICtrl::onCommit() { LL_DEBUGS("UIUsage") << "calling commit function " << mFunctionName << LL_ENDL; LLUIUsage::instance().logCommand(mFunctionName); + LLUIUsage::instance().logWidget(getPathname()); } else { diff --git a/indra/llui/lluiusage.cpp b/indra/llui/lluiusage.cpp index 50eeccd214..99de4ff78a 100644 --- a/indra/llui/lluiusage.cpp +++ b/indra/llui/lluiusage.cpp @@ -47,11 +47,19 @@ std::string LLUIUsage::sanitized(const std::string& s) void LLUIUsage::logFloater(const std::string& floater) { mFloaterCounts[sanitized(floater)]++; + LL_DEBUGS("UIUsage") << "floater " << floater << LL_ENDL; } void LLUIUsage::logCommand(const std::string& command) { mCommandCounts[sanitized(command)]++; + LL_DEBUGS("UIUsage") << "command " << command << LL_ENDL; +} + +void LLUIUsage::logWidget(const std::string& w) +{ + mWidgetCounts[sanitized(w)]++; + LL_DEBUGS("UIUsage") << "widget " << w << LL_ENDL; } LLSD LLUIUsage::asLLSD() const @@ -65,6 +73,10 @@ LLSD LLUIUsage::asLLSD() const { result["commands"][it.first] = LLSD::Integer(it.second); } + for (auto const& it : mWidgetCounts) + { + result["widgets"][it.first] = LLSD::Integer(it.second); + } return result; } diff --git a/indra/llui/lluiusage.h b/indra/llui/lluiusage.h index bac607aa60..efc8bb4032 100644 --- a/indra/llui/lluiusage.h +++ b/indra/llui/lluiusage.h @@ -41,10 +41,12 @@ public: static std::string sanitized(const std::string& s); void logFloater(const std::string& floater); void logCommand(const std::string& command); + void logWidget(const std::string& w); LLSD asLLSD() const; private: std::map mFloaterCounts; std::map mCommandCounts; + std::map mWidgetCounts; }; #endif // LLUIUIUSAGE.h diff --git a/indra/newview/llchatbar.cpp b/indra/newview/llchatbar.cpp index 3ab5c669c4..e400609a74 100644 --- a/indra/newview/llchatbar.cpp +++ b/indra/newview/llchatbar.cpp @@ -58,6 +58,7 @@ #include "llmultigesture.h" #include "llui.h" #include "lluictrlfactory.h" +#include "lluiusage.h" // // Globals @@ -566,6 +567,8 @@ void LLChatBar::sendChatFromViewer(const LLWString &wtext, EChatType type, BOOL // as soon as we say something, we no longer care about teaching the user // how to chat gWarningSettings.setBOOL("FirstOtherChatBeforeUser", FALSE); + + LLUIUsage::instance().logCommand("Chat.Send"); // Pseudo-command // Look for "/20 foo" channel chats. S32 channel = 0; diff --git a/indra/newview/llfloaterimnearbychat.cpp b/indra/newview/llfloaterimnearbychat.cpp index a6531ed7e1..3a850d4b68 100644 --- a/indra/newview/llfloaterimnearbychat.cpp +++ b/indra/newview/llfloaterimnearbychat.cpp @@ -67,6 +67,7 @@ #include "llviewerchat.h" #include "lltranslate.h" #include "llautoreplace.h" +#include "lluiusage.h" S32 LLFloaterIMNearbyChat::sLastSpecialChatChannel = 0; @@ -697,6 +698,7 @@ void LLFloaterIMNearbyChat::sendChatFromViewer(const std::string &utf8text, ECha void LLFloaterIMNearbyChat::sendChatFromViewer(const LLWString &wtext, EChatType type, BOOL animate) { + LLUIUsage::instance().logCommand("Chat.Send"); // pseuo-command // Look for "/20 foo" channel chats. S32 channel = 0; LLWString out_text = stripChannelNumber(wtext, &channel); diff --git a/indra/newview/llworldmipmap.cpp b/indra/newview/llworldmipmap.cpp index a2e519a61a..040d0deaf3 100644 --- a/indra/newview/llworldmipmap.cpp +++ b/indra/newview/llworldmipmap.cpp @@ -190,6 +190,8 @@ LLPointer LLWorldMipmap::loadObjectsTile(U32 grid_x, U32 //LL_INFOS("WorldMap") << "LLWorldMipmap::loadObjectsTile(), URL = " << imageurl << LL_ENDL; LLPointer img = LLViewerTextureManager::getFetchedTextureFromUrl(imageurl, FTT_MAP_TILE, TRUE, LLGLTexture::BOOST_NONE, LLViewerTexture::LOD_TEXTURE); + LL_INFOS("MAPURL") << "fetching map tile from " << imageurl << LL_ENDL; + img->setBoostLevel(LLGLTexture::BOOST_MAP); // Return the smart pointer -- cgit v1.2.3 From c06f43adde3aeb87a1510583b6f35b9327598408 Mon Sep 17 00:00:00 2001 From: Mnikolenko Productengine Date: Fri, 5 Mar 2021 16:50:41 +0200 Subject: SL-14931 Change messaging on empty lists in People floater --- indra/newview/llfloaterhandler.cpp | 9 ++++++++- indra/newview/llpanelpeople.cpp | 1 + indra/newview/skins/default/xui/en/panel_people.xml | 18 +++++++++++++----- 3 files changed, 22 insertions(+), 6 deletions(-) diff --git a/indra/newview/llfloaterhandler.cpp b/indra/newview/llfloaterhandler.cpp index e2160498e9..8ebb14149c 100644 --- a/indra/newview/llfloaterhandler.cpp +++ b/indra/newview/llfloaterhandler.cpp @@ -26,6 +26,7 @@ #include "llfloater.h" #include "llmediactrl.h" +#include "llfloaterreg.h" // register with dispatch via global object LLFloaterHandler gFloaterHandler; @@ -50,9 +51,15 @@ LLFloater* get_parent_floater(LLView* view) bool LLFloaterHandler::handle(const LLSD ¶ms, const LLSD &query_map, LLMediaCtrl *web) { - if (params.size() < 2) return false; + if (params.size() < 1) return false; LLFloater* floater = NULL; // *TODO: implement floater lookup by name + + if (params[0].asString() == "destinations") + { + LLFloaterReg::toggleInstanceOrBringToFront("destinations"); + return true; + } if (params[0].asString() == "self") { if (web) diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp index e5142f2b5f..5997d522c4 100644 --- a/indra/newview/llpanelpeople.cpp +++ b/indra/newview/llpanelpeople.cpp @@ -661,6 +661,7 @@ BOOL LLPanelPeople::postBuild() mRecentList->setShowIcons("RecentListShowIcons"); mGroupList = getChild("group_list"); + mGroupList->setNoItemsCommentText(getString("no_groups_msg")); mGroupList->setNoItemsMsg(getString("no_groups_msg")); mGroupList->setNoFilteredItemsMsg(getString("no_filtered_groups_msg")); diff --git a/indra/newview/skins/default/xui/en/panel_people.xml b/indra/newview/skins/default/xui/en/panel_people.xml index c4248d9b92..3c8a2fe4f4 100644 --- a/indra/newview/skins/default/xui/en/panel_people.xml +++ b/indra/newview/skins/default/xui/en/panel_people.xml @@ -12,7 +12,7 @@ width="333"> + value="No recent people." /> @@ -30,8 +30,13 @@ value="No friends" /> - Find friends using [secondlife:///app/search/people Search] or right-click on a Resident to add them as a friend. -Looking for people to hang out with? Try the [secondlife:///app/worldmap World Map]. + To add someone as a friend, right-click on their avatar or their name. + +Looking for places with more people? + +[secondlife:///app/floater/destinations Destination Guide] has locations chosen by Second Life staff. + +[secondlife:///app/search/people Search] lets you search all of Second Life for certain keywords. @@ -45,8 +50,11 @@ Looking for people to hang out with? Try the [secondlife:///app/worldmap World M name="no_filtered_groups_msg" value="Didn't find what you're looking for? Try [secondlife:///app/search/groups/[SEARCH_TERM] Search]." /> + name="no_groups_msg"> +You are not a member of any groups. + +Learn about [https://community.secondlife.com/knowledgebase/joining-and-participating-in-groups-r51/ groups in Second Life.] + -- cgit v1.2.3 From 446253df44dd82a7c5e711b9a69369cbbeb2acb7 Mon Sep 17 00:00:00 2001 From: Mnikolenko Productengine Date: Wed, 10 Mar 2021 17:54:44 +0200 Subject: SL-14901 Updated button according to new spec --- indra/newview/llfavoritesbar.cpp | 2 +- .../skins/default/textures/navbar/Landmarks.png | Bin 0 -> 15870 bytes indra/newview/skins/default/textures/textures.xml | 4 +++- .../skins/default/xui/en/panel_navigation_bar.xml | 21 ++++++++++----------- 4 files changed, 14 insertions(+), 13 deletions(-) create mode 100644 indra/newview/skins/default/textures/navbar/Landmarks.png diff --git a/indra/newview/llfavoritesbar.cpp b/indra/newview/llfavoritesbar.cpp index 3bebe6fc59..2394a763ee 100644 --- a/indra/newview/llfavoritesbar.cpp +++ b/indra/newview/llfavoritesbar.cpp @@ -838,7 +838,7 @@ void LLFavoritesBarCtrl::updateButtons() int j = first_changed_item_index; for (; j < mItems.size(); j++) { - last_new_button = createButton(mItems[j], button_params, j == 0? last_right_edge + 4 : last_right_edge); + last_new_button = createButton(mItems[j], button_params, last_right_edge); if (!last_new_button) { break; diff --git a/indra/newview/skins/default/textures/navbar/Landmarks.png b/indra/newview/skins/default/textures/navbar/Landmarks.png new file mode 100644 index 0000000000..2b35de913b Binary files /dev/null and b/indra/newview/skins/default/textures/navbar/Landmarks.png differ diff --git a/indra/newview/skins/default/textures/textures.xml b/indra/newview/skins/default/textures/textures.xml index 8d609afeae..03878d9fe7 100644 --- a/indra/newview/skins/default/textures/textures.xml +++ b/indra/newview/skins/default/textures/textures.xml @@ -339,7 +339,9 @@ with the same filename but different name - + + + diff --git a/indra/newview/skins/default/xui/en/panel_navigation_bar.xml b/indra/newview/skins/default/xui/en/panel_navigation_bar.xml index 4cc05fedc9..d3448ed0ba 100644 --- a/indra/newview/skins/default/xui/en/panel_navigation_bar.xml +++ b/indra/newview/skins/default/xui/en/panel_navigation_bar.xml @@ -151,32 +151,31 @@ layout="topleft" auto_resize="true" user_resize="true" - min_width="242" + min_width="254" name="favorites_layout_panel" - width="320"> + width="342"> Date: Wed, 10 Mar 2021 16:23:20 +0000 Subject: SL-14862 - use nested LLSD for widget info, condensed to the two leaf-most elements of the path. Simplified floater logging. --- indra/llui/llfloater.cpp | 2 ++ indra/llui/llfloaterreg.cpp | 8 -------- indra/llui/lluiusage.cpp | 33 ++++++++++++++++++++++++++++++++- indra/llui/lluiusage.h | 1 + indra/newview/llviewermessage.cpp | 1 - 5 files changed, 35 insertions(+), 10 deletions(-) diff --git a/indra/llui/llfloater.cpp b/indra/llui/llfloater.cpp index e9c980ad9a..c03b024dd5 100644 --- a/indra/llui/llfloater.cpp +++ b/indra/llui/llfloater.cpp @@ -58,6 +58,7 @@ #include "llhelp.h" #include "llmultifloater.h" #include "llsdutil.h" +#include "lluiusage.h" #include @@ -1631,6 +1632,7 @@ void LLFloater::bringToFront( S32 x, S32 y ) // virtual void LLFloater::setVisibleAndFrontmost(BOOL take_focus,const LLSD& key) { + LLUIUsage::instance().logFloater(getInstanceName()); LLMultiFloater* hostp = getHost(); if (hostp) { diff --git a/indra/llui/llfloaterreg.cpp b/indra/llui/llfloaterreg.cpp index 6307bf1028..7c0933f554 100644 --- a/indra/llui/llfloaterreg.cpp +++ b/indra/llui/llfloaterreg.cpp @@ -244,8 +244,6 @@ LLFloaterReg::const_instance_list_t& LLFloaterReg::getFloaterList(const std::str //static LLFloater* LLFloaterReg::showInstance(const std::string& name, const LLSD& key, BOOL focus) { - LL_DEBUGS("UIUsage") << "floater showInstance " << name << LL_ENDL; - LLUIUsage::instance().logFloater(name); if( sBlockShowFloaters // see EXT-7090 && sAlwaysShowableList.find(name) == sAlwaysShowableList.end()) @@ -276,9 +274,6 @@ bool LLFloaterReg::hideInstance(const std::string& name, const LLSD& key) // returns true if the instance is visible when completed bool LLFloaterReg::toggleInstance(const std::string& name, const LLSD& key) { - LL_DEBUGS("UIUsage") << "floater toggleInstance " << name << LL_ENDL; - LLUIUsage::instance().logFloater(name); - LLFloater* instance = findInstance(name, key); if (LLFloater::isShown(instance)) { @@ -478,9 +473,6 @@ void LLFloaterReg::toggleInstanceOrBringToFront(const LLSD& sdname, const LLSD& std::string name = sdname.asString(); LLFloater* instance = getInstance(name, key); - - LL_DEBUGS("UIUsage") << "floater toggleInstanceOrBringToFront " << name << LL_ENDL; - LLUIUsage::instance().logFloater(name); if (!instance) { LL_DEBUGS() << "Unable to get instance of floater '" << name << "'" << LL_ENDL; diff --git a/indra/llui/lluiusage.cpp b/indra/llui/lluiusage.cpp index 99de4ff78a..824c59730b 100644 --- a/indra/llui/lluiusage.cpp +++ b/indra/llui/lluiusage.cpp @@ -26,6 +26,7 @@ #include "linden_common.h" #include "lluiusage.h" +#include LLUIUsage::LLUIUsage() { @@ -41,9 +42,39 @@ std::string LLUIUsage::sanitized(const std::string& s) // ViewerStats db doesn't like "." in keys std::string result(s); std::replace(result.begin(), result.end(), '.', '_'); + std::replace(result.begin(), result.end(), ' ', '_'); return result; } +void LLUIUsage::setLLSDNested(LLSD& sd, const std::string& path, S32 max_elts, S32 val) const +{ + std::vector fields; + boost::split(fields, path, boost::is_any_of("/")); + auto first_pos = std::max(fields.begin(), fields.end() - max_elts); + auto end_pos = fields.end(); + std::vector last_fields(first_pos,end_pos); + + // Code below is just to accomplish the equivalent of + // sd[last_fields[0]][last_fields[1]] = LLSD::Integer(val); + // for an arbitrary number of fields. + LLSD* fsd = &sd; + for (auto it=last_fields.begin(); it!=last_fields.end(); ++it) + { + if (it == last_fields.end()-1) + { + (*fsd)[*it] = LLSD::Integer(val); + } + else + { + if (!(*fsd)[*it].isMap()) + { + (*fsd)[*it] = LLSD::emptyMap(); + } + fsd = &(*fsd)[*it]; + } + } +} + void LLUIUsage::logFloater(const std::string& floater) { mFloaterCounts[sanitized(floater)]++; @@ -75,7 +106,7 @@ LLSD LLUIUsage::asLLSD() const } for (auto const& it : mWidgetCounts) { - result["widgets"][it.first] = LLSD::Integer(it.second); + setLLSDNested(result["widgets"], it.first, 2, it.second); } return result; } diff --git a/indra/llui/lluiusage.h b/indra/llui/lluiusage.h index efc8bb4032..956e184edc 100644 --- a/indra/llui/lluiusage.h +++ b/indra/llui/lluiusage.h @@ -39,6 +39,7 @@ public: ~LLUIUsage(); public: static std::string sanitized(const std::string& s); + void setLLSDNested(LLSD& sd, const std::string& path, S32 max_elts, S32 val) const; void logFloater(const std::string& floater); void logCommand(const std::string& command); void logWidget(const std::string& w); diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index 458fc3b13d..0d1b074743 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -116,7 +116,6 @@ #include "llviewerregion.h" #include "llfloaterregionrestarting.h" -#include // #include #include "llnotificationmanager.h" // -- cgit v1.2.3 From 92a17bf53b33050402c292c22614b361dba0e292 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Wed, 10 Mar 2021 17:49:06 +0000 Subject: SL-14862 - tab logging --- indra/llui/lltabcontainer.cpp | 3 +++ indra/llui/lluiusage.cpp | 27 ++++++++++++++++++++++++--- indra/llui/lluiusage.h | 7 +++++-- indra/newview/llstartup.cpp | 3 +++ 4 files changed, 35 insertions(+), 5 deletions(-) diff --git a/indra/llui/lltabcontainer.cpp b/indra/llui/lltabcontainer.cpp index e6b43da8e5..459fdcf2ae 100644 --- a/indra/llui/lltabcontainer.cpp +++ b/indra/llui/lltabcontainer.cpp @@ -38,6 +38,7 @@ #include "llrender.h" #include "llfloater.h" #include "lltrans.h" +#include "lluiusage.h" //---------------------------------------------------------------------------- @@ -1556,6 +1557,8 @@ BOOL LLTabContainer::setTab(S32 which) if (is_selected) { + LLUIUsage::instance().logPanel(tuple->mTabPanel->getName()); + // Make sure selected tab is within scroll region if (mIsVertical) { diff --git a/indra/llui/lluiusage.cpp b/indra/llui/lluiusage.cpp index 824c59730b..c0d945438f 100644 --- a/indra/llui/lluiusage.cpp +++ b/indra/llui/lluiusage.cpp @@ -75,16 +75,22 @@ void LLUIUsage::setLLSDNested(LLSD& sd, const std::string& path, S32 max_elts, S } } +void LLUIUsage::logCommand(const std::string& command) +{ + mCommandCounts[sanitized(command)]++; + LL_DEBUGS("UIUsage") << "command " << command << LL_ENDL; +} + void LLUIUsage::logFloater(const std::string& floater) { mFloaterCounts[sanitized(floater)]++; LL_DEBUGS("UIUsage") << "floater " << floater << LL_ENDL; } -void LLUIUsage::logCommand(const std::string& command) +void LLUIUsage::logPanel(const std::string& p) { - mCommandCounts[sanitized(command)]++; - LL_DEBUGS("UIUsage") << "command " << command << LL_ENDL; + mPanelCounts[sanitized(p)]++; + LL_DEBUGS("UIUsage") << "panel " << p << LL_ENDL; } void LLUIUsage::logWidget(const std::string& w) @@ -104,6 +110,10 @@ LLSD LLUIUsage::asLLSD() const { result["commands"][it.first] = LLSD::Integer(it.second); } + for (auto const& it : mPanelCounts) + { + result["panels"][it.first] = LLSD::Integer(it.second); + } for (auto const& it : mWidgetCounts) { setLLSDNested(result["widgets"], it.first, 2, it.second); @@ -111,3 +121,14 @@ LLSD LLUIUsage::asLLSD() const return result; } +// Clear up some junk content generated during initial login/UI initialization +void LLUIUsage::clear() +{ + + LL_DEBUGS("UIUsage") << "clear" << LL_ENDL; + mCommandCounts.clear(); + mFloaterCounts.clear(); + mPanelCounts.clear(); + mWidgetCounts.clear(); +} + diff --git a/indra/llui/lluiusage.h b/indra/llui/lluiusage.h index 956e184edc..df7360c210 100644 --- a/indra/llui/lluiusage.h +++ b/indra/llui/lluiusage.h @@ -40,13 +40,16 @@ public: public: static std::string sanitized(const std::string& s); void setLLSDNested(LLSD& sd, const std::string& path, S32 max_elts, S32 val) const; - void logFloater(const std::string& floater); void logCommand(const std::string& command); + void logFloater(const std::string& floater); + void logPanel(const std::string& p); void logWidget(const std::string& w); LLSD asLLSD() const; + void clear(); private: - std::map mFloaterCounts; std::map mCommandCounts; + std::map mFloaterCounts; + std::map mPanelCounts; std::map mWidgetCounts; }; diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp index 17777c3ceb..b458582fa8 100644 --- a/indra/newview/llstartup.cpp +++ b/indra/newview/llstartup.cpp @@ -142,6 +142,7 @@ #include "lltoolmgr.h" #include "lltrans.h" #include "llui.h" +#include "lluiusage.h" #include "llurldispatcher.h" #include "llurlentry.h" #include "llslurl.h" @@ -2257,6 +2258,8 @@ bool idle_startup() gAgentAvatarp->sendHoverHeight(); + LLUIUsage::instance().clear(); + return TRUE; } -- cgit v1.2.3 From e3babd1f8d6d5347f9cf1ec5fee976718e0c6a44 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Thu, 11 Mar 2021 14:26:36 +0000 Subject: SL-14862 - more generalized LLSD funcs --- indra/llui/lluiusage.cpp | 26 ++++++++++++++++++-------- indra/llui/lluiusage.h | 3 ++- 2 files changed, 20 insertions(+), 9 deletions(-) diff --git a/indra/llui/lluiusage.cpp b/indra/llui/lluiusage.cpp index c0d945438f..60c124b711 100644 --- a/indra/llui/lluiusage.cpp +++ b/indra/llui/lluiusage.cpp @@ -46,23 +46,33 @@ std::string LLUIUsage::sanitized(const std::string& s) return result; } -void LLUIUsage::setLLSDNested(LLSD& sd, const std::string& path, S32 max_elts, S32 val) const +// static +void LLUIUsage::setLLSDPath(LLSD& sd, const std::string& path, S32 max_elts, const LLSD& val) { + // Keep the last max_elts components of the specified path std::vector fields; boost::split(fields, path, boost::is_any_of("/")); auto first_pos = std::max(fields.begin(), fields.end() - max_elts); auto end_pos = fields.end(); std::vector last_fields(first_pos,end_pos); - // Code below is just to accomplish the equivalent of - // sd[last_fields[0]][last_fields[1]] = LLSD::Integer(val); - // for an arbitrary number of fields. + setLLSDNested(sd, last_fields, val); +} + +// setLLSDNested +// Accomplish the equivalent of +// sd[fields[0]][fields[1]]... = val; +// for an arbitrary number of fields. +// +// static +void LLUIUsage::setLLSDNested(LLSD& sd, const std::vector& fields, const LLSD& val) +{ LLSD* fsd = &sd; - for (auto it=last_fields.begin(); it!=last_fields.end(); ++it) + for (auto it=fields.begin(); it!=fields.end(); ++it) { - if (it == last_fields.end()-1) + if (it == fields.end()-1) { - (*fsd)[*it] = LLSD::Integer(val); + (*fsd)[*it] = val; } else { @@ -116,7 +126,7 @@ LLSD LLUIUsage::asLLSD() const } for (auto const& it : mWidgetCounts) { - setLLSDNested(result["widgets"], it.first, 2, it.second); + setLLSDPath(result["widgets"], it.first, 2, LLSD::Integer(it.second)); } return result; } diff --git a/indra/llui/lluiusage.h b/indra/llui/lluiusage.h index df7360c210..e642c55e0f 100644 --- a/indra/llui/lluiusage.h +++ b/indra/llui/lluiusage.h @@ -39,7 +39,8 @@ public: ~LLUIUsage(); public: static std::string sanitized(const std::string& s); - void setLLSDNested(LLSD& sd, const std::string& path, S32 max_elts, S32 val) const; + static void setLLSDPath(LLSD& sd, const std::string& path, S32 max_elts, const LLSD& val); + static void setLLSDNested(LLSD& sd, const std::vector& fields, const LLSD& val); void logCommand(const std::string& command); void logFloater(const std::string& floater); void logPanel(const std::string& p); -- cgit v1.2.3 From acb2e87d9425c8f671d9772409fd291d7fed9aa7 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Thu, 11 Mar 2021 15:11:51 +0000 Subject: SL-14862 - renamed widgets to the more descriptive controls --- indra/llui/llbutton.cpp | 2 +- indra/llui/lluictrl.cpp | 2 +- indra/llui/lluiusage.cpp | 36 +++++++++++++++++++----------------- indra/llui/lluiusage.h | 4 ++-- 4 files changed, 23 insertions(+), 21 deletions(-) diff --git a/indra/llui/llbutton.cpp b/indra/llui/llbutton.cpp index 3a3d9254fd..0e59fdf519 100644 --- a/indra/llui/llbutton.cpp +++ b/indra/llui/llbutton.cpp @@ -442,7 +442,7 @@ BOOL LLButton::handleMouseDown(S32 x, S32 y, MASK mask) { LL_DEBUGS("UIUsage") << "calling mouse down function " << mFunctionName << LL_ENDL; LLUIUsage::instance().logCommand(mFunctionName); - LLUIUsage::instance().logWidget(getPathname()); + LLUIUsage::instance().logControl(getPathname()); } /* diff --git a/indra/llui/lluictrl.cpp b/indra/llui/lluictrl.cpp index 426c931d07..5924542a19 100644 --- a/indra/llui/lluictrl.cpp +++ b/indra/llui/lluictrl.cpp @@ -429,7 +429,7 @@ void LLUICtrl::onCommit() { LL_DEBUGS("UIUsage") << "calling commit function " << mFunctionName << LL_ENDL; LLUIUsage::instance().logCommand(mFunctionName); - LLUIUsage::instance().logWidget(getPathname()); + LLUIUsage::instance().logControl(getPathname()); } else { diff --git a/indra/llui/lluiusage.cpp b/indra/llui/lluiusage.cpp index 60c124b711..ccae6643b9 100644 --- a/indra/llui/lluiusage.cpp +++ b/indra/llui/lluiusage.cpp @@ -39,7 +39,7 @@ LLUIUsage::~LLUIUsage() // static std::string LLUIUsage::sanitized(const std::string& s) { - // ViewerStats db doesn't like "." in keys + // Remove characters that make the ViewerStats db unhappy std::string result(s); std::replace(result.begin(), result.end(), '.', '_'); std::replace(result.begin(), result.end(), ' ', '_'); @@ -59,10 +59,11 @@ void LLUIUsage::setLLSDPath(LLSD& sd, const std::string& path, S32 max_elts, con setLLSDNested(sd, last_fields, val); } -// setLLSDNested +// setLLSDNested() // Accomplish the equivalent of // sd[fields[0]][fields[1]]... = val; // for an arbitrary number of fields. +// This might be useful as an LLSD utility function; is not specific to LLUIUsage // // static void LLUIUsage::setLLSDNested(LLSD& sd, const std::vector& fields, const LLSD& val) @@ -91,6 +92,13 @@ void LLUIUsage::logCommand(const std::string& command) LL_DEBUGS("UIUsage") << "command " << command << LL_ENDL; } +void LLUIUsage::logControl(const std::string& control) +{ + mControlCounts[sanitized(control)]++; + LL_DEBUGS("UIUsage") << "control " << control << LL_ENDL; +} + + void LLUIUsage::logFloater(const std::string& floater) { mFloaterCounts[sanitized(floater)]++; @@ -103,30 +111,24 @@ void LLUIUsage::logPanel(const std::string& p) LL_DEBUGS("UIUsage") << "panel " << p << LL_ENDL; } -void LLUIUsage::logWidget(const std::string& w) -{ - mWidgetCounts[sanitized(w)]++; - LL_DEBUGS("UIUsage") << "widget " << w << LL_ENDL; -} - LLSD LLUIUsage::asLLSD() const { LLSD result; - for (auto const& it : mFloaterCounts) - { - result["floaters"][it.first] = LLSD::Integer(it.second); - } for (auto const& it : mCommandCounts) { result["commands"][it.first] = LLSD::Integer(it.second); } - for (auto const& it : mPanelCounts) + for (auto const& it : mControlCounts) { - result["panels"][it.first] = LLSD::Integer(it.second); + setLLSDPath(result["controls"], it.first, 2, LLSD::Integer(it.second)); } - for (auto const& it : mWidgetCounts) + for (auto const& it : mFloaterCounts) { - setLLSDPath(result["widgets"], it.first, 2, LLSD::Integer(it.second)); + result["floaters"][it.first] = LLSD::Integer(it.second); + } + for (auto const& it : mPanelCounts) + { + result["panels"][it.first] = LLSD::Integer(it.second); } return result; } @@ -137,8 +139,8 @@ void LLUIUsage::clear() LL_DEBUGS("UIUsage") << "clear" << LL_ENDL; mCommandCounts.clear(); + mControlCounts.clear(); mFloaterCounts.clear(); mPanelCounts.clear(); - mWidgetCounts.clear(); } diff --git a/indra/llui/lluiusage.h b/indra/llui/lluiusage.h index e642c55e0f..a30cd80db3 100644 --- a/indra/llui/lluiusage.h +++ b/indra/llui/lluiusage.h @@ -42,16 +42,16 @@ public: static void setLLSDPath(LLSD& sd, const std::string& path, S32 max_elts, const LLSD& val); static void setLLSDNested(LLSD& sd, const std::vector& fields, const LLSD& val); void logCommand(const std::string& command); + void logControl(const std::string& control); void logFloater(const std::string& floater); void logPanel(const std::string& p); - void logWidget(const std::string& w); LLSD asLLSD() const; void clear(); private: std::map mCommandCounts; + std::map mControlCounts; std::map mFloaterCounts; std::map mPanelCounts; - std::map mWidgetCounts; }; #endif // LLUIUIUSAGE.h -- cgit v1.2.3 From cdd71c5e64782b33aaf5f8caac8ef61eaa78f607 Mon Sep 17 00:00:00 2001 From: Mnikolenko Productengine Date: Tue, 16 Mar 2021 19:29:23 +0200 Subject: SL-14938 Remove Library and Inventory from Places floater --- indra/newview/llpanellandmarks.cpp | 464 +++------------------ indra/newview/llpanellandmarks.h | 57 +-- indra/newview/llpanelplaces.cpp | 22 +- .../default/xui/en/menu_places_gear_folder.xml | 3 + .../default/xui/en/menu_places_gear_sorting.xml | 3 + .../skins/default/xui/en/panel_favorites.xml | 22 + .../skins/default/xui/en/panel_landmarks.xml | 99 +---- .../newview/skins/default/xui/en/panel_places.xml | 7 +- indra/newview/skins/default/xui/en/strings.xml | 4 +- 9 files changed, 153 insertions(+), 528 deletions(-) create mode 100644 indra/newview/skins/default/xui/en/panel_favorites.xml diff --git a/indra/newview/llpanellandmarks.cpp b/indra/newview/llpanellandmarks.cpp index 9d0c8b015a..1a10654a71 100644 --- a/indra/newview/llpanellandmarks.cpp +++ b/indra/newview/llpanellandmarks.cpp @@ -36,7 +36,6 @@ #include "llregionhandle.h" #include "llaccordionctrl.h" -#include "llaccordionctrltab.h" #include "llagent.h" #include "llagentpicksinfo.h" #include "llagentui.h" @@ -60,8 +59,6 @@ // Not yet implemented; need to remove buildPanel() from constructor when we switch //static LLRegisterPanelClassWrapper t_landmarks("panel_landmarks"); -static const std::string TAB_FAVORITES = "tab_favorites"; - // helper functions static void filter_list(LLPlacesInventoryPanel* inventory_list, const std::string& string); static bool category_has_descendents(LLPlacesInventoryPanel* inventory_list); @@ -145,69 +142,37 @@ void LLOpenFolderByID::doFolder(LLFolderViewFolder* folder) } } -/** - * Bridge to support knowing when the inventory has changed to update Landmarks tab - * ShowFolderState filter setting to show all folders when the filter string is empty and - * empty folder message when Landmarks inventory category has no children. - * Ensures that "Landmarks" folder in the Library is open on strart up. - */ -class LLLandmarksPanelObserver : public LLInventoryObserver -{ -public: - LLLandmarksPanelObserver(LLLandmarksPanel* lp) - : mLP(lp), - mIsLibraryLandmarksOpen(false) - {} - virtual ~LLLandmarksPanelObserver() {} - /*virtual*/ void changed(U32 mask); - -private: - LLLandmarksPanel* mLP; - bool mIsLibraryLandmarksOpen; -}; - -void LLLandmarksPanelObserver::changed(U32 mask) +LLLandmarksPanel::LLLandmarksPanel() + : LLPanelPlacesTab() + , mLandmarksInventoryPanel(NULL) + , mCurrentSelectedList(NULL) + , mGearFolderMenu(NULL) + , mGearLandmarkMenu(NULL) + , mSortingMenu(NULL) + , mAddMenu(NULL) + , isLandmarksPanel(true) { - mLP->updateShowFolderState(); - - LLPlacesInventoryPanel* library = mLP->getLibraryInventoryPanel(); - if (!mIsLibraryLandmarksOpen && library) - { - // Search for "Landmarks" folder in the Library and open it once on start up. See EXT-4827. - const LLUUID &landmarks_cat = gInventory.findLibraryCategoryUUIDForType(LLFolderType::FT_LANDMARK, false); - if (landmarks_cat.notNull()) - { - LLOpenFolderByID opener(landmarks_cat); - library->getRootFolder()->applyFunctorRecursively(opener); - mIsLibraryLandmarksOpen = opener.isFolderOpen(); - } - } + buildFromFile("panel_landmarks.xml"); } -LLLandmarksPanel::LLLandmarksPanel() +LLLandmarksPanel::LLLandmarksPanel(bool is_landmark_panel) : LLPanelPlacesTab() - , mFavoritesInventoryPanel(NULL) , mLandmarksInventoryPanel(NULL) - , mMyInventoryPanel(NULL) - , mLibraryInventoryPanel(NULL) , mCurrentSelectedList(NULL) , mGearFolderMenu(NULL) , mGearLandmarkMenu(NULL) , mSortingMenu(NULL) , mAddMenu(NULL) + , isLandmarksPanel(is_landmark_panel) { - mInventoryObserver = new LLLandmarksPanelObserver(this); - gInventory.addObserver(mInventoryObserver); - - buildFromFile( "panel_landmarks.xml"); + if (is_landmark_panel) + { + buildFromFile("panel_landmarks.xml"); + } } LLLandmarksPanel::~LLLandmarksPanel() { - if (gInventory.containsObserver(mInventoryObserver)) - { - gInventory.removeObserver(mInventoryObserver); - } } BOOL LLLandmarksPanel::postBuild() @@ -217,17 +182,7 @@ BOOL LLLandmarksPanel::postBuild() // mast be called before any other initXXX methods to init Gear menu initListCommandsHandlers(); - - initFavoritesInventoryPanel(); initLandmarksInventoryPanel(); - initMyInventoryPanel(); - initLibraryInventoryPanel(); - - LLAccordionCtrl* accordion = getChild("landmarks_accordion"); - if (accordion) - { - accordion->setSkipScrollToChild(true); - } return TRUE; } @@ -235,30 +190,10 @@ BOOL LLLandmarksPanel::postBuild() // virtual void LLLandmarksPanel::onSearchEdit(const std::string& string) { - // give FolderView a chance to be refreshed. So, made all accordions visible - for (accordion_tabs_t::const_iterator iter = mAccordionTabs.begin(); iter != mAccordionTabs.end(); ++iter) - { - LLAccordionCtrlTab* tab = *iter; - tab->setVisible(TRUE); - - // expand accordion to see matched items in each one. See EXT-2014. - if (string != "") - { - tab->changeOpenClose(false); - } - - LLPlacesInventoryPanel* inventory_list = dynamic_cast(tab->getAccordionView()); - if (NULL == inventory_list) continue; - - filter_list(inventory_list, string); - } + filter_list(mCurrentSelectedList, string); if (sFilterSubString != string) sFilterSubString = string; - - // show all folders in Landmarks Accordion for empty filter - // only if Landmarks inventory folder is not empty - updateShowFolderState(); } // virtual @@ -349,76 +284,21 @@ LLToggleableMenu* LLLandmarksPanel::getCreateMenu() return mAddMenu; } -// virtual void LLLandmarksPanel::updateVerbs() { - if (!isTabVisible()) - return; -} - -void LLLandmarksPanel::onSelectionChange(LLPlacesInventoryPanel* inventory_list, const std::deque &items, BOOL user_action) -{ - if (user_action && (items.size() > 0)) - { - deselectOtherThan(inventory_list); - mCurrentSelectedList = inventory_list; - } - updateVerbs(); -} - -void LLLandmarksPanel::onSelectorButtonClicked() -{ - // TODO: mantipov: update getting of selected item - // TODO: bind to "i" button - LLFolderViewItem* cur_item = mFavoritesInventoryPanel->getRootFolder()->getCurSelectedItem(); - if (!cur_item) return; - - LLFolderViewModelItemInventory* listenerp = static_cast(cur_item->getViewModelItem()); - if (listenerp->getInventoryType() == LLInventoryType::IT_LANDMARK) - { - LLSD key; - key["type"] = "landmark"; - key["id"] = listenerp->getUUID(); - - LLFloaterSidePanelContainer::showPanel("places", key); - } -} - -void LLLandmarksPanel::updateShowFolderState() -{ - bool show_all_folders = mLandmarksInventoryPanel->getFilterSubString().empty(); - if (show_all_folders) - { - show_all_folders = category_has_descendents(mLandmarksInventoryPanel); - } - - mLandmarksInventoryPanel->setShowFolderState(show_all_folders ? - LLInventoryFilter::SHOW_ALL_FOLDERS : - LLInventoryFilter::SHOW_NON_EMPTY_FOLDERS - ); } void LLLandmarksPanel::setItemSelected(const LLUUID& obj_id, BOOL take_keyboard_focus) { - if (selectItemInAccordionTab(mFavoritesInventoryPanel, TAB_FAVORITES, obj_id, take_keyboard_focus)) - { - return; - } - - if (selectItemInAccordionTab(mLandmarksInventoryPanel, "tab_landmarks", obj_id, take_keyboard_focus)) - { + if (!mCurrentSelectedList) return; - } - - if (selectItemInAccordionTab(mMyInventoryPanel, "tab_inventory", obj_id, take_keyboard_focus)) - { - return; - } - if (selectItemInAccordionTab(mLibraryInventoryPanel, "tab_library", obj_id, take_keyboard_focus)) - { + LLFolderView* root = mCurrentSelectedList->getRootFolder(); + LLFolderViewItem* item = mCurrentSelectedList->getItemByID(obj_id); + if (!item) return; - } + root->setSelection(item, FALSE, take_keyboard_focus); + root->scrollToShowSelection(); } ////////////////////////////////////////////////////////////////////////// @@ -437,18 +317,6 @@ bool LLLandmarksPanel::isFolderSelected() const return current_item && (current_item->getInventoryType() == LLInventoryType::IT_CATEGORY); } -bool LLLandmarksPanel::isReceivedFolderSelected() const -{ - // Received Folder can be only in Landmarks accordion - if (mCurrentSelectedList != mLandmarksInventoryPanel) return false; - - // *TODO: it should be filled with logic when EXT-976 is done. - - LL_WARNS() << "Not implemented yet until EXT-976 is done." << LL_ENDL; - - return false; -} - void LLLandmarksPanel::doActionOnCurSelectedLandmark(LLLandmarkList::loaded_callback_t cb) { LLFolderViewModelItemInventory* cur_item = getCurSelectedViewModelItem(); @@ -478,36 +346,6 @@ LLFolderViewModelItemInventory* LLLandmarksPanel::getCurSelectedViewModelItem() } -LLFolderViewItem* LLLandmarksPanel::selectItemInAccordionTab(LLPlacesInventoryPanel* inventory_list, - const std::string& tab_name, - const LLUUID& obj_id, - BOOL take_keyboard_focus) const -{ - if (!inventory_list) - return NULL; - - LLFolderView* root = inventory_list->getRootFolder(); - - LLFolderViewItem* item = inventory_list->getItemByID(obj_id); - if (!item) - return NULL; - - LLAccordionCtrlTab* tab = getChild(tab_name); - if (!tab->isExpanded()) - { - tab->changeOpenClose(false); - } - - root->setSelection(item, FALSE, take_keyboard_focus); - - LLAccordionCtrl* accordion = getChild("landmarks_accordion"); - LLRect screen_rc; - localRectToScreen(item->getRect(), &screen_rc); - accordion->notifyParent(LLSD().with("scrollToShowRect", screen_rc.getValue())); - - return item; -} - void LLLandmarksPanel::updateSortOrder(LLInventoryPanel* panel, bool byDate) { if(!panel) return; @@ -525,8 +363,6 @@ void LLLandmarksPanel::updateSortOrder(LLInventoryPanel* panel, bool byDate) void LLLandmarksPanel::resetSelection() { - getChild(TAB_FAVORITES)->setDisplayChildren(true); - getChild(TAB_FAVORITES)->showAndFocusHeader(); } // virtual @@ -572,16 +408,6 @@ void LLLandmarksPanel::setErrorStatus(S32 status, const std::string& reason) // PRIVATE METHODS ////////////////////////////////////////////////////////////////////////// -void LLLandmarksPanel::initFavoritesInventoryPanel() -{ - mFavoritesInventoryPanel = getChild("favorites_list"); - - initLandmarksPanel(mFavoritesInventoryPanel); - mFavoritesInventoryPanel->getFilter().setEmptyLookupMessage("FavoritesNoMatchingItems"); - - initAccordion(TAB_FAVORITES, mFavoritesInventoryPanel, true); -} - void LLLandmarksPanel::initLandmarksInventoryPanel() { mLandmarksInventoryPanel = getChild("landmarks_list"); @@ -593,40 +419,13 @@ void LLLandmarksPanel::initLandmarksInventoryPanel() // subscribe to have auto-rename functionality while creating New Folder mLandmarksInventoryPanel->setSelectCallback(boost::bind(&LLInventoryPanel::onSelectionChange, mLandmarksInventoryPanel, _1, _2)); - mMyLandmarksAccordionTab = initAccordion("tab_landmarks", mLandmarksInventoryPanel, true); -} - -void LLLandmarksPanel::initMyInventoryPanel() -{ - mMyInventoryPanel= getChild("my_inventory_list"); - - initLandmarksPanel(mMyInventoryPanel); - - initAccordion("tab_inventory", mMyInventoryPanel, false); -} - -void LLLandmarksPanel::initLibraryInventoryPanel() -{ - mLibraryInventoryPanel = getChild("library_list"); - - initLandmarksPanel(mLibraryInventoryPanel); - - // We want to fetch only "Landmarks" category from the library. - const LLUUID &landmarks_cat = gInventory.findLibraryCategoryUUIDForType(LLFolderType::FT_LANDMARK, false); - if (landmarks_cat.notNull()) - { - LLInventoryModelBackgroundFetch::instance().start(landmarks_cat); - } - - // Expanding "Library" tab for new users who have no landmarks in "My Inventory". - initAccordion("tab_library", mLibraryInventoryPanel, true); + mCurrentSelectedList = mLandmarksInventoryPanel; } void LLLandmarksPanel::initLandmarksPanel(LLPlacesInventoryPanel* inventory_list) { inventory_list->getFilter().setEmptyLookupMessage("PlacesNoMatchingItems"); inventory_list->setFilterTypes(0x1 << LLInventoryType::IT_LANDMARK); - inventory_list->setSelectCallback(boost::bind(&LLLandmarksPanel::onSelectionChange, this, inventory_list, _1, _2)); inventory_list->setShowFolderState(LLInventoryFilter::SHOW_NON_EMPTY_FOLDERS); bool sorting_order = gSavedSettings.getBOOL("LandmarksSortedByDate"); @@ -644,71 +443,6 @@ void LLLandmarksPanel::initLandmarksPanel(LLPlacesInventoryPanel* inventory_list inventory_list->saveFolderState(); } -LLAccordionCtrlTab* LLLandmarksPanel::initAccordion(const std::string& accordion_tab_name, LLPlacesInventoryPanel* inventory_list, bool expand_tab) -{ - LLAccordionCtrlTab* accordion_tab = getChild(accordion_tab_name); - - mAccordionTabs.push_back(accordion_tab); - accordion_tab->setDropDownStateChangedCallback( - boost::bind(&LLLandmarksPanel::onAccordionExpandedCollapsed, this, _2, inventory_list)); - accordion_tab->setDisplayChildren(expand_tab); - return accordion_tab; -} - -void LLLandmarksPanel::onAccordionExpandedCollapsed(const LLSD& param, LLPlacesInventoryPanel* inventory_list) -{ - bool expanded = param.asBoolean(); - - if(!expanded && (mCurrentSelectedList == inventory_list)) - { - inventory_list->getRootFolder()->clearSelection(); - - mCurrentSelectedList = NULL; - updateVerbs(); - } - - // Start background fetch, mostly for My Inventory and Library - if (expanded) - { - const LLUUID &cat_id = inventory_list->getRootFolderID(); - // Just because the category itself has been fetched, doesn't mean its child folders have. - /* - if (!gInventory.isCategoryComplete(cat_id)) - */ - { - LLInventoryModelBackgroundFetch::instance().start(cat_id); - } - - // Apply filter substring because it might have been changed - // while accordion was closed. See EXT-3714. - filter_list(inventory_list, sFilterSubString); - } -} - -void LLLandmarksPanel::deselectOtherThan(const LLPlacesInventoryPanel* inventory_list) -{ - if (inventory_list != mFavoritesInventoryPanel) - { - mFavoritesInventoryPanel->clearSelection(); - mFavoritesInventoryPanel->getRootFolder()->clearSelection(); - } - - if (inventory_list != mLandmarksInventoryPanel) - { - mLandmarksInventoryPanel->clearSelection(); - mLandmarksInventoryPanel->getRootFolder()->clearSelection(); - } - if (inventory_list != mMyInventoryPanel) - { - mMyInventoryPanel->clearSelection(); - mMyInventoryPanel->getRootFolder()->clearSelection(); - } - if (inventory_list != mLibraryInventoryPanel) - { - mLibraryInventoryPanel->clearSelection(); - mLibraryInventoryPanel->getRootFolder()->clearSelection(); - } -} // List Commands Handlers void LLLandmarksPanel::initListCommandsHandlers() @@ -730,6 +464,7 @@ void LLLandmarksPanel::initListCommandsHandlers() // show menus even if all items are disabled mGearLandmarkMenu->setAlwaysShowMenu(TRUE); mGearFolderMenu->setAlwaysShowMenu(TRUE); + mAddMenu->setAlwaysShowMenu(TRUE); } void LLLandmarksPanel::updateMenuVisibility(LLUICtrl* menu) @@ -797,11 +532,6 @@ void LLLandmarksPanel::onAddAction(const LLSD& userdata) const //in case My Landmarks tab is completely empty (thus cannot be determined as being selected) menu_create_inventory_item(mLandmarksInventoryPanel, NULL, LLSD("category"), gInventory.findCategoryUUIDForType(LLFolderType::FT_LANDMARK)); - - if (mMyLandmarksAccordionTab) - { - mMyLandmarksAccordionTab->changeOpenClose(false); - } } } else if ("category_root" == command_name) @@ -809,11 +539,6 @@ void LLLandmarksPanel::onAddAction(const LLSD& userdata) const //in case My Landmarks tab is completely empty (thus cannot be determined as being selected) menu_create_inventory_item(mLandmarksInventoryPanel, NULL, LLSD("category"), gInventory.findCategoryUUIDForType(LLFolderType::FT_LANDMARK)); - - if (mMyLandmarksAccordionTab) - { - mMyLandmarksAccordionTab->changeOpenClose(false); - } } } @@ -848,27 +573,11 @@ void LLLandmarksPanel::onFoldingAction(const LLSD& userdata) if ("expand_all" == command_name) { - expand_all_folders(mFavoritesInventoryPanel->getRootFolder()); - expand_all_folders(mLandmarksInventoryPanel->getRootFolder()); - expand_all_folders(mMyInventoryPanel->getRootFolder()); - expand_all_folders(mLibraryInventoryPanel->getRootFolder()); - - for (accordion_tabs_t::const_iterator iter = mAccordionTabs.begin(); iter != mAccordionTabs.end(); ++iter) - { - (*iter)->changeOpenClose(false); - } + expand_all_folders(mCurrentSelectedList->getRootFolder()); } else if ("collapse_all" == command_name) { - collapse_all_folders(mFavoritesInventoryPanel->getRootFolder()); - collapse_all_folders(mLandmarksInventoryPanel->getRootFolder()); - collapse_all_folders(mMyInventoryPanel->getRootFolder()); - collapse_all_folders(mLibraryInventoryPanel->getRootFolder()); - - for (accordion_tabs_t::const_iterator iter = mAccordionTabs.begin(); iter != mAccordionTabs.end(); ++iter) - { - (*iter)->changeOpenClose(true); - } + collapse_all_folders(mCurrentSelectedList->getRootFolder()); } else if ("sort_by_date" == command_name) { @@ -876,8 +585,6 @@ void LLLandmarksPanel::onFoldingAction(const LLSD& userdata) sorting_order=!sorting_order; gSavedSettings.setBOOL("LandmarksSortedByDate",sorting_order); updateSortOrder(mLandmarksInventoryPanel, sorting_order); - updateSortOrder(mMyInventoryPanel, sorting_order); - updateSortOrder(mLibraryInventoryPanel, sorting_order); } else { @@ -911,49 +618,17 @@ bool LLLandmarksPanel::isActionEnabled(const LLSD& userdata) const if ("collapse_all" == command_name) { - bool disable_collapse_all = !has_expanded_folders(mFavoritesInventoryPanel->getRootFolder()) - && !has_expanded_folders(mLandmarksInventoryPanel->getRootFolder()) - && !has_expanded_folders(mMyInventoryPanel->getRootFolder()) - && !has_expanded_folders(mLibraryInventoryPanel->getRootFolder()); - if (disable_collapse_all) - { - for (accordion_tabs_t::const_iterator iter = mAccordionTabs.begin(); iter != mAccordionTabs.end(); ++iter) - { - if ((*iter)->isExpanded()) - { - disable_collapse_all = false; - break; - } - } - } - - return !disable_collapse_all; + return has_expanded_folders(mCurrentSelectedList->getRootFolder()); } else if ("expand_all" == command_name) { - bool disable_expand_all = !has_collapsed_folders(mFavoritesInventoryPanel->getRootFolder()) - && !has_collapsed_folders(mLandmarksInventoryPanel->getRootFolder()) - && !has_collapsed_folders(mMyInventoryPanel->getRootFolder()) - && !has_collapsed_folders(mLibraryInventoryPanel->getRootFolder()); - if (disable_expand_all) - { - for (accordion_tabs_t::const_iterator iter = mAccordionTabs.begin(); iter != mAccordionTabs.end(); ++iter) - { - if (!(*iter)->isExpanded()) - { - disable_expand_all = false; - break; - } - } - } - - return !disable_expand_all; + return has_collapsed_folders(mCurrentSelectedList->getRootFolder()); } else if ("sort_by_date" == command_name) { - // disable "sort_by_date" for Favorites accordion because + // disable "sort_by_date" for Favorites tab because // it has its own items order. EXT-1758 - if (mCurrentSelectedList == mFavoritesInventoryPanel) + if (!isLandmarksPanel) { return false; } @@ -970,6 +645,11 @@ bool LLLandmarksPanel::isActionEnabled(const LLSD& userdata) const std::set selected_uuids = root_folder_view->getSelectionList(); + if (selected_uuids.empty()) + { + return false; + } + // Allow to execute the command only if it can be applied to all selected items. for (std::set::const_iterator iter = selected_uuids.begin(); iter != selected_uuids.end(); ++iter) { @@ -1020,25 +700,10 @@ bool LLLandmarksPanel::isActionEnabled(const LLSD& userdata) const return true; } - if ("category_root" == command_name) + if ("category_root" == command_name || "category" == command_name) { - // Landmarks Accordion - return true; - } - else if("category" == command_name) - { - // we can add folder only in Landmarks Accordion - if (mCurrentSelectedList == mLandmarksInventoryPanel) - { - // ... but except Received folder - return !isReceivedFolderSelected(); - } - if (mCurrentSelectedList == mLibraryInventoryPanel) - { - return false; - } - //"Add a folder" is enabled by default (case when My Landmarks is empty) - return true; + // we can add folder only in Landmarks tab + return isLandmarksPanel; } else if("create_pick" == command_name) { @@ -1059,10 +724,7 @@ bool LLLandmarksPanel::isActionEnabled(const LLSD& userdata) const { return false; } - if (mCurrentSelectedList == mLibraryInventoryPanel) - { - return false; - } + LLFolderViewModelItemInventory* view_model = getCurSelectedViewModelItem(); if (!view_model || view_model->getInventoryType() != LLInventoryType::IT_CATEGORY) { @@ -1203,29 +865,17 @@ bool LLLandmarksPanel::canItemBeModified(const std::string& command_name, LLFold if (!item) return false; - // nothing can be modified in Library - if (mLibraryInventoryPanel == mCurrentSelectedList) return false; - bool can_be_modified = false; // landmarks can be modified in any other accordion... if (static_cast(item->getViewModelItem())->getInventoryType() == LLInventoryType::IT_LANDMARK) { can_be_modified = true; - - // we can modify landmarks anywhere except paste to My Inventory - if ("paste" == command_name) - { - can_be_modified = (mCurrentSelectedList != mMyInventoryPanel); - } } else { // ...folders only in the Landmarks accordion... - can_be_modified = mLandmarksInventoryPanel == mCurrentSelectedList; - - // ...except "Received" folder - can_be_modified &= !isReceivedFolderSelected(); + can_be_modified = isLandmarksPanel; } // then ask LLFolderView permissions @@ -1325,7 +975,6 @@ bool LLLandmarksPanel::handleDragAndDropToTrash(BOOL drop, EDragAndDropType carg break; } - updateVerbs(); return true; } @@ -1470,10 +1119,6 @@ static void collapse_all_folders(LLFolderView* root_folder) return; root_folder->setOpenArrangeRecursively(FALSE, LLFolderViewFolder::RECURSE_DOWN); - - // The top level folder is invisible, it must be open to - // display its sub-folders. - root_folder->openTopLevelFolders(); root_folder->arrangeAll(); } @@ -1540,4 +1185,31 @@ void toggle_restore_menu(LLMenuGL *menu, BOOL visible, BOOL enabled) } } } + +LLFavoritesPanel::LLFavoritesPanel() + : LLLandmarksPanel(false) +{ + buildFromFile("panel_favorites.xml"); +} + +BOOL LLFavoritesPanel::postBuild() +{ + if (!gInventory.isInventoryUsable()) + return FALSE; + + // mast be called before any other initXXX methods to init Gear menu + LLLandmarksPanel::initListCommandsHandlers(); + + initFavoritesInventoryPanel(); + + return TRUE; +} + +void LLFavoritesPanel::initFavoritesInventoryPanel() +{ + mCurrentSelectedList = getChild("favorites_list"); + + LLLandmarksPanel::initLandmarksPanel(mCurrentSelectedList); + mCurrentSelectedList->getFilter().setEmptyLookupMessage("FavoritesNoMatchingItems"); +} // EOF diff --git a/indra/newview/llpanellandmarks.h b/indra/newview/llpanellandmarks.h index 95256f4bb4..d7408269b5 100644 --- a/indra/newview/llpanellandmarks.h +++ b/indra/newview/llpanellandmarks.h @@ -50,6 +50,7 @@ class LLLandmarksPanel : public LLPanelPlacesTab, LLRemoteParcelInfoObserver { public: LLLandmarksPanel(); + LLLandmarksPanel(bool is_landmark_panel); virtual ~LLLandmarksPanel(); BOOL postBuild() override; @@ -70,26 +71,16 @@ public: */ bool handleDragAndDropToTrash(BOOL drop, EDragAndDropType cargo_type, void* cargo_data, EAcceptance* accept) override; - void onSelectionChange(LLPlacesInventoryPanel* inventory_list, const std::deque &items, BOOL user_action); - void onSelectorButtonClicked(); void setCurrentSelectedList(LLPlacesInventoryPanel* inventory_list) { mCurrentSelectedList = inventory_list; } - /** - * Update filter ShowFolderState setting to show empty folder message - * if Landmarks inventory folder is empty. - */ - void updateShowFolderState(); - /** * Selects item with "obj_id" in one of accordion tabs. */ void setItemSelected(const LLUUID& obj_id, BOOL take_keyboard_focus); - LLPlacesInventoryPanel* getLibraryInventoryPanel() { return mLibraryInventoryPanel; } - void updateMenuVisibility(LLUICtrl* menu); void doCreatePick(LLLandmark* landmark, const LLUUID &item_id ); @@ -102,40 +93,26 @@ protected: */ bool isLandmarkSelected() const; bool isFolderSelected() const; - bool isReceivedFolderSelected() const; void doActionOnCurSelectedLandmark(LLLandmarkList::loaded_callback_t cb); LLFolderViewItem* getCurSelectedItem() const; LLFolderViewModelItemInventory* getCurSelectedViewModelItem() const; - /** - * Selects item with "obj_id" in "inventory_list" and scrolls accordion - * scrollbar to show the item. - * Returns pointer to the item if it is found in "inventory_list", otherwise NULL. - */ - LLFolderViewItem* selectItemInAccordionTab(LLPlacesInventoryPanel* inventory_list, - const std::string& tab_name, - const LLUUID& obj_id, - BOOL take_keyboard_focus) const; - void updateSortOrder(LLInventoryPanel* panel, bool byDate); //LLRemoteParcelInfoObserver interface void processParcelInfo(const LLParcelData& parcel_data) override; void setParcelID(const LLUUID& parcel_id) override; void setErrorStatus(S32 status, const std::string& reason) override; + + // List Commands Handlers + void initListCommandsHandlers(); + void initLandmarksPanel(LLPlacesInventoryPanel* inventory_list); + + LLPlacesInventoryPanel* mCurrentSelectedList; private: - void initFavoritesInventoryPanel(); void initLandmarksInventoryPanel(); - void initMyInventoryPanel(); - void initLibraryInventoryPanel(); - void initLandmarksPanel(LLPlacesInventoryPanel* inventory_list); - LLAccordionCtrlTab* initAccordion(const std::string& accordion_tab_name, LLPlacesInventoryPanel* inventory_list, bool expand_tab); - void onAccordionExpandedCollapsed(const LLSD& param, LLPlacesInventoryPanel* inventory_list); - void deselectOtherThan(const LLPlacesInventoryPanel* inventory_list); - // List Commands Handlers - void initListCommandsHandlers(); void onTrashButtonClick() const; void onAddAction(const LLSD& command_name) const; void onClipboardAction(const LLSD& command_name) const; @@ -170,23 +147,25 @@ private: const LLParcelData& parcel_data); private: - LLPlacesInventoryPanel* mFavoritesInventoryPanel; LLPlacesInventoryPanel* mLandmarksInventoryPanel; - LLPlacesInventoryPanel* mMyInventoryPanel; - LLPlacesInventoryPanel* mLibraryInventoryPanel; LLToggleableMenu* mGearLandmarkMenu; LLToggleableMenu* mGearFolderMenu; LLToggleableMenu* mSortingMenu; LLToggleableMenu* mAddMenu; - LLPlacesInventoryPanel* mCurrentSelectedList; - LLInventoryObserver* mInventoryObserver; + + bool isLandmarksPanel; - typedef std::vector accordion_tabs_t; - accordion_tabs_t mAccordionTabs; + LLUUID mCreatePickItemId; // item we requested a pick for +}; - LLAccordionCtrlTab* mMyLandmarksAccordionTab; - LLUUID mCreatePickItemId; // item we requested a pick for +class LLFavoritesPanel : public LLLandmarksPanel +{ +public: + LLFavoritesPanel(); + + BOOL postBuild() override; + void initFavoritesInventoryPanel(); }; #endif //LL_LLPANELLANDMARKS_H diff --git a/indra/newview/llpanelplaces.cpp b/indra/newview/llpanelplaces.cpp index 11ae980941..7928896d96 100644 --- a/indra/newview/llpanelplaces.cpp +++ b/indra/newview/llpanelplaces.cpp @@ -1119,8 +1119,16 @@ void LLPanelPlaces::togglePlaceInfoPanel(BOOL visible) } else { - LLLandmarksPanel* landmarks_panel = - dynamic_cast(mTabContainer->getPanelByName("Landmarks")); + std::string tab_panel_name("Landmarks"); + if (mItem.notNull()) + { + if (gInventory.isObjectDescendentOf(mItem->getUUID(), gInventory.findCategoryUUIDForType(LLFolderType::FT_FAVORITE))) + { + tab_panel_name = "Favorites"; + } + } + + LLLandmarksPanel* landmarks_panel = dynamic_cast(mTabContainer->getPanelByName(tab_panel_name)); if (landmarks_panel) { // If a landmark info is being closed we open the landmarks tab @@ -1201,6 +1209,16 @@ void LLPanelPlaces::createTabs() if (!(gInventory.isInventoryUsable() && LLTeleportHistory::getInstance() && !mTabsCreated)) return; + LLFavoritesPanel* favorites_panel = new LLFavoritesPanel(); + if (favorites_panel) + { + mTabContainer->addTabPanel( + LLTabContainer::TabPanelParams(). + panel(favorites_panel). + label(getString("favorites_tab_title")). + insert_at(LLTabContainer::END)); + } + LLLandmarksPanel* landmarks_panel = new LLLandmarksPanel(); if (landmarks_panel) { diff --git a/indra/newview/skins/default/xui/en/menu_places_gear_folder.xml b/indra/newview/skins/default/xui/en/menu_places_gear_folder.xml index df1139c98f..e9ada52a8f 100644 --- a/indra/newview/skins/default/xui/en/menu_places_gear_folder.xml +++ b/indra/newview/skins/default/xui/en/menu_places_gear_folder.xml @@ -27,6 +27,9 @@ +
+ diff --git a/indra/newview/skins/default/xui/en/panel_favorites.xml b/indra/newview/skins/default/xui/en/panel_favorites.xml new file mode 100644 index 0000000000..1e8ea34ad2 --- /dev/null +++ b/indra/newview/skins/default/xui/en/panel_favorites.xml @@ -0,0 +1,22 @@ + + + + diff --git a/indra/newview/skins/default/xui/en/panel_landmarks.xml b/indra/newview/skins/default/xui/en/panel_landmarks.xml index af2115156e..10b925ec93 100644 --- a/indra/newview/skins/default/xui/en/panel_landmarks.xml +++ b/indra/newview/skins/default/xui/en/panel_landmarks.xml @@ -1,98 +1,23 @@ - - - - - - - - - - - - - - + diff --git a/indra/newview/skins/default/xui/en/panel_places.xml b/indra/newview/skins/default/xui/en/panel_places.xml index eed56209b7..dd4cf7ab4e 100644 --- a/indra/newview/skins/default/xui/en/panel_places.xml +++ b/indra/newview/skins/default/xui/en/panel_places.xml @@ -13,10 +13,13 @@ background_visible="true" width="333"> + value="LANDMARKS" /> + value="VISITED" /> + Didn't find what you're looking for? Try [secondlife:///app/search/all/[SEARCH_TERM] Search]. Didn't find what you're looking for? Try [secondlife:///app/inventory/filters Show filters]. Click "Use as Favorites folder" on a folder of your choice. You can choose a different folder at any time. System folders and folders inside them cannot be used for Favorites. - Didn't find what you're looking for? Try [secondlife:///app/search/places/[SEARCH_TERM] Search]. - Drag a landmark here to add it to your favorites. + To add a place to your landmarks, click the star to the right of the location name. + To add a place to your favorites bar, click the star to the right of the location name. No items found. Check the spelling of your search string and try again. You do not have a copy of this texture in your inventory Your Marketplace purchases will appear here. You may then drag them into your inventory to use them. -- cgit v1.2.3 From e48ce282784d508ecc58efbb771d2e717df5d3c8 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Tue, 16 Mar 2021 20:32:31 +0200 Subject: SL-14936 Do not create a saved outfit automatically for new users --- indra/newview/llstartup.cpp | 23 ----------------------- indra/newview/llstartup.h | 3 --- 2 files changed, 26 deletions(-) diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp index 3c250b3bb3..aa206a3cce 100644 --- a/indra/newview/llstartup.cpp +++ b/indra/newview/llstartup.cpp @@ -230,7 +230,6 @@ extern S32 gStartImageHeight; static bool gGotUseCircuitCodeAck = false; static std::string sInitialOutfit; static std::string sInitialOutfitGender; // "male" or "female" -static boost::signals2::connection sWearablesLoadedCon; static bool gUseCircuitCallbackCalled = false; @@ -2702,11 +2701,6 @@ void LLStartUp::loadInitialOutfit( const std::string& outfit_folder_name, } else { - // FIXME SH-3860 - this creates a race condition, where COF - // changes (base outfit link added) after appearance update - // request has been submitted. - sWearablesLoadedCon = gAgentWearables.addLoadedCallback(LLStartUp::saveInitialOutfit); - bool do_copy = true; bool do_append = false; LLViewerInventoryCategory *cat = gInventory.getCategory(cat_id); @@ -2720,23 +2714,6 @@ void LLStartUp::loadInitialOutfit( const std::string& outfit_folder_name, gAgentWearables.sendDummyAgentWearablesUpdate(); } -//static -void LLStartUp::saveInitialOutfit() -{ - if (sInitialOutfit.empty()) { - LL_DEBUGS() << "sInitialOutfit is empty" << LL_ENDL; - return; - } - - if (sWearablesLoadedCon.connected()) - { - LL_DEBUGS("Avatar") << "sWearablesLoadedCon is connected, disconnecting" << LL_ENDL; - sWearablesLoadedCon.disconnect(); - } - LL_DEBUGS("Avatar") << "calling makeNewOutfitLinks( \"" << sInitialOutfit << "\" )" << LL_ENDL; - LLAppearanceMgr::getInstance()->makeNewOutfitLinks(sInitialOutfit,false); -} - std::string& LLStartUp::getInitialOutfitName() { return sInitialOutfit; diff --git a/indra/newview/llstartup.h b/indra/newview/llstartup.h index 3ec3ff4133..116aeb36a7 100644 --- a/indra/newview/llstartup.h +++ b/indra/newview/llstartup.h @@ -110,9 +110,6 @@ public: static void loadInitialOutfit( const std::string& outfit_folder_name, const std::string& gender_name ); - //save loaded initial outfit into My Outfits category - static void saveInitialOutfit(); - static std::string& getInitialOutfitName(); static std::string getUserId(); -- cgit v1.2.3 From 38db12920c92b00e11aa533980790e8572ba6908 Mon Sep 17 00:00:00 2001 From: Mnikolenko Productengine Date: Thu, 18 Mar 2021 20:18:23 +0200 Subject: SL-14901 adjusted 'More' button --- indra/newview/llfavoritesbar.cpp | 2 ++ indra/newview/skins/default/xui/en/panel_navigation_bar.xml | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/indra/newview/llfavoritesbar.cpp b/indra/newview/llfavoritesbar.cpp index 2394a763ee..8791f605e9 100644 --- a/indra/newview/llfavoritesbar.cpp +++ b/indra/newview/llfavoritesbar.cpp @@ -402,6 +402,8 @@ LLFavoritesBarCtrl::LLFavoritesBarCtrl(const LLFavoritesBarCtrl::Params& p) mMoreTextBox = LLUICtrlFactory::create (more_button_params); mMoreTextBox->setClickedCallback(boost::bind(&LLFavoritesBarCtrl::showDropDownMenu, this)); addChild(mMoreTextBox); + LLRect rect = mMoreTextBox->getRect(); + mMoreTextBox->setRect(LLRect(rect.mLeft - rect.getWidth(), rect.mTop, rect.mRight, rect.mBottom)); mDropDownItemsCount = 0; diff --git a/indra/newview/skins/default/xui/en/panel_navigation_bar.xml b/indra/newview/skins/default/xui/en/panel_navigation_bar.xml index d3448ed0ba..2dae2649a9 100644 --- a/indra/newview/skins/default/xui/en/panel_navigation_bar.xml +++ b/indra/newview/skins/default/xui/en/panel_navigation_bar.xml @@ -187,7 +187,7 @@ name="favorite" image_drag_indication="Accordion_ArrowOpened_Off" tool_tip="Drag Landmarks here for quick access to your favorite places in Second Life!" - width="268"> + width="310">