summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview')
-rwxr-xr-xindra/newview/llagent.cpp7
-rw-r--r--indra/newview/llagent.h10
-rw-r--r--indra/newview/llfloaterpathfindinglinksets.cpp7
-rw-r--r--indra/newview/llfloaterpathfindinglinksets.h1
-rw-r--r--indra/newview/llfloaterpathfindingobjects.cpp87
-rw-r--r--indra/newview/llfloaterpathfindingobjects.h7
6 files changed, 72 insertions, 47 deletions
diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp
index 3870a3be2e..d94e01ee47 100755
--- a/indra/newview/llagent.cpp
+++ b/indra/newview/llagent.cpp
@@ -243,6 +243,7 @@ LLAgent::LLAgent() :
mbTeleportKeepsLookAt(false),
mAgentAccess(new LLAgentAccess(gSavedSettings)),
+ mGodLevelChangeSignal(),
mCanEditParcel(false),
mTeleportSourceSLURL(new LLSLURL),
mTeleportState( TELEPORT_NONE ),
@@ -2434,6 +2435,12 @@ void LLAgent::setAdminOverride(BOOL b)
void LLAgent::setGodLevel(U8 god_level)
{
mAgentAccess->setGodLevel(god_level);
+ mGodLevelChangeSignal(god_level);
+}
+
+LLAgent::god_level_change_slot_t LLAgent::registerGodLevelChanageListener(god_level_change_callback_t pGodLevelChangeCallback)
+{
+ return mGodLevelChangeSignal.connect(pGodLevelChangeCallback);
}
void LLAgent::setAOTransition()
diff --git a/indra/newview/llagent.h b/indra/newview/llagent.h
index 740770bbdf..72f695d917 100644
--- a/indra/newview/llagent.h
+++ b/indra/newview/llagent.h
@@ -631,6 +631,16 @@ public:
void requestEnterGodMode();
void requestLeaveGodMode();
+ typedef boost::function<void (U8)> god_level_change_callback_t;
+ typedef boost::signals2::signal<void (U8)> god_level_change_signal_t;
+ typedef boost::signals2::connection god_level_change_slot_t;
+
+ god_level_change_slot_t registerGodLevelChanageListener(god_level_change_callback_t pGodLevelChangeCallback);
+
+private:
+ god_level_change_signal_t mGodLevelChangeSignal;
+
+
//--------------------------------------------------------------------
// Maturity
//--------------------------------------------------------------------
diff --git a/indra/newview/llfloaterpathfindinglinksets.cpp b/indra/newview/llfloaterpathfindinglinksets.cpp
index 36f54ffae1..d53f4db5c2 100644
--- a/indra/newview/llfloaterpathfindinglinksets.cpp
+++ b/indra/newview/llfloaterpathfindinglinksets.cpp
@@ -264,13 +264,6 @@ LLSD LLFloaterPathfindingLinksets::convertObjectsIntoScrollListData(const LLPath
void LLFloaterPathfindingLinksets::updateControls()
{
LLFloaterPathfindingObjects::updateControls();
- updateStateOnEditFields();
- updateStateOnEditLinksetUse();
-}
-
-void LLFloaterPathfindingLinksets::updateSelection()
-{
- LLFloaterPathfindingObjects::updateSelection();
updateEditFieldValues();
updateStateOnEditFields();
updateStateOnEditLinksetUse();
diff --git a/indra/newview/llfloaterpathfindinglinksets.h b/indra/newview/llfloaterpathfindinglinksets.h
index d989e0ea4d..87719e28f0 100644
--- a/indra/newview/llfloaterpathfindinglinksets.h
+++ b/indra/newview/llfloaterpathfindinglinksets.h
@@ -65,7 +65,6 @@ protected:
virtual LLSD convertObjectsIntoScrollListData(const LLPathfindingObjectListPtr pObjectListPtr) const;
virtual void updateControls();
- virtual void updateSelection();
virtual S32 getNameColumnIndex() const;
virtual const LLColor4 &getBeaconColor() const;
diff --git a/indra/newview/llfloaterpathfindingobjects.cpp b/indra/newview/llfloaterpathfindingobjects.cpp
index 572f2f707e..d78ad9d754 100644
--- a/indra/newview/llfloaterpathfindingobjects.cpp
+++ b/indra/newview/llfloaterpathfindingobjects.cpp
@@ -74,7 +74,7 @@ void LLFloaterPathfindingObjects::onOpen(const LLSD &pKey)
if (!mSelectionUpdateSlot.connected())
{
- mSelectionUpdateSlot = LLSelectMgr::getInstance()->mUpdateSignal.connect(boost::bind(&LLFloaterPathfindingObjects::onSelectionListChanged, this));
+ mSelectionUpdateSlot = LLSelectMgr::getInstance()->mUpdateSignal.connect(boost::bind(&LLFloaterPathfindingObjects::onInWorldSelectionListChanged, this));
}
if (!mRegionBoundaryCrossingSlot.connected())
@@ -82,11 +82,21 @@ void LLFloaterPathfindingObjects::onOpen(const LLSD &pKey)
mRegionBoundaryCrossingSlot = LLEnvManagerNew::getInstance()->setRegionChangeCallback(boost::bind(&LLFloaterPathfindingObjects::onRegionBoundaryCrossed, this));
}
+ if (!mGodLevelChangeSlot.connected())
+ {
+ mGodLevelChangeSlot = gAgent.registerGodLevelChanageListener(boost::bind(&LLFloaterPathfindingObjects::onGodLevelChange, this, _1));
+ }
+
requestGetObjects();
}
void LLFloaterPathfindingObjects::onClose(bool pIsAppQuitting)
{
+ if (mGodLevelChangeSlot.connected())
+ {
+ mGodLevelChangeSlot.disconnect();
+ }
+
if (mRegionBoundaryCrossingSlot.connected())
{
mRegionBoundaryCrossingSlot.disconnect();
@@ -357,40 +367,6 @@ void LLFloaterPathfindingObjects::updateControls()
updateStateOnEditFields();
}
-void LLFloaterPathfindingObjects::updateSelection()
-{
- mObjectsSelection.clear();
- LLSelectMgr::getInstance()->deselectAll();
-
- std::vector<LLScrollListItem *> selectedItems = mObjectsScrollList->getAllSelected();
- if (!selectedItems.empty())
- {
- int numSelectedItems = selectedItems.size();
-
- std::vector<LLViewerObject *>viewerObjects;
- viewerObjects.reserve(numSelectedItems);
-
- for (std::vector<LLScrollListItem *>::const_iterator selectedItemIter = selectedItems.begin();
- selectedItemIter != selectedItems.end(); ++selectedItemIter)
- {
- const LLScrollListItem *selectedItem = *selectedItemIter;
-
- LLViewerObject *viewerObject = gObjectList.findObject(selectedItem->getUUID());
- if (viewerObject != NULL)
- {
- viewerObjects.push_back(viewerObject);
- }
- }
-
- if (!viewerObjects.empty())
- {
- mObjectsSelection = LLSelectMgr::getInstance()->selectObjectAndFamily(viewerObjects);
- }
- }
-
- updateControls();
-}
-
S32 LLFloaterPathfindingObjects::getNameColumnIndex() const
{
return 0;
@@ -552,10 +528,10 @@ void LLFloaterPathfindingObjects::onTeleportClicked()
void LLFloaterPathfindingObjects::onScrollListSelectionChanged()
{
- updateSelection();
+ updateOnScrollListChange();
}
-void LLFloaterPathfindingObjects::onSelectionListChanged()
+void LLFloaterPathfindingObjects::onInWorldSelectionListChanged()
{
updateControls();
}
@@ -565,6 +541,11 @@ void LLFloaterPathfindingObjects::onRegionBoundaryCrossed()
requestGetObjects();
}
+void LLFloaterPathfindingObjects::onGodLevelChange(U8 pGodLevel)
+{
+ requestGetObjects();
+}
+
void LLFloaterPathfindingObjects::updateMessagingStatus()
{
std::string statusText("");
@@ -676,6 +657,38 @@ void LLFloaterPathfindingObjects::updateStateOnEditFields()
mTeleportButton->setEnabled(numSelectedItems == 1);
}
+void LLFloaterPathfindingObjects::updateOnScrollListChange()
+{
+ mObjectsSelection.clear();
+ LLSelectMgr::getInstance()->deselectAll();
+
+ std::vector<LLScrollListItem *> selectedItems = mObjectsScrollList->getAllSelected();
+ if (!selectedItems.empty())
+ {
+ int numSelectedItems = selectedItems.size();
+
+ std::vector<LLViewerObject *>viewerObjects;
+ viewerObjects.reserve(numSelectedItems);
+
+ for (std::vector<LLScrollListItem *>::const_iterator selectedItemIter = selectedItems.begin();
+ selectedItemIter != selectedItems.end(); ++selectedItemIter)
+ {
+ const LLScrollListItem *selectedItem = *selectedItemIter;
+
+ LLViewerObject *viewerObject = gObjectList.findObject(selectedItem->getUUID());
+ if (viewerObject != NULL)
+ {
+ viewerObjects.push_back(viewerObject);
+ }
+ }
+
+ if (!viewerObjects.empty())
+ {
+ mObjectsSelection = LLSelectMgr::getInstance()->selectObjectAndFamily(viewerObjects);
+ }
+ }
+}
+
LLPathfindingObjectPtr LLFloaterPathfindingObjects::findObject(const LLScrollListItem *pListItem) const
{
LLPathfindingObjectPtr objectPtr;
diff --git a/indra/newview/llfloaterpathfindingobjects.h b/indra/newview/llfloaterpathfindingobjects.h
index f9c099e1a2..fc096a7c31 100644
--- a/indra/newview/llfloaterpathfindingobjects.h
+++ b/indra/newview/llfloaterpathfindingobjects.h
@@ -29,6 +29,7 @@
#include <boost/signals2.hpp>
+#include "llagent.h"
#include "llfloater.h"
#include "llpathfindingmanager.h"
#include "llpathfindingobject.h"
@@ -78,7 +79,6 @@ protected:
virtual LLSD convertObjectsIntoScrollListData(const LLPathfindingObjectListPtr pObjectListPtr) const;
virtual void updateControls();
- virtual void updateSelection();
virtual S32 getNameColumnIndex() const;
virtual const LLColor4 &getBeaconColor() const;
@@ -118,12 +118,14 @@ private:
void onTeleportClicked();
void onScrollListSelectionChanged();
- void onSelectionListChanged();
+ void onInWorldSelectionListChanged();
void onRegionBoundaryCrossed();
+ void onGodLevelChange(U8 pGodLevel);
void updateMessagingStatus();
void updateStateOnListActionControls();
void updateStateOnEditFields();
+ void updateOnScrollListChange();
LLPathfindingObjectPtr findObject(const LLScrollListItem *pListItem) const;
@@ -154,6 +156,7 @@ private:
boost::signals2::connection mSelectionUpdateSlot;
boost::signals2::connection mRegionBoundaryCrossingSlot;
+ LLAgent::god_level_change_slot_t mGodLevelChangeSlot;
public:
LLRootHandle<LLFloaterPathfindingObjects> mSelfHandle;