From 42e1a9ed870c537b5684cd15a7acc524a3672685 Mon Sep 17 00:00:00 2001 From: maxim_productengine Date: Mon, 27 Jan 2020 17:54:02 +0200 Subject: [PATCH 001/195] SL-12475 add Inventory Favorites tab # Conflicts: # indra/newview/llinventorybridge.cpp # indra/newview/llinventorypanel.cpp --- indra/llui/llfolderview.h | 2 + .../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 ++ .../default/xui/en/panel_main_inventory.xml | 40 +++++--- .../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. From ae1e7c1231861aab49ddf348f914eba1b8993bbb Mon Sep 17 00:00:00 2001 From: Andrey Lihatskiy Date: Tue, 28 Jan 2020 14:50:32 +0200 Subject: [PATCH 002/195] 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(); From 980cb570162f5f4e48a2de99726d83336e3d5f59 Mon Sep 17 00:00:00 2001 From: Mnikolenko Productengine Date: Fri, 21 Aug 2020 15:20:23 +0300 Subject: [PATCH 003/195] 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 + From 0e829d2ecca9454f4d4bcced0fe9049b0f91465d Mon Sep 17 00:00:00 2001 From: Mnikolenko Productengine Date: Fri, 21 Aug 2020 16:40:53 +0300 Subject: [PATCH 004/195] 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: [PATCH 005/195] 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: [PATCH 006/195] 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 .../skins/default/textures/textures.xml | 3 + .../widgets/TextField_Search_Highlight.png | Bin 0 -> 16287 bytes .../en/menu_inventory_search_visibility.xml | 44 +++++++++ .../default/xui/en/panel_main_inventory.xml | 42 +++++---- .../default/xui/en/widgets/filter_editor.xml | 4 +- .../default/xui/en/widgets/search_editor.xml | 4 +- 15 files changed, 259 insertions(+), 23 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 0000000000000000000000000000000000000000..048da25c9286bfb85c8d20be17d81e4d81b3df73 GIT binary patch literal 756 zcmVP000UI1^@s6L96vv0000PbVXQnQ*UN; zcVTj606}DLVr3vnZDD6+Qe|Oed2z{QJOBU!mPtfGRCwBAjEszAC@n2zxPALJ!>d=X z7=HZt!Jw?Htn1+5;4UaADDn2~+vkT5AKnR+zrxDO%Ala20LBw0Okh~BU;zU$fCWS_ zF)=ZG`}U3D`}gk*78Vx1Kpg+~?_c&8FJAl>5D-xJ_V%_ocI?_c6RnmHa0e{l`B_ve*OCO7?92L=g*%n5)u+NUS3|M`uh4&`}glp1Im42 zWMqUJVr^~xAD0D3j~-=YdHnb>12Z$TbXZu}jPvKu@18bo+9aUC4D;vDUkg;j2E;$& z;^IQruU~(prlzJKFfedAF!<7+JbCgAWJ zwE!y4$fT{UtpbYBn>TNs6B83-;O6FL;N;}wee>qc4NyY(@ZrNP5fKp~c6N4#PoF+9 zoH=vm1c(g`I#nd|7?&?!j$#3b5A-1Bi;9X0!>wDl z_5;KCOK@;-osyE$1)w+UfXUNWUS8hd>C>kdfGLf!r>Cb`Q&ZCb7?F)Y{uwzrIgH@h zzI{8Rr>EzC5RH+9MMXs!P6NTackhDT-QDXuJ3BW4gX$g7f|qJ)YK1W|F+xB`T$((2 zaxf1M&o7Ygky97CMOgC*&}9rlLP89{RP}4knl;tx>gwje%;*G+U=d*QzOiG+j(u0I mTsa9$g + + @@ -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 0000000000000000000000000000000000000000..e3944289c6f865ad4a4f57223bba9bd8ef43219d GIT binary patch literal 16287 zcmeI3dsGuw8o&p!RZ&~2wkQV=A?k`P$z<{*LlQKg1tACs3fmQ(OeQcj$;8ZH0t#AR z)YjtGwV+gc>Uy-RTdZ{}R$CwSSs%N$Dtk@^l*KAOTET9QR8iQOgh#l*th?==Jw0dU z9GLm;cfaqu^ZV}o?&OcVIyL3x;X$E65CjcROo&g1paAv}3K{$~`~Ta&zkQFr4RI!9 z(-1UtB=;8pRcsm!K`|@Ij4US0l#Jq(U5Z&KGa>cZot!PCi}g4$d_KX5%tS8f(2JWs zJ1iEF7QJ}3$|N&6TtHElDOD6lxd@R;s*>O`IU>?%rHD$YMUW_wT!tuML^}7{-ahu-omHx)oB&l?x+UtrnKaVYytw_K?s8 z4hHi`9P~J!lTJVJ1dY2$Cqq&W5$6{(Q~8WuEan1rT^;XbcXkDG&>iepim(TB!iZD` z_hn?kyKJ2KE}M5~791vQgq?6OG;4?SY3IzN7>drL`U%;k?l&--6O*YccAw+5+xrYn zGgB9`2s)7VX-Q`kI0-nNps9QpPE1|MzRI}1-ku??-O1_UiPQ8ucEUsUW5#KGX5Ojb z%aD$JS2WH=U<~ETpeUQcH_K8x5sKpCM3J*ehlO&}lXNiHyF1n0j)-`SAq;YvTqco4 zOXQjiM2*Tcs9gP$Oo7T|eolNn0UsvHLRt&@@F7>Da;?7)zn-8EcIj9!274ke{(b%Y zSa8%zx$GEYAnjN#0XrSJI=H*huV>eULgOeK@60K1wBo>uQZkEXqM4|BIhjr~|-pln27s(bm%;wjJ z8~uM8q7OH{LM4ziJ2eaZrYt*gy=81Bv7l#br@}^h%aIdv(FC{H^y1Fd)>Xf{$`fbf zU9>2MbA`-+b8CUH=-?i$-NWj#>@XvHC-BKA`~3Tv_aDQZM>zNvl+Ts7SN~3E%F4Jg z7cnK5ofH3Nnfn~}v;aNpV6Nud$p1kOXl&un%YfXhP+M_KDN!obxI~64Nxw(f=g_-E$Yu!yLJU#Q=A{RA9L3W zx|8Nxe?5y}=eE$hXzI9+29zzh?Bd6~g$~idz1q5`i?4qcS2%6?-u@c7jJ?>eOZMt8 z^;d(Y+5D#dYS6UXGSfja26;y`pxMug`?B%vy))U5aKfNgsT3+53^s!nsicRnWyO>1 zCP{OpU#?Pj7=fBTEwlYB+3nsN&1>kV=rHu<%I|yGTQq&G?AJK^LjdmjCD5y$cI`O7 z#m@)O3b+6u{Gx!1pAVoFZ~;L0MFAH-A3!VM0)X&~0xo_&fL6c- z0O1z}T>N|ht$+&v!Y>NA`1t@@0T%#-Ulefh^8vI1E&vF>DB$Af184tGS_(fh^LEUF-2?u+i*3F)r-P86ocS=`;C#0JosBi)VEnN;l z58B!LEeOh&LD21a5QJ`EPxVsk=AM`aL4oTNd*r4X7MSr_GXAfy1t1%Q}+8av!Y&jvy8a=xN1|;?y9Q$jYp3jmE*~SoG}}d4U+JX zXG-QupjPG3h=*IhzWL?N)RrS3TTi#2mwu)k9PxZ;YT5vr zrUOhDi>2^@a|^;`CvUF|p2%LYF-3b0eh|^TEPdQ@qH5vdPnqj?FI>8GNwb~ISrFDZ zX%LjS4&{cl5D~wy3*%3o^_eVAqZ;h)9 z+>#o3ZuHDoKhL3B_sw0>M$|0IFPRi-tZk|+yj##5e17(U3{gzCjUnwJR)<=(1>AYpx z#+@a^#zn@#%Uc&8`re3XX1pDot`AyS_xbt8nj3qfVhi8Xyq7k9MaJ3(N&Cu)?Be5@ znRD73{v2NX+q&Ju-dGvj@=D$AH4M5rEi-@fodbt9p1tnKdHw2vdzPA{Tfq&kkcNGZ zZ(aM}J+O;%K~>vHcf-A(PMlr6DCw0L!}QmK%OBott={I*6{lVNBnGn0dUfE=F=1iD zh`)TZc2!A9$xZh>W9{|RRUzdgTgq-UHeP$*Ohiy@7*ql}}A4=;H+ZT+dDqM{{#J$KGFAhLe)M_1<$Jrbbu zR6|kkOnY$qJlDA*@cqF@UVN+kr?tlOhuIVN?d^fkw(&U^Hk`O`<&MxNPECp5Wt_L{ EUr1 + + + + + + + + + + + + + + + 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: [PATCH 007/195] 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)); From 73ece917247d550140c0ae193746ebf66cca1081 Mon Sep 17 00:00:00 2001 From: maxim_productengine Date: Mon, 17 Feb 2020 17:43:00 +0200 Subject: [PATCH 008/195] =?UTF-8?q?SL-11867=20Show=20=E2=80=9CUnable=20to?= =?UTF-8?q?=20buy=E2=80=9D=20message=20via=20notification?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- indra/newview/llfloaterbuycurrency.cpp | 37 +++------------- .../default/xui/da/floater_buy_currency.xml | 5 +-- .../default/xui/de/floater_buy_currency.xml | 5 +-- .../default/xui/en/floater_buy_currency.xml | 42 ++----------------- .../skins/default/xui/en/notifications.xml | 12 ++++++ .../default/xui/es/floater_buy_currency.xml | 5 +-- .../default/xui/fr/floater_buy_currency.xml | 5 +-- .../default/xui/it/floater_buy_currency.xml | 5 +-- .../default/xui/ja/floater_buy_currency.xml | 5 +-- .../default/xui/pl/floater_buy_currency.xml | 5 +-- .../default/xui/pt/floater_buy_currency.xml | 5 +-- .../default/xui/ru/floater_buy_currency.xml | 5 +-- .../default/xui/tr/floater_buy_currency.xml | 5 +-- .../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. + diff --git a/indra/newview/skins/default/xui/de/menu_inventory_search_visibility.xml b/indra/newview/skins/default/xui/de/menu_inventory_search_visibility.xml new file mode 100644 index 0000000000..4545f88b6b --- /dev/null +++ b/indra/newview/skins/default/xui/de/menu_inventory_search_visibility.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/indra/newview/skins/default/xui/de/notifications.xml b/indra/newview/skins/default/xui/de/notifications.xml index 00f570ac40..c6b0155b6e 100644 --- a/indra/newview/skins/default/xui/de/notifications.xml +++ b/indra/newview/skins/default/xui/de/notifications.xml @@ -1748,10 +1748,6 @@ Fortfahren? Diese Gruppe verlassen? - - Sie haben die Gruppe „<nolink>[group_name]</nolink>“ verlassen. - - Sie sind gegenwärtig Mitglied der Gruppe „<nolink>[GROUP]</nolink>“. Erneutes Beitreten kostet [AMOUNT] L$. Diese Gruppe verlassen? @@ -4701,6 +4697,16 @@ Wählen Sie eine kleinere Landfläche aus. [REASON] + + Wählen Sie einen L$-Betrag auf der folgenden +Seite und klicken Sie auf Kaufen. Sie haben die +Möglichkeit an der Kasse eine Zahlungsmethode +zu hinterlegen. +
+
+ width="268"> Date: Thu, 25 Feb 2021 22:41:18 +0200 Subject: [PATCH 074/195] 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"/> From 14826e17dccb3a12fe7551effc60a2a3c62a4946 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Thu, 25 Feb 2021 23:48:48 +0200 Subject: [PATCH 075/195] 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") From 34b971150835872eb04fcd08af6f485601c79b54 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Fri, 26 Feb 2021 19:44:58 +0200 Subject: [PATCH 076/195] SL-14725 Adjust "Show Beacon" position --- .../xui/en/floater_fixedenvironment.xml | 2 +- .../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"/> From 4a2f7c82cc6c9628f6be6b4e322b172478d65b9c Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Fri, 26 Feb 2021 21:38:13 +0200 Subject: [PATCH 077/195] 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. From dd89dec893411c22d4916de14593a56f87d3a284 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Mon, 1 Mar 2021 21:38:46 +0000 Subject: [PATCH 078/195] 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 From fa98cb1e109b564970baba078a812a0f148158f3 Mon Sep 17 00:00:00 2001 From: Ansariel Date: Wed, 3 Mar 2021 15:11:05 +0100 Subject: [PATCH 079/195] Update German translation --- .../xui/de/floater_fs_teleporthistory.xml | 21 ++----------- .../skins/default/xui/de/menu_inventory.xml | 1 + .../default/xui/de/menu_place_add_button.xml | 8 ++--- .../xui/de/menu_places_gear_folder.xml | 3 -- .../xui/de/menu_places_gear_landmark.xml | 3 -- .../xui/de/menu_places_gear_sorting.xml | 6 ++++ .../xui/de/menu_teleport_history_gear.xml | 4 +-- .../xui/de/menu_teleport_history_item.xml | 4 +-- .../skins/default/xui/de/notifications.xml | 3 +- .../skins/default/xui/de/panel_landmarks.xml | 13 -------- .../skins/default/xui/de/panel_places.xml | 31 +++++++++++++++---- .../default/xui/de/panel_teleport_history.xml | 3 -- .../newview/skins/default/xui/de/strings.xml | 2 +- .../skins/default/xui/de/teleport_strings.xml | 3 +- 14 files changed, 46 insertions(+), 59 deletions(-) create mode 100644 indra/newview/skins/default/xui/de/menu_places_gear_sorting.xml diff --git a/indra/newview/skins/default/xui/de/floater_fs_teleporthistory.xml b/indra/newview/skins/default/xui/de/floater_fs_teleporthistory.xml index 8629bc5b65..9298217fa3 100644 --- a/indra/newview/skins/default/xui/de/floater_fs_teleporthistory.xml +++ b/indra/newview/skins/default/xui/de/floater_fs_teleporthistory.xml @@ -1,21 +1,6 @@ - - - - - - -
+ diff --git a/indra/newview/skins/default/xui/de/menu_place_add_button.xml b/indra/newview/skins/default/xui/de/menu_place_add_button.xml index 7c0ff4a46a..7c57f88b4f 100644 --- a/indra/newview/skins/default/xui/de/menu_place_add_button.xml +++ b/indra/newview/skins/default/xui/de/menu_place_add_button.xml @@ -1,5 +1,5 @@ - - - - + + + + diff --git a/indra/newview/skins/default/xui/de/menu_places_gear_folder.xml b/indra/newview/skins/default/xui/de/menu_places_gear_folder.xml index 16b16e6a5b..2c6034b77d 100644 --- a/indra/newview/skins/default/xui/de/menu_places_gear_folder.xml +++ b/indra/newview/skins/default/xui/de/menu_places_gear_folder.xml @@ -10,7 +10,4 @@ - - - diff --git a/indra/newview/skins/default/xui/de/menu_places_gear_landmark.xml b/indra/newview/skins/default/xui/de/menu_places_gear_landmark.xml index e57bb2ed2c..29daf0fa99 100644 --- a/indra/newview/skins/default/xui/de/menu_places_gear_landmark.xml +++ b/indra/newview/skins/default/xui/de/menu_places_gear_landmark.xml @@ -12,7 +12,4 @@ - - - diff --git a/indra/newview/skins/default/xui/de/menu_places_gear_sorting.xml b/indra/newview/skins/default/xui/de/menu_places_gear_sorting.xml new file mode 100644 index 0000000000..6ec02f250d --- /dev/null +++ b/indra/newview/skins/default/xui/de/menu_places_gear_sorting.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/indra/newview/skins/default/xui/de/menu_teleport_history_gear.xml b/indra/newview/skins/default/xui/de/menu_teleport_history_gear.xml index 9a5a0efbcd..d4b3daab11 100644 --- a/indra/newview/skins/default/xui/de/menu_teleport_history_gear.xml +++ b/indra/newview/skins/default/xui/de/menu_teleport_history_gear.xml @@ -1,5 +1,5 @@ - + @@ -12,4 +12,4 @@ - + diff --git a/indra/newview/skins/default/xui/de/menu_teleport_history_item.xml b/indra/newview/skins/default/xui/de/menu_teleport_history_item.xml index 64aef1a946..84f1a9e188 100644 --- a/indra/newview/skins/default/xui/de/menu_teleport_history_item.xml +++ b/indra/newview/skins/default/xui/de/menu_teleport_history_item.xml @@ -1,7 +1,7 @@ - + - + diff --git a/indra/newview/skins/default/xui/de/notifications.xml b/indra/newview/skins/default/xui/de/notifications.xml index 4c5fb2dde7..ff696aeced 100644 --- a/indra/newview/skins/default/xui/de/notifications.xml +++ b/indra/newview/skins/default/xui/de/notifications.xml @@ -997,8 +997,7 @@ Es wurde keine Suche durchgeführt. [REASON] - Bei der Bearbeitung Ihrer Teleport-Anfrage ist ein Problem aufgetreten. Sie müssen sich zum Teleportieren eventuell neu anmelden. -Falls diese Meldung weiterhin angezeigt wird, wenden Sie sich bitte an [SUPPORT_SITE]. + Teleport-Anfragen sind auf 6 pro Minute beschränkt. Falls Sie Probleme beim Teleportieren haben, warten Sie eine Minute und versuchen es erneut. Falls das Problem weiterhin besteht, melden Sie sich neu an. Bei der Bearbeitung Ihres Regionswechsels ist ein Problem aufgetreten. Sie müssen eventuell neu anmelden, um die Region wechseln zu können. diff --git a/indra/newview/skins/default/xui/de/panel_landmarks.xml b/indra/newview/skins/default/xui/de/panel_landmarks.xml index e65fdfdc74..6a2cfce045 100644 --- a/indra/newview/skins/default/xui/de/panel_landmarks.xml +++ b/indra/newview/skins/default/xui/de/panel_landmarks.xml @@ -6,17 +6,4 @@ - - - - Date: Wed, 10 Mar 2021 16:56:50 +0100 Subject: [PATCH 083/195] Make this less branded --- indra/newview/skins/default/xui/en/panel_people.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/indra/newview/skins/default/xui/en/panel_people.xml b/indra/newview/skins/default/xui/en/panel_people.xml index 4d064ebb32..c5674bcd62 100644 --- a/indra/newview/skins/default/xui/en/panel_people.xml +++ b/indra/newview/skins/default/xui/en/panel_people.xml @@ -34,9 +34,9 @@ Looking for places with more people? -[secondlife:///app/floater/destinations Destination Guide] has locations chosen by Second Life staff. +[secondlife:///app/floater/destinations Destination Guide] has locations chosen by the grid operator staff. -[secondlife:///app/search/people Search] lets you search all of Second Life for certain keywords. +[secondlife:///app/search/people Search] lets you search all the grid for certain keywords. @@ -53,7 +53,7 @@ Looking for places with more people? 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.] +Learn about [https://community.secondlife.com/knowledgebase/joining-and-participating-in-groups-r51/ groups]. Date: Wed, 10 Mar 2021 16:57:02 +0100 Subject: [PATCH 084/195] Update German translation --- .../skins/default/xui/de/panel_people.xml | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/indra/newview/skins/default/xui/de/panel_people.xml b/indra/newview/skins/default/xui/de/panel_people.xml index 61b09b590b..1d802c1037 100644 --- a/indra/newview/skins/default/xui/de/panel_people.xml +++ b/indra/newview/skins/default/xui/de/panel_people.xml @@ -1,21 +1,30 @@ - + - Verwenden Sie die [secondlife:///app/search/people Suche], um Freunde zu finden. Oder klicken Sie mit rechts auf einen Einwohner und fügen Sie diesen als Freund hinzu. -Sie suchen nach Leuten? Verwenden Sie die [secondlife:///app/worldmap Karte]. + Um jemanden als Freund hinzuzufügen, klicken Sie mit rechts auf deren Avatar oder Namen. + +Sie suchen nach Orten mit mehr Leuten? + +[secondlife:///app/floater/destinations Ziele] enthält Orte, die vom Grid-Betreiber ausgewählt wurden. + +[secondlife:///app/search/people Suche] lässt Sie das Grid nach bestimmten Schlüsselwörtern durchsuchen. Sie haben nicht das Richtige gefunden? Versuchen Sie es mit der [secondlife:///app/search/people/[SEARCH_TERM] Suche]. - + + Sie sind kein Mitglied einer Gruppe. + +Lernen Sie über [https://community.secondlife.com/knowledgebase/joining-and-participating-in-groups-r51/ Gruppen]. + From 89bd4269018fa5a36a15eac8d2c3f99674d18b2d Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Wed, 10 Mar 2021 16:23:20 +0000 Subject: [PATCH 085/195] 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" // From 92a17bf53b33050402c292c22614b361dba0e292 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Wed, 10 Mar 2021 17:49:06 +0000 Subject: [PATCH 086/195] 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; } From e3babd1f8d6d5347f9cf1ec5fee976718e0c6a44 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Thu, 11 Mar 2021 14:26:36 +0000 Subject: [PATCH 087/195] 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); From acb2e87d9425c8f671d9772409fd291d7fed9aa7 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Thu, 11 Mar 2021 15:11:51 +0000 Subject: [PATCH 088/195] 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,31 +111,25 @@ 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 : mControlCounts) + { + setLLSDPath(result["controls"], it.first, 2, LLSD::Integer(it.second)); + } + for (auto const& it : mFloaterCounts) + { + result["floaters"][it.first] = LLSD::Integer(it.second); + } for (auto const& it : mPanelCounts) { result["panels"][it.first] = LLSD::Integer(it.second); } - for (auto const& it : mWidgetCounts) - { - setLLSDPath(result["widgets"], it.first, 2, 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 From d846c3642d83f84997fcb4549b9e31ae4183ff50 Mon Sep 17 00:00:00 2001 From: Kitty Barnett Date: Sat, 13 Mar 2021 16:48:14 +0100 Subject: [PATCH 089/195] Increment version to RLVa-2.4.1 --- indra/newview/rlvdefines.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/newview/rlvdefines.h b/indra/newview/rlvdefines.h index 13631811d2..3bcca61473 100644 --- a/indra/newview/rlvdefines.h +++ b/indra/newview/rlvdefines.h @@ -39,7 +39,7 @@ const S32 RLV_VERSION_BUILD_COMPAT = 0; // Implementation version const S32 RLVa_VERSION_MAJOR = 2; const S32 RLVa_VERSION_MINOR = 4; -const S32 RLVa_VERSION_PATCH = 0; +const S32 RLVa_VERSION_PATCH = 1; const S32 RLVa_IMPL_ID = 13; // Uncomment before a final release From e9772fc7e221c959cf01c69ba14993030f51f7ff Mon Sep 17 00:00:00 2001 From: Kitty Barnett Date: Sat, 13 Mar 2021 20:41:01 +0100 Subject: [PATCH 090/195] Cleanup of Windlight lock-in (= force enabling + prevent disabling) --- indra/newview/llviewercontrol.cpp | 31 +++++++-------------------- indra/newview/pipeline.cpp | 9 +++++++- indra/newview/rlvhandler.cpp | 35 ++++++++++++++++++------------- indra/newview/rlvhelper.cpp | 18 ++++++++++++++++ indra/newview/rlvhelper.h | 5 +++++ 5 files changed, 58 insertions(+), 40 deletions(-) diff --git a/indra/newview/llviewercontrol.cpp b/indra/newview/llviewercontrol.cpp index a0ed94e8ac..6aa9a15e65 100644 --- a/indra/newview/llviewercontrol.cpp +++ b/indra/newview/llviewercontrol.cpp @@ -76,6 +76,7 @@ #include "llslurl.h" #include "llstartup.h" // [RLVa:KB] - Checked: 2015-12-27 (RLVa-1.5.0) +#include "llvisualeffect.h" #include "rlvactions.h" #include "rlvcommon.h" // [/RLVa:KB] @@ -143,15 +144,15 @@ static bool handleAvatarHoverOffsetChanged(const LLSD& newvalue) static bool handleSetShaderChanged(const LLSD& newvalue) { -// [RLVa:KB] - @setenv - if ( (!RlvActions::canChangeEnvironment()) && (LLFeatureManager::getInstance()->isFeatureAvailable("WindLightUseAtmosShaders")) && (!gSavedSettings.getBOOL("WindLightUseAtmosShaders")) ) +// [RLVa:KB] - @setenv and @setsphere + if ( (RlvActions::isRlvEnabled()) && (!RlvActions::canChangeEnvironment() || (LLVfxManager::instance().hasEffect(EVisualEffect::RlvSphere))) && + (LLFeatureManager::getInstance()->isFeatureAvailable("WindLightUseAtmosShaders"))&& (!gSavedSettings.getBOOL("WindLightUseAtmosShaders")) ) { gSavedSettings.setBOOL("WindLightUseAtmosShaders", TRUE); return true; } // [/RLVa:KB] - // changing shader level may invalidate existing cached bump maps, as the shader type determines the format of the bump map it expects - clear and repopulate the bump cache gBumpImageList.destroyGL(); gBumpImageList.restoreGL(); @@ -429,21 +430,9 @@ static bool handleRenderLocalLightsChanged(const LLSD& newvalue) return true; } -// [RLVa:KB] - @setsphere -static bool handleWindLightAtmosShadersChanged(const LLSD& newvalue) -{ - LLRenderTarget::sUseFBO = newvalue.asBoolean() && LLPipeline::sUseDepthTexture; - handleSetShaderChanged(LLSD()); - return true; -} -// [/RLVa:KB] - static bool handleRenderDeferredChanged(const LLSD& newvalue) { -// LLRenderTarget::sUseFBO = newvalue.asBoolean(); -// [RLVa:KB] - @setsphere - LLRenderTarget::sUseFBO = newvalue.asBoolean() || (gSavedSettings.getBOOL("WindLightUseAtmosShaders") && LLPipeline::sUseDepthTexture); -// [/RLVa:KB] + LLRenderTarget::sUseFBO = newvalue.asBoolean(); if (gPipeline.isInit()) { LLPipeline::refreshCachedSettings(); @@ -465,10 +454,7 @@ static bool handleRenderDeferredChanged(const LLSD& newvalue) // static bool handleRenderBumpChanged(const LLSD& newval) { -// LLRenderTarget::sUseFBO = newval.asBoolean(); -// [RLVa:KB] - @setsphere - LLRenderTarget::sUseFBO = newval.asBoolean() || (gSavedSettings.getBOOL("WindLightUseAtmosShaders") && LLPipeline::sUseDepthTexture); -// [/RLVa:KB] + LLRenderTarget::sUseFBO = newval.asBoolean(); if (gPipeline.isInit()) { gPipeline.updateRenderBump(); @@ -672,10 +658,7 @@ void settings_setup_listeners() gSavedSettings.getControl("RenderGlow")->getSignal()->connect(boost::bind(&handleSetShaderChanged, _2)); gSavedSettings.getControl("RenderGlowResolutionPow")->getSignal()->connect(boost::bind(&handleReleaseGLBufferChanged, _2)); gSavedSettings.getControl("RenderAvatarCloth")->getSignal()->connect(boost::bind(&handleSetShaderChanged, _2)); -// gSavedSettings.getControl("WindLightUseAtmosShaders")->getSignal()->connect(boost::bind(&handleSetShaderChanged, _2)); -// [RLVa:KB] - @setsphere - gSavedSettings.getControl("WindLightUseAtmosShaders")->getSignal()->connect(boost::bind(&handleWindLightAtmosShadersChanged, _2)); -// [/RLVa:KB] + gSavedSettings.getControl("WindLightUseAtmosShaders")->getSignal()->connect(boost::bind(&handleSetShaderChanged, _2)); gSavedSettings.getControl("RenderGammaFull")->getSignal()->connect(boost::bind(&handleSetShaderChanged, _2)); gSavedSettings.getControl("RenderVolumeLODFactor")->getSignal()->connect(boost::bind(&handleVolumeLODChanged, _2)); gSavedSettings.getControl("RenderAvatarLODFactor")->getSignal()->connect(boost::bind(&handleAvatarLODChanged, _2)); diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index ba40807dcb..3a837ab350 100644 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -1118,6 +1118,13 @@ void LLPipeline::updateRenderDeferred() RenderAvatarVP && WindLightUseAtmosShaders && (bool) LLFeatureManager::getInstance()->isFeatureAvailable("RenderDeferred"); +// [RLVa:KB] - @setsphere + if (!sRenderDeferred && RlvActions::hasBehaviour(RLV_BHVR_SETSPHERE) && WindLightUseAtmosShaders) + { + LLRenderTarget::sUseFBO = true; + LLPipeline::sUseDepthTexture = true; + } +// [/RLVa:KB] } // static @@ -4497,7 +4504,7 @@ void LLPipeline::renderGeom(LLCamera& camera, bool forceVBOUpdate) gGL.loadMatrix(gGLModelView); LLGLSLShader::bindNoShader(); // [RLVa:KB] - @setsphere - if (LLPipeline::RenderDeferred || !LLRenderTarget::sUseFBO || !LLPipeline::sUseDepthTexture) + if (LLPipeline::sRenderDeferred || !LLRenderTarget::sUseFBO || !LLPipeline::sUseDepthTexture) { doOcclusion(camera); } diff --git a/indra/newview/rlvhandler.cpp b/indra/newview/rlvhandler.cpp index d2117cbeaf..4042ce2482 100644 --- a/indra/newview/rlvhandler.cpp +++ b/indra/newview/rlvhandler.cpp @@ -2071,22 +2071,28 @@ ERlvCmdRet RlvBehaviourHandler::onCommand(const RlvCommand& ERlvCmdRet eRet = RlvBehaviourGenericHandler::onCommand(rlvCmd, fRefCount); if ( (RLV_RET_SUCCESS == eRet) && (!rlvCmd.isModifier()) ) { - // If we're not using deferred but are using Windlight shaders we need to force use of FBO and depthmap texture - if ( (!LLPipeline::RenderDeferred) && (LLPipeline::WindLightUseAtmosShaders) && (!LLPipeline::sUseDepthTexture) ) - { - LLRenderTarget::sUseFBO = true; - LLPipeline::sUseDepthTexture = true; - - gPipeline.releaseGLBuffers(); - gPipeline.createGLBuffers(); - gPipeline.resetVertexBuffers(); - LLViewerShaderMgr::instance()->setShaders(); - } - if (gRlvHandler.hasBehaviour(rlvCmd.getObjectID(), rlvCmd.getBehaviourType())) + { + Rlv::forceAtmosphericShadersIfAvailable(); + + // If we're not using deferred but are using Windlight shaders we need to force use of FBO and depthmap texture + if ( (!LLPipeline::sRenderDeferred) && (LLPipeline::WindLightUseAtmosShaders) && (!LLPipeline::sUseDepthTexture) ) + { + LLRenderTarget::sUseFBO = true; + LLPipeline::sUseDepthTexture = true; + + gPipeline.releaseGLBuffers(); + gPipeline.createGLBuffers(); + gPipeline.resetVertexBuffers(); + LLViewerShaderMgr::instance()->setShaders(); + } + LLVfxManager::instance().addEffect(new RlvSphereEffect(rlvCmd.getObjectID())); + } else + { LLVfxManager::instance().removeEffect(gRlvHandler.getCurrentObject()); + } } return eRet; } @@ -2402,11 +2408,10 @@ void RlvBehaviourToggleHandler::onCommandToggle(ERlvBehaviour e } } - // Don't allow toggling "Atmopsheric Shaders" through the debug settings under @setenv=n - gSavedSettings.getControl("WindLightUseAtmosShaders")->setHiddenFromSettingsEditor(fHasBhvr); - if (fHasBhvr) { + Rlv::forceAtmosphericShadersIfAvailable(); + // Usurp the 'edit' environment for RLVa locking so TPV tools like quick prefs and phototools are automatically locked out as well // (these needed per-feature awareness of RLV in the previous implementation which often wasn't implemented) LLEnvironment* pEnv = LLEnvironment::getInstance(); diff --git a/indra/newview/rlvhelper.cpp b/indra/newview/rlvhelper.cpp index dcef3f9827..33549a3118 100644 --- a/indra/newview/rlvhelper.cpp +++ b/indra/newview/rlvhelper.cpp @@ -17,9 +17,11 @@ #include "llviewerprecompiledheaders.h" #include "llappearancemgr.h" #include "llattachmentsmgr.h" +#include "llfeaturemanager.h" #include "llgesturemgr.h" #include "llnotificationsutil.h" #include "llviewerobjectlist.h" +#include "pipeline.h" #include "rlvcommon.h" #include "rlveffects.h" @@ -2038,3 +2040,19 @@ std::string rlvGetLastParenthesisedText(const std::string& strText, std::string: } // ========================================================================= +// Various helper functions +// + +namespace Rlv +{ + void forceAtmosphericShadersIfAvailable() + { + if ( (LLFeatureManager::getInstance()->isFeatureAvailable("WindLightUseAtmosShaders")) && (!LLPipeline::WindLightUseAtmosShaders) ) + { + // Triggers handleSetShaderChanged() which will do the actual work for us + gSavedSettings.setBOOL("WindLightUseAtmosShaders", TRUE); + } + } +} + +// ========================================================================= diff --git a/indra/newview/rlvhelper.h b/indra/newview/rlvhelper.h index 9a561bfcfb..d6e147df9a 100644 --- a/indra/newview/rlvhelper.h +++ b/indra/newview/rlvhelper.h @@ -692,6 +692,11 @@ ERlvAttachGroupType rlvAttachGroupFromString(const std::string& strGroup); std::string rlvGetFirstParenthesisedText(const std::string& strText, std::string::size_type* pidxMatch = NULL); std::string rlvGetLastParenthesisedText(const std::string& strText, std::string::size_type* pidxStart = NULL); +namespace Rlv +{ + void forceAtmosphericShadersIfAvailable(); +} + // ============================================================================ // Inlined class member functions // From cdd71c5e64782b33aaf5f8caac8ef61eaa78f607 Mon Sep 17 00:00:00 2001 From: Mnikolenko Productengine Date: Tue, 16 Mar 2021 19:29:23 +0200 Subject: [PATCH 091/195] SL-14938 Remove Library and Inventory from Places floater --- indra/newview/llpanellandmarks.cpp | 466 +++--------------- indra/newview/llpanellandmarks.h | 61 +-- indra/newview/llpanelplaces.cpp | 22 +- .../xui/en/menu_places_gear_folder.xml | 3 + .../xui/en/menu_places_gear_sorting.xml | 3 + .../skins/default/xui/en/panel_favorites.xml | 22 + .../skins/default/xui/en/panel_landmarks.xml | 99 +--- .../skins/default/xui/en/panel_places.xml | 7 +- .../newview/skins/default/xui/en/strings.xml | 4 +- 9 files changed, 156 insertions(+), 531 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) -{ - 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(); - } - } -} - LLLandmarksPanel::LLLandmarksPanel() : LLPanelPlacesTab() - , mFavoritesInventoryPanel(NULL) , mLandmarksInventoryPanel(NULL) - , mMyInventoryPanel(NULL) - , mLibraryInventoryPanel(NULL) , mCurrentSelectedList(NULL) , mGearFolderMenu(NULL) , mGearLandmarkMenu(NULL) , mSortingMenu(NULL) , mAddMenu(NULL) + , isLandmarksPanel(true) { - mInventoryObserver = new LLLandmarksPanelObserver(this); - gInventory.addObserver(mInventoryObserver); + buildFromFile("panel_landmarks.xml"); +} - buildFromFile( "panel_landmarks.xml"); +LLLandmarksPanel::LLLandmarksPanel(bool is_landmark_panel) + : LLPanelPlacesTab() + , mLandmarksInventoryPanel(NULL) + , mCurrentSelectedList(NULL) + , mGearFolderMenu(NULL) + , mGearLandmarkMenu(NULL) + , mSortingMenu(NULL) + , mAddMenu(NULL) + , isLandmarksPanel(is_landmark_panel) +{ + 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)) - { + if (!mCurrentSelectedList) return; - } - if (selectItemInAccordionTab(mLandmarksInventoryPanel, "tab_landmarks", obj_id, take_keyboard_focus)) - { + LLFolderView* root = mCurrentSelectedList->getRootFolder(); + LLFolderViewItem* item = mCurrentSelectedList->getItemByID(obj_id); + if (!item) return; - } - - if (selectItemInAccordionTab(mMyInventoryPanel, "tab_inventory", obj_id, take_keyboard_focus)) - { - return; - } - - if (selectItemInAccordionTab(mLibraryInventoryPanel, "tab_library", obj_id, take_keyboard_focus)) - { - 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; - -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 initLandmarksPanel(LLPlacesInventoryPanel* inventory_list); + + LLPlacesInventoryPanel* mCurrentSelectedList; + +private: + void initLandmarksInventoryPanel(); + 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; - - 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. From e48ce282784d508ecc58efbb771d2e717df5d3c8 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Tue, 16 Mar 2021 20:32:31 +0200 Subject: [PATCH 092/195] 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(); From 38db12920c92b00e11aa533980790e8572ba6908 Mon Sep 17 00:00:00 2001 From: Mnikolenko Productengine Date: Thu, 18 Mar 2021 20:18:23 +0200 Subject: [PATCH 093/195] 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"> - - - - - - - - + + 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/inventory/filters Show filters]. 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. From 297b81b03ad1e01339735e612dbf17f131019403 Mon Sep 17 00:00:00 2001 From: Mnikolenko Productengine Date: Wed, 21 Apr 2021 15:39:01 +0300 Subject: [PATCH 131/195] SL-15028 Update GuidebookURL setting --- indra/newview/app_settings/settings.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 25627e61ae..943062c127 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -4734,7 +4734,7 @@ Type String Value - https://guidebooks.secondlife.io/welcome + http://guidebooks.secondlife.io/welcome/index.html HighResSnapshot From 0ed270a0569e205f837f84773f5e72ab3b46d01b Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Wed, 21 Apr 2021 01:37:28 +0300 Subject: [PATCH 132/195] SL-14842 Landmarks created by '+' menu always starting in favorites --- indra/newview/llpanellandmarks.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/indra/newview/llpanellandmarks.cpp b/indra/newview/llpanellandmarks.cpp index 4b73412e60..769b060d93 100644 --- a/indra/newview/llpanellandmarks.cpp +++ b/indra/newview/llpanellandmarks.cpp @@ -499,6 +499,12 @@ void LLLandmarksPanel::onAddAction(const LLSD& userdata) const { args["dest_folder"] = view_model->getUUID(); } + if ("add_landmark_root" == command_name + && mCurrentSelectedList == mLandmarksInventoryPanel) + { + args["dest_folder"] = mLandmarksInventoryPanel->getRootFolderID(); + } + // else will end up in favorites LLFloaterReg::showInstance("add_landmark", args); } } From 9a944540b0f3c204112036d76c8358797013b51a Mon Sep 17 00:00:00 2001 From: Ansariel Date: Thu, 22 Apr 2021 08:22:21 +0200 Subject: [PATCH 133/195] Correct merge --- indra/newview/skins/default/xui/en/strings.xml | 1 - 1 file changed, 1 deletion(-) diff --git a/indra/newview/skins/default/xui/en/strings.xml b/indra/newview/skins/default/xui/en/strings.xml index 7218f71c65..ef46b34562 100644 --- a/indra/newview/skins/default/xui/en/strings.xml +++ b/indra/newview/skins/default/xui/en/strings.xml @@ -762,7 +762,6 @@ http://www.firestormviewer.org/support for help fixing this problem. Didn't find what you're looking for? Try [secondlife:///app/search/all/[SEARCH_TERM] Search]. Didn't find what you're looking for? Show [secondlife:///app/inventory/filters Filters]. - To add a place to your landmarks, click the star to the right of the location name. 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. From bba1a46c4a4db78c575e5005761dfdf47b36a8a1 Mon Sep 17 00:00:00 2001 From: Ansariel Date: Thu, 22 Apr 2021 08:22:43 +0200 Subject: [PATCH 134/195] Update German translation --- indra/newview/skins/ansastorm/xui/de/panel_main_inventory.xml | 1 - indra/newview/skins/default/xui/de/menu_login.xml | 1 - indra/newview/skins/default/xui/de/panel_people.xml | 2 +- indra/newview/skins/default/xui/de/strings.xml | 3 --- indra/newview/skins/vintage/xui/de/panel_main_inventory.xml | 1 - 5 files changed, 1 insertion(+), 7 deletions(-) diff --git a/indra/newview/skins/ansastorm/xui/de/panel_main_inventory.xml b/indra/newview/skins/ansastorm/xui/de/panel_main_inventory.xml index 04e08e4271..efc8e108cf 100644 --- a/indra/newview/skins/ansastorm/xui/de/panel_main_inventory.xml +++ b/indra/newview/skins/ansastorm/xui/de/panel_main_inventory.xml @@ -105,7 +105,6 @@ - diff --git a/indra/newview/skins/default/xui/de/menu_login.xml b/indra/newview/skins/default/xui/de/menu_login.xml index 49b9d19080..969d486194 100644 --- a/indra/newview/skins/default/xui/de/menu_login.xml +++ b/indra/newview/skins/default/xui/de/menu_login.xml @@ -10,7 +10,6 @@ - diff --git a/indra/newview/skins/default/xui/de/panel_people.xml b/indra/newview/skins/default/xui/de/panel_people.xml index 1d802c1037..7b82d2d4ae 100644 --- a/indra/newview/skins/default/xui/de/panel_people.xml +++ b/indra/newview/skins/default/xui/de/panel_people.xml @@ -14,7 +14,7 @@ Sie suchen nach Orten mit mehr Leuten? [secondlife:///app/floater/destinations Ziele] enthält Orte, die vom Grid-Betreiber ausgewählt wurden. -[secondlife:///app/search/people Suche] lässt Sie das Grid nach bestimmten Schlüsselwörtern durchsuchen. +[secondlife:///app/search/ Suche] lässt Sie das Grid nach bestimmten Schlüsselwörtern durchsuchen. Sie haben nicht das Richtige gefunden? Versuchen Sie es mit der [secondlife:///app/search/people/[SEARCH_TERM] Suche]. diff --git a/indra/newview/skins/default/xui/de/strings.xml b/indra/newview/skins/default/xui/de/strings.xml index 16077504b8..e72a49dad1 100644 --- a/indra/newview/skins/default/xui/de/strings.xml +++ b/indra/newview/skins/default/xui/de/strings.xml @@ -1708,9 +1708,6 @@ http://www.firestormviewer.org/support für Hilfe zum Lösen des Problems. Sie haben nicht das Richtige gefunden? [secondlife:///app/inventory/filters Filter] anzeigen. - - Wählen Sie auf „Als Favoriten-Ordner verwenden“ auf einen Ordner Ihrer Wahl. Sie können jederzeit einen anderen Ordner wählen. System-Ordner oder Ordner innerhalb davon können nicht als Favoriten-Ordner verwendet werden. - Sie haben nicht das Richtige gefunden? Versuchen Sie es mit der [secondlife:///app/search/places/[SEARCH_TERM] Suche]. diff --git a/indra/newview/skins/vintage/xui/de/panel_main_inventory.xml b/indra/newview/skins/vintage/xui/de/panel_main_inventory.xml index 262ad6e8a6..11aed902e2 100644 --- a/indra/newview/skins/vintage/xui/de/panel_main_inventory.xml +++ b/indra/newview/skins/vintage/xui/de/panel_main_inventory.xml @@ -112,7 +112,6 @@ - From a391cf9cbc0a53463db6d628c86a3477e7d8a8b8 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Thu, 22 Apr 2021 20:10:10 +0300 Subject: [PATCH 135/195] SL-14842 Clear history should be it's own button --- indra/newview/llpanelplaces.cpp | 8 ++++++-- indra/newview/llpanelteleporthistory.cpp | 10 ++++++---- indra/newview/llpanelteleporthistory.h | 2 +- .../default/xui/en/menu_teleport_history_item.xml | 11 ----------- indra/newview/skins/default/xui/en/notifications.xml | 2 +- 5 files changed, 14 insertions(+), 19 deletions(-) diff --git a/indra/newview/llpanelplaces.cpp b/indra/newview/llpanelplaces.cpp index 90a70adea7..ac7bc0fc32 100644 --- a/indra/newview/llpanelplaces.cpp +++ b/indra/newview/llpanelplaces.cpp @@ -656,7 +656,9 @@ void LLPanelPlaces::onTabSelected() // Hide menus bool supports_create = mActivePanel->getCreateMenu() != NULL; childSetVisible("add_btn_panel", supports_create); - childSetVisible("trash_btn_panel", supports_create); + + // favorites and inventory can remove items, history can clear history + childSetVisible("trash_btn_panel", TRUE); } void LLPanelPlaces::onTeleportButtonClicked() @@ -1224,7 +1226,9 @@ void LLPanelPlaces::createTabs() // Hide menus bool supports_create = mActivePanel->getCreateMenu() != NULL; childSetVisible("add_btn_panel", supports_create); - childSetVisible("trash_btn_panel", supports_create); + + // favorites and inventory can remove items, history can clear history + childSetVisible("trash_btn_panel", TRUE); } mTabsCreated = true; diff --git a/indra/newview/llpanelteleporthistory.cpp b/indra/newview/llpanelteleporthistory.cpp index 48614e1e47..7a3d3525ac 100644 --- a/indra/newview/llpanelteleporthistory.cpp +++ b/indra/newview/llpanelteleporthistory.cpp @@ -534,6 +534,12 @@ void LLTeleportHistoryPanel::onTeleport() confirmTeleport(itemp->getIndex()); } +// virtual +void LLTeleportHistoryPanel::onRemoveSelected() +{ + LLNotificationsUtil::add("ConfirmClearTeleportHistory", LLSD(), LLSD(), boost::bind(&LLTeleportHistoryPanel::onClearTeleportHistoryDialog, this, _1, _2)); +} + /* // virtual void LLTeleportHistoryPanel::onCopySLURL() @@ -1032,10 +1038,6 @@ void LLTeleportHistoryPanel::onGearMenuAction(const LLSD& userdata) mLastSelectedFlatlList->resetSelection(); } } - else if ("clear_history" == command_name) - { - LLNotificationsUtil::add("ConfirmClearTeleportHistory", LLSD(), LLSD(), boost::bind(&LLTeleportHistoryPanel::onClearTeleportHistoryDialog, this, _1, _2)); - } S32 index = -1; if (mLastSelectedFlatlList) diff --git a/indra/newview/llpanelteleporthistory.h b/indra/newview/llpanelteleporthistory.h index f76dc139bd..058fee0170 100644 --- a/indra/newview/llpanelteleporthistory.h +++ b/indra/newview/llpanelteleporthistory.h @@ -54,7 +54,7 @@ public: void onShowProfile() override; void onTeleport() override; ///*virtual*/ void onCopySLURL(); - void onRemoveSelected() override {}; + void onRemoveSelected() override; void updateVerbs() override; bool isSingleItemSelected() override; 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 f60f02f040..153e5a70a9 100644 --- a/indra/newview/skins/default/xui/en/menu_teleport_history_item.xml +++ b/indra/newview/skins/default/xui/en/menu_teleport_history_item.xml @@ -49,15 +49,4 @@ function="TeleportHistory.GearMenu.Enable" parameter="copy_slurl" /> - - - - - diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml index 87a702faab..0cf0376ef8 100644 --- a/indra/newview/skins/default/xui/en/notifications.xml +++ b/indra/newview/skins/default/xui/en/notifications.xml @@ -8710,7 +8710,7 @@ This upload will cost L$[PRICE], do you wish to continue with the upload? icon="alertmodal.tga" name="ConfirmClearTeleportHistory" type="alertmodal"> -Are you sure you want to delete your teleport history? +This will delete the entire list of places you have visited, and cannot be undone. Continue? confirm Date: Fri, 23 Apr 2021 14:56:01 +0300 Subject: [PATCH 136/195] SL-15144 FIXED The "Remove" button is enabled with no selection --- indra/newview/llpanellandmarks.cpp | 6 ++++++ indra/newview/llpanelplaces.cpp | 3 +++ indra/newview/llpanelplacestab.cpp | 1 + indra/newview/llpanelplacestab.h | 3 +++ indra/newview/llpanelteleporthistory.cpp | 4 ++-- 5 files changed, 15 insertions(+), 2 deletions(-) diff --git a/indra/newview/llpanellandmarks.cpp b/indra/newview/llpanellandmarks.cpp index 769b060d93..e698a61fef 100644 --- a/indra/newview/llpanellandmarks.cpp +++ b/indra/newview/llpanellandmarks.cpp @@ -285,6 +285,10 @@ LLToggleableMenu* LLLandmarksPanel::getCreateMenu() void LLLandmarksPanel::updateVerbs() { + if (sRemoveBtn) + { + sRemoveBtn->setEnabled(isActionEnabled("delete") && (isFolderSelected() || isLandmarkSelected())); + } } void LLLandmarksPanel::setItemSelected(const LLUUID& obj_id, BOOL take_keyboard_focus) @@ -425,6 +429,7 @@ void LLLandmarksPanel::initLandmarksPanel(LLPlacesInventoryPanel* inventory_list { inventory_list->getFilter().setEmptyLookupMessage("PlacesNoMatchingItems"); inventory_list->setFilterTypes(0x1 << LLInventoryType::IT_LANDMARK); + inventory_list->setSelectCallback(boost::bind(&LLLandmarksPanel::updateVerbs, this)); inventory_list->setShowFolderState(LLInventoryFilter::SHOW_NON_EMPTY_FOLDERS); bool sorting_order = gSavedSettings.getBOOL("LandmarksSortedByDate"); @@ -1032,6 +1037,7 @@ bool LLLandmarksPanel::handleDragAndDropToTrash(BOOL drop, EDragAndDropType carg break; } + updateVerbs(); return true; } diff --git a/indra/newview/llpanelplaces.cpp b/indra/newview/llpanelplaces.cpp index ac7bc0fc32..1713370692 100644 --- a/indra/newview/llpanelplaces.cpp +++ b/indra/newview/llpanelplaces.cpp @@ -1229,6 +1229,9 @@ void LLPanelPlaces::createTabs() // favorites and inventory can remove items, history can clear history childSetVisible("trash_btn_panel", TRUE); + + mActivePanel->setRemoveBtn(mRemoveSelectedBtn); + mActivePanel->updateVerbs(); } mTabsCreated = true; diff --git a/indra/newview/llpanelplacestab.cpp b/indra/newview/llpanelplacestab.cpp index 9601ac54a4..748a917147 100644 --- a/indra/newview/llpanelplacestab.cpp +++ b/indra/newview/llpanelplacestab.cpp @@ -38,6 +38,7 @@ #include "llworldmap.h" std::string LLPanelPlacesTab::sFilterSubString = LLStringUtil::null; +LLButton* LLPanelPlacesTab::sRemoveBtn = NULL; bool LLPanelPlacesTab::isTabVisible() { diff --git a/indra/newview/llpanelplacestab.h b/indra/newview/llpanelplacestab.h index 886f4ce9c0..aab1c130c1 100644 --- a/indra/newview/llpanelplacestab.h +++ b/indra/newview/llpanelplacestab.h @@ -67,9 +67,12 @@ public: const std::string& getFilterSubString() { return sFilterSubString; } void setFilterSubString(const std::string& string) { sFilterSubString = string; } + void setRemoveBtn(LLButton* trash_btn) { sRemoveBtn = trash_btn; } + protected: // Search string for filtering landmarks and teleport history locations static std::string sFilterSubString; + static LLButton* sRemoveBtn; }; #endif //LL_LLPANELPLACESTAB_H diff --git a/indra/newview/llpanelteleporthistory.cpp b/indra/newview/llpanelteleporthistory.cpp index 7a3d3525ac..b938b30479 100644 --- a/indra/newview/llpanelteleporthistory.cpp +++ b/indra/newview/llpanelteleporthistory.cpp @@ -570,9 +570,9 @@ void LLTeleportHistoryPanel::updateVerbs() if (!isTabVisible()) return; - if (!mLastSelectedFlatlList) + if (sRemoveBtn) { - return; + sRemoveBtn->setEnabled(true); } } From db8a55c2e606b77cc4bf758dd7b4228e37269eab Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Fri, 23 Apr 2021 18:38:07 +0300 Subject: [PATCH 137/195] SL-14842 Tooltip for clear history --- indra/newview/llpanelplaces.cpp | 18 ++++++++++++++++++ .../skins/default/xui/en/panel_places.xml | 7 ++++++- 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/indra/newview/llpanelplaces.cpp b/indra/newview/llpanelplaces.cpp index 1713370692..9c67ec40fe 100644 --- a/indra/newview/llpanelplaces.cpp +++ b/indra/newview/llpanelplaces.cpp @@ -659,6 +659,15 @@ void LLPanelPlaces::onTabSelected() // favorites and inventory can remove items, history can clear history childSetVisible("trash_btn_panel", TRUE); + + if (supports_create) + { + mRemoveSelectedBtn->setToolTip(getString("tooltip_trash_items")); + } + else + { + mRemoveSelectedBtn->setToolTip(getString("tooltip_trash_history")); + } } void LLPanelPlaces::onTeleportButtonClicked() @@ -1230,6 +1239,15 @@ void LLPanelPlaces::createTabs() // favorites and inventory can remove items, history can clear history childSetVisible("trash_btn_panel", TRUE); + if (supports_create) + { + mRemoveSelectedBtn->setToolTip(getString("tooltip_trash_items")); + } + else + { + mRemoveSelectedBtn->setToolTip(getString("tooltip_trash_history")); + } + mActivePanel->setRemoveBtn(mRemoveSelectedBtn); mActivePanel->updateVerbs(); } diff --git a/indra/newview/skins/default/xui/en/panel_places.xml b/indra/newview/skins/default/xui/en/panel_places.xml index dd4cf7ab4e..58be4d4c5e 100644 --- a/indra/newview/skins/default/xui/en/panel_places.xml +++ b/indra/newview/skins/default/xui/en/panel_places.xml @@ -20,6 +20,12 @@ background_visible="true" + + From 49f9195f4247b564186730e0cc95ec199e05127b Mon Sep 17 00:00:00 2001 From: Kitty Barnett Date: Sat, 24 Apr 2021 18:51:07 +0200 Subject: [PATCH 138/195] [FIXED] LLVisualEffectParams::step(bool isLast) will always be called with isLast == false (fixes RLVa spheres issues when AA is disabled) --- indra/newview/llvisualeffect.cpp | 7 ++++--- indra/newview/llvisualeffect.h | 1 + 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/indra/newview/llvisualeffect.cpp b/indra/newview/llvisualeffect.cpp index af68a57413..efa0cbf2b1 100644 --- a/indra/newview/llvisualeffect.cpp +++ b/indra/newview/llvisualeffect.cpp @@ -114,11 +114,12 @@ void LLVfxManager::runEffect(EVisualEffect eCode, LLVisualEffectParams* pParams) auto itEffect = boost::make_filter_iterator(pred, m_Effects.begin(), m_Effects.end()), endEffect = boost::make_filter_iterator(pred, m_Effects.end(), m_Effects.end()); - for (; itEffect != endEffect; ++itEffect) + while (itEffect != endEffect) { + LLVisualEffect* pEffect = *itEffect; if (pParams) - pParams->step(itEffect == endEffect); - (*itEffect)->run(pParams); + pParams->step(++itEffect == endEffect); + pEffect->run(pParams); } } diff --git a/indra/newview/llvisualeffect.h b/indra/newview/llvisualeffect.h index 6419e26b29..69387d49af 100644 --- a/indra/newview/llvisualeffect.h +++ b/indra/newview/llvisualeffect.h @@ -163,6 +163,7 @@ public: template T* getEffect(const LLUUID& idEffect) const { return dynamic_cast(getEffect(idEffect)); } LLVisualEffect* getEffect(EVisualEffect eCode) const; template T* getEffect(EVisualEffect eCode) const { return dynamic_cast(getEffect(eCode)); } + bool hasEffect(EVisualEffect eCode) const { return getEffect(eCode); } bool removeEffect(const LLUUID& idEffect); void runEffect(EVisualEffect eCode, LLVisualEffectParams* pParams = nullptr); void runEffect(EVisualEffectType eType, LLVisualEffectParams* pParams = nullptr); From a91e22731998230f9b41d6d86328b66bf7a122ae Mon Sep 17 00:00:00 2001 From: Mnikolenko Productengine Date: Wed, 28 Apr 2021 13:14:51 +0300 Subject: [PATCH 139/195] SL-15174 set Starting Guidebook location on-screen --- indra/llui/llfloater.cpp | 18 +++++++++++++++++- indra/llui/llfloater.h | 6 ++++++ .../skins/default/xui/en/floater_how_to.xml | 2 ++ 3 files changed, 25 insertions(+), 1 deletion(-) diff --git a/indra/llui/llfloater.cpp b/indra/llui/llfloater.cpp index c03b024dd5..3680e20f15 100644 --- a/indra/llui/llfloater.cpp +++ b/indra/llui/llfloater.cpp @@ -199,7 +199,9 @@ LLFloater::Params::Params() help_pressed_image("help_pressed_image"), open_callback("open_callback"), close_callback("close_callback"), - follows("follows") + follows("follows"), + rel_x("rel_x", 0), + rel_y("rel_y", 0) { changeDefault(visible, false); } @@ -268,6 +270,8 @@ LLFloater::LLFloater(const LLSD& key, const LLFloater::Params& p) mHasBeenDraggedWhileMinimized(FALSE), mPreviousMinimizedBottom(0), mPreviousMinimizedLeft(0), + mDefaultRelativeX(p.rel_x), + mDefaultRelativeY(p.rel_y), mMinimizeSignal(NULL) // mNotificationContext(NULL) { @@ -935,6 +939,15 @@ bool LLFloater::applyRectControl() saved_rect = true; } + else if ((mDefaultRelativeX != 0) && (mDefaultRelativeY != 0)) + { + mPosition.mX = mDefaultRelativeX; + mPosition.mY = mDefaultRelativeY; + mPositioning = LLFloaterEnums::POSITIONING_RELATIVE; + applyRelativePosition(); + + saved_rect = true; + } // remember updated position if (rect_specified) @@ -3200,6 +3213,9 @@ void LLFloater::initFromParams(const LLFloater::Params& p) mSingleInstance = p.single_instance; mReuseInstance = p.reuse_instance.isProvided() ? p.reuse_instance : p.single_instance; + mDefaultRelativeX = p.rel_x; + mDefaultRelativeY = p.rel_y; + mPositioning = p.positioning; mSaveRect = p.save_rect; diff --git a/indra/llui/llfloater.h b/indra/llui/llfloater.h index f8c04e8a2f..2672d600c6 100644 --- a/indra/llui/llfloater.h +++ b/indra/llui/llfloater.h @@ -172,6 +172,9 @@ public: Optional header_height, legacy_header_height; // HACK see initFromXML() + Optional rel_x, + rel_y; + // Images for top-right controls Optional close_image, restore_image, @@ -521,6 +524,9 @@ private: BOOL mHasBeenDraggedWhileMinimized; S32 mPreviousMinimizedBottom; S32 mPreviousMinimizedLeft; + + F32 mDefaultRelativeX; + F32 mDefaultRelativeY; }; diff --git a/indra/newview/skins/default/xui/en/floater_how_to.xml b/indra/newview/skins/default/xui/en/floater_how_to.xml index b4dd2e252f..acfa6a5152 100644 --- a/indra/newview/skins/default/xui/en/floater_how_to.xml +++ b/indra/newview/skins/default/xui/en/floater_how_to.xml @@ -12,4 +12,6 @@ save_rect="true" title="WELCOME ISLAND GUIDEBOOK" width="310" + rel_x="-0.469309" + rel_y="-0.011166" filename="floater_web_content.xml"/> \ No newline at end of file From 466bc74c061089597ac39717d34417bcdc37f4d9 Mon Sep 17 00:00:00 2001 From: Ansariel Date: Sat, 1 May 2021 00:38:36 +0200 Subject: [PATCH 140/195] Revert silly design decision to have the same icon delete a single entry in one case, but the whole list in another --- indra/newview/llpanelplaces.cpp | 42 +++++++++++-------- .../skins/default/xui/en/panel_places.xml | 1 + 2 files changed, 25 insertions(+), 18 deletions(-) diff --git a/indra/newview/llpanelplaces.cpp b/indra/newview/llpanelplaces.cpp index 2df7e9c6d5..a33f4e5b3b 100644 --- a/indra/newview/llpanelplaces.cpp +++ b/indra/newview/llpanelplaces.cpp @@ -692,16 +692,19 @@ void LLPanelPlaces::onTabSelected() childSetVisible("add_btn_panel", supports_create); // favorites and inventory can remove items, history can clear history - childSetVisible("trash_btn_panel", TRUE); + // Trashcan icon clearing everything? No way! + //childSetVisible("trash_btn_panel", TRUE); - if (supports_create) - { - mRemoveSelectedBtn->setToolTip(getString("tooltip_trash_items")); - } - else - { - mRemoveSelectedBtn->setToolTip(getString("tooltip_trash_history")); - } + //if (supports_create) + //{ + // mRemoveSelectedBtn->setToolTip(getString("tooltip_trash_items")); + //} + //else + //{ + // mRemoveSelectedBtn->setToolTip(getString("tooltip_trash_history")); + //} + childSetVisible("trash_btn_panel", supports_create); + // } void LLPanelPlaces::onTeleportButtonClicked() @@ -1275,16 +1278,19 @@ void LLPanelPlaces::createTabs() childSetVisible("add_btn_panel", supports_create); // favorites and inventory can remove items, history can clear history - childSetVisible("trash_btn_panel", TRUE); + // Trashcan icon clearing everything? No way! + //childSetVisible("trash_btn_panel", TRUE); - if (supports_create) - { - mRemoveSelectedBtn->setToolTip(getString("tooltip_trash_items")); - } - else - { - mRemoveSelectedBtn->setToolTip(getString("tooltip_trash_history")); - } + //if (supports_create) + //{ + // mRemoveSelectedBtn->setToolTip(getString("tooltip_trash_items")); + //} + //else + //{ + // mRemoveSelectedBtn->setToolTip(getString("tooltip_trash_history")); + //} + childSetVisible("trash_btn_panel", supports_create); + // mActivePanel->setRemoveBtn(mRemoveSelectedBtn); mActivePanel->updateVerbs(); diff --git a/indra/newview/skins/default/xui/en/panel_places.xml b/indra/newview/skins/default/xui/en/panel_places.xml index 2ac566632d..4c94b20a05 100644 --- a/indra/newview/skins/default/xui/en/panel_places.xml +++ b/indra/newview/skins/default/xui/en/panel_places.xml @@ -140,6 +140,7 @@ height="25" layout="topleft" name="trash_btn_panel" + tool_tip="Remove selected landmark or folder" width="31"> Date: Sat, 1 May 2021 00:40:27 +0200 Subject: [PATCH 141/195] Update German translation --- indra/newview/skins/default/xui/de/notifications.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/newview/skins/default/xui/de/notifications.xml b/indra/newview/skins/default/xui/de/notifications.xml index 75fa9d2a7e..9aec9531f7 100644 --- a/indra/newview/skins/default/xui/de/notifications.xml +++ b/indra/newview/skins/default/xui/de/notifications.xml @@ -3600,7 +3600,7 @@ Ihr aktueller Kontostand von [BALANCE] L$ reicht nicht aus, um [COUNT] Gegenstä - Möchten Sie Ihre Teleport-Liste löschen? + Möchten Sie die gesamte Teleport-Liste aller besuchten Orte löschen? Diese Aktion kann nicht rückgängig gemacht werden! From 9874d65e54c21db38efe65dfbb9c52f7c9971488 Mon Sep 17 00:00:00 2001 From: Andrey Lihatskiy Date: Sat, 1 May 2021 02:17:35 +0300 Subject: [PATCH 142/195] Follow-up merge conflict fix --- indra/newview/llfloaterfixedenvironment.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/newview/llfloaterfixedenvironment.cpp b/indra/newview/llfloaterfixedenvironment.cpp index 9978c837b2..4f2c36f45b 100644 --- a/indra/newview/llfloaterfixedenvironment.cpp +++ b/indra/newview/llfloaterfixedenvironment.cpp @@ -180,7 +180,7 @@ void LLFloaterFixedEnvironment::setEditSettingsAndUpdate(const LLSettingsBase::p updateEditEnvironment(); syncronizeTabs(); refresh(); - LLEnvironment::instance().updateEnvironment(LLEnvironment::TRANSITION_FAST); + LLEnvironment::instance().updateEnvironment(LLEnvironment::TRANSITION_INSTANT); } void LLFloaterFixedEnvironment::syncronizeTabs() From cfb6ca569b2c834520ce50564e857dfc06831675 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Thu, 6 May 2021 00:46:14 +0300 Subject: [PATCH 143/195] SL-15168 Viewer side functionality for guidebook window opening --- indra/newview/CMakeLists.txt | 2 + indra/newview/llappviewer.cpp | 2 + indra/newview/llenvironment.cpp | 2 +- indra/newview/llfloaterhowto.cpp | 7 +- indra/newview/llstartup.cpp | 2 - indra/newview/llurlfloaterdispatchhandler.cpp | 107 ++++++++++++++++++ indra/newview/llurlfloaterdispatchhandler.h | 46 ++++++++ 7 files changed, 163 insertions(+), 5 deletions(-) create mode 100644 indra/newview/llurlfloaterdispatchhandler.cpp create mode 100644 indra/newview/llurlfloaterdispatchhandler.h diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index 82dcd402be..e8e5b83957 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -638,6 +638,7 @@ set(viewer_SOURCE_FILES llurl.cpp llurldispatcher.cpp llurldispatcherlistener.cpp + llurlfloaterdispatchhandler.cpp llurlhistory.cpp llurllineeditorctrl.cpp llurlwhitelist.cpp @@ -1269,6 +1270,7 @@ set(viewer_HEADER_FILES llurl.h llurldispatcher.h llurldispatcherlistener.h + llurlfloaterdispatchhandler.h llurlhistory.h llurllineeditorctrl.h llurlwhitelist.h diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 0b2cdff36c..9d03edc060 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -59,6 +59,7 @@ #include "llslurl.h" #include "llstartup.h" #include "llfocusmgr.h" +#include "llurlfloaterdispatchhandler.h" #include "llviewerjoystick.h" #include "llallocator.h" #include "llcalc.h" @@ -917,6 +918,7 @@ bool LLAppViewer::init() // Load translations for tooltips LLFloater::initClass(); + LLUrlFloaterDispatchHandler::registerInDispatcher(); ///////////////////////////////////////////////// diff --git a/indra/newview/llenvironment.cpp b/indra/newview/llenvironment.cpp index 90d22c57b0..190051d763 100644 --- a/indra/newview/llenvironment.cpp +++ b/indra/newview/llenvironment.cpp @@ -327,7 +327,7 @@ namespace std::istringstream llsdData(llsdRaw); if (!LLSDSerialize::deserialize(message, llsdData, llsdRaw.length())) { - LL_WARNS() << "LLExperienceLogDispatchHandler: Attempted to read parameter data into LLSD but failed:" << llsdRaw << LL_ENDL; + LL_WARNS() << "LLEnvironmentPushDispatchHandler: Attempted to read parameter data into LLSD but failed:" << llsdRaw << LL_ENDL; } } diff --git a/indra/newview/llfloaterhowto.cpp b/indra/newview/llfloaterhowto.cpp index 665955c946..9db733db25 100644 --- a/indra/newview/llfloaterhowto.cpp +++ b/indra/newview/llfloaterhowto.cpp @@ -52,8 +52,11 @@ BOOL LLFloaterHowTo::postBuild() void LLFloaterHowTo::onOpen(const LLSD& key) { LLFloaterWebContent::Params p(key); - std::string url = gSavedSettings.getString("GuidebookURL"); - p.url = LLWeb::expandURLSubstitutions(url, LLSD()); + if (!p.url.isProvided() || p.url.getValue().empty()) + { + std::string url = gSavedSettings.getString("GuidebookURL"); + p.url = LLWeb::expandURLSubstitutions(url, LLSD()); + } p.show_chrome = false; LLFloaterWebContent::onOpen(p); diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp index 0ea5de8d67..55048b03be 100644 --- a/indra/newview/llstartup.cpp +++ b/indra/newview/llstartup.cpp @@ -1905,8 +1905,6 @@ bool idle_startup() // Set the show start location to true, now that the user has logged // on with this install. gSavedSettings.setBOOL("ShowStartLocation", TRUE); - - LLFloaterReg::toggleInstanceOrBringToFront("how_to"); } display_startup(); diff --git a/indra/newview/llurlfloaterdispatchhandler.cpp b/indra/newview/llurlfloaterdispatchhandler.cpp new file mode 100644 index 0000000000..7f9929041d --- /dev/null +++ b/indra/newview/llurlfloaterdispatchhandler.cpp @@ -0,0 +1,107 @@ +/** + * @file llurlfloaterdispatchhandler.cpp + * @brief Handles URLFloater generic message from server + * + * $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 "llviewerprecompiledheaders.h" + +#include "llurlfloaterdispatchhandler.h" + +#include "llfloaterreg.h" +#include "llfloaterwebcontent.h" +#include "llsdserialize.h" +#include "llviewercontrol.h" +#include "llviewergenericmessage.h" +#include "llweb.h" + +// values specified by server side's dispatcher +const std::string MESSAGE_URL_FLOATER("URLFloater"); +const std::string KEY_ACTION("OpenURL"); +const std::string KEY_PARAMS("floater_params"); +const std::string KEY_FLOATER("floater_title"); +const std::string KEY_URL("floater_url"); + +LLUrlFloaterDispatchHandler LLUrlFloaterDispatchHandler::sUrlDispatchhandler; + +LLUrlFloaterDispatchHandler::LLUrlFloaterDispatchHandler() +{ +} + +LLUrlFloaterDispatchHandler::~LLUrlFloaterDispatchHandler() +{ +} + +void LLUrlFloaterDispatchHandler::registerInDispatcher() +{ + if (!gGenericDispatcher.isHandlerPresent(MESSAGE_URL_FLOATER)) + { + gGenericDispatcher.addHandler(MESSAGE_URL_FLOATER, &sUrlDispatchhandler); + } +} + +//virtual +bool LLUrlFloaterDispatchHandler::operator()(const LLDispatcher *, const std::string& key, const LLUUID& invoice, const sparam_t& strings) +{ + // invoice - transaction id + + LLSD message; + sparam_t::const_iterator it = strings.begin(); + + if (it != strings.end()) + { + const std::string& llsdRaw = *it++; + std::istringstream llsdData(llsdRaw); + if (!LLSDSerialize::deserialize(message, llsdData, llsdRaw.length())) + { + LL_WARNS("URLFloater") << "Attempted to read parameter data into LLSD but failed:" << llsdRaw << LL_ENDL; + } + } + + std::string floater = message[KEY_FLOATER]; + LLSD &command_params = message[KEY_PARAMS]; + + LLFloaterWebContent::Params params; + params.url = message[KEY_URL]; + + if (floater == "guidebook" || floater == "how_to") + { + if (command_params.isMap()) // by default is undefines + { + params.trusted_content = command_params.has("trusted_content") ? command_params["trusted_content"] : false; + } + LLFloaterReg::toggleInstanceOrBringToFront("how_to", params); + } + else if (!params.url.getValue().empty()) + { + if (command_params.isMap()) // by default is undefines + { + params.trusted_content = command_params.has("trusted_content") ? command_params["trusted_content"] : false; + params.show_page_title = command_params.has("show_page_title") ? command_params["show_page_title"] : true; + params.allow_address_entry = command_params.has("allow_address_entry") ? command_params["allow_address_entry"] : true; + } + LLFloaterReg::showInstance("web_content", params); + } + + return true; +} diff --git a/indra/newview/llurlfloaterdispatchhandler.h b/indra/newview/llurlfloaterdispatchhandler.h new file mode 100644 index 0000000000..469f76b007 --- /dev/null +++ b/indra/newview/llurlfloaterdispatchhandler.h @@ -0,0 +1,46 @@ +/** + * @file llurlfloaterdispatchhandler.h + * @brief Handles URLFloater generic message from server + * + * $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_LLURLFLOATERDISPATCHHANDLER_H +#define LL_LLURLFLOATERDISPATCHHANDLER_H + +#include "lldispatcher.h" + +class LLUrlFloaterDispatchHandler : public LLDispatchHandler +{ +public: + LLUrlFloaterDispatchHandler(); + virtual ~LLUrlFloaterDispatchHandler(); + virtual bool operator()(const LLDispatcher *, const std::string& key, const LLUUID& invoice, const sparam_t& strings) override; + + static void registerInDispatcher(); + +private: + static LLUrlFloaterDispatchHandler sUrlDispatchhandler; +}; + +#endif // LL_LLURLFLOATERDISPATCHHANDLER_H + From cb42bc2823931b84ce079423a471a332dc332b0c Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Thu, 6 May 2021 21:57:46 +0300 Subject: [PATCH 144/195] SL-15168 Viewer side functionality for guidebook window opening #2 --- indra/llui/llfloaterreg.cpp | 6 ++ indra/llui/llfloaterreg.h | 1 + indra/newview/llfloaterhowto.cpp | 17 ++-- indra/newview/llfloaterhowto.h | 3 + indra/newview/llurlfloaterdispatchhandler.cpp | 80 +++++++++++++++++-- indra/newview/llurlfloaterdispatchhandler.h | 3 + 6 files changed, 96 insertions(+), 14 deletions(-) diff --git a/indra/llui/llfloaterreg.cpp b/indra/llui/llfloaterreg.cpp index 7c0933f554..36a0cb0fd0 100644 --- a/indra/llui/llfloaterreg.cpp +++ b/indra/llui/llfloaterreg.cpp @@ -57,6 +57,12 @@ void LLFloaterReg::add(const std::string& name, const std::string& filename, con sGroupMap[groupname] = groupname; // for referencing directly by group name } +//static +bool LLFloaterReg::isRegistered(const std::string& name) +{ + return sBuildMap.find(name) != sBuildMap.end(); +} + //static LLFloater* LLFloaterReg::getLastFloaterInGroup(const std::string& name) { diff --git a/indra/llui/llfloaterreg.h b/indra/llui/llfloaterreg.h index e3b17dcb4f..a457a15673 100644 --- a/indra/llui/llfloaterreg.h +++ b/indra/llui/llfloaterreg.h @@ -85,6 +85,7 @@ public: static void add(const std::string& name, const std::string& file, const LLFloaterBuildFunc& func, const std::string& groupname = LLStringUtil::null); + static bool isRegistered(const std::string& name); // Helpers static LLFloater* getLastFloaterInGroup(const std::string& name); diff --git a/indra/newview/llfloaterhowto.cpp b/indra/newview/llfloaterhowto.cpp index 9db733db25..ef40060807 100644 --- a/indra/newview/llfloaterhowto.cpp +++ b/indra/newview/llfloaterhowto.cpp @@ -61,13 +61,16 @@ void LLFloaterHowTo::onOpen(const LLSD& key) LLFloaterWebContent::onOpen(p); - // Elements from LLFloaterWebContent did not pick up restored size (save_rect) of LLFloaterHowTo - // set the stack size and position (alternative to preferred_media_size) - LLLayoutStack *stack = getChild("stack1"); - LLRect stack_rect = stack->getRect(); - stack->reshape(STACK_WIDTH, STACK_HEIGHT); - stack->setOrigin(stack_rect.mLeft, stack_rect.mTop - STACK_HEIGHT); - stack->updateLayout(); + if (p.preferred_media_size().isEmpty()) + { + // Elements from LLFloaterWebContent did not pick up restored size (save_rect) of LLFloaterHowTo + // set the stack size and position (alternative to preferred_media_size) + LLLayoutStack *stack = getChild("stack1"); + LLRect stack_rect = stack->getRect(); + stack->reshape(STACK_WIDTH, STACK_HEIGHT); + stack->setOrigin(stack_rect.mLeft, stack_rect.mTop - STACK_HEIGHT); + stack->updateLayout(); + } } LLFloaterHowTo* LLFloaterHowTo::getInstance() diff --git a/indra/newview/llfloaterhowto.h b/indra/newview/llfloaterhowto.h index e08d102e2a..15fc43335a 100644 --- a/indra/newview/llfloaterhowto.h +++ b/indra/newview/llfloaterhowto.h @@ -36,6 +36,9 @@ class LLFloaterHowTo : public LLFloaterWebContent { public: + LOG_CLASS(LLFloaterHowTo); + + typedef LLFloaterWebContent::Params Params; LLFloaterHowTo(const Params& key); diff --git a/indra/newview/llurlfloaterdispatchhandler.cpp b/indra/newview/llurlfloaterdispatchhandler.cpp index 7f9929041d..1a5da79a74 100644 --- a/indra/newview/llurlfloaterdispatchhandler.cpp +++ b/indra/newview/llurlfloaterdispatchhandler.cpp @@ -29,6 +29,7 @@ #include "llurlfloaterdispatchhandler.h" #include "llfloaterreg.h" +#include "llfloaterhowto.h" #include "llfloaterwebcontent.h" #include "llsdserialize.h" #include "llviewercontrol.h" @@ -36,11 +37,14 @@ #include "llweb.h" // values specified by server side's dispatcher +// for llopenfloater const std::string MESSAGE_URL_FLOATER("URLFloater"); -const std::string KEY_ACTION("OpenURL"); -const std::string KEY_PARAMS("floater_params"); +const std::string KEY_ACTION("action"); // "action" will be the string constant "OpenURL" +const std::string VALUE_OPEN_URL("OpenURL"); +const std::string KEY_DATA("action_data"); const std::string KEY_FLOATER("floater_title"); const std::string KEY_URL("floater_url"); +const std::string KEY_PARAMS("floater_params"); LLUrlFloaterDispatchHandler LLUrlFloaterDispatchHandler::sUrlDispatchhandler; @@ -75,26 +79,75 @@ bool LLUrlFloaterDispatchHandler::operator()(const LLDispatcher *, const std::st if (!LLSDSerialize::deserialize(message, llsdData, llsdRaw.length())) { LL_WARNS("URLFloater") << "Attempted to read parameter data into LLSD but failed:" << llsdRaw << LL_ENDL; + return false; } } - std::string floater = message[KEY_FLOATER]; - LLSD &command_params = message[KEY_PARAMS]; + std::string floater; + LLSD command_params; + std::string url; + + if (message.has(KEY_ACTION) && message[KEY_ACTION].asString() == VALUE_OPEN_URL) + { + LLSD &action_data = message[KEY_DATA]; + if (action_data.isMap()) + { + floater = action_data[KEY_FLOATER]; + command_params = action_data[KEY_PARAMS]; + url = action_data[KEY_URL]; + } + } + else if (message.has(KEY_FLOATER)) + { + floater = message[KEY_FLOATER]; + command_params = message[KEY_PARAMS]; + url = message[KEY_URL]; + } + else + { + LL_WARNS("URLFloater") << "Received " << MESSAGE_URL_FLOATER << " with unexpected data format: " << message << LL_ENDL; + return false; + } + + if (url.find("://") == std::string::npos) + { + // try unescaping + url = LLURI::unescape(url); + } LLFloaterWebContent::Params params; - params.url = message[KEY_URL]; + params.url = url; if (floater == "guidebook" || floater == "how_to") { if (command_params.isMap()) // by default is undefines { params.trusted_content = command_params.has("trusted_content") ? command_params["trusted_content"] : false; + + // Script's side argument list can't include other lists, neither + // there is a LLRect type, so expect just width and height + if (command_params.has("width") && command_params.has("height")) + { + LLRect rect(0, command_params["height"].asInteger(), command_params["width"].asInteger(), 0); + params.preferred_media_size.setValue(rect); + } } + + // Some locations will have customized guidebook, which this function easists for + // only one instance of guidebook can exist at a time, so if this command arrives, + // we need to close previous guidebook then reopen it. + + LLFloater* instance = LLFloaterReg::findInstance("how_to"); + if (instance) + { + instance->closeHostedFloater(); + } + LLFloaterReg::toggleInstanceOrBringToFront("how_to", params); } - else if (!params.url.getValue().empty()) + else if (floater == "web_content") { - if (command_params.isMap()) // by default is undefines + if (command_params.isMap()) // by default is undefines, might be better idea to init params from command_params { params.trusted_content = command_params.has("trusted_content") ? command_params["trusted_content"] : false; params.show_page_title = command_params.has("show_page_title") ? command_params["show_page_title"] : true; @@ -102,6 +155,19 @@ bool LLUrlFloaterDispatchHandler::operator()(const LLDispatcher *, const std::st } LLFloaterReg::showInstance("web_content", params); } + else + { + if (LLFloaterReg::isRegistered(floater)) + { + // A valid floater + LL_INFOS("URLFloater") << "Floater " << floater << " is not supported by llopenfloater or URLFloater" << LL_ENDL; + } + else + { + // A valid message, but no such flaoter + LL_WARNS("URLFloater") << "Recieved a command to open unknown floater: " << floater << LL_ENDL; + } + } return true; } diff --git a/indra/newview/llurlfloaterdispatchhandler.h b/indra/newview/llurlfloaterdispatchhandler.h index 469f76b007..1dff52c66f 100644 --- a/indra/newview/llurlfloaterdispatchhandler.h +++ b/indra/newview/llurlfloaterdispatchhandler.h @@ -32,8 +32,11 @@ class LLUrlFloaterDispatchHandler : public LLDispatchHandler { public: + LOG_CLASS(LLUrlFloaterDispatchHandler); + LLUrlFloaterDispatchHandler(); virtual ~LLUrlFloaterDispatchHandler(); + virtual bool operator()(const LLDispatcher *, const std::string& key, const LLUUID& invoice, const sparam_t& strings) override; static void registerInDispatcher(); From aac1fc4991338ef7c214e9b4e0dbc5d5bb554771 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Mon, 10 May 2021 21:15:12 +0300 Subject: [PATCH 145/195] SL-15168 Mac build fix --- indra/newview/llurlfloaterdispatchhandler.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/indra/newview/llurlfloaterdispatchhandler.cpp b/indra/newview/llurlfloaterdispatchhandler.cpp index 1a5da79a74..65fbfe9fa3 100644 --- a/indra/newview/llurlfloaterdispatchhandler.cpp +++ b/indra/newview/llurlfloaterdispatchhandler.cpp @@ -92,16 +92,16 @@ bool LLUrlFloaterDispatchHandler::operator()(const LLDispatcher *, const std::st LLSD &action_data = message[KEY_DATA]; if (action_data.isMap()) { - floater = action_data[KEY_FLOATER]; + floater = action_data[KEY_FLOATER].asString(); command_params = action_data[KEY_PARAMS]; - url = action_data[KEY_URL]; + url = action_data[KEY_URL].asString(); } } else if (message.has(KEY_FLOATER)) { - floater = message[KEY_FLOATER]; + floater = message[KEY_FLOATER].asString(); command_params = message[KEY_PARAMS]; - url = message[KEY_URL]; + url = message[KEY_URL].asString(); } else { @@ -122,7 +122,7 @@ bool LLUrlFloaterDispatchHandler::operator()(const LLDispatcher *, const std::st { if (command_params.isMap()) // by default is undefines { - params.trusted_content = command_params.has("trusted_content") ? command_params["trusted_content"] : false; + params.trusted_content = command_params.has("trusted_content") ? command_params["trusted_content"].asBoolean() : false; // Script's side argument list can't include other lists, neither // there is a LLRect type, so expect just width and height @@ -149,9 +149,9 @@ bool LLUrlFloaterDispatchHandler::operator()(const LLDispatcher *, const std::st { if (command_params.isMap()) // by default is undefines, might be better idea to init params from command_params { - params.trusted_content = command_params.has("trusted_content") ? command_params["trusted_content"] : false; - params.show_page_title = command_params.has("show_page_title") ? command_params["show_page_title"] : true; - params.allow_address_entry = command_params.has("allow_address_entry") ? command_params["allow_address_entry"] : true; + params.trusted_content = command_params.has("trusted_content") ? command_params["trusted_content"].asBoolean() : false; + params.show_page_title = command_params.has("show_page_title") ? command_params["show_page_title"].asBoolean() : true; + params.allow_address_entry = command_params.has("allow_address_entry") ? command_params["allow_address_entry"].asBoolean() : true; } LLFloaterReg::showInstance("web_content", params); } From 48394bdc23015c8289ef97fa1af99ba3e024ef36 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Tue, 11 May 2021 00:10:38 +0300 Subject: [PATCH 146/195] SL-15168 Reorginized contants --- indra/newview/llurlfloaterdispatchhandler.cpp | 40 +++++++++++++++---- 1 file changed, 32 insertions(+), 8 deletions(-) diff --git a/indra/newview/llurlfloaterdispatchhandler.cpp b/indra/newview/llurlfloaterdispatchhandler.cpp index 65fbfe9fa3..40afafa4c0 100644 --- a/indra/newview/llurlfloaterdispatchhandler.cpp +++ b/indra/newview/llurlfloaterdispatchhandler.cpp @@ -46,6 +46,24 @@ const std::string KEY_FLOATER("floater_title"); const std::string KEY_URL("floater_url"); const std::string KEY_PARAMS("floater_params"); +// Supported floaters +const std::string FLOATER_GUIDEBOOK("guidebook"); // alias for how_to +const std::string FLOATER_HOW_TO("how_to"); +const std::string FLOATER_WEB_CONTENT("web_content"); + +// Web content universal argument +const std::string KEY_TRUSTED_CONTENT("trusted_content"); + +// Guidebook specific arguments +const std::string KEY_WIDTH("width"); +const std::string KEY_HEGHT("height"); +const std::string KEY_CAN_CLOSE("can_close"); + +// web_content specific arguments +const std::string KEY_SHOW_PAGE_TITLE("show_page_title"); +const std::string KEY_ALLOW_ADRESS_ENTRY("allow_address_entry"); // It is not recomended to set this to true if trusted content is allowed + + LLUrlFloaterDispatchHandler LLUrlFloaterDispatchHandler::sUrlDispatchhandler; LLUrlFloaterDispatchHandler::LLUrlFloaterDispatchHandler() @@ -118,17 +136,17 @@ bool LLUrlFloaterDispatchHandler::operator()(const LLDispatcher *, const std::st LLFloaterWebContent::Params params; params.url = url; - if (floater == "guidebook" || floater == "how_to") + if (floater == FLOATER_GUIDEBOOK || floater == FLOATER_HOW_TO) { if (command_params.isMap()) // by default is undefines { - params.trusted_content = command_params.has("trusted_content") ? command_params["trusted_content"].asBoolean() : false; + params.trusted_content = command_params.has(KEY_TRUSTED_CONTENT) ? command_params[KEY_TRUSTED_CONTENT].asBoolean() : false; // Script's side argument list can't include other lists, neither // there is a LLRect type, so expect just width and height - if (command_params.has("width") && command_params.has("height")) + if (command_params.has(KEY_WIDTH) && command_params.has(KEY_HEGHT)) { - LLRect rect(0, command_params["height"].asInteger(), command_params["width"].asInteger(), 0); + LLRect rect(0, command_params[KEY_HEGHT].asInteger(), command_params[KEY_WIDTH].asInteger(), 0); params.preferred_media_size.setValue(rect); } } @@ -144,14 +162,20 @@ bool LLUrlFloaterDispatchHandler::operator()(const LLDispatcher *, const std::st } LLFloaterReg::toggleInstanceOrBringToFront("how_to", params); + + if (command_params.isMap() && command_params.has(KEY_CAN_CLOSE)) + { + LLFloater* instance = LLFloaterReg::findInstance("how_to"); + instance->setCanClose(command_params[KEY_CAN_CLOSE].asBoolean()); + } } - else if (floater == "web_content") + else if (floater == FLOATER_WEB_CONTENT) { if (command_params.isMap()) // by default is undefines, might be better idea to init params from command_params { - params.trusted_content = command_params.has("trusted_content") ? command_params["trusted_content"].asBoolean() : false; - params.show_page_title = command_params.has("show_page_title") ? command_params["show_page_title"].asBoolean() : true; - params.allow_address_entry = command_params.has("allow_address_entry") ? command_params["allow_address_entry"].asBoolean() : true; + params.trusted_content = command_params.has(KEY_TRUSTED_CONTENT) ? command_params[KEY_TRUSTED_CONTENT].asBoolean() : false; + params.show_page_title = command_params.has(KEY_SHOW_PAGE_TITLE) ? command_params[KEY_SHOW_PAGE_TITLE].asBoolean() : true; + params.allow_address_entry = command_params.has(KEY_ALLOW_ADRESS_ENTRY) ? command_params[KEY_ALLOW_ADRESS_ENTRY].asBoolean() : true; } LLFloaterReg::showInstance("web_content", params); } From 9dee16185a0b33177c6b7b3c60733682cebee66d Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Tue, 11 May 2021 01:23:28 +0300 Subject: [PATCH 147/195] SL-15168 Changed format instead of an url function takes an uri --- indra/newview/llurlfloaterdispatchhandler.cpp | 97 +++++++++++++------ 1 file changed, 67 insertions(+), 30 deletions(-) diff --git a/indra/newview/llurlfloaterdispatchhandler.cpp b/indra/newview/llurlfloaterdispatchhandler.cpp index 40afafa4c0..f03caf43b8 100644 --- a/indra/newview/llurlfloaterdispatchhandler.cpp +++ b/indra/newview/llurlfloaterdispatchhandler.cpp @@ -36,25 +36,30 @@ #include "llviewergenericmessage.h" #include "llweb.h" +#include + +// Example: +// llOpenFloater("My Help Title", "secondlife://guidebook", []); + // values specified by server side's dispatcher // for llopenfloater const std::string MESSAGE_URL_FLOATER("URLFloater"); const std::string KEY_ACTION("action"); // "action" will be the string constant "OpenURL" const std::string VALUE_OPEN_URL("OpenURL"); const std::string KEY_DATA("action_data"); -const std::string KEY_FLOATER("floater_title"); -const std::string KEY_URL("floater_url"); +const std::string KEY_FLOATER_TITLE("floater_title"); +const std::string KEY_URI("floater_url"); const std::string KEY_PARAMS("floater_params"); -// Supported floaters -const std::string FLOATER_GUIDEBOOK("guidebook"); // alias for how_to -const std::string FLOATER_HOW_TO("how_to"); -const std::string FLOATER_WEB_CONTENT("web_content"); +// Supported floaters, for now it's exact matching, later it might get extended +const std::string FLOATER_GUIDEBOOK("secondlife://guidebook"); // translates to "how_to" +const std::string FLOATER_WEB_CONTENT("secondlife://browser"); // translates to "web_content" -// Web content universal argument +// Web content universal arguments const std::string KEY_TRUSTED_CONTENT("trusted_content"); +const std::string KEY_URL("url"); -// Guidebook specific arguments +// Guidebook ("how_to") specific arguments const std::string KEY_WIDTH("width"); const std::string KEY_HEGHT("height"); const std::string KEY_CAN_CLOSE("can_close"); @@ -63,6 +68,10 @@ const std::string KEY_CAN_CLOSE("can_close"); const std::string KEY_SHOW_PAGE_TITLE("show_page_title"); const std::string KEY_ALLOW_ADRESS_ENTRY("allow_address_entry"); // It is not recomended to set this to true if trusted content is allowed +// expected format secondlife:///floater_alias +// intended to be extended to: secondlife:///floater_alias/instance_id +const boost::regex expression("secondlife:///[^ \n]{1,256}"); + LLUrlFloaterDispatchHandler LLUrlFloaterDispatchHandler::sUrlDispatchhandler; @@ -101,25 +110,25 @@ bool LLUrlFloaterDispatchHandler::operator()(const LLDispatcher *, const std::st } } - std::string floater; + std::string floater_title; LLSD command_params; - std::string url; + std::string floater_uri; if (message.has(KEY_ACTION) && message[KEY_ACTION].asString() == VALUE_OPEN_URL) { LLSD &action_data = message[KEY_DATA]; if (action_data.isMap()) { - floater = action_data[KEY_FLOATER].asString(); + floater_title = action_data[KEY_FLOATER_TITLE].asString(); command_params = action_data[KEY_PARAMS]; - url = action_data[KEY_URL].asString(); + floater_uri = action_data[KEY_URI].asString(); } } - else if (message.has(KEY_FLOATER)) + else if (message.has(KEY_FLOATER_TITLE)) { - floater = message[KEY_FLOATER].asString(); + floater_title = message[KEY_FLOATER_TITLE].asString(); command_params = message[KEY_PARAMS]; - url = message[KEY_URL].asString(); + floater_uri = message[KEY_URI].asString(); } else { @@ -127,16 +136,33 @@ bool LLUrlFloaterDispatchHandler::operator()(const LLDispatcher *, const std::st return false; } - if (url.find("://") == std::string::npos) + if (floater_uri.find(":///") == std::string::npos) { // try unescaping - url = LLURI::unescape(url); + floater_uri = LLURI::unescape(floater_uri); + } + + boost::cmatch what; + if (!boost::regex_match(floater_uri.c_str(), what, expression)) + { + LL_WARNS("URLFloater") << "Received " << MESSAGE_URL_FLOATER << " with invalid uri: " << floater_uri << LL_ENDL; + return false; } LLFloaterWebContent::Params params; - params.url = url; + if (command_params.isMap()) + { + if (command_params.has(KEY_TRUSTED_CONTENT)) + { + params.trusted_content = command_params[KEY_TRUSTED_CONTENT].asBoolean(); + } + if (command_params.has(KEY_URL)) + { + params.url = command_params[KEY_URL].asString(); + } + } - if (floater == FLOATER_GUIDEBOOK || floater == FLOATER_HOW_TO) + if (floater_uri == FLOATER_GUIDEBOOK) { if (command_params.isMap()) // by default is undefines { @@ -162,34 +188,45 @@ bool LLUrlFloaterDispatchHandler::operator()(const LLDispatcher *, const std::st } LLFloaterReg::toggleInstanceOrBringToFront("how_to", params); - + + instance = LLFloaterReg::findInstance("how_to"); + instance->setTitle(floater_title); if (command_params.isMap() && command_params.has(KEY_CAN_CLOSE)) { - LLFloater* instance = LLFloaterReg::findInstance("how_to"); instance->setCanClose(command_params[KEY_CAN_CLOSE].asBoolean()); } } - else if (floater == FLOATER_WEB_CONTENT) + else if (floater_uri == FLOATER_WEB_CONTENT) { - if (command_params.isMap()) // by default is undefines, might be better idea to init params from command_params + if (command_params.has(KEY_URL)) { - params.trusted_content = command_params.has(KEY_TRUSTED_CONTENT) ? command_params[KEY_TRUSTED_CONTENT].asBoolean() : false; - params.show_page_title = command_params.has(KEY_SHOW_PAGE_TITLE) ? command_params[KEY_SHOW_PAGE_TITLE].asBoolean() : true; - params.allow_address_entry = command_params.has(KEY_ALLOW_ADRESS_ENTRY) ? command_params[KEY_ALLOW_ADRESS_ENTRY].asBoolean() : true; + if (command_params.isMap()) // by default is undefines, might be better idea to init params from command_params + { + params.trusted_content = command_params.has(KEY_TRUSTED_CONTENT) ? command_params[KEY_TRUSTED_CONTENT].asBoolean() : false; + params.show_page_title = command_params.has(KEY_SHOW_PAGE_TITLE) ? command_params[KEY_SHOW_PAGE_TITLE].asBoolean() : true; + params.allow_address_entry = command_params.has(KEY_ALLOW_ADRESS_ENTRY) ? command_params[KEY_ALLOW_ADRESS_ENTRY].asBoolean() : true; + } + LLFloater* instance = LLFloaterReg::showInstance("web_content", params); + instance->setTitle(floater_title); } - LLFloaterReg::showInstance("web_content", params); } else { - if (LLFloaterReg::isRegistered(floater)) + LLSD path_array = LLURI(floater_uri).pathArray(); + S32 path_parts = path_array.size(); + if (path_parts == 0) + { + LL_INFOS("URLFloater") << "received an empty uri: " << floater_uri << LL_ENDL; + } + else if (LLFloaterReg::isRegistered(path_array[0])) { // A valid floater - LL_INFOS("URLFloater") << "Floater " << floater << " is not supported by llopenfloater or URLFloater" << LL_ENDL; + LL_INFOS("URLFloater") << "Floater " << path_array[0] << " is not supported by llopenfloater or URLFloater" << LL_ENDL; } else { // A valid message, but no such flaoter - LL_WARNS("URLFloater") << "Recieved a command to open unknown floater: " << floater << LL_ENDL; + LL_WARNS("URLFloater") << "Recieved a command to open unknown floater: " << floater_uri << LL_ENDL; } } From e886a5e34320c6448293dc05ac89a41b2b4a7f69 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Tue, 11 May 2021 01:48:21 +0300 Subject: [PATCH 148/195] SL-15168 Reset title of guidebook when opening --- indra/newview/llfloaterhowto.cpp | 6 ++++++ indra/newview/skins/default/xui/en/floater_how_to.xml | 9 +++++++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/indra/newview/llfloaterhowto.cpp b/indra/newview/llfloaterhowto.cpp index ef40060807..6e913b08ea 100644 --- a/indra/newview/llfloaterhowto.cpp +++ b/indra/newview/llfloaterhowto.cpp @@ -51,6 +51,12 @@ BOOL LLFloaterHowTo::postBuild() void LLFloaterHowTo::onOpen(const LLSD& key) { + // LLFloaterHowTo is intended to be opened as a location specific guidebook + // with custom titles, reset the title, LLUrlFloaterDispatchHandler will + // set needed one later + // todo: make title into general parameter for LLFloaterWebContent + setTitle(getString("default_tittle")); + LLFloaterWebContent::Params p(key); if (!p.url.isProvided() || p.url.getValue().empty()) { diff --git a/indra/newview/skins/default/xui/en/floater_how_to.xml b/indra/newview/skins/default/xui/en/floater_how_to.xml index acfa6a5152..95690219b8 100644 --- a/indra/newview/skins/default/xui/en/floater_how_to.xml +++ b/indra/newview/skins/default/xui/en/floater_how_to.xml @@ -3,7 +3,7 @@ legacy_header_height="18" can_resize="false" can_minimize="false" - can_close="false" + can_close="false" height="525" layout="topleft" name="floater_how_to" @@ -14,4 +14,9 @@ width="310" rel_x="-0.469309" rel_y="-0.011166" - filename="floater_web_content.xml"/> \ No newline at end of file + filename="floater_web_content.xml"> + +WELCOME ISLAND GUIDEBOOK + + \ No newline at end of file From 2ddbdeb165efc0c41866f1fba084fb365474e63c Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Tue, 11 May 2021 01:48:21 +0300 Subject: [PATCH 149/195] SL-15168 Reset title of guidebook when opening --- indra/newview/llfloaterhowto.cpp | 6 ++++++ indra/newview/llurlfloaterdispatchhandler.cpp | 4 ++-- indra/newview/skins/default/xui/en/floater_how_to.xml | 9 +++++++-- 3 files changed, 15 insertions(+), 4 deletions(-) diff --git a/indra/newview/llfloaterhowto.cpp b/indra/newview/llfloaterhowto.cpp index ef40060807..6e913b08ea 100644 --- a/indra/newview/llfloaterhowto.cpp +++ b/indra/newview/llfloaterhowto.cpp @@ -51,6 +51,12 @@ BOOL LLFloaterHowTo::postBuild() void LLFloaterHowTo::onOpen(const LLSD& key) { + // LLFloaterHowTo is intended to be opened as a location specific guidebook + // with custom titles, reset the title, LLUrlFloaterDispatchHandler will + // set needed one later + // todo: make title into general parameter for LLFloaterWebContent + setTitle(getString("default_tittle")); + LLFloaterWebContent::Params p(key); if (!p.url.isProvided() || p.url.getValue().empty()) { diff --git a/indra/newview/llurlfloaterdispatchhandler.cpp b/indra/newview/llurlfloaterdispatchhandler.cpp index f03caf43b8..519f81b72d 100644 --- a/indra/newview/llurlfloaterdispatchhandler.cpp +++ b/indra/newview/llurlfloaterdispatchhandler.cpp @@ -52,8 +52,8 @@ const std::string KEY_URI("floater_url"); const std::string KEY_PARAMS("floater_params"); // Supported floaters, for now it's exact matching, later it might get extended -const std::string FLOATER_GUIDEBOOK("secondlife://guidebook"); // translates to "how_to" -const std::string FLOATER_WEB_CONTENT("secondlife://browser"); // translates to "web_content" +const std::string FLOATER_GUIDEBOOK("secondlife:///guidebook"); // translates to "how_to" +const std::string FLOATER_WEB_CONTENT("secondlife:///browser"); // translates to "web_content" // Web content universal arguments const std::string KEY_TRUSTED_CONTENT("trusted_content"); diff --git a/indra/newview/skins/default/xui/en/floater_how_to.xml b/indra/newview/skins/default/xui/en/floater_how_to.xml index acfa6a5152..95690219b8 100644 --- a/indra/newview/skins/default/xui/en/floater_how_to.xml +++ b/indra/newview/skins/default/xui/en/floater_how_to.xml @@ -3,7 +3,7 @@ legacy_header_height="18" can_resize="false" can_minimize="false" - can_close="false" + can_close="false" height="525" layout="topleft" name="floater_how_to" @@ -14,4 +14,9 @@ width="310" rel_x="-0.469309" rel_y="-0.011166" - filename="floater_web_content.xml"/> \ No newline at end of file + filename="floater_web_content.xml"> + +WELCOME ISLAND GUIDEBOOK + + \ No newline at end of file From 80eb5ae1f21df34aa043d1aadd99abe042cfd3ba Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Tue, 11 May 2021 13:18:29 +0300 Subject: [PATCH 150/195] SL-15168 Improved uri recognition --- indra/newview/llurlfloaterdispatchhandler.cpp | 56 ++++++++++--------- 1 file changed, 31 insertions(+), 25 deletions(-) diff --git a/indra/newview/llurlfloaterdispatchhandler.cpp b/indra/newview/llurlfloaterdispatchhandler.cpp index 519f81b72d..6de019d73c 100644 --- a/indra/newview/llurlfloaterdispatchhandler.cpp +++ b/indra/newview/llurlfloaterdispatchhandler.cpp @@ -52,8 +52,8 @@ const std::string KEY_URI("floater_url"); const std::string KEY_PARAMS("floater_params"); // Supported floaters, for now it's exact matching, later it might get extended -const std::string FLOATER_GUIDEBOOK("secondlife:///guidebook"); // translates to "how_to" -const std::string FLOATER_WEB_CONTENT("secondlife:///browser"); // translates to "web_content" +const std::string FLOATER_GUIDEBOOK("guidebook"); // translates to "how_to" +const std::string FLOATER_WEB_CONTENT("browser"); // translates to "web_content" // Web content universal arguments const std::string KEY_TRUSTED_CONTENT("trusted_content"); @@ -68,10 +68,6 @@ const std::string KEY_CAN_CLOSE("can_close"); const std::string KEY_SHOW_PAGE_TITLE("show_page_title"); const std::string KEY_ALLOW_ADRESS_ENTRY("allow_address_entry"); // It is not recomended to set this to true if trusted content is allowed -// expected format secondlife:///floater_alias -// intended to be extended to: secondlife:///floater_alias/instance_id -const boost::regex expression("secondlife:///[^ \n]{1,256}"); - LLUrlFloaterDispatchHandler LLUrlFloaterDispatchHandler::sUrlDispatchhandler; @@ -112,7 +108,8 @@ bool LLUrlFloaterDispatchHandler::operator()(const LLDispatcher *, const std::st std::string floater_title; LLSD command_params; - std::string floater_uri; + std::string raw_uri; + std::string floater_identifier; if (message.has(KEY_ACTION) && message[KEY_ACTION].asString() == VALUE_OPEN_URL) { @@ -121,14 +118,14 @@ bool LLUrlFloaterDispatchHandler::operator()(const LLDispatcher *, const std::st { floater_title = action_data[KEY_FLOATER_TITLE].asString(); command_params = action_data[KEY_PARAMS]; - floater_uri = action_data[KEY_URI].asString(); + raw_uri = action_data[KEY_URI].asString(); } } else if (message.has(KEY_FLOATER_TITLE)) { floater_title = message[KEY_FLOATER_TITLE].asString(); command_params = message[KEY_PARAMS]; - floater_uri = message[KEY_URI].asString(); + raw_uri = message[KEY_URI].asString(); } else { @@ -136,16 +133,31 @@ bool LLUrlFloaterDispatchHandler::operator()(const LLDispatcher *, const std::st return false; } - if (floater_uri.find(":///") == std::string::npos) + if (raw_uri.find(":///") == std::string::npos) { // try unescaping - floater_uri = LLURI::unescape(floater_uri); + raw_uri = LLURI::unescape(raw_uri); } - boost::cmatch what; - if (!boost::regex_match(floater_uri.c_str(), what, expression)) + LLURI floater_uri(raw_uri); + if (floater_uri.scheme().empty() || floater_uri.scheme() != "secondlife") { - LL_WARNS("URLFloater") << "Received " << MESSAGE_URL_FLOATER << " with invalid uri: " << floater_uri << LL_ENDL; + LL_WARNS("URLFloater") << "Received " << raw_uri << " with unexpected scheme in uri: " << floater_uri << LL_ENDL; + return false; + } + + LLSD path_array = floater_uri.pathArray(); + S32 path_parts = path_array.size(); + if (path_parts == 0) + { + LL_WARNS("URLFloater") << "received an empty uri: " << floater_uri << LL_ENDL; + return false; + } + + floater_identifier = path_array[0]; + if (floater_identifier.size() < 3) + { + LL_WARNS("URLFloater") << "received invalid flaoter indentifier: " << floater_identifier << LL_ENDL; return false; } @@ -162,7 +174,7 @@ bool LLUrlFloaterDispatchHandler::operator()(const LLDispatcher *, const std::st } } - if (floater_uri == FLOATER_GUIDEBOOK) + if (floater_identifier == FLOATER_GUIDEBOOK) { if (command_params.isMap()) // by default is undefines { @@ -196,7 +208,7 @@ bool LLUrlFloaterDispatchHandler::operator()(const LLDispatcher *, const std::st instance->setCanClose(command_params[KEY_CAN_CLOSE].asBoolean()); } } - else if (floater_uri == FLOATER_WEB_CONTENT) + else if (floater_identifier == FLOATER_WEB_CONTENT) { if (command_params.has(KEY_URL)) { @@ -212,21 +224,15 @@ bool LLUrlFloaterDispatchHandler::operator()(const LLDispatcher *, const std::st } else { - LLSD path_array = LLURI(floater_uri).pathArray(); - S32 path_parts = path_array.size(); - if (path_parts == 0) - { - LL_INFOS("URLFloater") << "received an empty uri: " << floater_uri << LL_ENDL; - } - else if (LLFloaterReg::isRegistered(path_array[0])) + if (LLFloaterReg::isRegistered(floater_identifier)) { // A valid floater - LL_INFOS("URLFloater") << "Floater " << path_array[0] << " is not supported by llopenfloater or URLFloater" << LL_ENDL; + LL_INFOS("URLFloater") << "Floater " << floater_identifier << " is not supported by llopenfloater or URLFloater" << LL_ENDL; } else { // A valid message, but no such flaoter - LL_WARNS("URLFloater") << "Recieved a command to open unknown floater: " << floater_uri << LL_ENDL; + LL_WARNS("URLFloater") << "Recieved a command to open unknown floater: " << raw_uri << LL_ENDL; } } From c8c06400a6627053897d69f127e8699f89e503f7 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Tue, 11 May 2021 13:23:04 +0300 Subject: [PATCH 151/195] SL-15245 Multiple guide books open, but cannot close them all "how_to" floater is supposed to be single instance --- indra/newview/llfloaterhowto.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/indra/newview/llfloaterhowto.h b/indra/newview/llfloaterhowto.h index 15fc43335a..fa1d9cace0 100644 --- a/indra/newview/llfloaterhowto.h +++ b/indra/newview/llfloaterhowto.h @@ -42,12 +42,14 @@ public: LLFloaterHowTo(const Params& key); - /*virtual*/ void onOpen(const LLSD& key); + void onOpen(const LLSD& key) override; static LLFloaterHowTo* getInstance(); + bool matchesKey(const LLSD& key) override { return true; /*single instance*/ }; + private: - /*virtual*/ BOOL postBuild(); + BOOL postBuild() override; }; #endif // LL_LLFLOATERHOWTO_H From e4dc39cf19a00ab148de6d1bd6c4cd229cf545f5 Mon Sep 17 00:00:00 2001 From: Mnikolenko Productengine Date: Tue, 11 May 2021 13:25:57 +0300 Subject: [PATCH 152/195] SL-15249 FIXED The F1 key does not close the guidebook after clicking a link --- indra/newview/llfloaterhowto.cpp | 13 +++++++++++++ indra/newview/llfloaterhowto.h | 2 ++ 2 files changed, 15 insertions(+) diff --git a/indra/newview/llfloaterhowto.cpp b/indra/newview/llfloaterhowto.cpp index 6e913b08ea..2bd2c47dd7 100644 --- a/indra/newview/llfloaterhowto.cpp +++ b/indra/newview/llfloaterhowto.cpp @@ -83,3 +83,16 @@ LLFloaterHowTo* LLFloaterHowTo::getInstance() { return LLFloaterReg::getTypedInstance("how_to"); } + +BOOL LLFloaterHowTo::handleKeyHere(KEY key, MASK mask) +{ + BOOL handled = FALSE; + + if (KEY_F1 == key ) + { + closeFloater(); + handled = TRUE; + } + + return handled; +} diff --git a/indra/newview/llfloaterhowto.h b/indra/newview/llfloaterhowto.h index fa1d9cace0..c2703d815b 100644 --- a/indra/newview/llfloaterhowto.h +++ b/indra/newview/llfloaterhowto.h @@ -44,6 +44,8 @@ public: void onOpen(const LLSD& key) override; + virtual BOOL handleKeyHere(KEY key, MASK mask); + static LLFloaterHowTo* getInstance(); bool matchesKey(const LLSD& key) override { return true; /*single instance*/ }; From a7fada58acd778059e63d9b5a2af8c09cebcf7a2 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Tue, 11 May 2021 17:12:27 +0300 Subject: [PATCH 153/195] SL-15249 Fix MAC build issue --- indra/newview/llfloaterhowto.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/newview/llfloaterhowto.h b/indra/newview/llfloaterhowto.h index c2703d815b..d8da355600 100644 --- a/indra/newview/llfloaterhowto.h +++ b/indra/newview/llfloaterhowto.h @@ -44,7 +44,7 @@ public: void onOpen(const LLSD& key) override; - virtual BOOL handleKeyHere(KEY key, MASK mask); + BOOL handleKeyHere(KEY key, MASK mask) override; static LLFloaterHowTo* getInstance(); From 8eede89c0f3edb7eb6289dc023c3b8e67ae33fd9 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Tue, 11 May 2021 20:46:11 +0300 Subject: [PATCH 154/195] Revert "SL-15168 Changed format" --- indra/newview/llfloaterhowto.cpp | 6 - indra/newview/llurlfloaterdispatchhandler.cpp | 103 +++++------------- .../skins/default/xui/en/floater_how_to.xml | 7 +- 3 files changed, 31 insertions(+), 85 deletions(-) diff --git a/indra/newview/llfloaterhowto.cpp b/indra/newview/llfloaterhowto.cpp index 2bd2c47dd7..ddb3ea04ba 100644 --- a/indra/newview/llfloaterhowto.cpp +++ b/indra/newview/llfloaterhowto.cpp @@ -51,12 +51,6 @@ BOOL LLFloaterHowTo::postBuild() void LLFloaterHowTo::onOpen(const LLSD& key) { - // LLFloaterHowTo is intended to be opened as a location specific guidebook - // with custom titles, reset the title, LLUrlFloaterDispatchHandler will - // set needed one later - // todo: make title into general parameter for LLFloaterWebContent - setTitle(getString("default_tittle")); - LLFloaterWebContent::Params p(key); if (!p.url.isProvided() || p.url.getValue().empty()) { diff --git a/indra/newview/llurlfloaterdispatchhandler.cpp b/indra/newview/llurlfloaterdispatchhandler.cpp index 6de019d73c..40afafa4c0 100644 --- a/indra/newview/llurlfloaterdispatchhandler.cpp +++ b/indra/newview/llurlfloaterdispatchhandler.cpp @@ -36,30 +36,25 @@ #include "llviewergenericmessage.h" #include "llweb.h" -#include - -// Example: -// llOpenFloater("My Help Title", "secondlife://guidebook", []); - // values specified by server side's dispatcher // for llopenfloater const std::string MESSAGE_URL_FLOATER("URLFloater"); const std::string KEY_ACTION("action"); // "action" will be the string constant "OpenURL" const std::string VALUE_OPEN_URL("OpenURL"); const std::string KEY_DATA("action_data"); -const std::string KEY_FLOATER_TITLE("floater_title"); -const std::string KEY_URI("floater_url"); +const std::string KEY_FLOATER("floater_title"); +const std::string KEY_URL("floater_url"); const std::string KEY_PARAMS("floater_params"); -// Supported floaters, for now it's exact matching, later it might get extended -const std::string FLOATER_GUIDEBOOK("guidebook"); // translates to "how_to" -const std::string FLOATER_WEB_CONTENT("browser"); // translates to "web_content" +// Supported floaters +const std::string FLOATER_GUIDEBOOK("guidebook"); // alias for how_to +const std::string FLOATER_HOW_TO("how_to"); +const std::string FLOATER_WEB_CONTENT("web_content"); -// Web content universal arguments +// Web content universal argument const std::string KEY_TRUSTED_CONTENT("trusted_content"); -const std::string KEY_URL("url"); -// Guidebook ("how_to") specific arguments +// Guidebook specific arguments const std::string KEY_WIDTH("width"); const std::string KEY_HEGHT("height"); const std::string KEY_CAN_CLOSE("can_close"); @@ -106,26 +101,25 @@ bool LLUrlFloaterDispatchHandler::operator()(const LLDispatcher *, const std::st } } - std::string floater_title; + std::string floater; LLSD command_params; - std::string raw_uri; - std::string floater_identifier; + std::string url; if (message.has(KEY_ACTION) && message[KEY_ACTION].asString() == VALUE_OPEN_URL) { LLSD &action_data = message[KEY_DATA]; if (action_data.isMap()) { - floater_title = action_data[KEY_FLOATER_TITLE].asString(); + floater = action_data[KEY_FLOATER].asString(); command_params = action_data[KEY_PARAMS]; - raw_uri = action_data[KEY_URI].asString(); + url = action_data[KEY_URL].asString(); } } - else if (message.has(KEY_FLOATER_TITLE)) + else if (message.has(KEY_FLOATER)) { - floater_title = message[KEY_FLOATER_TITLE].asString(); + floater = message[KEY_FLOATER].asString(); command_params = message[KEY_PARAMS]; - raw_uri = message[KEY_URI].asString(); + url = message[KEY_URL].asString(); } else { @@ -133,48 +127,16 @@ bool LLUrlFloaterDispatchHandler::operator()(const LLDispatcher *, const std::st return false; } - if (raw_uri.find(":///") == std::string::npos) + if (url.find("://") == std::string::npos) { // try unescaping - raw_uri = LLURI::unescape(raw_uri); - } - - LLURI floater_uri(raw_uri); - if (floater_uri.scheme().empty() || floater_uri.scheme() != "secondlife") - { - LL_WARNS("URLFloater") << "Received " << raw_uri << " with unexpected scheme in uri: " << floater_uri << LL_ENDL; - return false; - } - - LLSD path_array = floater_uri.pathArray(); - S32 path_parts = path_array.size(); - if (path_parts == 0) - { - LL_WARNS("URLFloater") << "received an empty uri: " << floater_uri << LL_ENDL; - return false; - } - - floater_identifier = path_array[0]; - if (floater_identifier.size() < 3) - { - LL_WARNS("URLFloater") << "received invalid flaoter indentifier: " << floater_identifier << LL_ENDL; - return false; + url = LLURI::unescape(url); } LLFloaterWebContent::Params params; - if (command_params.isMap()) - { - if (command_params.has(KEY_TRUSTED_CONTENT)) - { - params.trusted_content = command_params[KEY_TRUSTED_CONTENT].asBoolean(); - } - if (command_params.has(KEY_URL)) - { - params.url = command_params[KEY_URL].asString(); - } - } + params.url = url; - if (floater_identifier == FLOATER_GUIDEBOOK) + if (floater == FLOATER_GUIDEBOOK || floater == FLOATER_HOW_TO) { if (command_params.isMap()) // by default is undefines { @@ -200,39 +162,34 @@ bool LLUrlFloaterDispatchHandler::operator()(const LLDispatcher *, const std::st } LLFloaterReg::toggleInstanceOrBringToFront("how_to", params); - - instance = LLFloaterReg::findInstance("how_to"); - instance->setTitle(floater_title); + if (command_params.isMap() && command_params.has(KEY_CAN_CLOSE)) { + LLFloater* instance = LLFloaterReg::findInstance("how_to"); instance->setCanClose(command_params[KEY_CAN_CLOSE].asBoolean()); } } - else if (floater_identifier == FLOATER_WEB_CONTENT) + else if (floater == FLOATER_WEB_CONTENT) { - if (command_params.has(KEY_URL)) + if (command_params.isMap()) // by default is undefines, might be better idea to init params from command_params { - if (command_params.isMap()) // by default is undefines, might be better idea to init params from command_params - { - params.trusted_content = command_params.has(KEY_TRUSTED_CONTENT) ? command_params[KEY_TRUSTED_CONTENT].asBoolean() : false; - params.show_page_title = command_params.has(KEY_SHOW_PAGE_TITLE) ? command_params[KEY_SHOW_PAGE_TITLE].asBoolean() : true; - params.allow_address_entry = command_params.has(KEY_ALLOW_ADRESS_ENTRY) ? command_params[KEY_ALLOW_ADRESS_ENTRY].asBoolean() : true; - } - LLFloater* instance = LLFloaterReg::showInstance("web_content", params); - instance->setTitle(floater_title); + params.trusted_content = command_params.has(KEY_TRUSTED_CONTENT) ? command_params[KEY_TRUSTED_CONTENT].asBoolean() : false; + params.show_page_title = command_params.has(KEY_SHOW_PAGE_TITLE) ? command_params[KEY_SHOW_PAGE_TITLE].asBoolean() : true; + params.allow_address_entry = command_params.has(KEY_ALLOW_ADRESS_ENTRY) ? command_params[KEY_ALLOW_ADRESS_ENTRY].asBoolean() : true; } + LLFloaterReg::showInstance("web_content", params); } else { - if (LLFloaterReg::isRegistered(floater_identifier)) + if (LLFloaterReg::isRegistered(floater)) { // A valid floater - LL_INFOS("URLFloater") << "Floater " << floater_identifier << " is not supported by llopenfloater or URLFloater" << LL_ENDL; + LL_INFOS("URLFloater") << "Floater " << floater << " is not supported by llopenfloater or URLFloater" << LL_ENDL; } else { // A valid message, but no such flaoter - LL_WARNS("URLFloater") << "Recieved a command to open unknown floater: " << raw_uri << LL_ENDL; + LL_WARNS("URLFloater") << "Recieved a command to open unknown floater: " << floater << LL_ENDL; } } diff --git a/indra/newview/skins/default/xui/en/floater_how_to.xml b/indra/newview/skins/default/xui/en/floater_how_to.xml index 95690219b8..baff8e1bc0 100644 --- a/indra/newview/skins/default/xui/en/floater_how_to.xml +++ b/indra/newview/skins/default/xui/en/floater_how_to.xml @@ -14,9 +14,4 @@ width="310" rel_x="-0.469309" rel_y="-0.011166" - filename="floater_web_content.xml"> - -WELCOME ISLAND GUIDEBOOK - - \ No newline at end of file + filename="floater_web_content.xml"/> \ No newline at end of file From 87f1d6071ee480c5dfcf15f6da3f9a9b9766d723 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Tue, 11 May 2021 20:55:12 +0300 Subject: [PATCH 155/195] SL-15168 Added 'Title' argument --- indra/newview/llurlfloaterdispatchhandler.cpp | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/indra/newview/llurlfloaterdispatchhandler.cpp b/indra/newview/llurlfloaterdispatchhandler.cpp index 40afafa4c0..ec2e423c64 100644 --- a/indra/newview/llurlfloaterdispatchhandler.cpp +++ b/indra/newview/llurlfloaterdispatchhandler.cpp @@ -36,13 +36,16 @@ #include "llviewergenericmessage.h" #include "llweb.h" +// Example: +// llOpenFloater("guidebook", "http://page.com", []); + // values specified by server side's dispatcher // for llopenfloater const std::string MESSAGE_URL_FLOATER("URLFloater"); const std::string KEY_ACTION("action"); // "action" will be the string constant "OpenURL" const std::string VALUE_OPEN_URL("OpenURL"); const std::string KEY_DATA("action_data"); -const std::string KEY_FLOATER("floater_title"); +const std::string KEY_FLOATER("floater_title"); // name of the floater, not title const std::string KEY_URL("floater_url"); const std::string KEY_PARAMS("floater_params"); @@ -58,6 +61,7 @@ const std::string KEY_TRUSTED_CONTENT("trusted_content"); const std::string KEY_WIDTH("width"); const std::string KEY_HEGHT("height"); const std::string KEY_CAN_CLOSE("can_close"); +const std::string KEY_TITLE("title"); // web_content specific arguments const std::string KEY_SHOW_PAGE_TITLE("show_page_title"); @@ -163,10 +167,17 @@ bool LLUrlFloaterDispatchHandler::operator()(const LLDispatcher *, const std::st LLFloaterReg::toggleInstanceOrBringToFront("how_to", params); - if (command_params.isMap() && command_params.has(KEY_CAN_CLOSE)) + if (command_params.isMap()) { LLFloater* instance = LLFloaterReg::findInstance("how_to"); - instance->setCanClose(command_params[KEY_CAN_CLOSE].asBoolean()); + if (command_params.has(KEY_CAN_CLOSE)) + { + instance->setCanClose(command_params[KEY_CAN_CLOSE].asBoolean()); + } + if (command_params.has(KEY_TITLE)) + { + instance->setTitle(command_params[KEY_TITLE].asString()); + } } } else if (floater == FLOATER_WEB_CONTENT) From 3917de54db0dacf2aaa4f8af083db632c6a51365 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Wed, 12 May 2021 14:25:46 +0300 Subject: [PATCH 156/195] SL-15245 Multiple guide books open, but cannot close them all Opening and closing single-instance floaters rapidly and multiple times could result in cleaning instance from floaterreg twice, thus removing new isntance instead of current one --- indra/llui/llfloater.cpp | 7 ++++++- indra/newview/llurlfloaterdispatchhandler.cpp | 3 +++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/indra/llui/llfloater.cpp b/indra/llui/llfloater.cpp index 3680e20f15..8ceb411ede 100644 --- a/indra/llui/llfloater.cpp +++ b/indra/llui/llfloater.cpp @@ -510,7 +510,12 @@ void LLFloater::destroy() // virtual LLFloater::~LLFloater() { - LLFloaterReg::removeInstance(mInstanceName, mKey); + if (!isDead()) + { + // If it's dead, instance is supposed to be already removed, and + // in case of single instance we can remove new one by accident + LLFloaterReg::removeInstance(mInstanceName, mKey); + } if( gFocusMgr.childHasKeyboardFocus(this)) { diff --git a/indra/newview/llurlfloaterdispatchhandler.cpp b/indra/newview/llurlfloaterdispatchhandler.cpp index ec2e423c64..0343485864 100644 --- a/indra/newview/llurlfloaterdispatchhandler.cpp +++ b/indra/newview/llurlfloaterdispatchhandler.cpp @@ -54,6 +54,7 @@ const std::string FLOATER_GUIDEBOOK("guidebook"); // alias for how_to const std::string FLOATER_HOW_TO("how_to"); const std::string FLOATER_WEB_CONTENT("web_content"); +// All arguments are palceholders! Server side will need to add validation first. // Web content universal argument const std::string KEY_TRUSTED_CONTENT("trusted_content"); @@ -105,6 +106,8 @@ bool LLUrlFloaterDispatchHandler::operator()(const LLDispatcher *, const std::st } } + // At the moment command_params is a placeholder and code treats it as map + // Once server side adds argument validation this will be either a map or an array std::string floater; LLSD command_params; std::string url; From 110b89e485b6601adffeca1900c4423fd443c337 Mon Sep 17 00:00:00 2001 From: Kitty_Barnett Date: Sun, 16 May 2021 22:32:16 +0200 Subject: [PATCH 157/195] @setoverlay can cause an infinite loop --- indra/newview/llvisualeffect.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/indra/newview/llvisualeffect.cpp b/indra/newview/llvisualeffect.cpp index efa0cbf2b1..0f4ea959e8 100644 --- a/indra/newview/llvisualeffect.cpp +++ b/indra/newview/llvisualeffect.cpp @@ -116,9 +116,9 @@ void LLVfxManager::runEffect(EVisualEffect eCode, LLVisualEffectParams* pParams) endEffect = boost::make_filter_iterator(pred, m_Effects.end(), m_Effects.end()); while (itEffect != endEffect) { - LLVisualEffect* pEffect = *itEffect; + LLVisualEffect* pEffect = *itEffect++; if (pParams) - pParams->step(++itEffect == endEffect); + pParams->step(itEffect == endEffect); pEffect->run(pParams); } } From 7513574e8e04874165a07d5d00ee756673010940 Mon Sep 17 00:00:00 2001 From: Kitty_Barnett Date: Sun, 16 May 2021 22:32:56 +0200 Subject: [PATCH 158/195] @setoverlay can cause an infinite loop --- indra/newview/llvisualeffect.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/indra/newview/llvisualeffect.cpp b/indra/newview/llvisualeffect.cpp index efa0cbf2b1..0f4ea959e8 100644 --- a/indra/newview/llvisualeffect.cpp +++ b/indra/newview/llvisualeffect.cpp @@ -116,9 +116,9 @@ void LLVfxManager::runEffect(EVisualEffect eCode, LLVisualEffectParams* pParams) endEffect = boost::make_filter_iterator(pred, m_Effects.end(), m_Effects.end()); while (itEffect != endEffect) { - LLVisualEffect* pEffect = *itEffect; + LLVisualEffect* pEffect = *itEffect++; if (pParams) - pParams->step(++itEffect == endEffect); + pParams->step(itEffect == endEffect); pEffect->run(pParams); } } From 38444462d035accada0e38d8af0545b14023e932 Mon Sep 17 00:00:00 2001 From: Kitty Barnett Date: Mon, 17 May 2021 14:40:34 +0200 Subject: [PATCH 159/195] CATZ-586: Switch to an expandable input editor for the RLVa console --- indra/newview/rlvfloaters.cpp | 25 +++-- indra/newview/rlvfloaters.h | 31 +++--- .../default/xui/en/floater_rlv_console.xml | 104 +++++++++++------- 3 files changed, 101 insertions(+), 59 deletions(-) diff --git a/indra/newview/rlvfloaters.cpp b/indra/newview/rlvfloaters.cpp index b0b089e138..92a5e4efb3 100644 --- a/indra/newview/rlvfloaters.cpp +++ b/indra/newview/rlvfloaters.cpp @@ -19,6 +19,7 @@ #include "llagent.h" #include "llappearancemgr.h" #include "llavatarnamecache.h" +#include #include "llclipboard.h" #include "llcombobox.h" #include "llinventoryfunctions.h" @@ -733,7 +734,7 @@ static const char s_strRlvConsoleDisabled[] = "RLVa is disabled"; static const char s_strRlvConsoleInvalid[] = "Invalid command"; RlvFloaterConsole::RlvFloaterConsole(const LLSD& sdKey) - : LLFloater(sdKey), m_pOutputText(nullptr) + : LLFloater(sdKey) { } @@ -743,11 +744,14 @@ RlvFloaterConsole::~RlvFloaterConsole() BOOL RlvFloaterConsole::postBuild() { - LLLineEditor* pInputEdit = getChild("console_input"); - pInputEdit->setEnableLineHistory(true); - pInputEdit->setCommitCallback(boost::bind(&RlvFloaterConsole::onInput, this, _1, _2)); - pInputEdit->setFocus(true); - pInputEdit->setCommitOnFocusLost(false); + m_pInputEdit = getChild("console_input"); + m_pInputEdit->setCommitCallback(boost::bind(&RlvFloaterConsole::onInput, this, _1, _2)); + m_pInputEdit->setTextExpandedCallback(boost::bind(&RlvFloaterConsole::reshapeLayoutPanel, this)); + m_pInputEdit->setFocus(true); + m_pInputEdit->setCommitOnFocusLost(false); + + m_pInputPanel = getChild("input_panel"); + m_nInputEditPad = m_pInputPanel->getRect().getHeight() - m_pInputEdit->getRect().getHeight(); m_pOutputText = getChild("console_output"); m_pOutputText->appendText(s_strRlvConsolePrompt, false); @@ -769,12 +773,12 @@ void RlvFloaterConsole::addCommandReply(const std::string& strCommand, const std void RlvFloaterConsole::onInput(LLUICtrl* pCtrl, const LLSD& sdParam) { - LLLineEditor* pInputEdit = static_cast(pCtrl); + LLChatEntry* pInputEdit = static_cast(pCtrl); std::string strInput = pInputEdit->getText(); LLStringUtil::trim(strInput); m_pOutputText->appendText(strInput, false); - pInputEdit->clear(); + pInputEdit->setText(LLStringUtil::null); if (!rlv_handler_t::isEnabled()) { @@ -831,4 +835,9 @@ void RlvFloaterConsole::onInput(LLUICtrl* pCtrl, const LLSD& sdParam) m_pOutputText->appendText(s_strRlvConsolePrompt, true); } +void RlvFloaterConsole::reshapeLayoutPanel() +{ + m_pInputPanel->reshape(m_pInputPanel->getRect().getWidth(), m_pInputEdit->getRect().getHeight() + m_nInputEditPad, FALSE); +} + // ============================================================================ diff --git a/indra/newview/rlvfloaters.h b/indra/newview/rlvfloaters.h index f29fa92483..2ca4adc904 100644 --- a/indra/newview/rlvfloaters.h +++ b/indra/newview/rlvfloaters.h @@ -1,21 +1,20 @@ -/** +/** * * Copyright (c) 2009-2011, Kitty Barnett - * - * The source code in this file is provided to you under the terms of the + * + * The source code in this file is provided to you under the terms of the * GNU Lesser General Public License, version 2.1, but WITHOUT ANY WARRANTY; - * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A - * PARTICULAR PURPOSE. Terms of the LGPL can be found in doc/LGPL-licence.txt + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A + * PARTICULAR PURPOSE. Terms of the LGPL can be found in doc/LGPL-licence.txt * in this distribution, or online at http://www.gnu.org/licenses/lgpl-2.1.txt - * + * * By copying, modifying or distributing this software, you acknowledge that - * you have read and understood your obligations described above, and agree to + * you have read and understood your obligations described above, and agree to * abide by those obligations. - * + * */ -#ifndef RLV_FLOATERS_H -#define RLV_FLOATERS_H +#pragma once #include "llfloater.h" @@ -25,7 +24,9 @@ // ============================================================================ // Foward declarations // +class LLChatEntry; class LLComboBox; +class LLLayoutPanel; class LLTextEditor; // ============================================================================ @@ -150,21 +151,23 @@ private: public: BOOL postBuild() override; void onClose(bool fQuitting) override; - + /* * Member functions */ protected: void addCommandReply(const std::string& strCommand, const std::string& strReply); void onInput(LLUICtrl* ctrl, const LLSD& param); + void reshapeLayoutPanel(); /* * Member variables */ protected: - LLTextEditor* m_pOutputText; + LLTextEditor* m_pOutputText = nullptr; + LLLayoutPanel* m_pInputPanel = nullptr; + LLChatEntry* m_pInputEdit = nullptr; + int m_nInputEditPad = 0; }; // ============================================================================ - -#endif // RLV_FLOATERS_H diff --git a/indra/newview/skins/default/xui/en/floater_rlv_console.xml b/indra/newview/skins/default/xui/en/floater_rlv_console.xml index 8c09e7dacc..928d50cb41 100644 --- a/indra/newview/skins/default/xui/en/floater_rlv_console.xml +++ b/indra/newview/skins/default/xui/en/floater_rlv_console.xml @@ -1,43 +1,73 @@ - + - - - + + + + + + + + + From 0aba47476f655afa1f259c3d8aa711eee43b3457 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Tue, 25 May 2021 00:27:32 +0300 Subject: [PATCH 160/195] SL-15298 Move Landmark's Edit button --- .../default/xui/en/panel_landmark_info.xml | 28 +++++++++---------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/indra/newview/skins/default/xui/en/panel_landmark_info.xml b/indra/newview/skins/default/xui/en/panel_landmark_info.xml index f00d25ff05..e82305ef17 100644 --- a/indra/newview/skins/default/xui/en/panel_landmark_info.xml +++ b/indra/newview/skins/default/xui/en/panel_landmark_info.xml @@ -289,7 +289,18 @@ name="title_value" text_color="white" top_pad="5" - width="290" /> + width="200" /> +