summaryrefslogtreecommitdiff
path: root/indra/newview/llpanelgrouplandmoney.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llpanelgrouplandmoney.cpp')
-rwxr-xr-xindra/newview/llpanelgrouplandmoney.cpp101
1 files changed, 51 insertions, 50 deletions
diff --git a/indra/newview/llpanelgrouplandmoney.cpp b/indra/newview/llpanelgrouplandmoney.cpp
index 17707557bb..375c54479d 100755
--- a/indra/newview/llpanelgrouplandmoney.cpp
+++ b/indra/newview/llpanelgrouplandmoney.cpp
@@ -131,7 +131,7 @@ public:
- static LLMap<LLUUID, LLGroupMoneyTabEventHandler*> sInstanceIDs;
+ static std::map<LLUUID, LLGroupMoneyTabEventHandler*> sInstanceIDs;
static std::map<LLPanel*, LLGroupMoneyTabEventHandler*> sTabsToHandlers;
protected:
LLGroupMoneyTabEventHandlerImpl* mImplementationp;
@@ -324,7 +324,7 @@ bool LLPanelGroupLandMoney::impl::applyContribution()
if(!gAgent.setGroupContribution(mPanel.mGroupID, new_contribution))
{
// should never happen...
- llwarns << "Unable to set contribution." << llendl;
+ LL_WARNS() << "Unable to set contribution." << LL_ENDL;
return false;
}
}
@@ -421,27 +421,14 @@ void LLPanelGroupLandMoney::impl::processGroupLand(LLMessageSystem* msg)
msg->getUUID("QueryData", "OwnerID", owner_id, 0);
msg->getUUID("TransactionData", "TransactionID", trans_id);
+ S32 total_contribution = 0;
if(owner_id.isNull())
{
// special block which has total contribution
++first_block;
-
- S32 total_contribution;
+
msg->getS32("QueryData", "ActualArea", total_contribution, 0);
mPanel.getChild<LLUICtrl>("total_contributed_land_value")->setTextArg("[AREA]", llformat("%d", total_contribution));
-
- S32 committed;
- msg->getS32("QueryData", "BillableArea", committed, 0);
- mPanel.getChild<LLUICtrl>("total_land_in_use_value")->setTextArg("[AREA]", llformat("%d", committed));
-
- S32 available = total_contribution - committed;
- mPanel.getChild<LLUICtrl>("land_available_value")->setTextArg("[AREA]", llformat("%d", available));
-
- if ( mGroupOverLimitTextp && mGroupOverLimitIconp )
- {
- mGroupOverLimitIconp->setVisible(available < 0);
- mGroupOverLimitTextp->setVisible(available < 0);
- }
}
if ( trans_id != mTransID ) return;
@@ -460,7 +447,8 @@ void LLPanelGroupLandMoney::impl::processGroupLand(LLMessageSystem* msg)
std::string sim_name;
std::string land_sku;
std::string land_type;
-
+ S32 committed = 0;
+
for(S32 i = first_block; i < count; ++i)
{
msg->getUUID("QueryData", "OwnerID", owner_id, i);
@@ -476,7 +464,7 @@ void LLPanelGroupLandMoney::impl::processGroupLand(LLMessageSystem* msg)
if ( msg->getSizeFast(_PREHASH_QueryData, i, _PREHASH_ProductSKU) > 0 )
{
msg->getStringFast( _PREHASH_QueryData, _PREHASH_ProductSKU, land_sku, i);
- llinfos << "Land sku: " << land_sku << llendl;
+ LL_INFOS() << "Land sku: " << land_sku << LL_ENDL;
land_type = LLProductInfoRequestManager::instance().getDescriptionForSku(land_sku);
}
else
@@ -489,6 +477,9 @@ void LLPanelGroupLandMoney::impl::processGroupLand(LLMessageSystem* msg)
S32 region_y = llround(global_y) % REGION_WIDTH_UNITS;
std::string location = sim_name + llformat(" (%d, %d)", region_x, region_y);
std::string area;
+ committed+=billable_area;
+
+
if(billable_area == actual_area)
{
area = llformat("%d", billable_area);
@@ -525,6 +516,16 @@ void LLPanelGroupLandMoney::impl::processGroupLand(LLMessageSystem* msg)
mGroupParcelsp->addElement(row);
}
+
+ mPanel.getChild<LLUICtrl>("total_land_in_use_value")->setTextArg("[AREA]", llformat("%d", committed));
+
+ S32 available = total_contribution - committed;
+ mPanel.getChild<LLUICtrl>("land_available_value")->setTextArg("[AREA]", llformat("%d", available));
+ if ( mGroupOverLimitTextp && mGroupOverLimitIconp )
+ {
+ mGroupOverLimitIconp->setVisible(available < 0);
+ mGroupOverLimitTextp->setVisible(available < 0);
+ }
}
}
@@ -534,7 +535,7 @@ void LLPanelGroupLandMoney::impl::processGroupLand(LLMessageSystem* msg)
//static
-LLMap<LLUUID, LLPanelGroupLandMoney*> LLPanelGroupLandMoney::sGroupIDs;
+std::map<LLUUID, LLPanelGroupLandMoney*> LLPanelGroupLandMoney::sGroupIDs;
LLPanelGroupLandMoney::LLPanelGroupLandMoney() :
LLPanelGroupTab()
@@ -547,13 +548,13 @@ LLPanelGroupLandMoney::LLPanelGroupLandMoney() :
//will then only be working for the last panel for a given group id :(
//FIXME - add to setGroupID()
- //LLPanelGroupLandMoney::sGroupIDs.addData(group_id, this);
+ //LLPanelGroupLandMoney::sGroupIDs.insert(group_id, this);
}
LLPanelGroupLandMoney::~LLPanelGroupLandMoney()
{
delete mImplementationp;
- LLPanelGroupLandMoney::sGroupIDs.removeData(mGroupID);
+ LLPanelGroupLandMoney::sGroupIDs.erase(mGroupID);
}
void LLPanelGroupLandMoney::activate()
@@ -821,15 +822,15 @@ void LLPanelGroupLandMoney::processPlacesReply(LLMessageSystem* msg, void**)
LLUUID group_id;
msg->getUUID("AgentData", "QueryID", group_id);
- LLPanelGroupLandMoney* selfp = sGroupIDs.getIfThere(group_id);
- if(!selfp)
+ group_id_map_t::iterator found_it = sGroupIDs.find(group_id);
+ if(found_it == sGroupIDs.end())
{
- llinfos << "Group Panel Land L$ " << group_id << " no longer in existence."
- << llendl;
+ LL_INFOS() << "Group Panel Land L$ " << group_id << " no longer in existence."
+ << LL_ENDL;
return;
}
- selfp->mImplementationp->processGroupLand(msg);
+ found_it->second->mImplementationp->processGroupLand(msg);
}
@@ -885,7 +886,7 @@ void LLGroupMoneyTabEventHandlerImpl::updateButtons()
//** LLGroupMoneyTabEventHandler Functions **
//*******************************************
-LLMap<LLUUID, LLGroupMoneyTabEventHandler*> LLGroupMoneyTabEventHandler::sInstanceIDs;
+std::map<LLUUID, LLGroupMoneyTabEventHandler*> LLGroupMoneyTabEventHandler::sInstanceIDs;
std::map<LLPanel*, LLGroupMoneyTabEventHandler*> LLGroupMoneyTabEventHandler::sTabsToHandlers;
LLGroupMoneyTabEventHandler::LLGroupMoneyTabEventHandler(LLButton* earlier_buttonp,
@@ -922,13 +923,13 @@ LLGroupMoneyTabEventHandler::LLGroupMoneyTabEventHandler(LLButton* earlier_butto
tab_containerp->setCommitCallback(boost::bind(&LLGroupMoneyTabEventHandler::onClickTab, this));
}
- sInstanceIDs.addData(mImplementationp->mPanelID, this);
+ sInstanceIDs.insert(std::make_pair(mImplementationp->mPanelID, this));
sTabsToHandlers[panelp] = this;
}
LLGroupMoneyTabEventHandler::~LLGroupMoneyTabEventHandler()
{
- sInstanceIDs.removeData(mImplementationp->mPanelID);
+ sInstanceIDs.erase(mImplementationp->mPanelID);
sTabsToHandlers.erase(mImplementationp->mTabPanelp);
delete mImplementationp;
@@ -1045,7 +1046,7 @@ void LLGroupMoneyDetailsTabEventHandler::processReply(LLMessageSystem* msg,
msg->getUUIDFast(_PREHASH_AgentData, _PREHASH_GroupID, group_id );
if (mImplementationp->getGroupID() != group_id)
{
- llwarns << "Group Account details not for this group!" << llendl;
+ LL_WARNS() << "Group Account details not for this group!" << LL_ENDL;
return;
}
@@ -1068,8 +1069,8 @@ void LLGroupMoneyDetailsTabEventHandler::processReply(LLMessageSystem* msg,
if ( interval_days != mImplementationp->mIntervalLength ||
current_interval != mImplementationp->mCurrentInterval )
{
- llinfos << "Out of date details packet " << interval_days << " "
- << current_interval << llendl;
+ LL_INFOS() << "Out of date details packet " << interval_days << " "
+ << current_interval << LL_ENDL;
return;
}
@@ -1116,16 +1117,16 @@ void LLPanelGroupLandMoney::processGroupAccountDetailsReply(LLMessageSystem* msg
msg->getUUIDFast(_PREHASH_AgentData, _PREHASH_AgentID, agent_id );
if (gAgent.getID() != agent_id)
{
- llwarns << "Got group L$ history reply for another agent!" << llendl;
+ LL_WARNS() << "Got group L$ history reply for another agent!" << LL_ENDL;
return;
}
LLUUID request_id;
msg->getUUIDFast(_PREHASH_MoneyData, _PREHASH_RequestID, request_id );
- LLGroupMoneyTabEventHandler* selfp = LLGroupMoneyTabEventHandler::sInstanceIDs.getIfThere(request_id);
+ LLGroupMoneyTabEventHandler* selfp = get_ptr_in_map(LLGroupMoneyTabEventHandler::sInstanceIDs, request_id);
if (!selfp)
{
- llwarns << "GroupAccountDetails recieved for non-existent group panel." << llendl;
+ LL_WARNS() << "GroupAccountDetails received for non-existent group panel." << LL_ENDL;
return;
}
@@ -1186,7 +1187,7 @@ void LLGroupMoneySalesTabEventHandler::processReply(LLMessageSystem* msg,
msg->getUUIDFast(_PREHASH_AgentData, _PREHASH_GroupID, group_id );
if (mImplementationp->getGroupID() != group_id)
{
- llwarns << "Group Account Transactions not for this group!" << llendl;
+ LL_WARNS() << "Group Account Transactions not for this group!" << LL_ENDL;
return;
}
@@ -1203,8 +1204,8 @@ void LLGroupMoneySalesTabEventHandler::processReply(LLMessageSystem* msg,
if (interval_days != mImplementationp->mIntervalLength ||
current_interval != mImplementationp->mCurrentInterval)
{
- llinfos << "Out of date details packet " << interval_days << " "
- << current_interval << llendl;
+ LL_INFOS() << "Out of date details packet " << interval_days << " "
+ << current_interval << LL_ENDL;
return;
}
@@ -1293,7 +1294,7 @@ void LLPanelGroupLandMoney::processGroupAccountTransactionsReply(LLMessageSystem
msg->getUUIDFast(_PREHASH_AgentData, _PREHASH_AgentID, agent_id );
if (gAgent.getID() != agent_id)
{
- llwarns << "Got group L$ history reply for another agent!" << llendl;
+ LL_WARNS() << "Got group L$ history reply for another agent!" << LL_ENDL;
return;
}
@@ -1302,10 +1303,10 @@ void LLPanelGroupLandMoney::processGroupAccountTransactionsReply(LLMessageSystem
LLGroupMoneyTabEventHandler* self;
- self = LLGroupMoneyTabEventHandler::sInstanceIDs.getIfThere(request_id);
+ self = get_ptr_in_map(LLGroupMoneyTabEventHandler::sInstanceIDs, request_id);
if (!self)
{
- llwarns << "GroupAccountTransactions recieved for non-existent group panel." << llendl;
+ LL_WARNS() << "GroupAccountTransactions recieved for non-existent group panel." << LL_ENDL;
return;
}
@@ -1364,7 +1365,7 @@ void LLGroupMoneyPlanningTabEventHandler::processReply(LLMessageSystem* msg,
msg->getUUIDFast(_PREHASH_AgentData, _PREHASH_GroupID, group_id );
if (mImplementationp->getGroupID() != group_id)
{
- llwarns << "Group Account Summary received not for this group!" << llendl;
+ LL_WARNS() << "Group Account Summary received not for this group!" << LL_ENDL;
return;
}
@@ -1415,8 +1416,8 @@ void LLGroupMoneyPlanningTabEventHandler::processReply(LLMessageSystem* msg,
if (interval_days != mImplementationp->mIntervalLength ||
current_interval != mImplementationp->mCurrentInterval)
{
- llinfos << "Out of date summary packet " << interval_days << " "
- << current_interval << llendl;
+ LL_INFOS() << "Out of date summary packet " << interval_days << " "
+ << current_interval << LL_ENDL;
return;
}
@@ -1473,7 +1474,7 @@ void LLPanelGroupLandMoney::processGroupAccountSummaryReply(LLMessageSystem* msg
msg->getUUIDFast(_PREHASH_AgentData, _PREHASH_AgentID, agent_id );
if (gAgent.getID() != agent_id)
{
- llwarns << "Got group L$ history reply for another agent!" << llendl;
+ LL_WARNS() << "Got group L$ history reply for another agent!" << LL_ENDL;
return;
}
@@ -1482,10 +1483,10 @@ void LLPanelGroupLandMoney::processGroupAccountSummaryReply(LLMessageSystem* msg
LLGroupMoneyTabEventHandler* self;
- self = LLGroupMoneyTabEventHandler::sInstanceIDs.getIfThere(request_id);
+ self = get_ptr_in_map(LLGroupMoneyTabEventHandler::sInstanceIDs, request_id);
if (!self)
{
- llwarns << "GroupAccountSummary recieved for non-existent group L$ planning tab." << llendl;
+ LL_WARNS() << "GroupAccountSummary recieved for non-existent group L$ planning tab." << LL_ENDL;
return;
}
@@ -1494,9 +1495,9 @@ void LLPanelGroupLandMoney::processGroupAccountSummaryReply(LLMessageSystem* msg
void LLPanelGroupLandMoney::setGroupID(const LLUUID& id)
{
- LLPanelGroupLandMoney::sGroupIDs.removeData(mGroupID);
+ LLPanelGroupLandMoney::sGroupIDs.erase(mGroupID);
LLPanelGroupTab::setGroupID(id);
- LLPanelGroupLandMoney::sGroupIDs.addData(mGroupID, this);
+ LLPanelGroupLandMoney::sGroupIDs.insert(std::make_pair(mGroupID, this));
bool can_view = gAgent.isInGroup(mGroupID);