summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTodd Stinson <stinson@lindenlab.com>2012-05-31 17:25:41 -0700
committerTodd Stinson <stinson@lindenlab.com>2012-05-31 17:25:41 -0700
commit41bcd567646190cda86ec3ee77041bd84193c377 (patch)
tree86682757c7938df5e6124ccacbf01db2cdd60240
parent938f42ded789dd70b31820d29694256cec3a1572 (diff)
A bit more class clean-up for the LLFloaterPathfindingObjects.
-rw-r--r--indra/newview/llfloaterpathfindinglinksets.cpp7
-rw-r--r--indra/newview/llfloaterpathfindinglinksets.h1
-rw-r--r--indra/newview/llfloaterpathfindingobjects.cpp72
-rw-r--r--indra/newview/llfloaterpathfindingobjects.h40
4 files changed, 55 insertions, 65 deletions
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 3f6c4983d5..a8f604b970 100644
--- a/indra/newview/llfloaterpathfindingobjects.cpp
+++ b/indra/newview/llfloaterpathfindingobjects.cpp
@@ -70,7 +70,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())
@@ -356,40 +356,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;
@@ -551,10 +517,10 @@ void LLFloaterPathfindingObjects::onTeleportClicked()
void LLFloaterPathfindingObjects::onScrollListSelectionChanged()
{
- updateSelection();
+ updateOnScrollListChange();
}
-void LLFloaterPathfindingObjects::onSelectionListChanged()
+void LLFloaterPathfindingObjects::onInWorldSelectionListChanged()
{
updateControls();
}
@@ -679,6 +645,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 79d241757c..aacf299d13 100644
--- a/indra/newview/llfloaterpathfindingobjects.h
+++ b/indra/newview/llfloaterpathfindingobjects.h
@@ -79,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;
@@ -102,25 +101,26 @@ protected:
private:
LLFloaterPathfindingObjects(const LLFloaterPathfindingObjects &pOther);
- void setMessagingState(EMessagingState pMessagingState);
-
- void onRefreshObjectsClicked();
- void onSelectAllObjectsClicked();
- void onSelectNoneObjectsClicked();
- void onTakeClicked();
- void onTakeCopyClicked();
- void onReturnClicked();
- void onDeleteClicked();
- void onTeleportClicked();
-
- void onScrollListSelectionChanged();
- void onSelectionListChanged();
- void onRegionBoundaryCrossed();
- void onGodLevelChange(U8 pGodLevel);
-
- void updateMessagingStatus();
- void updateStateOnListActionControls();
- void updateStateOnEditFields();
+ void setMessagingState(EMessagingState pMessagingState);
+
+ void onRefreshObjectsClicked();
+ void onSelectAllObjectsClicked();
+ void onSelectNoneObjectsClicked();
+ void onTakeClicked();
+ void onTakeCopyClicked();
+ void onReturnClicked();
+ void onDeleteClicked();
+ void onTeleportClicked();
+
+ void onScrollListSelectionChanged();
+ void onInWorldSelectionListChanged();
+ void onRegionBoundaryCrossed();
+ void onGodLevelChange(U8 pGodLevel);
+
+ void updateMessagingStatus();
+ void updateStateOnListActionControls();
+ void updateStateOnEditFields();
+ void updateOnScrollListChange();
LLPathfindingObjectPtr findObject(const LLScrollListItem *pListItem) const;