Skip to content
Snippets Groups Projects
Commit 16b1af72 authored by Sergei Litovchuk's avatar Sergei Litovchuk
Browse files

Fixed (EXT-4589) 'About Land' floater loose information after user quit Place Profile

- Fixed Places panel not to remove parcel selection when it is used by "About Land" floater.

--HG--
branch : product-engine
parent 18932985
Branches
Tags
No related merge requests found
...@@ -265,25 +265,6 @@ void LLPanelPlaceInfo::reshape(S32 width, S32 height, BOOL called_from_parent) ...@@ -265,25 +265,6 @@ void LLPanelPlaceInfo::reshape(S32 width, S32 height, BOOL called_from_parent)
} }
} }
// virtual
void LLPanelPlaceInfo::handleVisibilityChange(BOOL new_visibility)
{
LLPanel::handleVisibilityChange(new_visibility);
LLViewerParcelMgr* parcel_mgr = LLViewerParcelMgr::getInstance();
if (!parcel_mgr)
return;
// Remove land selection when panel hides.
if (!new_visibility)
{
if (!parcel_mgr->selectionEmpty())
{
parcel_mgr->deselectLand();
}
}
}
void LLPanelPlaceInfo::createPick(const LLVector3d& pos_global, LLPanelPickEdit* pick_panel) void LLPanelPlaceInfo::createPick(const LLVector3d& pos_global, LLPanelPickEdit* pick_panel)
{ {
std::string region_name = mRegionName->getText(); std::string region_name = mRegionName->getText();
......
...@@ -94,7 +94,6 @@ class LLPanelPlaceInfo : public LLPanel, LLRemoteParcelInfoObserver ...@@ -94,7 +94,6 @@ class LLPanelPlaceInfo : public LLPanel, LLRemoteParcelInfoObserver
/*virtual*/ void processParcelInfo(const LLParcelData& parcel_data); /*virtual*/ void processParcelInfo(const LLParcelData& parcel_data);
/*virtual*/ void reshape(S32 width, S32 height, BOOL called_from_parent = TRUE); /*virtual*/ void reshape(S32 width, S32 height, BOOL called_from_parent = TRUE);
/*virtual*/ void handleVisibilityChange (BOOL new_visibility);
// Create a pick for the location specified // Create a pick for the location specified
// by global_pos. // by global_pos.
......
...@@ -257,6 +257,25 @@ void LLPanelPlaceProfile::processParcelInfo(const LLParcelData& parcel_data) ...@@ -257,6 +257,25 @@ void LLPanelPlaceProfile::processParcelInfo(const LLParcelData& parcel_data)
} }
} }
// virtual
void LLPanelPlaceProfile::handleVisibilityChange(BOOL new_visibility)
{
LLPanel::handleVisibilityChange(new_visibility);
LLViewerParcelMgr* parcel_mgr = LLViewerParcelMgr::getInstance();
if (!parcel_mgr)
return;
// Remove land selection when panel hides.
if (!new_visibility)
{
if (!parcel_mgr->selectionEmpty())
{
parcel_mgr->deselectUnused();
}
}
}
void LLPanelPlaceProfile::displaySelectedParcelInfo(LLParcel* parcel, void LLPanelPlaceProfile::displaySelectedParcelInfo(LLParcel* parcel,
LLViewerRegion* region, LLViewerRegion* region,
const LLVector3d& pos_global, const LLVector3d& pos_global,
......
...@@ -52,6 +52,8 @@ class LLPanelPlaceProfile : public LLPanelPlaceInfo ...@@ -52,6 +52,8 @@ class LLPanelPlaceProfile : public LLPanelPlaceInfo
/*virtual*/ void processParcelInfo(const LLParcelData& parcel_data); /*virtual*/ void processParcelInfo(const LLParcelData& parcel_data);
/*virtual*/ void handleVisibilityChange(BOOL new_visibility);
// Displays information about the currently selected parcel // Displays information about the currently selected parcel
// without sending a request to the server. // without sending a request to the server.
// If is_current_parcel true shows "You Are Here" banner. // If is_current_parcel true shows "You Are Here" banner.
......
...@@ -289,9 +289,11 @@ BOOL LLPanelPlaces::postBuild() ...@@ -289,9 +289,11 @@ BOOL LLPanelPlaces::postBuild()
void LLPanelPlaces::onOpen(const LLSD& key) void LLPanelPlaces::onOpen(const LLSD& key)
{ {
if(!mPlaceProfile || !mLandmarkInfo || key.size() == 0) if (!mPlaceProfile || !mLandmarkInfo)
return; return;
if (key.size() != 0)
{
mFilterEditor->clear(); mFilterEditor->clear();
onFilterEdit("", false); onFilterEdit("", false);
...@@ -371,6 +373,7 @@ void LLPanelPlaces::onOpen(const LLSD& key) ...@@ -371,6 +373,7 @@ void LLPanelPlaces::onOpen(const LLSD& key)
} }
updateVerbs(); updateVerbs();
}
LLViewerParcelMgr* parcel_mgr = LLViewerParcelMgr::getInstance(); LLViewerParcelMgr* parcel_mgr = LLViewerParcelMgr::getInstance();
if (!parcel_mgr) if (!parcel_mgr)
...@@ -388,9 +391,12 @@ void LLPanelPlaces::onOpen(const LLSD& key) ...@@ -388,9 +391,12 @@ void LLPanelPlaces::onOpen(const LLSD& key)
{ {
parcel_mgr->removeObserver(mParcelObserver); parcel_mgr->removeObserver(mParcelObserver);
// Clear the reference to selection to allow its removal in deselectUnused().
mParcel.clear();
if (!parcel_mgr->selectionEmpty()) if (!parcel_mgr->selectionEmpty())
{ {
parcel_mgr->deselectLand(); parcel_mgr->deselectUnused();
} }
} }
} }
...@@ -826,6 +832,14 @@ void LLPanelPlaces::togglePlaceInfoPanel(BOOL visible) ...@@ -826,6 +832,14 @@ void LLPanelPlaces::togglePlaceInfoPanel(BOOL visible)
mLandmarkInfo->setVisible(FALSE); mLandmarkInfo->setVisible(FALSE);
} }
else if (mPlaceInfoType == AGENT_INFO_TYPE)
{
LLViewerParcelMgr::getInstance()->removeObserver(mParcelObserver);
// Clear reference to parcel selection when closing place profile panel.
// LLViewerParcelMgr removes the selection if it has 1 reference to it.
mParcel.clear();
}
} }
else if (mPlaceInfoType == CREATE_LANDMARK_INFO_TYPE || else if (mPlaceInfoType == CREATE_LANDMARK_INFO_TYPE ||
mPlaceInfoType == LANDMARK_INFO_TYPE) mPlaceInfoType == LANDMARK_INFO_TYPE)
...@@ -858,6 +872,20 @@ void LLPanelPlaces::togglePlaceInfoPanel(BOOL visible) ...@@ -858,6 +872,20 @@ void LLPanelPlaces::togglePlaceInfoPanel(BOOL visible)
} }
} }
// virtual
void LLPanelPlaces::handleVisibilityChange(BOOL new_visibility)
{
LLPanel::handleVisibilityChange(new_visibility);
if (!new_visibility && mPlaceInfoType == AGENT_INFO_TYPE)
{
LLViewerParcelMgr::getInstance()->removeObserver(mParcelObserver);
// Clear reference to parcel selection when closing places panel.
mParcel.clear();
}
}
void LLPanelPlaces::changedParcelSelection() void LLPanelPlaces::changedParcelSelection()
{ {
if (!mPlaceProfile) if (!mPlaceProfile)
......
...@@ -97,6 +97,8 @@ class LLPanelPlaces : public LLPanel ...@@ -97,6 +97,8 @@ class LLPanelPlaces : public LLPanel
void togglePickPanel(BOOL visible); void togglePickPanel(BOOL visible);
void togglePlaceInfoPanel(BOOL visible); void togglePlaceInfoPanel(BOOL visible);
/*virtual*/ void handleVisibilityChange(BOOL new_visibility);
void updateVerbs(); void updateVerbs();
LLPanelPlaceInfo* getCurrentInfoPanel(); LLPanelPlaceInfo* getCurrentInfoPanel();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment