diff options
author | Mark Palange (Mani) <palange@lindenlab.com> | 2009-10-02 10:35:42 -0700 |
---|---|---|
committer | Mark Palange (Mani) <palange@lindenlab.com> | 2009-10-02 10:35:42 -0700 |
commit | 4d53e235c2445b820bb0ae7303b269648dd86037 (patch) | |
tree | c1ab3643cf257099822e7a0e1e832d76813555f6 /indra/newview/llpanelgroupgeneral.cpp | |
parent | 80f27013b2d2a7ca6509db033c8f0c31562e04c7 (diff) | |
parent | dde2153014cd7d7b8fa704f7067a41344bfbb1c2 (diff) |
merge of latest viewer/viewer-20
Diffstat (limited to 'indra/newview/llpanelgroupgeneral.cpp')
-rw-r--r-- | indra/newview/llpanelgroupgeneral.cpp | 64 |
1 files changed, 7 insertions, 57 deletions
diff --git a/indra/newview/llpanelgroupgeneral.cpp b/indra/newview/llpanelgroupgeneral.cpp index f3893a104c..2e1d971995 100644 --- a/indra/newview/llpanelgroupgeneral.cpp +++ b/indra/newview/llpanelgroupgeneral.cpp @@ -50,7 +50,6 @@ #include "llnamelistctrl.h" #include "llscrolllistitem.h" #include "llspinctrl.h" -#include "llstatusbar.h" // can_afford_transaction() #include "lltextbox.h" #include "lltexteditor.h" #include "lltexturectrl.h" @@ -96,15 +95,12 @@ BOOL LLPanelGroupGeneral::postBuild() { bool recurse = true; - // General info - mGroupNameEditor = getChild<LLLineEditor>("group_name_editor", recurse); - mEditCharter = getChild<LLTextEditor>("charter", recurse); if(mEditCharter) { mEditCharter->setCommitCallback(onCommitAny, this); - mEditCharter->setFocusReceivedCallback(onFocusEdit, this); - mEditCharter->setFocusChangedCallback(onFocusEdit, this); + mEditCharter->setFocusReceivedCallback(boost::bind(onFocusEdit, _1, this)); + mEditCharter->setFocusChangedCallback(boost::bind(onFocusEdit, _1, this)); } @@ -194,7 +190,6 @@ BOOL LLPanelGroupGeneral::postBuild() // If the group_id is null, then we are creating a new group if (mGroupID.isNull()) { - mGroupNameEditor->setEnabled(TRUE); mEditCharter->setEnabled(TRUE); mCtrlShowInGroupList->setEnabled(TRUE); @@ -217,6 +212,7 @@ void LLPanelGroupGeneral::setupCtrls(LLPanel* panel_group) mDefaultIconID = mInsignia->getImageAssetID(); } mFounderName = panel_group->getChild<LLNameBox>("founder_name"); + mGroupNameEditor = panel_group->getChild<LLLineEditor>("group_name_editor"); } // static @@ -298,56 +294,6 @@ void LLPanelGroupGeneral::onClickInfo(void *userdata) } // static -void LLPanelGroupGeneral::onClickJoin(void *userdata) -{ - LLPanelGroupGeneral *self = (LLPanelGroupGeneral *)userdata; - - if ( !self ) return; - - lldebugs << "joining group: " << self->mGroupID << llendl; - - LLGroupMgrGroupData* gdatap = LLGroupMgr::getInstance()->getGroupData(self->mGroupID); - - if (gdatap) - { - S32 cost = gdatap->mMembershipFee; - LLSD args; - args["COST"] = llformat("%d", cost); - LLSD payload; - payload["group_id"] = self->mGroupID; - - if (can_afford_transaction(cost)) - { - LLNotifications::instance().add("JoinGroupCanAfford", args, payload, LLPanelGroupGeneral::joinDlgCB); - } - else - { - LLNotifications::instance().add("JoinGroupCannotAfford", args, payload); - } - } - else - { - llwarns << "LLGroupMgr::getInstance()->getGroupData(" << self->mGroupID - << ") was NULL" << llendl; - } -} - -// static -bool LLPanelGroupGeneral::joinDlgCB(const LLSD& notification, const LLSD& response) -{ - S32 option = LLNotification::getSelectedOption(notification, response); - - if (option == 1) - { - // user clicked cancel - return false; - } - - LLGroupMgr::getInstance()->sendGroupMemberJoin(notification["payload"]["group_id"].asUUID()); - return false; -} - -// static void LLPanelGroupGeneral::openProfile(void* data) { LLPanelGroupGeneral* self = (LLPanelGroupGeneral*)data; @@ -883,10 +829,13 @@ void LLPanelGroupGeneral::reset() mComboActiveTitle->setVisible(false); mInsignia->setImageAssetID(LLUUID::null); + + mInsignia->setEnabled(true); { std::string empty_str = ""; mEditCharter->setText(empty_str); + mGroupNameEditor->setText(empty_str); } { @@ -902,6 +851,7 @@ void LLPanelGroupGeneral::reset() { mComboMature->setEnabled(true); mComboMature->setVisible( !gAgent.isTeen() ); + mComboMature->selectFirstItem(); } |