diff options
author | dolphin <dolphin@lindenlab.com> | 2014-02-28 16:21:42 -0800 |
---|---|---|
committer | dolphin <dolphin@lindenlab.com> | 2014-02-28 16:21:42 -0800 |
commit | 49f08d775d3644bb47d342f8e37dd15051aeaa62 (patch) | |
tree | f310183241edfc049945df7e5afc60e4e05e6655 /indra | |
parent | c1f730ed46c14c12d5856109b622bf085c39abb0 (diff) |
Add group editing for experiences
Diffstat (limited to 'indra')
-rw-r--r-- | indra/newview/llfloaterexperiencepicker.cpp | 12 | ||||
-rw-r--r-- | indra/newview/llfloaterexperienceprofile.cpp | 42 | ||||
-rw-r--r-- | indra/newview/llfloaterexperienceprofile.h | 5 | ||||
-rw-r--r-- | indra/newview/llfloaterexperiences.cpp | 13 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/floater_experienceprofile.xml | 45 | ||||
-rwxr-xr-x | indra/newview/skins/default/xui/en/notifications.xml | 21 |
6 files changed, 110 insertions, 28 deletions
diff --git a/indra/newview/llfloaterexperiencepicker.cpp b/indra/newview/llfloaterexperiencepicker.cpp index a1b62648d6..be53f2e12c 100644 --- a/indra/newview/llfloaterexperiencepicker.cpp +++ b/indra/newview/llfloaterexperiencepicker.cpp @@ -245,12 +245,16 @@ void LLFloaterExperiencePicker::onBtnSelect() getSelectedExperienceIds(results, experience_ids); mSelectionCallback(experience_ids); + getChild<LLScrollListCtrl>(LIST_RESULTS)->deselectAllItems(TRUE); + if(mCloseOnSelect) + { + mCloseOnSelect = FALSE; + closeFloater(); + } } - getChild<LLScrollListCtrl>(LIST_RESULTS)->deselectAllItems(TRUE); - if(mCloseOnSelect) + else { - mCloseOnSelect = FALSE; - closeFloater(); + onBtnProfile(); } } diff --git a/indra/newview/llfloaterexperienceprofile.cpp b/indra/newview/llfloaterexperienceprofile.cpp index 1843d2eb8b..fd0f7aee1d 100644 --- a/indra/newview/llfloaterexperienceprofile.cpp +++ b/indra/newview/llfloaterexperienceprofile.cpp @@ -48,6 +48,7 @@ #include "lltrans.h" #include "llviewerregion.h" #include "llevents.h" +#include "llfloatergroups.h" #define XML_PANEL_EXPERIENCE_PROFILE "floater_experienceprofile.xml" #define TF_NAME "experience_title" @@ -81,6 +82,7 @@ #define BTN_PRIVATE "private_btn" #define BTN_SET_LOCATION "location_btn" #define BTN_CLEAR_LOCATION "clear_btn" +#define BTN_SET_GROUP "Group_btn" @@ -304,10 +306,10 @@ BOOL LLFloaterExperienceProfile::postBuild() childSetAction(BTN_FORGET, boost::bind(&LLFloaterExperienceProfile::onClickForget, this)); childSetAction(BTN_BLOCK, boost::bind(&LLFloaterExperienceProfile::onClickPermission, this, "Block")); childSetAction(BTN_CANCEL, boost::bind(&LLFloaterExperienceProfile::onClickCancel, this)); - childSetAction(BTN_SAVE, boost::bind(&LLFloaterExperienceProfile::onClickSave, this)); - childSetAction(BTN_SET_LOCATION, boost::bind(&LLFloaterExperienceProfile::onClickLocation, this)); - childSetAction(BTN_CLEAR_LOCATION, boost::bind(&LLFloaterExperienceProfile::onClickClear, this)); - + childSetAction(BTN_SAVE, boost::bind(&LLFloaterExperienceProfile::onClickSave, this)); + childSetAction(BTN_SET_LOCATION, boost::bind(&LLFloaterExperienceProfile::onClickLocation, this)); + childSetAction(BTN_CLEAR_LOCATION, boost::bind(&LLFloaterExperienceProfile::onClickClear, this)); + childSetAction(BTN_SET_GROUP, boost::bind(&LLFloaterExperienceProfile::onPickGroup, this)); getChild<LLTextEditor>(EDIT TF_DESC)->setKeystrokeCallback(boost::bind(&LLFloaterExperienceProfile::onFieldChanged, this)); getChild<LLUICtrl>(EDIT TF_MATURITY)->setCommitCallback(boost::bind(&LLFloaterExperienceProfile::onFieldChanged, this)); @@ -498,10 +500,15 @@ void LLFloaterExperienceProfile::refreshExperience( const LLSD& experience ) id = experience[LLExperienceCache::GROUP_ID].asUUID(); + bool id_null = id.isNull(); child = getChild<LLTextBox>(TF_GROUP); value = LLSLURL("group", id, "inspect").getSLURLString(); child->setText(value); - getChild<LLLayoutPanel>(PNL_GROUP)->setVisible(id.notNull()); + getChild<LLLayoutPanel>(PNL_GROUP)->setVisible(!id_null); + + setEditGroup(id); + + getChild<LLButton>(BTN_SET_GROUP)->setEnabled(experience[LLExperienceCache::AGENT_ID].asUUID() == gAgent->getID()); LLCheckBoxCtrl* enable = getChild<LLCheckBoxCtrl>(EDIT BTN_ENABLE); S32 properties = mExperienceDetails[LLExperienceCache::PROPERTIES].asInteger(); @@ -916,3 +923,28 @@ void LLFloaterExperienceProfile::updatePackage() mPackage[LLExperienceCache::PROPERTIES] = properties; } + +void LLFloaterExperienceProfile::onPickGroup() +{ + LLFloater* parent_floater = gFloaterView->getParentFloater(this); + + LLFloaterGroupPicker* widget = LLFloaterReg::showTypedInstance<LLFloaterGroupPicker>("group_picker", LLSD(gAgent.getID())); + if (widget) + { + widget->setSelectGroupCallback(boost::bind(&LLFloaterExperienceProfile::setEditGroup, this, _1)); + if (parent_floater) + { + LLRect new_rect = gFloaterView->findNeighboringPosition(parent_floater, widget); + widget->setOrigin(new_rect.mLeft, new_rect.mBottom); + parent_floater->addDependentFloater(widget); + } + } +} + +void LLFloaterExperienceProfile::setEditGroup( LLUUID group_id ) +{ + LLTextBox* child = getChild<LLTextBox>(EDIT TF_GROUP); + std::string value = LLSLURL("group", group_id, "inspect").getSLURLString(); + child->setText(value); + mPackage[LLExperienceCache::GROUP_ID] = group_id; +} diff --git a/indra/newview/llfloaterexperienceprofile.h b/indra/newview/llfloaterexperienceprofile.h index 550b3c6f27..5e9fd8f03a 100644 --- a/indra/newview/llfloaterexperienceprofile.h +++ b/indra/newview/llfloaterexperienceprofile.h @@ -68,9 +68,12 @@ protected: void onClickCancel(); void onClickSave(); void onClickLocation(); - void onClickClear(); + void onClickClear(); + void onPickGroup(); void onFieldChanged(); + void setEditGroup(LLUUID group_id); + void changeToView(); void experienceForgotten(); diff --git a/indra/newview/llfloaterexperiences.cpp b/indra/newview/llfloaterexperiences.cpp index 8e860a9ee0..956afe15c3 100644 --- a/indra/newview/llfloaterexperiences.cpp +++ b/indra/newview/llfloaterexperiences.cpp @@ -37,6 +37,9 @@ #include "llnotificationsutil.h" + +#define SHOW_RECENT_TAB (0) + class LLExperienceListResponder : public LLHTTPClient::Responder { public: @@ -106,9 +109,11 @@ BOOL LLFloaterExperiences::postBuild() addTab("Blocked_Experiences_Tab", false); addTab("Admin_Experiences_Tab", false); addTab("Contrib_Experiences_Tab", false); - addTab("Recent_Experiences_Tab", false); LLPanelExperiences* owned = addTab("Owned_Experiences_Tab", false); owned->setButtonAction("acquire", boost::bind(&LLFloaterExperiences::sendPurchaseRequest, this)); +#if SHOW_RECENT_TAB + addTab("Recent_Experiences_Tab", false); +#endif //SHOW_RECENT_TAB resizeToTabs(); @@ -118,8 +123,10 @@ BOOL LLFloaterExperiences::postBuild() return TRUE; } + void LLFloaterExperiences::clearFromRecent(const LLSD& ids) { +#if SHOW_RECENT_TAB LLTabContainer* tabs = getChild<LLTabContainer>("xp_tabs"); LLPanelExperiences* tab = (LLPanelExperiences*)tabs->getPanelByName("Recent_Experiences_Tab"); @@ -127,10 +134,12 @@ void LLFloaterExperiences::clearFromRecent(const LLSD& ids) return; tab->removeExperiences(ids); +#endif // SHOW_RECENT_TAB } void LLFloaterExperiences::setupRecentTabs() { +#if SHOW_RECENT_TAB LLTabContainer* tabs = getChild<LLTabContainer>("xp_tabs"); LLPanelExperiences* tab = (LLPanelExperiences*)tabs->getPanelByName("Recent_Experiences_Tab"); @@ -152,8 +161,10 @@ void LLFloaterExperiences::setupRecentTabs() } tab->setExperienceList(recent); +#endif // SHOW_RECENT_TAB } + void LLFloaterExperiences::resizeToTabs() { const S32 TAB_WIDTH_PADDING = 16; diff --git a/indra/newview/skins/default/xui/en/floater_experienceprofile.xml b/indra/newview/skins/default/xui/en/floater_experienceprofile.xml index 43ff3f07e4..fda84b0d4a 100644 --- a/indra/newview/skins/default/xui/en/floater_experienceprofile.xml +++ b/indra/newview/skins/default/xui/en/floater_experienceprofile.xml @@ -72,17 +72,16 @@ <panel bg_alpha_color="DkGray2" follows="top|left|right" - height="480" + height="510" layout="topleft" left="0" - min_height="480" name="scrolling_panel" top="0" width="315" min_width="315"> <layout_stack follows="all" - height="480" + height="510" layout="topleft" left="0" top="0" @@ -421,7 +420,7 @@ <scroll_container color="DkGray2" follows="all" - height="525" + height="520" layout="topleft" left="9" name="edit_xp_scroll" @@ -431,7 +430,7 @@ <panel bg_alpha_color="DkGray2" follows="top|left|right" - height="525" + height="590" layout="topleft" left="0" name="edit_scrolling_panel" @@ -485,6 +484,25 @@ text_color="black" right="-11" word_wrap="true"/> + <button + top_pad="10" + left="10" + width="125" + height="23" + name="Group_btn" + label="Group" + /> + <text + type="string" + length="1" + follows="left|top|right" + height="14" + layout="topleft" + left_pad="10" + top_pad="-18" + use_ellipses="true" + name="edit_GroupText" + right="-10" /> <text top_pad="10" type="string" @@ -565,10 +583,10 @@ top_pad="-14" use_ellipses="true" name="edit_LocationTextText" - right="-10"></text> + right="-10" /> <button left="10" - width="150" + width="125" height="23" name="location_btn" label="Set to Current" @@ -577,9 +595,9 @@ top_pad="-23" follows="top|right" right="-10" - width="80" + width="125" name="clear_btn" - label="Clear"/> + label="Clear Location"/> <text type="string" length="1" @@ -610,10 +628,11 @@ tool_tip="" label="Enable Experience" name="edit_enable_btn"/> - <check_box width="130" + <check_box width="125" height="21" top_pad="-21" right="-10" + visible="false" layout="topleft" follows="top|left|right" label="Hide In Search" @@ -624,7 +643,7 @@ label="Back" layout="topleft" name="cancel_btn" - width="120" + width="125" top_pad="15" left="10" visible="true"/> @@ -635,12 +654,12 @@ layout="topleft" name="save_btn" top_pad="-23" - width="120" + width="125" right="-10" visible="true"/> <text follows="left|top|right" - height="50" + height="25" layout="topleft" left="10" top_pad="10" diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml index 75a7240c9e..0da1e546ee 100755 --- a/indra/newview/skins/default/xui/en/notifications.xml +++ b/indra/newview/skins/default/xui/en/notifications.xml @@ -6997,20 +6997,33 @@ Unable to acquire a new experience: name="okbutton" yestext="OK"/> </notification> - - - + + + <notification icon="notify.tga" name="TeleportedHomeExperienceRemoved" persist="true" type="notify"> - You have been teleported from the [region_name] for removing the experience secondlife:///app/experience/[public_id]/profile and are no longer permitted in the region. + You have been teleported from the region [region_name] for removing the experience secondlife:///app/experience/[public_id]/profile and are no longer permitted in the region. <form name="form"> <ignore name="ignore" text="Kicked from region for removing an experience"/> </form> </notification> + + <notification + icon="notify.tga" + name="TrustedExperienceEntry" + persist="true" + type="notify"> + You have been allowed into the region [region_name] by participating in the trusted experience secondlife:///app/experience/[public_id]/profile removing this experience may kick you from the region. + <form name="form"> + <ignore name="ignore" + text="Allowed into a region by an experience"/> + </form> + </notification> + <notification icon="notify.tga" name="ScriptQuestionExperience" |