From b1f30f0a06e6f0fd4bf28c2555349a2babb6d96f Mon Sep 17 00:00:00 2001 From: Xenhat Liamano <xenhat@polarityviewer.org> Date: Fri, 22 Nov 2019 19:11:25 -0500 Subject: [PATCH] Add ability to toggle teleport history directly --- indra/newview/llpanelplaces.cpp | 15 +++++++++++++++ indra/newview/llviewermenu.cpp | 18 ++++++++++++++++++ .../skins/default/xui/en/menu_viewer.xml | 7 +++++++ 3 files changed, 40 insertions(+) diff --git a/indra/newview/llpanelplaces.cpp b/indra/newview/llpanelplaces.cpp index a163bc408a..cf20f3c104 100644 --- a/indra/newview/llpanelplaces.cpp +++ b/indra/newview/llpanelplaces.cpp @@ -79,6 +79,7 @@ static const std::string LANDMARK_INFO_TYPE = "landmark"; static const std::string REMOTE_PLACE_INFO_TYPE = "remote_place"; static const std::string TELEPORT_HISTORY_INFO_TYPE = "teleport_history"; static const std::string LANDMARK_TAB_INFO_TYPE = "open_landmark_tab"; +static const std::string TELEPORT_HISTORY_TAB_INFO_TYPE = "open_teleport_history_tab"; // Support for secondlife:///app/parcel/{UUID}/about SLapps class LLParcelHandler final : public LLCommandHandler @@ -382,6 +383,20 @@ void LLPanelPlaces::onOpen(const LLSD& key) // Update the buttons at the bottom of the panel updateVerbs(); } + else if (key_type == TELEPORT_HISTORY_TAB_INFO_TYPE) + { + togglePlaceInfoPanel(FALSE); + mPlaceInfoType = LANDMARK_TAB_INFO_TYPE; + + mLandmarkInfo->setVisible(FALSE); + LLTeleportHistoryPanel * teleport_history_panel = (LLTeleportHistoryPanel*)mTabContainer->getPanelByName("Teleport History"); + if (teleport_history_panel) + { + mTabContainer->selectTabPanel(teleport_history_panel); + onTabSelected(); + updateVerbs(); + } + } else { mFilterEditor->clear(); diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index 1cba05381a..13ec9ccb72 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -9039,6 +9039,23 @@ void show_topinfobar_context_menu(LLView* ctrl, S32 x, S32 y) LLMenuGL::showPopup(ctrl, show_topbarinfo_context_menu, x, y); } +void toggleTeleportHistory() +{ + LLFloater* floater = LLFloaterReg::findInstance("places"); + if (floater && floater->isMinimized()) + { + floater->setMinimized(FALSE); + } + else if (LLFloater::isShown(floater)) + { + LLFloaterReg::hideInstance("places"); + } + else + { + LLFloaterSidePanelContainer::showPanel("places", LLSD().with("type", "open_teleport_history_tab")); + } +} + void initialize_edit_menu() { view_listener_t::addMenu(new LLEditUndo(), "Edit.Undo"); @@ -9578,4 +9595,5 @@ void initialize_menus() } // [/RLVa:KB] ALViewerMenu::initialize_menus(); + commit.add("ToggleTeleportHistory", boost::bind(&toggleTeleportHistory)); } diff --git a/indra/newview/skins/default/xui/en/menu_viewer.xml b/indra/newview/skins/default/xui/en/menu_viewer.xml index 26f4f55333..df5eca9c23 100644 --- a/indra/newview/skins/default/xui/en/menu_viewer.xml +++ b/indra/newview/skins/default/xui/en/menu_viewer.xml @@ -61,6 +61,13 @@ function="Floater.ToggleOrBringToFront" parameter="places" /> </menu_item_call> + <menu_item_call + label="Teleport History" + name="Teleport History" + shortcut="alt|H"> + <menu_item_call.on_click + function="ToggleTeleportHistory"/> + </menu_item_call> <menu_item_call label="Picks..." name="Picks"> -- GitLab