diff options
-rw-r--r-- | indra/llui/llscrolllistctrl.cpp | 8 | ||||
-rw-r--r-- | indra/llui/llscrolllistctrl.h | 10 | ||||
-rw-r--r-- | indra/newview/CMakeLists.txt | 2 | ||||
-rw-r--r-- | indra/newview/llagentbenefits.cpp | 7 | ||||
-rw-r--r-- | indra/newview/llagentbenefits.h | 2 | ||||
-rw-r--r-- | indra/newview/llgroupactions.cpp | 4 | ||||
-rw-r--r-- | indra/newview/llgroupmgr.cpp | 4 | ||||
-rw-r--r-- | indra/newview/llpanelgroup.cpp | 41 | ||||
-rw-r--r-- | indra/newview/llpanelgroup.h | 3 | ||||
-rw-r--r-- | indra/newview/llpanelgroupcreate.cpp | 237 | ||||
-rw-r--r-- | indra/newview/llpanelgroupcreate.h | 73 | ||||
-rw-r--r-- | indra/newview/llpanelgroupgeneral.cpp | 59 | ||||
-rw-r--r-- | indra/newview/llpanelgroupgeneral.h | 1 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/floater_people.xml | 6 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/notifications.xml | 12 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/panel_group_creation_sidetray.xml | 314 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/panel_group_info_sidetray.xml | 11 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/strings.xml | 6 |
18 files changed, 680 insertions, 120 deletions
diff --git a/indra/llui/llscrolllistctrl.cpp b/indra/llui/llscrolllistctrl.cpp index f4028057e8..7415e7d974 100644 --- a/indra/llui/llscrolllistctrl.cpp +++ b/indra/llui/llscrolllistctrl.cpp @@ -137,6 +137,7 @@ LLScrollListCtrl::Params::Params() background_visible("background_visible"), draw_stripes("draw_stripes"), column_padding("column_padding"), + row_padding("row_padding", 2), fg_unselected_color("fg_unselected_color"), fg_selected_color("fg_selected_color"), bg_selected_color("bg_selected_color"), @@ -199,6 +200,7 @@ LLScrollListCtrl::LLScrollListCtrl(const LLScrollListCtrl::Params& p) mHoveredColor(p.hovered_color()), mSearchColumn(p.search_column), mColumnPadding(p.column_padding), + mRowPadding(p.row_padding), mContextMenuType(MENU_NONE), mIsFriendSignal(NULL) { @@ -685,8 +687,6 @@ bool LLScrollListCtrl::updateColumnWidths() return width_changed; } -const S32 SCROLL_LIST_ROW_PAD = 2; - // Line height is the max height of all the cells in all the items. void LLScrollListCtrl::updateLineHeight() { @@ -699,7 +699,7 @@ void LLScrollListCtrl::updateLineHeight() S32 i = 0; for (const LLScrollListCell* cell = itemp->getColumn(i); i < num_cols; cell = itemp->getColumn(++i)) { - mLineHeight = llmax( mLineHeight, cell->getHeight() + SCROLL_LIST_ROW_PAD ); + mLineHeight = llmax( mLineHeight, cell->getHeight() + mRowPadding ); } } } @@ -711,7 +711,7 @@ void LLScrollListCtrl::updateLineHeightInsert(LLScrollListItem* itemp) S32 i = 0; for (const LLScrollListCell* cell = itemp->getColumn(i); i < num_cols; cell = itemp->getColumn(++i)) { - mLineHeight = llmax( mLineHeight, cell->getHeight() + SCROLL_LIST_ROW_PAD ); + mLineHeight = llmax( mLineHeight, cell->getHeight() + mRowPadding ); } } diff --git a/indra/llui/llscrolllistctrl.h b/indra/llui/llscrolllistctrl.h index b35a8608e7..51e0819ecc 100644 --- a/indra/llui/llscrolllistctrl.h +++ b/indra/llui/llscrolllistctrl.h @@ -108,7 +108,8 @@ public: // layout Optional<S32> column_padding, - page_lines, + row_padding, + page_lines, heading_height; // sort and search behavior @@ -283,8 +284,10 @@ public: void setBackgroundVisible(BOOL b) { mBackgroundVisible = b; } void setDrawStripes(BOOL b) { mDrawStripes = b; } - void setColumnPadding(const S32 c) { mColumnPadding = c; } - S32 getColumnPadding() { return mColumnPadding; } + void setColumnPadding(const S32 c) { mColumnPadding = c; } + S32 getColumnPadding() const { return mColumnPadding; } + void setRowPadding(const S32 c) { mColumnPadding = c; } + S32 getRowPadding() const { return mColumnPadding; } void setCommitOnKeyboardMovement(BOOL b) { mCommitOnKeyboardMovement = b; } void setCommitOnSelectionChange(BOOL b) { mCommitOnSelectionChange = b; } void setAllowKeyboardMovement(BOOL b) { mAllowKeyboardMovement = b; } @@ -468,6 +471,7 @@ private: LLRect mItemListRect; S32 mColumnPadding; + S32 mRowPadding; BOOL mBackgroundVisible; BOOL mDrawStripes; diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index 5423ddb684..748cffd1c3 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -441,6 +441,7 @@ set(viewer_SOURCE_FILES llpanelface.cpp llpanelgenerictip.cpp llpanelgroup.cpp + llpanelgroupcreate.cpp llpanelgroupbulk.cpp llpanelgroupbulkban.cpp llpanelgroupexperiences.cpp @@ -1060,6 +1061,7 @@ set(viewer_HEADER_FILES llpanelface.h llpanelgenerictip.h llpanelgroup.h + llpanelgroupcreate.h llpanelgroupbulk.h llpanelgroupbulkimpl.h llpanelgroupbulkban.h diff --git a/indra/newview/llagentbenefits.cpp b/indra/newview/llagentbenefits.cpp index fcb1600b1d..2d219735a0 100644 --- a/indra/newview/llagentbenefits.cpp +++ b/indra/newview/llagentbenefits.cpp @@ -217,6 +217,7 @@ bool LLAgentBenefitsMgr::initCurrent(const std::string& package, const LLSD& ben else { instance().mCurrent = benefits; + instance().mCurrentName = package; } return true; @@ -227,3 +228,9 @@ bool LLAgentBenefitsMgr::has(const std::string& package) { return instance().mPackageMap.find(package) != instance().mPackageMap.end(); } + +//static +bool LLAgentBenefitsMgr::isCurrent(const std::string& package) +{ + return instance().mCurrentName == package; +} diff --git a/indra/newview/llagentbenefits.h b/indra/newview/llagentbenefits.h index 680b1e7b07..48aa6bd869 100644 --- a/indra/newview/llagentbenefits.h +++ b/indra/newview/llagentbenefits.h @@ -75,8 +75,10 @@ public: static bool init(const std::string& package, const LLSD& benefits_sd); static bool initCurrent(const std::string& package, const LLSD& benefits_sd); static bool has(const std::string& package); + static bool isCurrent(const std::string& package); private: + std::string mCurrentName; LLAgentBenefits mCurrent; LLAgentBenefits mDefault; std::map<std::string, LLAgentBenefits> mPackageMap; diff --git a/indra/newview/llgroupactions.cpp b/indra/newview/llgroupactions.cpp index 599790d2bb..d2bd716f55 100644 --- a/indra/newview/llgroupactions.cpp +++ b/indra/newview/llgroupactions.cpp @@ -400,10 +400,10 @@ void LLGroupActions::createGroup() { LLSD params; params["group_id"] = LLUUID::null; - params["open_tab_name"] = "panel_group_info_sidetray"; + params["open_tab_name"] = "panel_group_creation_sidetray"; params["action"] = "create"; - LLFloaterSidePanelContainer::showPanel("people", "panel_group_info_sidetray", params); + LLFloaterSidePanelContainer::showPanel("people", "panel_group_creation_sidetray", params); } //static diff --git a/indra/newview/llgroupmgr.cpp b/indra/newview/llgroupmgr.cpp index e384019a43..dbf7639539 100644 --- a/indra/newview/llgroupmgr.cpp +++ b/indra/newview/llgroupmgr.cpp @@ -45,7 +45,7 @@ #include "lltransactiontypes.h" #include "llstatusbar.h" #include "llviewerwindow.h" -#include "llpanelgroup.h" +#include "llpanelgroupcreate.h" #include "llgroupactions.h" #include "llnotificationsutil.h" #include "lluictrlfactory.h" @@ -1451,7 +1451,7 @@ void LLGroupMgr::processCreateGroupReply(LLMessageSystem* msg, void ** data) gAgent.mGroups.push_back(gd); - LLPanelGroup::refreshCreatedGroup(group_id); + LLPanelGroupCreate::refreshCreatedGroup(group_id); //FIXME //LLFloaterGroupInfo::closeCreateGroup(); //LLFloaterGroupInfo::showFromUUID(group_id,"roles_tab"); diff --git a/indra/newview/llpanelgroup.cpp b/indra/newview/llpanelgroup.cpp index e41211ddbd..ab255d5215 100644 --- a/indra/newview/llpanelgroup.cpp +++ b/indra/newview/llpanelgroup.cpp @@ -128,10 +128,6 @@ void LLPanelGroup::onOpen(const LLSD& key) { onBackBtnClick(); } - else if(str_action == "create") - { - setGroupID(LLUUID::null); - } else if(str_action == "refresh_notices") { LLPanelGroupNotices* panel_notices = findChild<LLPanelGroupNotices>("group_notices_tab_panel"); @@ -162,12 +158,8 @@ BOOL LLPanelGroup::postBuild() button = getChild<LLButton>("btn_refresh"); button->setClickedCallback(onBtnRefresh, this); - getChild<LLButton>("btn_create")->setVisible(false); - childSetCommitCallback("back",boost::bind(&LLPanelGroup::onBackBtnClick,this),NULL); - childSetCommitCallback("btn_create",boost::bind(&LLPanelGroup::onBtnCreate,this),NULL); - LLPanelGroupTab* panel_general = findChild<LLPanelGroupTab>("group_general_tab_panel"); LLPanelGroupTab* panel_roles = findChild<LLPanelGroupTab>("group_roles_tab_panel"); LLPanelGroupTab* panel_notices = findChild<LLPanelGroupTab>("group_notices_tab_panel"); @@ -223,7 +215,6 @@ void LLPanelGroup::reposButtons() } reposButton("btn_apply"); - reposButton("btn_create"); reposButton("btn_refresh"); reposButton("btn_cancel"); reposButton("btn_chat"); @@ -246,23 +237,6 @@ void LLPanelGroup::onBackBtnClick() } } - -void LLPanelGroup::onBtnCreate() -{ - LLPanelGroupGeneral* panel_general = findChild<LLPanelGroupGeneral>("group_general_tab_panel"); - if(!panel_general) - return; - std::string apply_mesg; - if(panel_general->apply(apply_mesg))//yes yes you need to call apply to create... - return; - if ( !apply_mesg.empty() ) - { - LLSD args; - args["MESSAGE"] = apply_mesg; - LLNotificationsUtil::add("GenericAlert", args); - } -} - void LLPanelGroup::onBtnRefresh(void* user_data) { LLPanelGroup* self = static_cast<LLPanelGroup*>(user_data); @@ -378,7 +352,6 @@ void LLPanelGroup::setGroupID(const LLUUID& group_id) LLButton* button_apply = findChild<LLButton>("btn_apply"); LLButton* button_refresh = findChild<LLButton>("btn_refresh"); - LLButton* button_create = findChild<LLButton>("btn_create"); LLButton* button_cancel = findChild<LLButton>("btn_cancel"); LLButton* button_call = findChild<LLButton>("btn_call"); @@ -391,8 +364,6 @@ void LLPanelGroup::setGroupID(const LLUUID& group_id) if(button_refresh) button_refresh->setVisible(!is_null_group_id); - if(button_create) - button_create->setVisible(is_null_group_id); if(button_cancel) button_cancel->setVisible(!is_null_group_id); @@ -611,18 +582,6 @@ void LLPanelGroup::showNotice(const std::string& subject, panel_notices->showNotice(subject,message,has_inventory,inventory_name,inventory_offer); } - - - -//static -void LLPanelGroup::refreshCreatedGroup(const LLUUID& group_id) -{ - LLPanelGroup* panel = LLFloaterSidePanelContainer::getPanel<LLPanelGroup>("people", "panel_group_info_sidetray"); - if(!panel) - return; - panel->setGroupID(group_id); -} - //static void LLPanelGroup::showNotice(const std::string& subject, diff --git a/indra/newview/llpanelgroup.h b/indra/newview/llpanelgroup.h index 0b40c8b5d3..be40b08a6d 100644 --- a/indra/newview/llpanelgroup.h +++ b/indra/newview/llpanelgroup.h @@ -79,8 +79,6 @@ public: virtual void reshape(S32 width, S32 height, BOOL called_from_parent = TRUE); - static void refreshCreatedGroup(const LLUUID& group_id); - static void showNotice(const std::string& subject, const std::string& message, const LLUUID& group_id, @@ -92,7 +90,6 @@ public: protected: virtual void update(LLGroupChange gc); - void onBtnCreate(); void onBackBtnClick(); void onBtnJoin(); diff --git a/indra/newview/llpanelgroupcreate.cpp b/indra/newview/llpanelgroupcreate.cpp new file mode 100644 index 0000000000..a782edae72 --- /dev/null +++ b/indra/newview/llpanelgroupcreate.cpp @@ -0,0 +1,237 @@ +/** + * @file llpanelgroupcreate.cpp + * + * $LicenseInfo:firstyear=2019&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2019, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + +#include "llviewerprecompiledheaders.h" + +#include "llpanelgroupcreate.h" + +// UI includes +#include "llbutton.h" +#include "llcheckboxctrl.h" +#include "llcombobox.h" +#include "llfloatersidepanelcontainer.h" +#include "llsidetraypanelcontainer.h" +#include "llscrolllistctrl.h" +#include "llspinctrl.h" +#include "lltextbox.h" +#include "lltexteditor.h" +#include "lltexturectrl.h" +#include "lluictrlfactory.h" + +// Viewer includes +#include "llagentbenefits.h" +#include "llfloaterreg.h" +#include "llfloater.h" +#include "llgroupmgr.h" +#include "lltrans.h" +#include "llnotificationsutil.h" +#include "lluicolortable.h" + + +const S32 MATURE_CONTENT = 1; +const S32 NON_MATURE_CONTENT = 2; +const S32 DECLINE_TO_STATE = 0; + +static LLPanelInjector<LLPanelGroupCreate> t_panel_group_creation("panel_group_creation_sidetray"); + +LLPanelGroupCreate::LLPanelGroupCreate() +: LLPanel() +{ +} + +LLPanelGroupCreate::~LLPanelGroupCreate() +{ +} + +BOOL LLPanelGroupCreate::postBuild() +{ + childSetCommitCallback("back", boost::bind(&LLPanelGroupCreate::onBackBtnClick, this), NULL); + + mComboMature = getChild<LLComboBox>("group_mature_check", TRUE); + mCtrlOpenEnrollment = getChild<LLCheckBoxCtrl>("open_enrollement", TRUE); + mCtrlEnrollmentFee = getChild<LLCheckBoxCtrl>("check_enrollment_fee", TRUE); + mEditCharter = getChild<LLTextEditor>("charter", TRUE); + mSpinEnrollmentFee = getChild<LLSpinCtrl>("spin_enrollment_fee", TRUE); + mMembershipList = getChild<LLScrollListCtrl>("membership_list", TRUE); + + mCreateButton = getChild<LLButton>("btn_create", TRUE); + mCreateButton->setCommitCallback(boost::bind(&LLPanelGroupCreate::onBtnCreate, this)); + + mGroupNameEditor = getChild<LLLineEditor>("group_name_editor", TRUE); + mGroupNameEditor->setPrevalidate(LLTextValidate::validateASCIINoLeadingSpace); + + mInsignia = getChild<LLTextureCtrl>("insignia", TRUE); + mInsignia->setAllowLocalTexture(FALSE); + mInsignia->setCanApplyImmediately(FALSE); + + return TRUE; +} + +void LLPanelGroupCreate::onOpen(const LLSD& key) +{ + mInsignia->setImageAssetID(LLUUID::null); + mInsignia->setImageAssetName(mInsignia->getDefaultImageName()); + mGroupNameEditor->clear(); + mEditCharter->clear(); + mSpinEnrollmentFee->set(0.f); + mCtrlEnrollmentFee->set(FALSE); + mCtrlOpenEnrollment->set(FALSE); + mMembershipList->clearRows(); + + // populate list + addMembershipRow("Base"); + addMembershipRow("Premium"); + addMembershipRow("PremiumPlus"); + addMembershipRow("Internal");// Present only if you are already in one, needed for testing + + S32 cost = LLAgentBenefitsMgr::current().getCreateGroupCost(); + mCreateButton->setLabelArg("[COST]", llformat("%d", cost)); +} + +//static +void LLPanelGroupCreate::refreshCreatedGroup(const LLUUID& group_id) +{ + LLSD params; + params["group_id"] = group_id; + params["open_tab_name"] = "panel_group_info_sidetray"; + LLFloaterSidePanelContainer::showPanel("people", "panel_group_info_sidetray", params); +} + +void LLPanelGroupCreate::addMembershipRow(const std::string &name) +{ + if (LLAgentBenefitsMgr::has(name)) + { + bool is_current = LLAgentBenefitsMgr::isCurrent(name); + + LLScrollListItem::Params item_params; + LLScrollListCell::Params cell_params; + cell_params.font = LLFontGL::getFontSansSerif(); + // Start out right justifying numeric displays + cell_params.font_halign = LLFontGL::LEFT; + if (is_current) + { + cell_params.color = LLUIColorTable::instance().getColor("DrYellow"); + } + + cell_params.column = "clmn_name"; + std::string mem_str = name + "Membership"; + if (is_current) + { + cell_params.value = LLTrans::getString(mem_str) + " " + getString("current_membership"); + } + else + { + cell_params.value = LLTrans::getString(mem_str); + } + item_params.columns.add(cell_params); + cell_params.column = "clmn_price"; + cell_params.value = llformat("L$ %d",LLAgentBenefitsMgr::get(name).getCreateGroupCost()); + item_params.columns.add(cell_params); + mMembershipList->addRow(item_params); + } +} + +void LLPanelGroupCreate::onBackBtnClick() +{ + LLSideTrayPanelContainer* parent = dynamic_cast<LLSideTrayPanelContainer*>(getParent()); + if(parent) + { + parent->openPreviousPanel(); + } +} + +bool LLPanelGroupCreate::confirmMatureApply(const LLSD& notification, const LLSD& response) +{ + S32 option = LLNotificationsUtil::getSelectedOption(notification, response); + // 0 == Yes + // 1 == No + // 2 == Cancel + switch (option) + { + case 0: + mComboMature->setCurrentByIndex(MATURE_CONTENT); + createGroup(); + break; + case 1: + mComboMature->setCurrentByIndex(NON_MATURE_CONTENT); + createGroup(); + break; + default: + break; + } + + return true; +} + +void LLPanelGroupCreate::onBtnCreate() +{ + LL_INFOS() << "Validating group creation" << LL_ENDL; + + // Validate the group name length. + std::string gr_name = mGroupNameEditor->getText(); + LLStringUtil::trim(gr_name); + S32 group_name_len = gr_name.size(); + if (group_name_len < DB_GROUP_NAME_MIN_LEN + || group_name_len > DB_GROUP_NAME_STR_LEN) + { + LLSD args; + args["MIN_LEN"] = DB_GROUP_NAME_MIN_LEN; + args["MAX_LEN"] = DB_GROUP_NAME_STR_LEN; + LLNotificationsUtil::add("GroupNameLengthWarning", args); + } + else + // Check to make sure mature has been set + if (mComboMature && + mComboMature->getCurrentIndex() == DECLINE_TO_STATE) + { + LLNotificationsUtil::add("SetGroupMature", LLSD(), LLSD(), + boost::bind(&LLPanelGroupCreate::confirmMatureApply, this, _1, _2)); + } + else + { + createGroup(); + } +} + +void LLPanelGroupCreate::createGroup() +{ + LL_INFOS() << "Creating group" << LL_ENDL; + + U32 enrollment_fee = (mCtrlEnrollmentFee->get() ? + (U32)mSpinEnrollmentFee->get() : 0); + LLUUID insignia_id = mInsignia->getImageItemID().isNull() ? LLUUID::null : mInsignia->getImageAssetID(); + + std::string gr_name = mGroupNameEditor->getText(); + LLStringUtil::trim(gr_name); + LLGroupMgr::getInstance()->sendCreateGroupRequest(gr_name, + mEditCharter->getText(), + true, + insignia_id, + enrollment_fee, + mCtrlOpenEnrollment->get(), + false, + mComboMature->getCurrentIndex() == MATURE_CONTENT); +} + diff --git a/indra/newview/llpanelgroupcreate.h b/indra/newview/llpanelgroupcreate.h new file mode 100644 index 0000000000..3ae2e7f24a --- /dev/null +++ b/indra/newview/llpanelgroupcreate.h @@ -0,0 +1,73 @@ +/** + * @file llpanelgroupcreate.h + * + * $LicenseInfo:firstyear=2019&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2019, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + +#ifndef LL_LLPANELGROUPCREATE_H +#define LL_LLPANELGROUPCREATE_H + +#include "llpanel.h" + + +// Forward declares +class LLButton; +class LLCheckBoxCtrl; +class LLComboBox; +class LLLineEditor; +class LLTextEditor; +class LLTextureCtrl; +class LLScrollListCtrl; +class LLSpinCtrl; + + +class LLPanelGroupCreate : public LLPanel +{ +public: + LLPanelGroupCreate(); + virtual ~LLPanelGroupCreate(); + + virtual BOOL postBuild(); + + void onOpen(const LLSD& key); + + static void refreshCreatedGroup(const LLUUID& group_id); + +private: + void addMembershipRow(const std::string &name); + bool confirmMatureApply(const LLSD& notification, const LLSD& response); + void onBtnCreate(); + void onBackBtnClick(); + void createGroup(); + + LLComboBox *mComboMature; + LLButton *mCreateButton; + LLCheckBoxCtrl *mCtrlOpenEnrollment; + LLCheckBoxCtrl *mCtrlEnrollmentFee; + LLTextEditor *mEditCharter; + LLTextureCtrl *mInsignia; + LLLineEditor *mGroupNameEditor; + LLScrollListCtrl *mMembershipList; + LLSpinCtrl *mSpinEnrollmentFee; +}; + +#endif // LL_LLPANELGROUPCREATE_H diff --git a/indra/newview/llpanelgroupgeneral.cpp b/indra/newview/llpanelgroupgeneral.cpp index 18f38b0d12..375daf60f8 100644 --- a/indra/newview/llpanelgroupgeneral.cpp +++ b/indra/newview/llpanelgroupgeneral.cpp @@ -304,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()); @@ -313,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; @@ -326,27 +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; - } - - LLSD args; - args["COST"] = LLAgentBenefitsMgr::current().getCreateGroupCost(); - LLNotificationsUtil::add("CreateGroupCost", args, LLSD(), boost::bind(&LLPanelGroupGeneral::createGroupCallback, this, _1, _2)); - - return false; - } - LLGroupMgrGroupData* gdatap = LLGroupMgr::getInstance()->getGroupData(mGroupID); if (!gdatap) { @@ -453,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) { diff --git a/indra/newview/llpanelgroupgeneral.h b/indra/newview/llpanelgroupgeneral.h index 11972bafa9..1d0789521c 100644 --- a/indra/newview/llpanelgroupgeneral.h +++ b/indra/newview/llpanelgroupgeneral.h @@ -51,7 +51,6 @@ public: virtual bool needsApply(std::string& mesg); virtual bool apply(std::string& mesg); virtual void cancel(); - bool createGroupCallback(const LLSD& notification, const LLSD& response); virtual void update(LLGroupChange gc); diff --git a/indra/newview/skins/default/xui/en/floater_people.xml b/indra/newview/skins/default/xui/en/floater_people.xml index 701233ba4a..0cc0ca1ce4 100644 --- a/indra/newview/skins/default/xui/en/floater_people.xml +++ b/indra/newview/skins/default/xui/en/floater_people.xml @@ -31,5 +31,11 @@ filename="panel_group_info_sidetray.xml" label="Group Profile" font="SansSerifBold"/> + <panel + class="panel_group_creation_sidetray" + name="panel_group_creation_sidetray" + filename="panel_group_creation_sidetray.xml" + label="Create Group" + font="SansSerifBold"/> </panel_container> </floater> diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml index 670784f3bf..2417c52251 100644 --- a/indra/newview/skins/default/xui/en/notifications.xml +++ b/indra/newview/skins/default/xui/en/notifications.xml @@ -686,6 +686,18 @@ Do you want to revoke modify rights for the selected Residents? <notification icon="alertmodal.tga" + name="GroupNameLengthWarning" + type="alertmodal"> +A group name must be between [MIN_LEN] and [MAX_LEN] characters. + <tag>group</tag> + <tag>fail</tag> + <usetemplate + name="okbutton" + yestext="OK"/> + </notification> + + <notification + icon="alertmodal.tga" name="UnableToCreateGroup" type="alertmodal"> Unable to create group. diff --git a/indra/newview/skins/default/xui/en/panel_group_creation_sidetray.xml b/indra/newview/skins/default/xui/en/panel_group_creation_sidetray.xml new file mode 100644 index 0000000000..c0265c2fa2 --- /dev/null +++ b/indra/newview/skins/default/xui/en/panel_group_creation_sidetray.xml @@ -0,0 +1,314 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<panel +background_visible="true" + follows="all" + height="570" + label="Group Creation" + layout="topleft" + min_height="350" + left="0" + top="20" + name="GroupCreation" + width="313"> + <panel.string + name="current_membership"> +(your membership) + </panel.string> + <panel + name="group_info_top" + follows="top|left" + top="0" + left="0" + height="29" + width="313" + layout="topleft"> + <line_editor + follows="left|top" + font="SansSerif" + label="Type your new group name here" + layout="topleft" + max_length_bytes="35" + name="group_name_editor" + left="12" + top="5" + width="270" + height="20" + visible="true" /> + </panel> + <layout_stack + name="layout" + orientation="vertical" + follows="all" + left="8" + top_pad="0" + height="538" + width="300" + border_size="0"> + <layout_panel + bg_alpha_color="DkGray2" + bg_opaque_color="DkGray2" + background_visible="true" + background_opaque="true" + name="group_info" + follows="all" + layout="topleft" + auto_resize="false" + user_resize="false" + height="206" + width="313"> + <panel + name="group_info_top" + follows="top|left|right" + top="0" + left="0" + height="99" + width="312" + layout="topleft"> + <texture_picker + default_image_name="Generic_Group_Large" + follows="left|top" + name="insignia" + label="" + no_commit_on_selection="true" + tool_tip="Click to choose a picture" + layout="topleft" + height="110" + left="5" + top="5" + width="100" /> + <text_editor + follows="left|top|right" + layout="topleft" + type="string" + name="charter" + left_pad="3" + height="86" + max_length="511" + top="6" + right="-4" + bg_readonly_color="DkGray2" + text_readonly_color="White" + word_wrap="true"> + Group Charter + </text_editor> + </panel> + <panel + layout="topleft" + follows="left|top|right" + background_visible="false" + bevel_style="none" + border="false" + bg_alpha_color="FloaterUnfocusBorderColor" + height="100" + width="313" + left="0" + name="preferences_container" + top_pad="5"> + <check_box + follows="right|top|left" + layout="topleft" + label="Anyone can join" + height="16" + left="10" + name="open_enrollement" + tool_tip="Sets whether this group allows new members to join without being invited." + width="90" /> + <check_box + label="Cost to join" + layout="topleft" + name="check_enrollment_fee" + tool_tip="Sets whether to require an enrollment fee to join the group" + top_pad="5" + left_delta="0" + height="16" + width="300" /> + <spinner + decimal_digits="0" + follows="left|top" + halign="left" + increment="1" + label_width="15" + label="L$" + layout="topleft" + max_val="99999" + height="23" + left="30" + name="spin_enrollment_fee" + tool_tip="New members must pay this fee to join the group when Enrollment Fee is checked." + width="170" /> + <combo_box + follows="left|top" + layout="topleft" + name="group_mature_check" + tool_tip="Maturity ratings designate the type of content and behavior allowed in a group" + height="23" + left="10" + top_pad="4" + width="190"> + <combo_item name="select_mature" value="Select"> + - Select maturity rating - + </combo_item> + <combo_box.item + label="Moderate Content" + name="mature" + value="Mature" /> + <combo_box.item + label="General Content" + name="pg" + value="Not Mature" /> + </combo_box> + </panel> + </layout_panel> + <layout_panel + background_visible="false" + background_opaque="true" + name="create_info" + follows="all" + layout="topleft" + auto_resize="false" + user_resize="false" + height="200" + width="313"> + <text + font="SansSerifSmall" + follows="top|left|right" + layout="topleft" + mouse_opaque="false" + type="string" + name="fee_information" + skip_link_underline="true" + height="26" + left="8" + right="-8" + top="5" + word_wrap="true"> + The fee to create a group is based on your membership level. [https://secondlife.com/my/account/membership.php More info] + </text> + <scroll_list + draw_border="false" + background_visible="false" + follows="left|top|bottom|right" + layout="topleft" + multi_select="true" + name="membership_list" + row_padding="4" + enabled="false" + height="150" + left="2" + top_pad="8" + width="290"> + <scroll_list.columns + dynamic_width="false" + name="clmn_name" + width="220"/> + <scroll_list.columns + dynamic_width="true" + name="clmn_price"/> + <scroll_list.rows + name="basic" + value="Basic (placeholder)"/> + <scroll_list.rows + name="plc2" + value="" /> + <scroll_list.rows + name="premium" + value="Premium (placeholder)" /> + </scroll_list> + </layout_panel> + <layout_panel + background_visible="false" + background_opaque="true" + name="create_actions" + follows="all" + layout="topleft" + auto_resize="true" + user_resize="true" + height="200" + width="313"> + </layout_panel> + <layout_panel + background_visible="false" + background_opaque="true" + name="create_actions" + follows="all" + layout="topleft" + auto_resize="false" + user_resize="false" + height="75" + width="313"> + + <layout_stack + follows="bottom|left|right" + layout="topleft" + name="button_row_ls" + left="1" + right="-1" + orientation="horizontal" + height="25" + top="1"> + <layout_panel + follows="bottom|left|right" + layout="bottomleft" + name="layout_crt" + auto_resize="true" + height="23" + width="91"> + <!-- placeholder to autoadjust buttons (since they are of different sizes)--> + </layout_panel> + <layout_panel + follows="bottom|left|right" + layout="bottomleft" + name="layout_crt" + auto_resize="false" + height="23" + width="245"> + <button + follows="bottom|left|right" + layout="topleft" + label="Create group for L$ [COST]" + name="btn_create" + visible="true" + tool_tip="Create a new Group" + height="23" + left="1" + top="0" + width="160" /> + <button + follows="bottom|left|right" + name="back" + label="Cancel" + layout="topleft" + tool_tip="Return to list of groups" + left_pad="13" + height="23" + top="0" + width="70" /> + </layout_panel> + <layout_panel + follows="bottom|left|right" + layout="bottomleft" + name="layout_crt" + auto_resize="true" + height="23" + width="91"> + <!-- placeholder to autoadjust buttons--> + </layout_panel> + </layout_stack> + <text + font="SansSerifSmall" + follows="top|left|right" + layout="topleft" + mouse_opaque="false" + type="string" + height="26" + left="6" + right="-6" + name="info_deletion" + top_pad="8" + word_wrap="true" + halign="center"> + Note: After 7 days, a group with no members (other than the creator) is deleted + </text> + </layout_panel> + </layout_stack> +</panel> diff --git a/indra/newview/skins/default/xui/en/panel_group_info_sidetray.xml b/indra/newview/skins/default/xui/en/panel_group_info_sidetray.xml index 95312edfb9..05de249d22 100644 --- a/indra/newview/skins/default/xui/en/panel_group_info_sidetray.xml +++ b/indra/newview/skins/default/xui/en/panel_group_info_sidetray.xml @@ -280,17 +280,6 @@ background_visible="true" left="1" top="0" width="90" /> - <button - follows="bottom|left|right" - height="23" - layout="topleft" - left="1" - top="0" - label="Create Group" - name="btn_create" - visible="true" - tool_tip="Create a new Group" - width="90" /> </layout_panel> </layout_stack> diff --git a/indra/newview/skins/default/xui/en/strings.xml b/indra/newview/skins/default/xui/en/strings.xml index 9eedc45aa9..942fb925b5 100644 --- a/indra/newview/skins/default/xui/en/strings.xml +++ b/indra/newview/skins/default/xui/en/strings.xml @@ -3934,6 +3934,12 @@ Please check http://status.secondlifegrid.net to see if there is a known problem <string name="Accounting">Accounting</string> <string name="Notices">Notices</string> <string name="Chat">Chat</string> + + <!-- SL Membership --> + <string name="BaseMembership">Base</string> + <string name="PremiumMembership">Premium</string> + <string name="PremiumPlusMembership">Premium Plus</string> + <string name="InternalMembership">Internal</string> <!-- No need to translate --> <!-- Question strings for delete items notifications --> <string name="DeleteItems">Delete selected items?</string> |