summaryrefslogtreecommitdiff
path: root/indra/newview/llpanelgrouproles.cpp
diff options
context:
space:
mode:
authorSteven Bennetts <steve@lindenlab.com>2009-08-26 20:47:27 +0000
committerSteven Bennetts <steve@lindenlab.com>2009-08-26 20:47:27 +0000
commitaf98aad98d43ec8b128ecac3089426d6ae6edc3f (patch)
tree5971f87afc04580df470a003793dcc8c974e29a7 /indra/newview/llpanelgrouproles.cpp
parent6a364e6f32c12c1ab2c0f33e8ef07d885a8765a2 (diff)
svn merge https://svn.aws.productengine.com/secondlife/export-from-ll/viewer-2-0@1471 https://svn.aws.productengine.com/secondlife/pe/stable-1@1476 -> viewer-2.0.0-3
EXT-65 EXT-270 EXT-359 EXT-361 EXT-367 EXT-367 EXT-368 EXT-455 EXT-468 EXT-530 EXT-539 EXT-540 EXT-542 EXT-545 EXT-555 EXT-557 EXT-558 EXT-559 EXT-559 EXT-560 EXT-561 EXT-562 EXT-563 EXT-564 EXT-566 EXT-568 EXT-569 EXT-570 EXT-571 EXT-581 EXT-590 EXT-594 EXT-596 EXT-597 EXT-601 EXT-602 EXT-603 EXT-613 EXT-620 EXT-624 EXT-628 EXT-630 EXT-631 EXT-632 EXT-639 EXT-640 EXT-641 EXT-642 EXT-662 EXT-671 EXT-672 EXT-676 EXT-682 EXT-692 EXT-703 EXT-717
Diffstat (limited to 'indra/newview/llpanelgrouproles.cpp')
-rw-r--r--indra/newview/llpanelgrouproles.cpp103
1 files changed, 34 insertions, 69 deletions
diff --git a/indra/newview/llpanelgrouproles.cpp b/indra/newview/llpanelgrouproles.cpp
index ab614fea53..4618b49df4 100644
--- a/indra/newview/llpanelgrouproles.cpp
+++ b/indra/newview/llpanelgrouproles.cpp
@@ -49,6 +49,7 @@
#include "lltabcontainer.h"
#include "lltextbox.h"
#include "lltexteditor.h"
+#include "llsearcheditor.h"
#include "llviewertexturelist.h"
#include "llviewerwindow.h"
#include "llfocusmgr.h"
@@ -464,9 +465,7 @@ LLPanelGroupSubTab::LLPanelGroupSubTab()
: LLPanelGroupTab(),
mHeader(NULL),
mFooter(NULL),
- mSearchLineEditor(NULL),
- mSearchButton(NULL),
- mShowAllButton(NULL)
+ mSearchEditor(NULL)
{
}
@@ -478,22 +477,14 @@ BOOL LLPanelGroupSubTab::postBuild()
{
// Hook up the search widgets.
bool recurse = true;
- mSearchLineEditor = getChild<LLLineEditor>("search_text", recurse);
+ mSearchEditor = getChild<LLSearchEditor>("filter_input", recurse);
- if (!mSearchLineEditor) return FALSE;
- mSearchLineEditor->setKeystrokeCallback(onSearchKeystroke, this);
-
- mSearchButton = getChild<LLButton>("search_button", recurse);
-
- if (!mSearchButton) return FALSE;
- mSearchButton->setClickedCallback(onClickSearch, this);
- mSearchButton->setEnabled(FALSE);
+ if (!mSearchEditor)
+ return FALSE;
- mShowAllButton = getChild<LLButton>("show_all_button", recurse);
+ mSearchEditor->setCommitCallback(boost::bind(&LLPanelGroupSubTab::onClickSearch, this));
+ mSearchEditor->setKeystrokeCallback(onSearchKeystroke, this);
- if (!mShowAllButton) return FALSE;
- mShowAllButton->setClickedCallback(onClickShowAll, this);
- mShowAllButton->setEnabled(FALSE);
// Get icons for later use.
mActionIcons.clear();
@@ -516,63 +507,35 @@ BOOL LLPanelGroupSubTab::postBuild()
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)
+void LLPanelGroupSubTab::setGroupID(const LLUUID& id)
{
- if (caller->getText().size())
- {
- setDefaultBtn( mSearchButton );
- mSearchButton->setEnabled(TRUE);
- }
- else
+ LLPanelGroupTab::setGroupID(id);
+ if(mSearchEditor)
{
- setDefaultBtn( NULL );
- mSearchButton->setEnabled(FALSE);
+ mSearchEditor->clear();
+ setSearchFilter("");
}
}
-// static
-void LLPanelGroupSubTab::onClickSearch(void* user_data)
+// static
+void LLPanelGroupSubTab::onSearchKeystroke(LLLineEditor* caller, 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;
- }
+ self->handleSearchKeystroke(caller);
- setSearchFilter( mSearchLineEditor->getText() );
- mShowAllButton->setEnabled(TRUE);
}
-// static
-void LLPanelGroupSubTab::onClickShowAll(void* user_data)
+void LLPanelGroupSubTab::handleSearchKeystroke(LLLineEditor* caller)
{
- LLPanelGroupSubTab* self = static_cast<LLPanelGroupSubTab*>(user_data);
- self->handleClickShowAll();
+ setSearchFilter( caller->getText() );
}
-void LLPanelGroupSubTab::handleClickShowAll()
+// static
+void LLPanelGroupSubTab::onClickSearch()
{
- lldebugs << "LLPanelGroupSubTab::handleClickShowAll()" << llendl;
- setSearchFilter( LLStringUtil::null );
- mShowAllButton->setEnabled(FALSE);
+ setSearchFilter( mSearchEditor->getText() );
}
+
void LLPanelGroupSubTab::setSearchFilter(const std::string& filter)
{
@@ -892,6 +855,12 @@ BOOL LLPanelGroupMembersSubTab::postBuildSubTab(LLView* root)
return TRUE;
}
+void LLPanelGroupMembersSubTab::setGroupID(const LLUUID& id)
+{
+ LLPanelGroupSubTab::setGroupID(id);
+
+}
+
// static
void LLPanelGroupMembersSubTab::onMemberSelect(LLUICtrl* ctrl, void* user_data)
@@ -2583,19 +2552,15 @@ void LLPanelGroupRoles::setGroupID(const LLUUID& id)
if(group_members_tab) group_members_tab->setGroupID(id);
if(group_roles_tab) group_roles_tab->setGroupID(id);
if(group_actions_tab) group_actions_tab->setGroupID(id);
-
- activate();
- if (!mSubTabContainer) return ;
+ LLButton* button = getChild<LLButton>("member_invite");
+ if ( button )
+ button->setEnabled(gAgent.hasPowerInGroup(mGroupID, GP_MEMBER_INVITE));
- // Hook up each sub-tabs callback and widgets.
- for (S32 i = 0; i < mSubTabContainer->getTabCount(); ++i)
- {
- LLPanel* panel = mSubTabContainer->getPanelByIndex(i);
- LLPanelGroupSubTab* subtabp = dynamic_cast<LLPanelGroupSubTab*>(panel);
- if (subtabp)
- subtabp->postBuildSubTab(this);
- }
+ if(mSubTabContainer)
+ mSubTabContainer->selectTab(0);
+
+ activate();
}