UI cleanup.
-Added ui-local transformation matrix. -Gutted legacy commitcallbacks throughout ui widget ctors. -Created filter_editor ui widget which issues commit on keypress -search_editor commits on focus loss/enter press -search_editor and filter_editor now have a built in 'x' button to clear text. -LLComboBox::setPrearrangeCallback now uses boost::function -LLComboBox::setTextEntryCallback now uses boost::function -LLLineEditor::setKeystrokeCallback now uses boost::function -LLLineEditor::setPrevalidate now uses boost::function -LLPanel::childSetKeystrokeCallback removed -LLPanel::childSetPrevalidate removed -LLPanel::childSetActionTextbox now uses boost::function -LLTextBox::setClickedCallback now uses boost::function -LLTextEditor::setKeystrokeCallback added. -Cleaned up JCFloaterAreaSearch
This commit is contained in:
@@ -35,12 +35,15 @@
|
||||
#include "llcheckboxctrl.h"
|
||||
|
||||
#include "llagent.h"
|
||||
#include "llavatarnamecache.h"
|
||||
#include "llbutton.h"
|
||||
#include "llfiltereditor.h"
|
||||
#include "llfloateravatarinfo.h"
|
||||
#include "llfloatergroupinvite.h"
|
||||
#include "lliconctrl.h"
|
||||
#include "lllineeditor.h"
|
||||
#include "llnamelistctrl.h"
|
||||
#include "llnotifications.h"
|
||||
#include "llnotificationsutil.h"
|
||||
#include "llpanelgrouproles.h"
|
||||
#include "llscrolllistctrl.h"
|
||||
@@ -117,15 +120,13 @@ LLPanelGroupRoles::LLPanelGroupRoles(const std::string& name, const LLUUID& grou
|
||||
mCurrentTab(NULL),
|
||||
mRequestedTab( NULL ),
|
||||
mSubTabContainer( NULL ),
|
||||
mFirstUse( TRUE ),
|
||||
mIgnoreTransition( FALSE )
|
||||
mFirstUse( TRUE )
|
||||
{
|
||||
}
|
||||
|
||||
LLPanelGroupRoles::~LLPanelGroupRoles()
|
||||
{
|
||||
int i;
|
||||
for (i = 0; i < mSubTabContainer->getTabCount(); ++i)
|
||||
for (S32 i = 0; i < mSubTabContainer->getTabCount(); ++i)
|
||||
{
|
||||
LLPanelGroupSubTab* subtabp = (LLPanelGroupSubTab*) mSubTabContainer->getPanelByIndex(i);
|
||||
|
||||
@@ -142,20 +143,25 @@ BOOL LLPanelGroupRoles::postBuild()
|
||||
if (!mSubTabContainer) return FALSE;
|
||||
|
||||
// Hook up each sub-tabs callback and widgets.
|
||||
S32 i;
|
||||
for (i = 0; i < mSubTabContainer->getTabCount(); ++i)
|
||||
for (S32 i = 0; i < mSubTabContainer->getTabCount(); ++i)
|
||||
{
|
||||
LLPanelGroupSubTab* subtabp = (LLPanelGroupSubTab*) mSubTabContainer->getPanelByIndex(i);
|
||||
LLPanel* panel = mSubTabContainer->getPanelByIndex(i);
|
||||
LLPanelGroupSubTab* subtabp = dynamic_cast<LLPanelGroupSubTab*>(panel);
|
||||
if (!subtabp)
|
||||
{
|
||||
llwarns << "Invalid subtab panel: " << panel->getName() << llendl;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
// Hand the subtab a pointer to this LLPanelGroupRoles, so that it can
|
||||
// look around for the widgets it is interested in.
|
||||
if (!subtabp->postBuildSubTab(this)) return FALSE;
|
||||
if (!subtabp->postBuildSubTab(this))
|
||||
return FALSE;
|
||||
|
||||
subtabp->addObserver(this);
|
||||
}
|
||||
|
||||
// Add click callbacks to all the tabs.
|
||||
mSubTabContainer->setCommitCallback(boost::bind(&LLPanelGroupRoles::handleClickSubTab,this));
|
||||
// Add click callbacks to tab switching.
|
||||
mSubTabContainer->setValidateBeforeCommit(boost::bind(&LLPanelGroupRoles::handleSubTabSwitch, this, _1));
|
||||
|
||||
// Set the current tab to whatever is currently being shown.
|
||||
mCurrentTab = (LLPanelGroupTab*) mSubTabContainer->getCurrentPanel();
|
||||
@@ -197,30 +203,17 @@ BOOL LLPanelGroupRoles::isVisibleByAgent(LLAgent* agentp)
|
||||
|
||||
}
|
||||
|
||||
void LLPanelGroupRoles::handleClickSubTab()
|
||||
bool LLPanelGroupRoles::handleSubTabSwitch(const LLSD& data)
|
||||
{
|
||||
// If we are already handling a transition,
|
||||
// ignore this.
|
||||
if (mIgnoreTransition)
|
||||
std::string panel_name = data.asString();
|
||||
|
||||
if(mRequestedTab != NULL)//we already have tab change request
|
||||
{
|
||||
return;
|
||||
return false;
|
||||
}
|
||||
|
||||
mRequestedTab = (LLPanelGroupTab*) mSubTabContainer->getCurrentPanel();
|
||||
mRequestedTab = static_cast<LLPanelGroupTab*>(mSubTabContainer->getPanelByName(panel_name));
|
||||
|
||||
// Make sure they aren't just clicking the same tab...
|
||||
if (mRequestedTab == mCurrentTab)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
// Try to switch from the current panel to the panel the user selected.
|
||||
attemptTransition();
|
||||
}
|
||||
|
||||
BOOL LLPanelGroupRoles::attemptTransition()
|
||||
{
|
||||
// Check if the current tab needs to be applied.
|
||||
std::string mesg;
|
||||
if (mCurrentTab && mCurrentTab->needsApply(mesg))
|
||||
{
|
||||
@@ -236,26 +229,14 @@ BOOL LLPanelGroupRoles::attemptTransition()
|
||||
LLNotificationsUtil::add("PanelGroupApply", args, LLSD(),
|
||||
boost::bind(&LLPanelGroupRoles::handleNotifyCallback, this, _1, _2));
|
||||
mHasModal = TRUE;
|
||||
// We need to reselect the current tab, since it isn't finished.
|
||||
if (mSubTabContainer)
|
||||
{
|
||||
mIgnoreTransition = TRUE;
|
||||
mSubTabContainer->selectTabPanel( mCurrentTab );
|
||||
mIgnoreTransition = FALSE;
|
||||
}
|
||||
|
||||
// Returning FALSE will block a close action from finishing until
|
||||
// we get a response back from the user.
|
||||
return FALSE;
|
||||
}
|
||||
else
|
||||
{
|
||||
// The current panel didn't have anything it needed to apply.
|
||||
if (mRequestedTab)
|
||||
{
|
||||
transitionToTab();
|
||||
}
|
||||
return TRUE;
|
||||
return false;
|
||||
}
|
||||
|
||||
transitionToTab();
|
||||
return true;
|
||||
}
|
||||
|
||||
void LLPanelGroupRoles::transitionToTab()
|
||||
@@ -272,13 +253,15 @@ void LLPanelGroupRoles::transitionToTab()
|
||||
// This is now the current tab;
|
||||
mCurrentTab = mRequestedTab;
|
||||
mCurrentTab->activate();
|
||||
mRequestedTab = 0;
|
||||
}
|
||||
}
|
||||
|
||||
bool LLPanelGroupRoles::handleNotifyCallback(const LLSD& notification, const LLSD& response)
|
||||
{
|
||||
S32 option = LLNotification::getSelectedOption(notification, response);
|
||||
S32 option = LLNotificationsUtil::getSelectedOption(notification, response);
|
||||
mHasModal = FALSE;
|
||||
LLPanelGroupTab* transition_tab = mRequestedTab;
|
||||
switch (option)
|
||||
{
|
||||
case 0: // "Apply Changes"
|
||||
@@ -298,26 +281,20 @@ bool LLPanelGroupRoles::handleNotifyCallback(const LLSD& notification, const LLS
|
||||
// Skip switching tabs.
|
||||
break;
|
||||
}
|
||||
|
||||
// This panel's info successfully applied.
|
||||
// Switch to the next panel.
|
||||
// No break! Continue into 'Ignore Changes' which just switches tabs.
|
||||
mIgnoreTransition = TRUE;
|
||||
mSubTabContainer->selectTabPanel( mRequestedTab );
|
||||
mIgnoreTransition = FALSE;
|
||||
transitionToTab();
|
||||
mSubTabContainer->selectTabPanel( transition_tab );
|
||||
|
||||
break;
|
||||
}
|
||||
case 1: // "Ignore Changes"
|
||||
// Switch to the requested panel without applying changes
|
||||
cancel();
|
||||
mIgnoreTransition = TRUE;
|
||||
mSubTabContainer->selectTabPanel( mRequestedTab );
|
||||
mIgnoreTransition = FALSE;
|
||||
transitionToTab();
|
||||
mSubTabContainer->selectTabPanel( transition_tab );
|
||||
break;
|
||||
case 2: // "Cancel"
|
||||
default:
|
||||
mRequestedTab = NULL;
|
||||
// Do nothing. The user is canceling the action.
|
||||
break;
|
||||
}
|
||||
@@ -470,9 +447,8 @@ LLPanelGroupSubTab::LLPanelGroupSubTab(const std::string& name, const LLUUID& gr
|
||||
: LLPanelGroupTab(name, group_id),
|
||||
mHeader(NULL),
|
||||
mFooter(NULL),
|
||||
mSearchLineEditor(NULL),
|
||||
mSearchButton(NULL),
|
||||
mShowAllButton(NULL)
|
||||
mActivated(false),
|
||||
mSearchEditor(NULL)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -480,121 +456,47 @@ LLPanelGroupSubTab::~LLPanelGroupSubTab()
|
||||
{
|
||||
}
|
||||
|
||||
BOOL LLPanelGroupSubTab::postBuildSubTab(LLView* root)
|
||||
{
|
||||
// Get icons for later use.
|
||||
mActionIcons.clear();
|
||||
|
||||
if (hasString("power_folder_icon"))
|
||||
{
|
||||
mActionIcons["folder"] = getString("power_folder_icon");
|
||||
}
|
||||
|
||||
if (hasString("power_all_have_icon"))
|
||||
{
|
||||
mActionIcons["full"] = getString("power_all_have_icon");
|
||||
}
|
||||
|
||||
if (hasString("power_partial_icon"))
|
||||
{
|
||||
mActionIcons["partial"] = getString("power_partial_icon");
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
BOOL LLPanelGroupSubTab::postBuild()
|
||||
{
|
||||
// Hook up the search widgets.
|
||||
bool recurse = true;
|
||||
mSearchLineEditor = getChild<LLLineEditor>("search_text", recurse);
|
||||
mSearchEditor = getChild<LLFilterEditor>("filter_input", recurse);
|
||||
|
||||
if (!mSearchLineEditor) return FALSE;
|
||||
mSearchLineEditor->setKeystrokeCallback(onSearchKeystroke);
|
||||
mSearchLineEditor->setCallbackUserData(this);
|
||||
if (!mSearchEditor)
|
||||
return FALSE;
|
||||
|
||||
mSearchButton = getChild<LLButton>("search_button", recurse);
|
||||
|
||||
if (!mSearchButton) return FALSE;
|
||||
mSearchButton->setClickedCallback(boost::bind(&LLPanelGroupSubTab::onClickSearch,this));
|
||||
mSearchButton->setEnabled(FALSE);
|
||||
|
||||
mShowAllButton = getChild<LLButton>("show_all_button", recurse);
|
||||
|
||||
if (!mShowAllButton) return FALSE;
|
||||
mShowAllButton->setClickedCallback(boost::bind(&LLPanelGroupSubTab::onClickShowAll,this));
|
||||
mShowAllButton->setEnabled(FALSE);
|
||||
|
||||
// Get icons for later use.
|
||||
mActionIcons.clear();
|
||||
|
||||
bool no_recurse = false;
|
||||
|
||||
LLIconCtrl* icon = getChild<LLIconCtrl>("power_folder_icon",no_recurse);
|
||||
if (icon && !icon->getImageName().empty())
|
||||
{
|
||||
mActionIcons["folder"] = icon->getImageName();
|
||||
removeChild(icon);
|
||||
delete icon;
|
||||
}
|
||||
|
||||
icon = getChild<LLIconCtrl>("power_all_have_icon",no_recurse, false);
|
||||
if (icon && !icon->getImageName().empty())
|
||||
{
|
||||
mActionIcons["full"] = icon->getImageName();
|
||||
removeChild(icon);
|
||||
delete icon;
|
||||
}
|
||||
|
||||
icon = getChild<LLIconCtrl>("power_partial_icon",no_recurse, false);
|
||||
if (icon && !icon->getImageName().empty())
|
||||
{
|
||||
mActionIcons["partial"] = icon->getImageName();
|
||||
removeChild(icon);
|
||||
delete icon;
|
||||
}
|
||||
mSearchEditor->setCommitCallback(boost::bind(&LLPanelGroupSubTab::setSearchFilter, this, _2));
|
||||
|
||||
return LLPanelGroupTab::postBuild();
|
||||
}
|
||||
|
||||
// static
|
||||
void LLPanelGroupSubTab::onSearchKeystroke(LLLineEditor* caller, void* user_data)
|
||||
{
|
||||
LLPanelGroupSubTab* self = static_cast<LLPanelGroupSubTab*>(user_data);
|
||||
self->handleSearchKeystroke(caller);
|
||||
}
|
||||
|
||||
void LLPanelGroupSubTab::handleSearchKeystroke(LLLineEditor* caller)
|
||||
{
|
||||
if (caller->getText().size())
|
||||
{
|
||||
setDefaultBtn( mSearchButton );
|
||||
mSearchButton->setEnabled(TRUE);
|
||||
}
|
||||
else
|
||||
{
|
||||
setDefaultBtn( NULL );
|
||||
mSearchButton->setEnabled(FALSE);
|
||||
}
|
||||
}
|
||||
|
||||
// static
|
||||
void LLPanelGroupSubTab::onClickSearch(void* user_data)
|
||||
{
|
||||
LLPanelGroupSubTab* self = static_cast<LLPanelGroupSubTab*>(user_data);
|
||||
self->handleClickSearch();
|
||||
}
|
||||
|
||||
void LLPanelGroupSubTab::handleClickSearch()
|
||||
{
|
||||
lldebugs << "LLPanelGroupSubTab::handleClickSearch()" << llendl;
|
||||
|
||||
if (0 == mSearchLineEditor->getText().size())
|
||||
{
|
||||
// No search text. (This shouldn't happen... the search button should have been disabled).
|
||||
llwarns << "handleClickSearch with no search text!" << llendl;
|
||||
mSearchButton->setEnabled(FALSE);
|
||||
return;
|
||||
}
|
||||
|
||||
setSearchFilter( mSearchLineEditor->getText() );
|
||||
mShowAllButton->setEnabled(TRUE);
|
||||
}
|
||||
|
||||
// static
|
||||
void LLPanelGroupSubTab::onClickShowAll(void* user_data)
|
||||
{
|
||||
LLPanelGroupSubTab* self = static_cast<LLPanelGroupSubTab*>(user_data);
|
||||
self->handleClickShowAll();
|
||||
}
|
||||
|
||||
void LLPanelGroupSubTab::handleClickShowAll()
|
||||
{
|
||||
lldebugs << "LLPanelGroupSubTab::handleClickShowAll()" << llendl;
|
||||
setSearchFilter( LLStringUtil::null );
|
||||
mShowAllButton->setEnabled(FALSE);
|
||||
}
|
||||
|
||||
void LLPanelGroupSubTab::setSearchFilter(const std::string& filter)
|
||||
{
|
||||
lldebugs << "LLPanelGroupSubTab::setSearchFilter() ==> '" << filter << "'" << llendl;
|
||||
if(mSearchFilter == filter)
|
||||
return;
|
||||
mSearchFilter = filter;
|
||||
LLStringUtil::toLower(mSearchFilter);
|
||||
update(GC_ALL);
|
||||
@@ -875,6 +777,8 @@ LLPanelGroupMembersSubTab::~LLPanelGroupMembersSubTab()
|
||||
|
||||
BOOL LLPanelGroupMembersSubTab::postBuildSubTab(LLView* root)
|
||||
{
|
||||
LLPanelGroupSubTab::postBuildSubTab(root);
|
||||
|
||||
// Upcast parent so we can ask it for sibling controls.
|
||||
LLPanelGroupRoles* parent = (LLPanelGroupRoles*) root;
|
||||
|
||||
@@ -1174,7 +1078,8 @@ void LLPanelGroupMembersSubTab::handleEjectMembers()
|
||||
for (itor = selection.begin() ;
|
||||
itor != selection.end(); ++itor)
|
||||
{
|
||||
selected_members.push_back((*itor)->getUUID());
|
||||
LLUUID member_id = (*itor)->getUUID();
|
||||
selected_members.push_back( member_id );
|
||||
}
|
||||
|
||||
mMembersList->deleteSelectedItems();
|
||||
@@ -1298,15 +1203,19 @@ void LLPanelGroupMembersSubTab::handleMemberDoubleClick()
|
||||
LLScrollListItem* selected = mMembersList->getFirstSelected();
|
||||
if (selected)
|
||||
{
|
||||
LLFloaterAvatarInfo::showFromDirectory( selected->getUUID() );
|
||||
LLUUID member_id = selected->getUUID();
|
||||
LLFloaterAvatarInfo::showFromDirectory( member_id );
|
||||
}
|
||||
}
|
||||
|
||||
void LLPanelGroupMembersSubTab::activate()
|
||||
{
|
||||
LLPanelGroupSubTab::activate();
|
||||
|
||||
update(GC_ALL);
|
||||
if(!mActivated)
|
||||
{
|
||||
update(GC_ALL);
|
||||
mActivated = true;
|
||||
}
|
||||
}
|
||||
|
||||
void LLPanelGroupMembersSubTab::deactivate()
|
||||
@@ -1382,7 +1291,7 @@ bool LLPanelGroupMembersSubTab::apply(std::string& mesg)
|
||||
|
||||
bool LLPanelGroupMembersSubTab::addOwnerCB(const LLSD& notification, const LLSD& response)
|
||||
{
|
||||
S32 option = LLNotification::getSelectedOption(notification, response);
|
||||
S32 option = LLNotificationsUtil::getSelectedOption(notification, response);
|
||||
mHasModal = FALSE;
|
||||
|
||||
if (0 == option)
|
||||
@@ -1468,13 +1377,20 @@ U64 LLPanelGroupMembersSubTab::getAgentPowersBasedOnRoleChanges(const LLUUID& ag
|
||||
return GP_NO_POWERS;
|
||||
}
|
||||
|
||||
LLGroupMemberData* member_data = gdatap->mMembers[agent_id];
|
||||
if ( !member_data )
|
||||
LLGroupMgrGroupData::member_list_t::iterator iter = gdatap->mMembers.find(agent_id);
|
||||
if ( iter == gdatap->mMembers.end() )
|
||||
{
|
||||
llwarns << "LLPanelGroupMembersSubTab::getAgentPowersBasedOnRoleChanges() -- No member data for member with UUID " << agent_id << llendl;
|
||||
return GP_NO_POWERS;
|
||||
}
|
||||
|
||||
LLGroupMemberData* member_data = (*iter).second;
|
||||
if (!member_data)
|
||||
{
|
||||
llwarns << "LLPanelGroupMembersSubTab::getAgentPowersBasedOnRoleChanges() -- Null member data for member with UUID " << agent_id << llendl;
|
||||
return GP_NO_POWERS;
|
||||
}
|
||||
|
||||
//see if there are unsaved role changes for this agent
|
||||
role_change_data_map_t* role_change_datap = NULL;
|
||||
member_role_changes_map_t::iterator member = mMemberRoleChangeData.find(agent_id);
|
||||
@@ -1581,9 +1497,6 @@ void LLPanelGroupMembersSubTab::update(LLGroupChange gc)
|
||||
return;
|
||||
}
|
||||
|
||||
// Rebuild the members list.
|
||||
mMembersList->deleteAllItems();
|
||||
|
||||
// Wait for both all data to be retrieved before displaying anything.
|
||||
if ( gdatap->isMemberDataComplete()
|
||||
&& gdatap->isRoleDataComplete()
|
||||
@@ -1619,6 +1532,50 @@ void LLPanelGroupMembersSubTab::update(LLGroupChange gc)
|
||||
}
|
||||
}
|
||||
|
||||
void LLPanelGroupMembersSubTab::addMemberToList(LLGroupMemberData* data)
|
||||
{
|
||||
if (!data) return;
|
||||
LLUIString donated = getString("donation_area");
|
||||
donated.setArg("[AREA]", llformat("%d", data->getContribution()));
|
||||
|
||||
LLSD row;
|
||||
row["id"] = data->getID();
|
||||
|
||||
row["columns"][0]["column"] = "name";
|
||||
row["columns"][0]["font"] = "SANSSERIF_SMALL";
|
||||
|
||||
row["columns"][1]["column"] = "donated";
|
||||
row["columns"][1]["value"] = donated.getString();
|
||||
|
||||
row["columns"][2]["column"] = "online";
|
||||
row["columns"][2]["value"] = data->getOnlineStatus();
|
||||
row["columns"][2]["font"] = "SANSSERIF_SMALL";
|
||||
mMembersList->addNameItemRow(row);
|
||||
|
||||
mHasMatch = TRUE;
|
||||
}
|
||||
|
||||
void LLPanelGroupMembersSubTab::onNameCache(const LLUUID& update_id, LLGroupMemberData* member, const LLAvatarName& av_name)
|
||||
{
|
||||
LLGroupMgrGroupData* gdatap = LLGroupMgr::getInstance()->getGroupData(mGroupID);
|
||||
if (!gdatap
|
||||
|| gdatap->getMemberVersion() != update_id
|
||||
|| !member)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
// trying to avoid unnecessary hash lookups
|
||||
if (matchesSearchFilter(av_name.getLegacyName()))
|
||||
{
|
||||
addMemberToList(member);
|
||||
if(!mMembersList->getEnabled())
|
||||
{
|
||||
mMembersList->setEnabled(TRUE);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
void LLPanelGroupMembersSubTab::updateMembers()
|
||||
{
|
||||
mPendingMemberUpdate = FALSE;
|
||||
@@ -1640,48 +1597,38 @@ void LLPanelGroupMembersSubTab::updateMembers()
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//cleanup list only for first iretation
|
||||
if(mMemberProgress == gdatap->mMembers.begin())
|
||||
{
|
||||
mMembersList->deleteAllItems();
|
||||
}
|
||||
|
||||
|
||||
LLGroupMgrGroupData::member_list_t::iterator end = gdatap->mMembers.end();
|
||||
|
||||
S32 i = 0;
|
||||
for( ; mMemberProgress != end && i<UPDATE_MEMBERS_PER_FRAME;
|
||||
++mMemberProgress, ++i)
|
||||
LLTimer update_time;
|
||||
update_time.setTimerExpirySec(UPDATE_MEMBERS_SECONDS_PER_FRAME);
|
||||
|
||||
for( ; mMemberProgress != end && !update_time.hasExpired(); ++mMemberProgress)
|
||||
{
|
||||
if (!mMemberProgress->second)
|
||||
continue;
|
||||
// Do filtering on name if it is already in the cache.
|
||||
bool add_member = true;
|
||||
|
||||
std::string fullname;
|
||||
if (gCacheName->getFullName(mMemberProgress->first, fullname))
|
||||
// Do filtering on name if it is already in the cache.
|
||||
LLAvatarName av_name;
|
||||
if (LLAvatarNameCache::get(mMemberProgress->first, &av_name))
|
||||
{
|
||||
if ( !matchesSearchFilter(fullname) )
|
||||
if (matchesSearchFilter(av_name.getLegacyName()))
|
||||
{
|
||||
add_member = false;
|
||||
addMemberToList(mMemberProgress->second);
|
||||
}
|
||||
}
|
||||
|
||||
if (add_member)
|
||||
else
|
||||
{
|
||||
// Build the donated tier string.
|
||||
std::ostringstream donated;
|
||||
donated << mMemberProgress->second->getContribution() << " sq. m.";
|
||||
|
||||
LLSD row;
|
||||
row["id"] = (*mMemberProgress).first;
|
||||
|
||||
row["columns"][0]["column"] = "name";
|
||||
// value is filled in by name list control
|
||||
|
||||
row["columns"][1]["column"] = "donated";
|
||||
row["columns"][1]["value"] = donated.str();
|
||||
|
||||
row["columns"][2]["column"] = "online";
|
||||
row["columns"][2]["value"] = mMemberProgress->second->getOnlineStatus();
|
||||
row["columns"][2]["font"] = "SANSSERIF_SMALL";
|
||||
|
||||
mMembersList->addNameItem(row);
|
||||
mHasMatch = TRUE;
|
||||
// If name is not cached, onNameCache() should be called when it is cached and add this member to list.
|
||||
LLAvatarNameCache::get(mMemberProgress->first, boost::bind(&LLPanelGroupMembersSubTab::onNameCache,
|
||||
this, gdatap->getMemberVersion(), mMemberProgress->second, _2));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1720,7 +1667,17 @@ void* LLPanelGroupRolesSubTab::createTab(void* data)
|
||||
}
|
||||
|
||||
LLPanelGroupRolesSubTab::LLPanelGroupRolesSubTab(const std::string& name, const LLUUID& group_id)
|
||||
: LLPanelGroupSubTab(name, group_id), mHasRoleChange(FALSE)
|
||||
: LLPanelGroupSubTab(name, group_id),
|
||||
mRolesList(NULL),
|
||||
mAssignedMembersList(NULL),
|
||||
mAllowedActionsList(NULL),
|
||||
mRoleName(NULL),
|
||||
mRoleTitle(NULL),
|
||||
mRoleDescription(NULL),
|
||||
mMemberVisibleCheck(NULL),
|
||||
mDeleteRoleButton(NULL),
|
||||
mCreateRoleButton(NULL),
|
||||
mHasRoleChange(FALSE)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -1730,6 +1687,8 @@ LLPanelGroupRolesSubTab::~LLPanelGroupRolesSubTab()
|
||||
|
||||
BOOL LLPanelGroupRolesSubTab::postBuildSubTab(LLView* root)
|
||||
{
|
||||
LLPanelGroupSubTab::postBuildSubTab(root);
|
||||
|
||||
// Upcast parent so we can ask it for sibling controls.
|
||||
LLPanelGroupRoles* parent = (LLPanelGroupRoles*) root;
|
||||
|
||||
@@ -1775,27 +1734,20 @@ BOOL LLPanelGroupRolesSubTab::postBuildSubTab(LLView* root)
|
||||
}
|
||||
|
||||
mRolesList->setCommitOnSelectionChange(TRUE);
|
||||
mRolesList->setCallbackUserData(this);
|
||||
mRolesList->setCommitCallback(onRoleSelect);
|
||||
mRolesList->setCommitCallback(boost::bind(&LLPanelGroupRolesSubTab::onRoleSelect,_1,this));
|
||||
|
||||
mMemberVisibleCheck->setCallbackUserData(this);
|
||||
mMemberVisibleCheck->setCommitCallback(onMemberVisibilityChange);
|
||||
mMemberVisibleCheck->setCommitCallback(boost::bind(&LLPanelGroupRolesSubTab::onMemberVisibilityChange,_1,this));
|
||||
|
||||
mAllowedActionsList->setCommitOnSelectionChange(TRUE);
|
||||
mAllowedActionsList->setCallbackUserData(this);
|
||||
|
||||
mRoleName->setCommitOnFocusLost(TRUE);
|
||||
mRoleName->setCallbackUserData(this);
|
||||
mRoleName->setKeystrokeCallback(onPropertiesKey);
|
||||
mRoleName->setKeystrokeCallback(boost::bind(&LLPanelGroupRolesSubTab::onPropertiesKey,_1,this));
|
||||
|
||||
mRoleTitle->setCommitOnFocusLost(TRUE);
|
||||
mRoleTitle->setCallbackUserData(this);
|
||||
mRoleTitle->setKeystrokeCallback(onPropertiesKey);
|
||||
mRoleTitle->setKeystrokeCallback(boost::bind(&LLPanelGroupRolesSubTab::onPropertiesKey,_1,this));
|
||||
|
||||
mRoleDescription->setCommitOnFocusLost(TRUE);
|
||||
mRoleDescription->setCallbackUserData(this);
|
||||
mRoleDescription->setCommitCallback(onDescriptionCommit);
|
||||
mRoleDescription->setFocusReceivedCallback(boost::bind(&LLPanelGroupRolesSubTab::onDescriptionFocus, this));
|
||||
mRoleDescription->setKeystrokeCallback(boost::bind(&LLPanelGroupRolesSubTab::onDescriptionKeyStroke, this, _1));
|
||||
|
||||
setFooterEnabled(FALSE);
|
||||
|
||||
@@ -1840,7 +1792,8 @@ bool LLPanelGroupRolesSubTab::apply(std::string& mesg)
|
||||
{
|
||||
lldebugs << "LLPanelGroupRolesSubTab::apply()" << llendl;
|
||||
|
||||
saveRoleChanges();
|
||||
saveRoleChanges(true);
|
||||
|
||||
LLGroupMgr::getInstance()->sendGroupRoleChanges(mGroupID);
|
||||
|
||||
notifyObservers();
|
||||
@@ -2019,7 +1972,7 @@ void LLPanelGroupRolesSubTab::handleRoleSelect()
|
||||
return;
|
||||
}
|
||||
|
||||
saveRoleChanges();
|
||||
saveRoleChanges(false);
|
||||
|
||||
// Check if there is anything selected.
|
||||
LLScrollListItem* item = mRolesList->getFirstSelected();
|
||||
@@ -2201,7 +2154,7 @@ void LLPanelGroupRolesSubTab::handleActionCheck(LLUICtrl* ctrl, bool force)
|
||||
{
|
||||
warning = "AssignDangerousAbilityWarning";
|
||||
}
|
||||
LLNotifications::instance().add(warning, args, LLSD(), boost::bind(&LLPanelGroupRolesSubTab::addActionCB, this, _1, _2, check));
|
||||
LLNotificationsUtil::add(warning, args, LLSD(), boost::bind(&LLPanelGroupRolesSubTab::addActionCB, this, _1, _2, check));
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -2229,7 +2182,7 @@ bool LLPanelGroupRolesSubTab::addActionCB(const LLSD& notification, const LLSD&
|
||||
|
||||
mHasModal = FALSE;
|
||||
|
||||
S32 option = LLNotification::getSelectedOption(notification, response);
|
||||
S32 option = LLNotificationsUtil::getSelectedOption(notification, response);
|
||||
if (0 == option)
|
||||
{
|
||||
// User clicked "Yes"
|
||||
@@ -2251,7 +2204,7 @@ void LLPanelGroupRolesSubTab::onPropertiesKey(LLLineEditor* ctrl, void* user_dat
|
||||
self->notifyObservers();
|
||||
}
|
||||
|
||||
void LLPanelGroupRolesSubTab::onDescriptionFocus()
|
||||
void LLPanelGroupRolesSubTab::onDescriptionKeyStroke(LLTextEditor* caller)
|
||||
{
|
||||
mHasRoleChange = TRUE;
|
||||
notifyObservers();
|
||||
@@ -2382,7 +2335,7 @@ void LLPanelGroupRolesSubTab::handleDeleteRole()
|
||||
notifyObservers();
|
||||
}
|
||||
|
||||
void LLPanelGroupRolesSubTab::saveRoleChanges()
|
||||
void LLPanelGroupRolesSubTab::saveRoleChanges(bool select_saved_role)
|
||||
{
|
||||
LLGroupMgrGroupData* gdatap = LLGroupMgr::getInstance()->getGroupData(mGroupID);
|
||||
|
||||
@@ -2397,13 +2350,23 @@ void LLPanelGroupRolesSubTab::saveRoleChanges()
|
||||
rd.mRoleDescription = mRoleDescription->getText();
|
||||
rd.mRoleTitle = mRoleTitle->getText();
|
||||
|
||||
S32 role_members_count = 0;
|
||||
if (mSelectedRole.isNull())
|
||||
{
|
||||
role_members_count = gdatap->mMemberCount;
|
||||
}
|
||||
else if(LLGroupRoleData* grd = get_ptr_in_map(gdatap->mRoles, mSelectedRole))
|
||||
{
|
||||
role_members_count = grd->getTotalMembersInRole();
|
||||
}
|
||||
|
||||
gdatap->setRoleData(mSelectedRole,rd);
|
||||
|
||||
mRolesList->deleteSingleItem(mRolesList->getItemIndex(mSelectedRole));
|
||||
|
||||
LLSD row = createRoleItem(mSelectedRole,rd.mRoleName,rd.mRoleTitle,0);
|
||||
LLSD row = createRoleItem(mSelectedRole,rd.mRoleName,rd.mRoleTitle,role_members_count);
|
||||
LLScrollListItem* item = mRolesList->addElement(row, ADD_BOTTOM, this);
|
||||
item->setSelected(TRUE);
|
||||
item->setSelected(select_saved_role);
|
||||
|
||||
mHasRoleChange = FALSE;
|
||||
}
|
||||
@@ -2430,6 +2393,8 @@ LLPanelGroupActionsSubTab::~LLPanelGroupActionsSubTab()
|
||||
|
||||
BOOL LLPanelGroupActionsSubTab::postBuildSubTab(LLView* root)
|
||||
{
|
||||
LLPanelGroupSubTab::postBuildSubTab(root);
|
||||
|
||||
// Upcast parent so we can ask it for sibling controls.
|
||||
LLPanelGroupRoles* parent = (LLPanelGroupRoles*) root;
|
||||
|
||||
@@ -2446,13 +2411,9 @@ BOOL LLPanelGroupActionsSubTab::postBuildSubTab(LLView* root)
|
||||
|
||||
if (!mActionList || !mActionDescription || !mActionRoles || !mActionMembers) return FALSE;
|
||||
|
||||
mActionList->setCallbackUserData(this);
|
||||
mActionList->setCommitOnSelectionChange(TRUE);
|
||||
mActionList->setCommitCallback(boost::bind(&LLPanelGroupActionsSubTab::handleActionSelect, this));
|
||||
|
||||
mActionMembers->setCallbackUserData(this);
|
||||
mActionRoles->setCallbackUserData(this);
|
||||
|
||||
update(GC_ALL);
|
||||
|
||||
return TRUE;
|
||||
@@ -2463,10 +2424,8 @@ void LLPanelGroupActionsSubTab::activate()
|
||||
LLPanelGroupSubTab::activate();
|
||||
lldebugs << "LLPanelGroupActionsSubTab::activate()" << llendl;
|
||||
|
||||
mActionList->deselectAllItems();
|
||||
mActionMembers->deleteAllItems();
|
||||
mActionRoles->deleteAllItems();
|
||||
mActionDescription->clear();
|
||||
|
||||
update(GC_ALL);
|
||||
}
|
||||
|
||||
void LLPanelGroupActionsSubTab::deactivate()
|
||||
|
||||
Reference in New Issue
Block a user