diff options
author | Todd Stinson <stinson@lindenlab.com> | 2012-03-01 16:04:18 -0800 |
---|---|---|
committer | Todd Stinson <stinson@lindenlab.com> | 2012-03-01 16:04:18 -0800 |
commit | 2b93f44f197930790e7f81f51ffcdaf684b4a221 (patch) | |
tree | 7f0ebaca7240bd34b71784ebfea2eb5563f152d0 /indra/newview | |
parent | ed60f5b2d52a96f6144e611257b796fdcd561b7e (diff) |
BUGFIX Correcting a problem with the object selection code in the pathfinding characters and linksets floaters. The code was not seeing the callback from the object update message of the selection manager.
Diffstat (limited to 'indra/newview')
-rw-r--r-- | indra/newview/llfloaterpathfindingcharacters.cpp | 17 | ||||
-rw-r--r-- | indra/newview/llfloaterpathfindingcharacters.h | 3 | ||||
-rw-r--r-- | indra/newview/llfloaterpathfindinglinksets.cpp | 16 | ||||
-rw-r--r-- | indra/newview/llfloaterpathfindinglinksets.h | 3 |
4 files changed, 35 insertions, 4 deletions
diff --git a/indra/newview/llfloaterpathfindingcharacters.cpp b/indra/newview/llfloaterpathfindingcharacters.cpp index e2e1921cc6..ae023bc06e 100644 --- a/indra/newview/llfloaterpathfindingcharacters.cpp +++ b/indra/newview/llfloaterpathfindingcharacters.cpp @@ -123,12 +123,24 @@ void LLFloaterPathfindingCharacters::onOpen(const LLSD& pKey) {
sendCharactersDataGetRequest();
selectNoneCharacters();
+
+ if (!mSelectionUpdateSlot.connected())
+ {
+ mSelectionUpdateSlot = LLSelectMgr::getInstance()->mUpdateSignal.connect(boost::bind(&LLFloaterPathfindingCharacters::updateActionFields, this));
+ }
+
mCharactersScrollList->setCommitOnSelectionChange(true);
}
void LLFloaterPathfindingCharacters::onClose(bool app_quitting)
{
mCharactersScrollList->setCommitOnSelectionChange(false);
+
+ if (mSelectionUpdateSlot.connected())
+ {
+ mSelectionUpdateSlot.disconnect();
+ }
+
selectNoneCharacters();
if (mCharacterSelection.notNull())
{
@@ -227,7 +239,8 @@ LLFloaterPathfindingCharacters::LLFloaterPathfindingCharacters(const LLSD& pSeed mReturnBtn(NULL),
mDeleteBtn(NULL),
mTeleportBtn(NULL),
- mCharacterSelection()
+ mCharacterSelection(),
+ mSelectionUpdateSlot()
{
mSelfHandle.bind(this);
}
@@ -570,7 +583,7 @@ void LLFloaterPathfindingCharacters::setEnableActionFields(BOOL pEnabled) {
mLabelActions->setEnabled(pEnabled);
mShowBeaconCheckBox->setEnabled(pEnabled);
- mTakeBtn->setEnabled(pEnabled && tools_visible_take_object());
+ mTakeBtn->setEnabled(pEnabled && visible_take_object());
mTakeCopyBtn->setEnabled(pEnabled && enable_object_take_copy());
mReturnBtn->setEnabled(pEnabled && enable_object_return());
mDeleteBtn->setEnabled(pEnabled && enable_object_delete());
diff --git a/indra/newview/llfloaterpathfindingcharacters.h b/indra/newview/llfloaterpathfindingcharacters.h index ecc605c300..c381492784 100644 --- a/indra/newview/llfloaterpathfindingcharacters.h +++ b/indra/newview/llfloaterpathfindingcharacters.h @@ -36,6 +36,8 @@ #include "llpathfindingcharacter.h"
#include "llselectmgr.h"
+#include <boost/signals2.hpp>
+
class LLSD;
class LLTextBase;
class LLScrollListCtrl;
@@ -90,6 +92,7 @@ private: LLButton *mDeleteBtn;
LLButton *mTeleportBtn;
LLObjectSelectionHandle mCharacterSelection;
+ boost::signals2::connection mSelectionUpdateSlot;
// Does its own instance management, so clients not allowed
// to allocate or destroy.
diff --git a/indra/newview/llfloaterpathfindinglinksets.cpp b/indra/newview/llfloaterpathfindinglinksets.cpp index 9b86ecd66a..27047b4fd9 100644 --- a/indra/newview/llfloaterpathfindinglinksets.cpp +++ b/indra/newview/llfloaterpathfindinglinksets.cpp @@ -53,6 +53,7 @@ #include "llnotificationsutil.h"
#include <boost/bind.hpp>
+#include <boost/signals2.hpp>
#define XUI_LINKSET_USE_NONE 0
#define XUI_LINKSET_USE_WALKABLE 1
@@ -212,10 +213,20 @@ void LLFloaterPathfindingLinksets::onOpen(const LLSD& pKey) {
LLPathfindingManager::getInstance()->registerAgentStateSignal(boost::bind(&LLFloaterPathfindingLinksets::onAgentStateCB, this, _1));
}
+
+ if (!mSelectionUpdateSlot.connected())
+ {
+ mSelectionUpdateSlot = LLSelectMgr::getInstance()->mUpdateSignal.connect(boost::bind(&LLFloaterPathfindingLinksets::updateControls, this));
+ }
}
void LLFloaterPathfindingLinksets::onClose(bool pAppQuitting)
{
+ if (mSelectionUpdateSlot.connected())
+ {
+ mSelectionUpdateSlot.disconnect();
+ }
+
if (mAgentStateSlot.connected())
{
mAgentStateSlot.disconnect();
@@ -307,7 +318,8 @@ LLFloaterPathfindingLinksets::LLFloaterPathfindingLinksets(const LLSD& pSeed) mMessagingState(kMessagingUnknown),
mLinksetsListPtr(),
mLinksetsSelection(),
- mAgentStateSlot()
+ mAgentStateSlot(),
+ mSelectionUpdateSlot()
{
}
@@ -1004,7 +1016,7 @@ void LLFloaterPathfindingLinksets::updateEnableStateOnEditFields() bool isEditEnabled = ((numSelectedItems > 0) && LLPathfindingManager::getInstance()->isAllowAlterPermanent());
mShowBeaconCheckBox->setEnabled(numSelectedItems > 0);
- mTakeButton->setEnabled(isEditEnabled && tools_visible_take_object());
+ mTakeButton->setEnabled(isEditEnabled && visible_take_object());
mTakeCopyButton->setEnabled(isEditEnabled && enable_object_take_copy());
mReturnButton->setEnabled(isEditEnabled && enable_object_return());
mDeleteButton->setEnabled(isEditEnabled && enable_object_delete());
diff --git a/indra/newview/llfloaterpathfindinglinksets.h b/indra/newview/llfloaterpathfindinglinksets.h index 6432652568..d201ffe20b 100644 --- a/indra/newview/llfloaterpathfindinglinksets.h +++ b/indra/newview/llfloaterpathfindinglinksets.h @@ -35,6 +35,8 @@ #include "llpathfindinglinksetlist.h"
#include "llpathfindingmanager.h"
+#include <boost/signals2.hpp> + class LLSD;
class LLUICtrl;
class LLTextBase;
@@ -120,6 +122,7 @@ private: LLPathfindingLinksetListPtr mLinksetsListPtr;
LLObjectSelectionHandle mLinksetsSelection;
LLPathfindingManager::agent_state_slot_t mAgentStateSlot;
+ boost::signals2::connection mSelectionUpdateSlot; // Does its own instance management, so clients not allowed
// to allocate or destroy.
|