diff --git a/indra/newview/fsfloaterteleporthistory.cpp b/indra/newview/fsfloaterteleporthistory.cpp index f9ec067f38..c6f8004137 100644 --- a/indra/newview/fsfloaterteleporthistory.cpp +++ b/indra/newview/fsfloaterteleporthistory.cpp @@ -54,6 +54,15 @@ BOOL FSFloaterTeleportHistory::postBuild() { mHistoryPanel->setIsStandAlone(true); + mHistoryPanel->mTeleportBtn = getChild("teleport_btn"); + mHistoryPanel->mShowOnMapBtn = getChild("map_btn"); + mHistoryPanel->mShowProfile = getChild("profile_btn"); + + mHistoryPanel->mTeleportBtn->setClickedCallback(boost::bind(&LLTeleportHistoryPanel::onTeleport, mHistoryPanel)); + mHistoryPanel->mShowProfile->setClickedCallback(boost::bind(&LLTeleportHistoryPanel::onShowProfile, mHistoryPanel)); + mHistoryPanel->mShowOnMapBtn->setClickedCallback(boost::bind(&LLTeleportHistoryPanel::onShowOnMap, mHistoryPanel)); + + mFilterEditor = getChild("Filter"); if (mFilterEditor) { diff --git a/indra/newview/llpanellandmarks.cpp b/indra/newview/llpanellandmarks.cpp index c3a20f45f2..90ee359766 100644 --- a/indra/newview/llpanellandmarks.cpp +++ b/indra/newview/llpanellandmarks.cpp @@ -208,6 +208,13 @@ void LLLandmarksPanel::onShowOnMap() return; } + // FIRE-31033: Keep Teleport/Map/Profile buttons on places floater + // Disable the "Map" button because loading landmark can take some time. + // During this time the button is useless. It will be enabled on callback finish + // or upon switching to other item. + mShowOnMapBtn->setEnabled(FALSE); + // + doActionOnCurSelectedLandmark(boost::bind(&LLLandmarksPanel::doShowOnMap, this, _1)); } @@ -293,6 +300,16 @@ void LLLandmarksPanel::updateVerbs() { sRemoveBtn->setEnabled(isActionEnabled("delete") && (isFolderSelected() || isLandmarkSelected())); } + + // FIRE-31033: Keep Teleport/Map/Profile buttons on places floater + if (!isTabVisible()) + return; + + bool landmark_selected = isLandmarkSelected(); + mTeleportBtn->setEnabled(landmark_selected && isActionEnabled("teleport")); + mShowProfile->setEnabled(landmark_selected && isActionEnabled("more_info")); + mShowOnMapBtn->setEnabled(landmark_selected && isActionEnabled("show_on_map")); + // } void LLLandmarksPanel::setItemSelected(const LLUUID& obj_id, BOOL take_keyboard_focus) @@ -1071,6 +1088,7 @@ void LLLandmarksPanel::doShowOnMap(LLLandmark* landmark) LLFloaterReg::showInstance("world_map", "center"); } + mShowOnMapBtn->setEnabled(TRUE); // FIRE-31033: Keep Teleport/Map/Profile buttons on places floater mGearLandmarkMenu->setItemEnabled("show_on_map", TRUE); } diff --git a/indra/newview/llpanelplaces.cpp b/indra/newview/llpanelplaces.cpp index de8688fc5d..d7b07dc5f8 100644 --- a/indra/newview/llpanelplaces.cpp +++ b/indra/newview/llpanelplaces.cpp @@ -307,6 +307,11 @@ BOOL LLPanelPlaces::postBuild() mOverflowBtn = getChild("overflow_btn"); mOverflowBtn->setMouseDownCallback(boost::bind(&LLPanelPlaces::onOverflowButtonClicked, this)); + // FIRE-31033: Keep Teleport/Map/Profile buttons on places floater + mPlaceInfoBtn = getChild("profile_btn"); + mPlaceInfoBtn->setClickedCallback(boost::bind(&LLPanelPlaces::onProfileButtonClicked, this)); + // + mGearMenuButton = getChild("options_gear_btn"); mGearMenuButton->setMouseDownCallback(boost::bind(&LLPanelPlaces::onGearMenuClick, this)); @@ -355,7 +360,7 @@ BOOL LLPanelPlaces::postBuild() } mButtonsContainer = getChild("button_layout_panel"); - mButtonsContainer->setVisible(FALSE); + //mButtonsContainer->setVisible(FALSE); // FIRE-31033: Keep Teleport/Map/Profile buttons on places floater mFilterContainer = getChild("top_menu_panel"); mFilterEditor = getChild("Filter"); @@ -963,6 +968,16 @@ void LLPanelPlaces::onOverflowButtonClicked() mOverflowBtn->setMenu(menu, LLMenuButton::MP_TOP_RIGHT); } +// FIRE-31033: Keep Teleport/Map/Profile buttons on places floater +void LLPanelPlaces::onProfileButtonClicked() +{ + if (!mActivePanel) + return; + + mActivePanel->onShowProfile(); +} +// + bool LLPanelPlaces::onOverflowMenuItemEnable(const LLSD& param) { std::string value = param.asString(); @@ -1245,6 +1260,9 @@ void LLPanelPlaces::createTabs() LLFavoritesPanel* favorites_panel = new LLFavoritesPanel(); if (favorites_panel) { + // FIRE-31033: Keep Teleport/Map/Profile buttons on places floater + favorites_panel->setPanelPlacesButtons(this); + mTabContainer->addTabPanel( LLTabContainer::TabPanelParams(). panel(favorites_panel). @@ -1255,6 +1273,9 @@ void LLPanelPlaces::createTabs() LLLandmarksPanel* landmarks_panel = new LLLandmarksPanel(); if (landmarks_panel) { + // FIRE-31033: Keep Teleport/Map/Profile buttons on places floater + landmarks_panel->setPanelPlacesButtons(this); + mTabContainer->addTabPanel( LLTabContainer::TabPanelParams(). panel(landmarks_panel). @@ -1265,6 +1286,9 @@ void LLPanelPlaces::createTabs() LLTeleportHistoryPanel* teleport_history_panel = new LLTeleportHistoryPanel(); if (teleport_history_panel) { + // FIRE-31033: Keep Teleport/Map/Profile buttons on places floater + teleport_history_panel->setPanelPlacesButtons(this); + mTabContainer->addTabPanel( LLTabContainer::TabPanelParams(). panel(teleport_history_panel). @@ -1369,12 +1393,17 @@ void LLPanelPlaces::updateVerbs() mSaveBtn->setVisible(isLandmarkEditModeOn); mCancelBtn->setVisible(isLandmarkEditModeOn); mCloseBtn->setVisible(is_create_landmark_visible && !isLandmarkEditModeOn); + // FIRE-31033: Keep Teleport/Map/Profile buttons on places floater + mPlaceInfoBtn->setVisible(!is_place_info_visible && !is_create_landmark_visible && !isLandmarkEditModeOn && !is_pick_panel_visible); bool show_options_btn = is_place_info_visible && !is_create_landmark_visible && !isLandmarkEditModeOn; mOverflowBtn->setVisible(show_options_btn); getChild("lp_options")->setVisible(show_options_btn); getChild("lp2")->setVisible(!show_options_btn); + // FIRE-31033: Keep Teleport/Map/Profile buttons on places floater + mPlaceInfoBtn->setEnabled(!is_create_landmark_visible && !isLandmarkEditModeOn && have_3d_pos); + if (is_place_info_visible) { mShowOnMapBtn->setEnabled(have_3d_pos); diff --git a/indra/newview/llpanelplaces.h b/indra/newview/llpanelplaces.h index 24b7605fd6..81f1c6d70e 100644 --- a/indra/newview/llpanelplaces.h +++ b/indra/newview/llpanelplaces.h @@ -104,6 +104,7 @@ private: bool onOverflowMenuItemEnable(const LLSD& param); void onCreateLandmarkButtonClicked(const LLUUID& folder_id); void onBackButtonClicked(); + void onProfileButtonClicked(); // FIRE-31033: Keep Teleport/Map/Profile buttons on places floater void onGearMenuClick(); void onSortingMenuClick(); void onAddMenuClick(); @@ -140,6 +141,7 @@ private: LLButton* mCancelBtn; LLButton* mCloseBtn; LLMenuButton* mOverflowBtn; + LLButton* mPlaceInfoBtn; // FIRE-31033: Keep Teleport/Map/Profile buttons on places floater // Top menu LLMenuButton* mGearMenuButton; diff --git a/indra/newview/llpanelplacestab.cpp b/indra/newview/llpanelplacestab.cpp index 1594cac817..139949a9c8 100644 --- a/indra/newview/llpanelplacestab.cpp +++ b/indra/newview/llpanelplacestab.cpp @@ -48,6 +48,15 @@ bool LLPanelPlacesTab::isTabVisible() return true; } +// FIRE-31033: Keep Teleport/Map/Profile buttons on places floater +void LLPanelPlacesTab::setPanelPlacesButtons(LLPanelPlaces* panel) +{ + mTeleportBtn = panel->getChild("teleport_btn"); + mShowOnMapBtn = panel->getChild("map_btn"); + mShowProfile = panel->getChild("profile_btn"); +} +// + void LLPanelPlacesTab::onRegionResponse(const LLVector3d& landmark_global_pos, U64 region_handle, const std::string& url, diff --git a/indra/newview/llpanelplacestab.h b/indra/newview/llpanelplacestab.h index aab1c130c1..9376d1a6df 100644 --- a/indra/newview/llpanelplacestab.h +++ b/indra/newview/llpanelplacestab.h @@ -58,6 +58,7 @@ public: bool isTabVisible(); // Check if parent TabContainer is visible. + void setPanelPlacesButtons(LLPanelPlaces* panel); // FIRE-31033: Keep Teleport/Map/Profile buttons on places floater void onRegionResponse(const LLVector3d& landmark_global_pos, U64 region_handle, const std::string& url, @@ -70,6 +71,12 @@ public: void setRemoveBtn(LLButton* trash_btn) { sRemoveBtn = trash_btn; } protected: + // FIRE-31033: Keep Teleport/Map/Profile buttons on places floater + LLButton* mTeleportBtn; + LLButton* mShowOnMapBtn; + LLButton* mShowProfile; + // + // Search string for filtering landmarks and teleport history locations static std::string sFilterSubString; static LLButton* sRemoveBtn; diff --git a/indra/newview/llpanelteleporthistory.cpp b/indra/newview/llpanelteleporthistory.cpp index 0ddcaa4496..a5dbb5a212 100644 --- a/indra/newview/llpanelteleporthistory.cpp +++ b/indra/newview/llpanelteleporthistory.cpp @@ -661,6 +661,22 @@ void LLTeleportHistoryPanel::updateVerbs() { sRemoveBtn->setEnabled(true); } + + // FIRE-31033: Keep Teleport/Map/Profile buttons on places floater + if (!mLastSelectedFlatlList) + { + mTeleportBtn->setEnabled(false); + mShowProfile->setEnabled(false); + mShowOnMapBtn->setEnabled(false); + return; + } + + LLTeleportHistoryFlatItem* itemp = dynamic_cast (mLastSelectedFlatlList->getSelectedItem()); + + mTeleportBtn->setEnabled(NULL != itemp); + mShowProfile->setEnabled(NULL != itemp); + mShowOnMapBtn->setEnabled(NULL != itemp); + // } // virtual 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 9298217fa3..fb2199d294 100644 --- a/indra/newview/skins/default/xui/de/floater_fs_teleporthistory.xml +++ b/indra/newview/skins/default/xui/de/floater_fs_teleporthistory.xml @@ -3,4 +3,21 @@ + + + + + +