summaryrefslogtreecommitdiff
path: root/indra/newview/llpanelgrouproles.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llpanelgrouproles.cpp')
-rwxr-xr-xindra/newview/llpanelgrouproles.cpp195
1 files changed, 114 insertions, 81 deletions
diff --git a/indra/newview/llpanelgrouproles.cpp b/indra/newview/llpanelgrouproles.cpp
index f3cb9900fe..76cb3cc498 100755
--- a/indra/newview/llpanelgrouproles.cpp
+++ b/indra/newview/llpanelgrouproles.cpp
@@ -1304,6 +1304,8 @@ void LLPanelGroupMembersSubTab::deactivate()
bool LLPanelGroupMembersSubTab::needsApply(std::string& mesg)
{
+ LL_INFOS("BAKER") << "[BAKER] needsApply()" << LL_ENDL;
+
return mChanged;
}
@@ -2711,8 +2713,6 @@ void LLPanelGroupActionsSubTab::setGroupID(const LLUUID& id)
LLPanelGroupSubTab::setGroupID(id);
}
-//////////////////////////////////////////////////////////////////////////
-
////////////////////////////
// LLPanelGroupBanListSubTab
@@ -2724,14 +2724,10 @@ LLPanelGroupBanListSubTab::LLPanelGroupBanListSubTab()
mBanList(NULL),
mCreateBanButton(NULL),
mDeleteBanButton(NULL)
-{
- LL_INFOS("BAKER") << "[BAKER] LLPanelGroupBanListSubTab::ctor()" << LL_ENDL;
-}
+{}
BOOL LLPanelGroupBanListSubTab::postBuildSubTab(LLView* root)
{
- LL_INFOS("BAKER") << "[BAKER] LLPanelGroupBanListSubTab::postBuildSubTab()" << LL_ENDL;
-
LLPanelGroupSubTab::postBuildSubTab(root);
// Upcast parent so we can ask it for sibling controls.
@@ -2740,49 +2736,50 @@ BOOL LLPanelGroupBanListSubTab::postBuildSubTab(LLView* root)
// Look recursively from the parent to find all our widgets.
bool recurse = true;
- // BAKER TODO:
- // What are these? Looks like something inhereted from LLPanelGroupSubTab
- mHeader = parent->getChild<LLPanel>("banlist_header", recurse);
- mFooter = parent->getChild<LLPanel>("banlist_footer", recurse);
- //////////////////////////////////////////////////////////////////////////
+ mHeader = parent->getChild<LLPanel>("banlist_header", recurse);
+ mFooter = parent->getChild<LLPanel>("banlist_footer", recurse);
mBanList = parent->getChild<LLNameListCtrl>("ban_list", recurse);
- mCreateBanButton = parent->getChild<LLButton>("ban_create", recurse);
- mDeleteBanButton = parent->getChild<LLButton>("ban_delete", recurse);
+
+ mCreateBanButton = parent->getChild<LLButton>("ban_create", recurse);
+ mDeleteBanButton = parent->getChild<LLButton>("ban_delete", recurse);
+ mRefreshBanListButton = parent->getChild<LLButton>("ban_refresh", recurse);
- if(!mBanList || !mCreateBanButton || !mDeleteBanButton)
+ if(!mBanList || !mCreateBanButton || !mDeleteBanButton || !mRefreshBanListButton)
return FALSE;
mBanList->setCommitOnSelectionChange(TRUE);
mBanList->setCommitCallback(onBanEntrySelect, this);
mCreateBanButton->setClickedCallback(onCreateBanEntry, this);
- mCreateBanButton->setEnabled(FALSE);
-
+ mCreateBanButton->setEnabled(TRUE);
+
mDeleteBanButton->setClickedCallback(onDeleteBanEntry, this);
mDeleteBanButton->setEnabled(FALSE);
- setFooterEnabled(FALSE);
-
- LLGroupMgrGroupData* gdatap = LLGroupMgr::getInstance()->getGroupData(mGroupID);
- if(gdatap && (gdatap->getGroupBanStatus() == LLGroupMgrGroupData::STATUS_INIT))
- {
- LLGroupMgr::getInstance()->sendGroupBanRequest(LLGroupMgr::REQUEST_GET, mGroupID);
- gdatap->setGroupBanStatus(LLGroupMgrGroupData::STATUS_REQUESTING);
- }
+ mRefreshBanListButton->setClickedCallback(onRefreshBanList, this);
+ mRefreshBanListButton->setEnabled(FALSE);
+ mBanList->setOnNameListCompleteCallback(boost::bind(&LLPanelGroupBanListSubTab::onBanListCompleted, this, _1));
+
+ setFooterEnabled(FALSE);
return TRUE;
}
void LLPanelGroupBanListSubTab::activate()
{
- LL_INFOS("BAKER") << "[BAKER] LLPanelGroupBanListSubTab::activate()" << LL_ENDL;
-
LLPanelGroupSubTab::activate();
mBanList->deselectAllItems();
mDeleteBanButton->setEnabled(FALSE);
+ // BAKER: Should I really request everytime activate() is called?
+ // Perhaps I should only do it on a force refresh, or if an action on the list happens...
+ // Because it's not going to live-update the list anyway... You'd have to refresh if you
+ // wanted to see someone else's additions anyway...
+ //
+ LLGroupMgr::getInstance()->sendGroupBanRequest(LLGroupMgr::REQUEST_GET, mGroupID);
+
setFooterEnabled(FALSE);
update(GC_ALL);
}
@@ -2820,68 +2817,53 @@ void LLPanelGroupBanListSubTab::update(LLGroupChange gc)
//if (gc != GC_ALL && gc != GC_BANLIST)
// return;
- LLGroupMgrGroupData* gdatap = LLGroupMgr::getInstance()->getGroupData(mGroupID);
- if(!gdatap)
- {
- LL_INFOS("BAKER") << "[BAKER] No group data!" << LL_ENDL;
- return;
- }
-
- switch(gdatap->getGroupBanStatus())
- {
- // Must be initial update [ Check if I should request this at panel creation
- // with everything else -- might as well]
- // Request our ban list!
- case LLGroupMgrGroupData::STATUS_INIT:
- LLGroupMgr::getInstance()->sendGroupBanRequest(LLGroupMgr::REQUEST_GET, mGroupID);
- gdatap->setGroupBanStatus(LLGroupMgrGroupData::STATUS_REQUESTING);
- break;
+// LLGroupMgrGroupData* gdatap = LLGroupMgr::getInstance()->getGroupData(mGroupID);
+// if(!gdatap)
+// {
+// LL_INFOS("BAKER") << "[BAKER] No group data!" << LL_ENDL;
+// return;
+// }
+
+ populateBanList();
+// // Do I even need this anymore?
+// switch(gdatap->getGroupBanStatus())
+// {
+// // Must be initial update [ Check if I should request this at panel creation
+// // with everything else -- might as well]
+// // Request our ban list!
+// case LLGroupMgrGroupData::STATUS_INIT:
+// LLGroupMgr::getInstance()->sendGroupBanRequest(LLGroupMgr::REQUEST_GET, mGroupID);
+// gdatap->setGroupBanStatus(LLGroupMgrGroupData::STATUS_REQUESTING);
+// break;
+//
+// // Already have a request out -- don't bother sending another one
+// // Repeat sending won't make a difference, as it'll be behind a load balancer
+// case LLGroupMgrGroupData::STATUS_REQUESTING:
+// // Maybe here we call populate ban list as well, and see about how many
+// // more names we need to complete the ban list
+// break;
+//
+// // See if the list needs updating -- if we call update, but nothing changed,
+// // there's no reason to send another request.
+// // [NOTHING CHANGED] - Do Nothing!
+// // [SOMETHING CHANGED] - Don't panic! Just repopulate the ban list!
+// case LLGroupMgrGroupData::STATUS_COMPLETE:
+// populateBanList();
+// break;
+// }
+//
- // Already have a request out -- don't bother sending another one
- // Repeat sending won't make a difference, as it'll be behind a load balancer
- case LLGroupMgrGroupData::STATUS_REQUESTING:
- break;
-
- // See if the list needs updating -- if we call update, but nothing changed,
- // there's no reason to send another request.
- // [NOTHING CHANGED] - Do Nothing!
- // [SOMETHING CHANGED] - Don't panic! Just repopulate the ban list!
- case LLGroupMgrGroupData::STATUS_COMPLETE:
- populateBanList();
- break;
- }
+
}
void LLPanelGroupBanListSubTab::draw()
{
LLPanelGroupSubTab::draw();
- // if(mPendingBanUpdate)
+ //if(mPendingBanUpdate)
// populateBanList();
}
-void LLPanelGroupBanListSubTab::populateBanList()
-{
- LLGroupMgrGroupData* gdatap = LLGroupMgr::getInstance()->getGroupData(mGroupID);
- if(!gdatap)
- {
- LL_INFOS("BAKER") << "[BAKER] No group data!" << LL_ENDL;
- return;
- }
-
- if(gdatap->getGroupBanStatus() != LLGroupMgrGroupData::STATUS_COMPLETE)
- return;
-
- mBanList->deleteAllItems();
- std::map<LLUUID,LLGroupBanData>::const_iterator entry = gdatap->mBanList.begin();
- for(; entry != gdatap->mBanList.end(); entry++)
- {
- LLNameListCtrl::NameItem ban_entry;
- ban_entry.value = entry->first;
- mBanList->addNameItemRow(ban_entry);
- }
-}
-
void LLPanelGroupBanListSubTab::onBanEntrySelect(LLUICtrl* ctrl, void* user_data)
{
@@ -3035,10 +3017,59 @@ void LLPanelGroupBanListSubTab::handleDeleteBanEntry()
}
-void LLPanelGroupBanListSubTab::setGroupID(const LLUUID& id)
+void LLPanelGroupBanListSubTab::onRefreshBanList(void* user_data)
{
- LL_INFOS("BAKER") << "[BAKER] LLPanelGroupBanListSubTab::setGroupID()" << LL_ENDL;
+ LL_INFOS("BAKER") << "[BAKER] LLPanelGroupBanListSubTab::onRefreshBanList()" << LL_ENDL;
+
+ LLPanelGroupBanListSubTab* self = static_cast<LLPanelGroupBanListSubTab*>(user_data);
+ if (!self)
+ return;
+
+ self->handleRefreshBanList();
+}
+
+void LLPanelGroupBanListSubTab::handleRefreshBanList()
+{
+ LL_INFOS("BAKER") << "[BAKER] LLPanelGroupBanListSubTab::handleRefreshBanList()" << LL_ENDL;
+ mRefreshBanListButton->setEnabled(FALSE);
+ LLGroupMgr::getInstance()->sendGroupBanRequest(LLGroupMgr::REQUEST_GET, mGroupID);
+}
+
+
+void LLPanelGroupBanListSubTab::onBanListCompleted(bool isComplete)
+{
+ if(isComplete)
+ {
+ mRefreshBanListButton->setEnabled(TRUE);
+ populateBanList();
+ }
+}
+
+void LLPanelGroupBanListSubTab::populateBanList()
+{
+ LLGroupMgrGroupData* gdatap = LLGroupMgr::getInstance()->getGroupData(mGroupID);
+ if(!gdatap)
+ {
+ LL_INFOS("BAKER") << "[BAKER] No group data!" << LL_ENDL;
+ return;
+ }
+
+ mBanList->deleteAllItems();
+ std::map<LLUUID,LLGroupBanData>::const_iterator entry = gdatap->mBanList.begin();
+ for(; entry != gdatap->mBanList.end(); entry++)
+ {
+ LLNameListCtrl::NameItem ban_entry;
+ ban_entry.value = entry->first;
+ mBanList->addNameItemRow(ban_entry);
+ }
+
+ mRefreshBanListButton->setEnabled(TRUE);
+}
+
+
+void LLPanelGroupBanListSubTab::setGroupID(const LLUUID& id)
+{
if(mBanList)
mBanList->deleteAllItems();
@@ -3050,3 +3081,5 @@ void LLPanelGroupBanListSubTab::setGroupID(const LLUUID& id)
+
+