summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
authorMaxim Nikolenko <maximnproductengine@lindenlab.com>2024-01-10 17:16:00 +0200
committerGitHub <noreply@github.com>2024-01-10 17:16:00 +0200
commit38a89c1fe66a7002b47e3801c074304f0893cba2 (patch)
treeee944055d15302f5ec1a434f69da09a3ee5df53c /indra/newview
parent284a3cbee95a001c9f7f897a7dd6f81a4b974bd1 (diff)
SL-20770 FIXED Picks location field not updating to different parcel/region
Diffstat (limited to 'indra/newview')
-rw-r--r--indra/newview/llpanelprofilepicks.cpp32
-rw-r--r--indra/newview/llpanelprofilepicks.h7
2 files changed, 38 insertions, 1 deletions
diff --git a/indra/newview/llpanelprofilepicks.cpp b/indra/newview/llpanelprofilepicks.cpp
index e02ecfaa0a..5826621645 100644
--- a/indra/newview/llpanelprofilepicks.cpp
+++ b/indra/newview/llpanelprofilepicks.cpp
@@ -252,6 +252,8 @@ void LLPanelProfilePicks::onClickNewBtn()
select_tab(true).
label(pick_panel->getPickName()));
updateButtons();
+
+ pick_panel->addLocationChangedCallbacks();
}
void LLPanelProfilePicks::onClickDelete()
@@ -488,6 +490,8 @@ LLPanelProfilePick::LLPanelProfilePick()
, mLocationChanged(false)
, mNewPick(false)
, mIsEditing(false)
+ , mRegionCallbackConnection()
+ , mParcelCallbackConnection()
{
}
@@ -505,6 +509,15 @@ LLPanelProfilePick::~LLPanelProfilePick()
{
LLRemoteParcelInfoProcessor::getInstance()->removeObserver(mParcelId, this);
}
+
+ if (mRegionCallbackConnection.connected())
+ {
+ mRegionCallbackConnection.disconnect();
+ }
+ if (mParcelCallbackConnection.connected())
+ {
+ mParcelCallbackConnection.disconnect();
+ }
}
void LLPanelProfilePick::setAvatarId(const LLUUID& avatar_id)
@@ -781,6 +794,18 @@ void LLPanelProfilePick::onClickSetLocation()
void LLPanelProfilePick::onClickSave()
{
+ if (mRegionCallbackConnection.connected())
+ {
+ mRegionCallbackConnection.disconnect();
+ }
+ if (mParcelCallbackConnection.connected())
+ {
+ mParcelCallbackConnection.disconnect();
+ }
+ if (mLocationChanged)
+ {
+ onClickSetLocation();
+ }
sendUpdate();
mLocationChanged = false;
@@ -828,6 +853,13 @@ void LLPanelProfilePick::processParcelInfo(const LLParcelData& parcel_data)
}
}
+void LLPanelProfilePick::addLocationChangedCallbacks()
+{
+ mRegionCallbackConnection = gAgent.addRegionChangedCallback([this]() { onClickSetLocation(); });
+ mParcelCallbackConnection = gAgent.addParcelChangedCallback([this]() { onClickSetLocation(); });
+}
+
+
void LLPanelProfilePick::sendUpdate()
{
LLPickData pick_data;
diff --git a/indra/newview/llpanelprofilepicks.h b/indra/newview/llpanelprofilepicks.h
index 27331831d3..d56f786ff1 100644
--- a/indra/newview/llpanelprofilepicks.h
+++ b/indra/newview/llpanelprofilepicks.h
@@ -140,7 +140,9 @@ public:
void setParcelID(const LLUUID& parcel_id) override { mParcelId = parcel_id; }
void setErrorStatus(S32 status, const std::string& reason) override {};
-protected:
+ void addLocationChangedCallbacks();
+
+ protected:
/**
* Sends remote parcel info request to resolve parcel name from its ID.
@@ -239,6 +241,9 @@ protected:
LLUUID mRequestedId;
std::string mPickNameStr;
+ boost::signals2::connection mRegionCallbackConnection;
+ boost::signals2::connection mParcelCallbackConnection;
+
bool mLocationChanged;
bool mNewPick;
bool mIsEditing;