diff options
author | Andrey Lihatskiy <alihatskiy@productengine.com> | 2020-03-18 21:03:57 +0200 |
---|---|---|
committer | Andrey Lihatskiy <alihatskiy@productengine.com> | 2020-03-18 21:03:57 +0200 |
commit | ada02267718df63b152ef663c3a58b6798ebe885 (patch) | |
tree | b44889556a42a947ddd5eb7e36cee7db163683b9 /indra/newview/llpanelgroupgeneral.cpp | |
parent | d34f95ab976aa148bd7881001463a43999ffddff (diff) | |
parent | 328329fceab6b18dd7dda6f7ce9a3d4788fd7c54 (diff) |
Merge branch 'master' into DRTVWR-497
Diffstat (limited to 'indra/newview/llpanelgroupgeneral.cpp')
-rw-r--r-- | indra/newview/llpanelgroupgeneral.cpp | 58 |
1 files changed, 7 insertions, 51 deletions
diff --git a/indra/newview/llpanelgroupgeneral.cpp b/indra/newview/llpanelgroupgeneral.cpp index b53cd222e7..375daf60f8 100644 --- a/indra/newview/llpanelgroupgeneral.cpp +++ b/indra/newview/llpanelgroupgeneral.cpp @@ -30,6 +30,7 @@ #include "llavatarnamecache.h" #include "llagent.h" +#include "llagentbenefits.h" #include "llsdparam.h" #include "lluictrlfactory.h" #include "roles_constants.h" @@ -303,6 +304,11 @@ void LLPanelGroupGeneral::draw() bool LLPanelGroupGeneral::apply(std::string& mesg) { + if (mGroupID.isNull()) + { + return false; + } + if (!mGroupID.isNull() && mAllowEdit && mComboActiveTitle && mComboActiveTitle->isDirty()) { LLGroupMgr::getInstance()->sendGroupTitleUpdate(mGroupID,mComboActiveTitle->getCurrentID()); @@ -312,7 +318,7 @@ bool LLPanelGroupGeneral::apply(std::string& mesg) BOOL has_power_in_group = gAgent.hasPowerInGroup(mGroupID,GP_GROUP_CHANGE_IDENTITY); - if (has_power_in_group || mGroupID.isNull()) + if (has_power_in_group) { LL_INFOS() << "LLPanelGroupGeneral::apply" << LL_ENDL; @@ -325,25 +331,6 @@ bool LLPanelGroupGeneral::apply(std::string& mesg) return false; } - if (mGroupID.isNull()) - { - // Validate the group name length. - S32 group_name_len = mGroupNameEditor->getText().size(); - if ( group_name_len < DB_GROUP_NAME_MIN_LEN - || group_name_len > DB_GROUP_NAME_STR_LEN) - { - std::ostringstream temp_error; - temp_error << "A group name must be between " << DB_GROUP_NAME_MIN_LEN - << " and " << DB_GROUP_NAME_STR_LEN << " characters."; - mesg = temp_error.str(); - return false; - } - - LLNotificationsUtil::add("CreateGroupCost", LLSD(), LLSD(), boost::bind(&LLPanelGroupGeneral::createGroupCallback, this, _1, _2)); - - return false; - } - LLGroupMgrGroupData* gdatap = LLGroupMgr::getInstance()->getGroupData(mGroupID); if (!gdatap) { @@ -450,37 +437,6 @@ bool LLPanelGroupGeneral::confirmMatureApply(const LLSD& notification, const LLS return ret; } -// static -bool LLPanelGroupGeneral::createGroupCallback(const LLSD& notification, const LLSD& response) -{ - S32 option = LLNotificationsUtil::getSelectedOption(notification, response); - switch(option) - { - case 0: - { - // Yay! We are making a new group! - U32 enrollment_fee = (mCtrlEnrollmentFee->get() ? - (U32) mSpinEnrollmentFee->get() : 0); - LLUUID insignia_id = mInsignia->getImageItemID().isNull() ? LLUUID::null : mInsignia->getImageAssetID(); - - LLGroupMgr::getInstance()->sendCreateGroupRequest(mGroupNameEditor->getText(), - mEditCharter->getText(), - mCtrlShowInGroupList->get(), - insignia_id, - enrollment_fee, - mCtrlOpenEnrollment->get(), - false, - mComboMature->getCurrentIndex() == MATURE_CONTENT); - - } - break; - case 1: - default: - break; - } - return false; -} - // virtual void LLPanelGroupGeneral::update(LLGroupChange gc) { |