diff --git a/indra/newview/llavataractions.cpp b/indra/newview/llavataractions.cpp index 1851e389b..efc51d319 100644 --- a/indra/newview/llavataractions.cpp +++ b/indra/newview/llavataractions.cpp @@ -31,7 +31,7 @@ #include "llavatarnamecache.h" // IDEVO #include "llnotifications.h" -#include "llnotificationsutil.h" // for LLNotificationsUtil +#include "llnotificationsutil.h" #include "roles_constants.h" // for GP_MEMBER_INVITE #include "llagent.h" @@ -75,6 +75,9 @@ void LLAvatarActions::requestFriendshipDialog(const LLUUID& id, const std::strin payload["name"] = name; LLNotificationsUtil::add("AddFriendWithMessage", args, payload, &callbackAddFriendWithMessage); + + // add friend to recent people list + //LLRecentPeople::instance().add(id); } void on_avatar_name_friendship(const LLUUID& id, const LLAvatarName av_name) @@ -218,7 +221,6 @@ static void on_avatar_name_cache_start_call(const LLUUID& agent_id, make_ui_sound("UISndStartIM"); } - // static void LLAvatarActions::startCall(const LLUUID& id) { @@ -240,8 +242,7 @@ void LLAvatarActions::startCall(const LLUUID& id) } // [/RLVa:KB] - LLAvatarNameCache::get(id, - boost::bind(&on_avatar_name_cache_start_call, _1, _2)); + LLAvatarNameCache::get(id, boost::bind(&on_avatar_name_cache_start_call, _1, _2)); } // static @@ -568,8 +569,8 @@ void LLAvatarActions::inviteToGroup(const LLUUID& id) { widget->center(); widget->setPowersMask(GP_MEMBER_INVITE); - //widget->removeNoneOption(); - widget->setSelectCallback(callback_invite_to_group, (void*)&id); + widget->removeNoneOption(); + widget->setSelectGroupCallback(boost::bind(callback_invite_to_group, _1, id)); } } @@ -625,10 +626,10 @@ bool LLAvatarActions::handlePay(const LLSD& notification, const LLSD& response, } // static -void LLAvatarActions::callback_invite_to_group(LLUUID group_id, void* id) +void LLAvatarActions::callback_invite_to_group(LLUUID group_id, LLUUID id) { uuid_vec_t agent_ids; - agent_ids.push_back(*static_cast(id)); + agent_ids.push_back(id); LLFloaterGroupInvite::showForGroup(group_id, &agent_ids); } @@ -725,7 +726,6 @@ void LLAvatarActions::requestFriendship(const LLUUID& target_id, const std::stri LLSD payload; payload["from_id"] = target_id; - //payload["SUPPRESS_TOAST"] = true; LLNotificationsUtil::add("FriendshipOffered", args, payload); } @@ -754,4 +754,3 @@ bool LLAvatarActions::canBlock(const LLUUID& id) bool is_self = id == gAgentID; return !is_self && !is_linden; } - diff --git a/indra/newview/llavataractions.h b/indra/newview/llavataractions.h index b0ac68df0..6131954a6 100644 --- a/indra/newview/llavataractions.h +++ b/indra/newview/llavataractions.h @@ -187,7 +187,7 @@ private: static bool handleKick(const LLSD& notification, const LLSD& response); static bool handleFreeze(const LLSD& notification, const LLSD& response); static bool handleUnfreeze(const LLSD& notification, const LLSD& response); - static void callback_invite_to_group(LLUUID group_id, void* id); + static void callback_invite_to_group(LLUUID group_id, LLUUID id); public: // Just request friendship, no dialog. diff --git a/indra/newview/llfloatergroups.cpp b/indra/newview/llfloatergroups.cpp index c342d8d89..00d31dd1c 100644 --- a/indra/newview/llfloatergroups.cpp +++ b/indra/newview/llfloatergroups.cpp @@ -40,94 +40,68 @@ #include "llviewerprecompiledheaders.h" #include "llfloatergroups.h" -#include "llfloatergroupinvite.h" -#include "message.h" #include "roles_constants.h" #include "hbfloatergrouptitles.h" #include "llagent.h" #include "llbutton.h" -#include "llfloatergroupinfo.h" -#include "llfloaterdirectory.h" -#include "llfocusmgr.h" +#include "llfloatergroupinvite.h" #include "llgroupactions.h" -#include "llselectmgr.h" +#include "llimview.h" #include "llscrolllistctrl.h" #include "llscrolllistitem.h" -#include "llnotificationsutil.h" #include "lltextbox.h" #include "lluictrlfactory.h" -#include "llviewerwindow.h" -#include "llimview.h" +#include "lltrans.h" #include "hippolimits.h" using namespace LLOldEvents; -// static -std::map LLFloaterGroupPicker::sInstances; - // helper functions -void init_group_list(LLScrollListCtrl* ctrl, const LLUUID& highlight_id, const std::string& none_text, U64 powers_mask = GP_ALL_POWERS); +void init_group_list(LLScrollListCtrl* ctrl, const LLUUID& highlight_id, U64 powers_mask = GP_ALL_POWERS); ///---------------------------------------------------------------------------- /// Class LLFloaterGroupPicker ///---------------------------------------------------------------------------- // static -LLFloaterGroupPicker* LLFloaterGroupPicker::findInstance(const LLSD& seed) +LLFloaterGroupPicker* LLFloaterGroupPicker::showInstance(const LLSD& seed) { - instance_map_t::iterator found_it = sInstances.find(seed.asUUID()); - if (found_it != sInstances.end()) - { - return found_it->second; - } - return NULL; -} - -// static -LLFloaterGroupPicker* LLFloaterGroupPicker::createInstance(const LLSD &seed) -{ - LLFloaterGroupPicker* pickerp = new LLFloaterGroupPicker(seed); - LLUICtrlFactory::getInstance()->buildFloater(pickerp, "floater_choose_group.xml"); + LLFloaterGroupPicker* pickerp = getInstance(seed); + if (pickerp) pickerp->open(); + else pickerp = new LLFloaterGroupPicker(seed); return pickerp; } -LLFloaterGroupPicker::LLFloaterGroupPicker(const LLSD& seed) : - mSelectCallback(NULL), - mCallbackUserdata(NULL), - mPowersMask(GP_ALL_POWERS) +LLFloaterGroupPicker::LLFloaterGroupPicker(const LLSD& seed) +: LLFloater(), LLInstanceTracker(seed.asUUID()), + mPowersMask(GP_ALL_POWERS), + mID(seed.asUUID()) { - mID = seed.asUUID(); - sInstances.insert(std::make_pair(mID, this)); + LLUICtrlFactory::getInstance()->buildFloater(this, "floater_choose_group.xml"); } LLFloaterGroupPicker::~LLFloaterGroupPicker() { - sInstances.erase(mID); -} - -void LLFloaterGroupPicker::setSelectCallback(void (*callback)(LLUUID, void*), - void* userdata) -{ - mSelectCallback = callback; - mCallbackUserdata = userdata; } void LLFloaterGroupPicker::setPowersMask(U64 powers_mask) { mPowersMask = powers_mask; - postBuild(); + init_group_list(getChild("group list"), gAgent.getGroupID(), mPowersMask); } BOOL LLFloaterGroupPicker::postBuild() { - - const std::string none_text = getString("none"); - LLScrollListCtrl* group_list = getChild("group list"); - init_group_list(group_list, gAgent.getGroupID(), none_text, mPowersMask); + LLScrollListCtrl* list_ctrl = getChild("group list"); + if (list_ctrl) + { + init_group_list(list_ctrl, gAgent.getGroupID(), mPowersMask); + list_ctrl->setDoubleClickCallback(onBtnOK, this); + } childSetAction("OK", onBtnOK, this); @@ -135,13 +109,25 @@ BOOL LLFloaterGroupPicker::postBuild() setDefaultBtn("OK"); - group_list->setDoubleClickCallback(boost::bind(&LLFloaterGroupPicker::onBtnOK,this)); - - childEnable("OK"); + getChildView("OK")->setEnabled(TRUE); return TRUE; } +void LLFloaterGroupPicker::removeNoneOption() +{ + // Remove group "none" from list. Group "none" is added in init_group_list(). + // Some UI elements use group "none", we need to manually delete it here. + // Group "none" ID is LLUUID:null. + LLCtrlListInterface* group_list = getChild("group list")->getListInterface(); + if(group_list) + { + group_list->selectByValue(LLUUID::null); + group_list->operateOnSelection(LLCtrlListInterface::OP_DELETE); + } +} + + void LLFloaterGroupPicker::onBtnOK(void* userdata) { LLFloaterGroupPicker* self = (LLFloaterGroupPicker*)userdata; @@ -163,10 +149,7 @@ void LLFloaterGroupPicker::ok() { group_id = group_list->getCurrentID(); } - if(mSelectCallback) - { - mSelectCallback(group_id, mCallbackUserdata); - } + mGroupSelectSignal(group_id); close(); } @@ -202,38 +185,39 @@ LLPanelGroups::~LLPanelGroups() // clear the group list, and get a fresh set of info. void LLPanelGroups::reset() { - childSetTextArg("groupcount", "[COUNT]", llformat("%d",gAgent.mGroups.count())); - childSetTextArg("groupcount", "[MAX]", llformat("%d", gHippoLimits->getMaxAgentGroups())); - - const std::string none_text = getString("none"); - init_group_list(getChild("group list"), gAgent.getGroupID(), none_text); + getChild("groupcount")->setTextArg("[COUNT]", llformat("%d",gAgent.mGroups.count())); + getChild("groupcount")->setTextArg("[MAX]", llformat("%d", gHippoLimits->getMaxAgentGroups())); + + init_group_list(getChild("group list"), gAgent.getGroupID()); enableButtons(); } BOOL LLPanelGroups::postBuild() { - childSetTextArg("groupcount", "[COUNT]", llformat("%d",gAgent.mGroups.count())); - childSetTextArg("groupcount", "[MAX]", llformat("%d", gHippoLimits->getMaxAgentGroups())); + getChild("groupcount")->setTextArg("[COUNT]", llformat("%d",gAgent.mGroups.count())); + getChild("groupcount")->setTextArg("[MAX]", llformat("%d",gHippoLimits->getMaxAgentGroups())); - const std::string none_text = getString("none"); - LLScrollListCtrl *group_list = getChild("group list"); - init_group_list(group_list, gAgent.getGroupID(), none_text); - group_list->setCommitCallback(boost::bind(&LLPanelGroups::onGroupList,this)); - group_list->setSortChangedCallback(boost::bind(&LLPanelGroups::onGroupSortChanged,this)); //Force 'none' to always be first entry. - group_list->setDoubleClickCallback(boost::bind(LLGroupActions::startIM, boost::bind(&LLScrollListCtrl::getCurrentID, group_list))); + LLScrollListCtrl *list = getChild("group list"); + if (list) + { + init_group_list(list, gAgent.getGroupID()); + list->setCommitCallback(boost::bind(&LLPanelGroups::onGroupList, this)); + list->setSortChangedCallback(boost::bind(&LLPanelGroups::onGroupSortChanged,this)); //Force 'none' to always be first entry. + list->setDoubleClickCallback(boost::bind(LLGroupActions::startIM, boost::bind(&LLScrollListCtrl::getCurrentID, list))); + } - getChild("Activate")->setCommitCallback(boost::bind(LLGroupActions::activate, boost::bind(&LLScrollListCtrl::getCurrentID, group_list))); + getChild("Activate")->setCommitCallback(boost::bind(LLGroupActions::activate, boost::bind(&LLScrollListCtrl::getCurrentID, list))); - getChild("Info")->setCommitCallback(boost::bind(LLGroupActions::show, boost::bind(&LLScrollListCtrl::getCurrentID, group_list))); + getChild("Info")->setCommitCallback(boost::bind(LLGroupActions::show, boost::bind(&LLScrollListCtrl::getCurrentID, list))); - getChild("IM")->setCommitCallback(boost::bind(LLGroupActions::startIM, boost::bind(&LLScrollListCtrl::getCurrentID, group_list))); + getChild("IM")->setCommitCallback(boost::bind(LLGroupActions::startIM, boost::bind(&LLScrollListCtrl::getCurrentID, list))); - getChild("Leave")->setCommitCallback(boost::bind(LLGroupActions::leave, boost::bind(&LLScrollListCtrl::getCurrentID, group_list))); + getChild("Leave")->setCommitCallback(boost::bind(LLGroupActions::leave, boost::bind(&LLScrollListCtrl::getCurrentID, list))); getChild("Create")->setCommitCallback(boost::bind(LLGroupActions::createGroup)); getChild("Search...")->setCommitCallback(boost::bind(LLGroupActions::search)); - + childSetAction("Invite...", onBtnInvite, this); getChild("Titles...")->setCommitCallback(boost::bind(HBFloaterGroupTitles::toggle)); @@ -256,40 +240,26 @@ void LLPanelGroups::enableButtons() if(group_id != gAgent.getGroupID()) { - childEnable("Activate"); + getChildView("Activate")->setEnabled(TRUE); } else { - childDisable("Activate"); + getChildView("Activate")->setEnabled(FALSE); } if (group_id.notNull()) { - childEnable("Info"); - childEnable("IM"); - childEnable("Leave"); + getChildView("Info")->setEnabled(TRUE); + getChildView("IM")->setEnabled(TRUE); + getChildView("Leave")->setEnabled(TRUE); } else { - childDisable("Info"); - childDisable("IM"); - childDisable("Leave"); - } - if(gAgent.mGroups.count() < gHippoLimits->getMaxAgentGroups()) - { - childEnable("Create"); - } - else - { - childDisable("Create"); - } - if (group_id.notNull() && gAgent.hasPowerInGroup(group_id, GP_MEMBER_INVITE)) - { - LLPanelGroups::childEnable("Invite..."); - } - else - { - LLPanelGroups::childDisable("Invite..."); + getChildView("Info")->setEnabled(FALSE); + getChildView("IM")->setEnabled(FALSE); + getChildView("Leave")->setEnabled(FALSE); } + getChildView("Create")->setEnabled(gAgent.mGroups.count() < gHippoLimits->getMaxAgentGroups()); + getChildView("Invite...")->setEnabled(group_id.notNull() && gAgent.hasPowerInGroup(group_id, GP_MEMBER_INVITE)); } @@ -303,15 +273,11 @@ void LLPanelGroups::invite() { LLCtrlListInterface *group_list = childGetListInterface("group list"); LLUUID group_id; - - //if (group_list && (group_id = group_list->getCurrentID()).notNull()) - if (group_list) { group_id = group_list->getCurrentID(); } - - LLFloaterGroupInvite::showForGroup(group_id); + LLFloaterGroupInvite::showForGroup(group_id); } void LLPanelGroups::onGroupSortChanged() @@ -335,7 +301,7 @@ void LLPanelGroups::onGroupList() if(!item) return; - const LLUUID group_id = item->getValue().asUUID(); + const LLUUID group_id = item->getValue().asUUID(); if(group_id.isNull()) return; @@ -361,13 +327,13 @@ void LLPanelGroups::onGroupList() update_group_floaters(group_id); } -LLSD create_group_element(const LLGroupData *group_datap, const LLUUID &active_group, const std::string& none_text, const U64 &powers_mask) +LLSD create_group_element(const LLGroupData *group_datap, const LLUUID &active_group, const U64 &powers_mask) { if(group_datap && !((powers_mask == GP_ALL_POWERS) || ((group_datap->mPowers & powers_mask) != 0))) return LLSD(); const LLUUID &id = group_datap ? group_datap->mID : LLUUID::null; const bool enabled = !!group_datap; - + std::string style = (group_datap && group_datap->mListInProfile) ? "BOLD" : "NORMAL"; if(active_group == id) { @@ -377,7 +343,7 @@ LLSD create_group_element(const LLGroupData *group_datap, const LLUUID &active_g element["id"] = id; LLSD& name_column = element["columns"][0]; name_column["column"] = "name"; - name_column["value"] = group_datap ? group_datap->mName : none_text; + name_column["value"] = group_datap ? group_datap->mName : LLTrans::getString("GroupsNone"); name_column["font"] = "SANSSERIF"; name_column["font-style"] = style; @@ -402,7 +368,7 @@ LLSD create_group_element(const LLGroupData *group_datap, const LLUUID &active_g return element; } -void init_group_list(LLScrollListCtrl* ctrl, const LLUUID& highlight_id, const std::string& none_text, U64 powers_mask) +void init_group_list(LLScrollListCtrl* ctrl, const LLUUID& highlight_id, U64 powers_mask) { S32 count = gAgent.mGroups.count(); LLUUID id; @@ -417,13 +383,13 @@ void init_group_list(LLScrollListCtrl* ctrl, const LLUUID& highlight_id, const s for(S32 i = 0; i < count; ++i) { - LLSD element = create_group_element(&gAgent.mGroups.get(i), highlight_id, none_text, powers_mask); + LLSD element = create_group_element(&gAgent.mGroups.get(i), highlight_id, powers_mask); if(element.size()) group_list->addElement(element, ADD_SORTED); } // add "none" to list at top - group_list->addElement(create_group_element(NULL, highlight_id, none_text, powers_mask), ADD_TOP); + group_list->addElement(create_group_element(NULL, highlight_id, powers_mask), ADD_TOP); if(selected_id.notNull()) group_list->selectByValue(selected_id); diff --git a/indra/newview/llfloatergroups.h b/indra/newview/llfloatergroups.h index b262b3f4a..8af8e03c3 100644 --- a/indra/newview/llfloatergroups.h +++ b/indra/newview/llfloatergroups.h @@ -46,20 +46,26 @@ #include "lluuid.h" #include "llfloater.h" +#include "llinstancetracker.h" #include +#include +#include class LLUICtrl; class LLTextBox; class LLScrollListCtrl; class LLButton; -class LLFloaterGroupPicker : public LLFloater, public LLUIFactory > +class LLFloaterGroupPicker : public LLFloater, public LLInstanceTracker { - friend class LLUIFactory; public: + static LLFloaterGroupPicker* showInstance(const LLSD& seed); + LLFloaterGroupPicker(const LLSD& seed); ~LLFloaterGroupPicker(); - void setSelectCallback( void (*callback)(LLUUID, void*), - void* userdata); + + // Note: Don't return connection; use boost::bind + boost::signals2::trackable to disconnect slots + typedef boost::signals2::signal signal_t; + void setSelectGroupCallback(const signal_t::slot_type& cb) { mGroupSelectSignal.connect(cb); } void setPowersMask(U64 powers_mask); BOOL postBuild(); @@ -67,8 +73,10 @@ public: static LLFloaterGroupPicker* findInstance(const LLSD& seed); static LLFloaterGroupPicker* createInstance(const LLSD& seed); + // for cases like inviting avatar to group we don't want the none option + void removeNoneOption(); + protected: - LLFloaterGroupPicker(const LLSD& seed); void ok(); static void onBtnOK(void* userdata); static void onBtnCancel(void* userdata); @@ -76,8 +84,7 @@ protected: protected: LLUUID mID; U64 mPowersMask; - void (*mSelectCallback)(LLUUID id, void* userdata); - void* mCallbackUserdata; + signal_t mGroupSelectSignal; typedef std::map instance_map_t; static instance_map_t sInstances; diff --git a/indra/newview/llfloaterland.cpp b/indra/newview/llfloaterland.cpp index 5bd8425ea..56d974282 100644 --- a/indra/newview/llfloaterland.cpp +++ b/indra/newview/llfloaterland.cpp @@ -43,25 +43,20 @@ #include "llnotificationsutil.h" #include "llparcel.h" #include "message.h" -#include "lluserauth.h" #include "llagent.h" #include "llagentaccess.h" #include "llavataractions.h" -#include "llavatarconstants.h" //For new Online check - HgB #include "llbutton.h" #include "llcheckboxctrl.h" -#include "llradiogroup.h" #include "llcombobox.h" #include "llfloaterauction.h" #include "llfloateravatarpicker.h" #include "llfloatergroups.h" -#include "llfloatergroupinfo.h" #include "llfloaterscriptlimits.h" #include "llgroupactions.h" #include "lllineeditor.h" #include "llnamelistctrl.h" -#include "llnotify.h" #include "llpanellandaudio.h" #include "llpanellandmedia.h" #include "llradiogroup.h" @@ -222,16 +217,15 @@ void LLFloaterLand::onClose(bool app_quitting) LLFloaterLand::LLFloaterLand(const LLSD& seed) : LLFloater(std::string("floaterland"), std::string("FloaterLandRect5"), std::string("About Land")) { - LLCallbackMap::map_t factory_map; - factory_map["land_general_panel"] = LLCallbackMap(createPanelLandGeneral, this); - factory_map["land_covenant_panel"] = LLCallbackMap(createPanelLandCovenant, this); - factory_map["land_objects_panel"] = LLCallbackMap(createPanelLandObjects, this); - factory_map["land_options_panel"] = LLCallbackMap(createPanelLandOptions, this); - factory_map["land_audio_panel"] = LLCallbackMap(createPanelLandAudio, this); - factory_map["land_media_panel"] = LLCallbackMap(createPanelLandMedia, this); - factory_map["land_access_panel"] = LLCallbackMap(createPanelLandAccess, this); + mFactoryMap["land_general_panel"] = LLCallbackMap(createPanelLandGeneral, this); + mFactoryMap["land_covenant_panel"] = LLCallbackMap(createPanelLandCovenant, this); + mFactoryMap["land_objects_panel"] = LLCallbackMap(createPanelLandObjects, this); + mFactoryMap["land_options_panel"] = LLCallbackMap(createPanelLandOptions, this); + mFactoryMap["land_audio_panel"] = LLCallbackMap(createPanelLandAudio, this); + mFactoryMap["land_media_panel"] = LLCallbackMap(createPanelLandMedia, this); + mFactoryMap["land_access_panel"] = LLCallbackMap(createPanelLandAccess, this); - LLUICtrlFactory::getInstance()->buildFloater(this, "floater_about_land.xml", &factory_map, false); + LLUICtrlFactory::getInstance()->buildFloater(this, "floater_about_land.xml", &getFactoryMap(), false); sObserver = new LLParcelSelectionObserver(); LLViewerParcelMgr::getInstance()->addObserver( sObserver ); @@ -797,7 +791,7 @@ void LLPanelLandGeneral::refreshNames() mTextOwner->setText(owner); std::string group; - if(!parcel->getGroupID().isNull()) + if (!parcel->getGroupID().isNull()) { gCacheName->getGroupName(parcel->getGroupID(), group); } @@ -823,7 +817,6 @@ void LLPanelLandGeneral::refreshNames() // virtual void LLPanelLandGeneral::draw() { - //refreshNames(); LLPanel::draw(); } @@ -834,7 +827,7 @@ void LLPanelLandGeneral::onClickSetGroup() LLFloaterGroupPicker* fg = LLFloaterGroupPicker::showInstance(LLSD(gAgent.getID())); if (fg) { - fg->setSelectCallback( cbGroupID, this); + fg->setSelectGroupCallback( boost::bind(&LLPanelLandGeneral::setGroup, this, _1 )); if (parent_floater) { LLRect new_rect = gFloaterView->findNeighboringPosition(parent_floater, fg); @@ -868,13 +861,6 @@ void LLPanelLandGeneral::onClickProfile() } } -// static -void LLPanelLandGeneral::cbGroupID(LLUUID group_id, void* userdata) -{ - LLPanelLandGeneral* self = (LLPanelLandGeneral*)userdata; - self->setGroup(group_id); -} - // public void LLPanelLandGeneral::setGroup(const LLUUID& group_id) { @@ -1129,7 +1115,6 @@ BOOL LLPanelLandObjects::postBuild() mCleanOtherObjectsTime->setFocusLostCallback(boost::bind(&LLPanelLandObjects::onLostFocus, _1, this)); mCleanOtherObjectsTime->setCommitCallback(onCommitClean, this); - mCleanOtherObjectsTime->setPrevalidate(LLLineEditor::prevalidateNonNegativeS32); mBtnRefresh = getChild("Refresh List"); @@ -1887,7 +1872,6 @@ BOOL LLPanelLandOptions::postBuild() childSetCommitCallback("check landmark", onCommitAny, this); mCheckLandmark->setVisible(!gHippoGridManager->getConnectedGrid()->isSecondLife()); - mCheckGroupScripts = getChild( "check group scripts"); childSetCommitCallback("check group scripts", onCommitAny, this); @@ -2453,11 +2437,15 @@ BOOL LLPanelLandAccess::postBuild() mListAccess = getChild("AccessList"); if (mListAccess) + { mListAccess->sortByColumnIndex(0, TRUE); // ascending + } mListBanned = getChild("BannedList"); if (mListBanned) + { mListBanned->sortByColumnIndex(0, TRUE); // ascending + } return TRUE; } @@ -2970,10 +2958,7 @@ void LLPanelLandCovenant::refresh() } LLTextBox* region_landtype = getChild("region_landtype_text"); - if (region_landtype) - { - region_landtype->setText(region->getLocalizedSimProductName()); - } + region_landtype->setText(region->getLocalizedSimProductName()); LLTextBox* region_maturity = getChild("region_maturity_text"); if (region_maturity) @@ -3023,11 +3008,8 @@ void LLPanelLandCovenant::updateCovenantText(const std::string &string) if (self) { LLViewerTextEditor* editor = self->getChild("covenant_editor"); - if (editor) - { - editor->setHandleEditKeysDirectly(TRUE); - editor->setText(string); - } + editor->setHandleEditKeysDirectly(TRUE); + editor->setText(string); } } diff --git a/indra/newview/llfloaterland.h b/indra/newview/llfloaterland.h index 4dd7b962b..7c7316513 100644 --- a/indra/newview/llfloaterland.h +++ b/indra/newview/llfloaterland.h @@ -152,7 +152,6 @@ public: void onClickProfile(); void onClickSetGroup(); static void onClickInfoGroup(void*); - static void cbGroupID(LLUUID group_id, void* userdata); static void onClickDeed(void*); static void onClickBuyLand(void* data); static void onClickScriptLimits(void* data); diff --git a/indra/newview/llfloaterregioninfo.cpp b/indra/newview/llfloaterregioninfo.cpp index 8719cf98f..d8e7fadd4 100644 --- a/indra/newview/llfloaterregioninfo.cpp +++ b/indra/newview/llfloaterregioninfo.cpp @@ -355,7 +355,7 @@ void LLFloaterRegionInfo::processRegionInfo(LLMessageSystem* msg) // extract message std::string sim_name; std::string sim_type = LLTrans::getString("land_type_unknown"); - U32 region_flags; + U64 region_flags; U8 agent_limit; F32 object_bonus_factor; U8 sim_access; @@ -365,7 +365,6 @@ void LLFloaterRegionInfo::processRegionInfo(LLMessageSystem* msg) BOOL use_estate_sun; F32 sun_hour; msg->getString("RegionInfo", "SimName", sim_name); - msg->getU32("RegionInfo", "RegionFlags", region_flags); msg->getU8("RegionInfo", "MaxAgents", agent_limit); msg->getF32("RegionInfo", "ObjectBonusFactor", object_bonus_factor); msg->getU8("RegionInfo", "SimAccess", sim_access); @@ -384,6 +383,17 @@ void LLFloaterRegionInfo::processRegionInfo(LLMessageSystem* msg) LLTrans::findString(sim_type, sim_type); // try localizing sim product name } + if (msg->has(_PREHASH_RegionInfo3)) + { + msg->getU64("RegionInfo3", "RegionFlagsExtended", region_flags); + } + else + { + U32 flags = 0; + msg->getU32("RegionInfo", "RegionFlags", flags); + region_flags = flags; + } + // Disable Environment Tab when not supported if (region) { @@ -1497,7 +1507,8 @@ bool LLPanelEstateInfo::addAllowedGroup(const LLSD& notification, const LLSD& re LLFloaterGroupPicker* widget = LLFloaterGroupPicker::showInstance(LLSD(gAgent.getID())); if (widget) { - widget->setSelectCallback(addAllowedGroup2, NULL); + widget->removeNoneOption(); + widget->setSelectGroupCallback(boost::bind(&LLPanelEstateInfo::addAllowedGroup2, this, _1)); if (parent_floater) { LLRect new_rect = gFloaterView->findNeighboringPosition(parent_floater, widget); @@ -1687,9 +1698,8 @@ struct LLEstateAccessChangeInfo uuid_vec_t mAgentOrGroupIDs; // List of agent IDs to apply to this change }; -// static // Special case callback for groups, since it has different callback format than names -void LLPanelEstateInfo::addAllowedGroup2(LLUUID id, void*) +void LLPanelEstateInfo::addAllowedGroup2(LLUUID id) { LLSD payload; payload["operation"] = (S32)ESTATE_ACCESS_ALLOWED_GROUP_ADD; @@ -2343,8 +2353,8 @@ public: // if we get an error response /*virtual*/ void error(U32 status, const std::string& reason) { - llinfos << "LLEstateChangeInfoResponder::error " - << status << ": " << reason << llendl; + llinfos << "LLEstateChangeInfoResponder::error [status:" + << status << "]: " << reason << llendl; } /*virtual*/ AIHTTPTimeoutPolicy const& getHTTPTimeoutPolicy(void) const { return estateChangeInfoResponder_timeout; } @@ -2702,7 +2712,7 @@ BOOL LLPanelEstateCovenant::sendUpdate() return TRUE; } -const std::string& LLPanelEstateCovenant::getEstateName() const +std::string LLPanelEstateCovenant::getEstateName() const { return mEstateNameText->getText(); } @@ -2753,7 +2763,7 @@ void LLPanelEstateCovenant::updateEstateOwnerName(const std::string& name) } } -const std::string& LLPanelEstateCovenant::getOwnerName() const +std::string LLPanelEstateCovenant::getOwnerName() const { return mEstateOwnerText->getText(); } diff --git a/indra/newview/llfloaterregioninfo.h b/indra/newview/llfloaterregioninfo.h index f81ec930b..00c672b9d 100644 --- a/indra/newview/llfloaterregioninfo.h +++ b/indra/newview/llfloaterregioninfo.h @@ -229,7 +229,7 @@ public: virtual BOOL postBuild(); // LLPanel virtual bool refreshFromRegion(LLViewerRegion* region); // refresh local settings from region update from simulator - + BOOL validateTextureSizes(); protected: @@ -273,7 +273,7 @@ public: // Group picker callback is different, can't use core methods below bool addAllowedGroup(const LLSD& notification, const LLSD& response); - static void addAllowedGroup2(LLUUID id, void*); + void addAllowedGroup2(LLUUID id); // Core methods for all above add/remove button clicks static void accessAddCore(U32 operation_flag, const std::string& dialog_name); @@ -309,7 +309,7 @@ public: virtual BOOL postBuild(); virtual void updateChild(LLUICtrl* child_ctrl); virtual void refresh(); - + void refreshFromEstate(); static bool isLindenEstate(); @@ -369,9 +369,9 @@ public: const LLUUID& getCovenantID() const { return mCovenantID; } void setCovenantID(const LLUUID& id) { mCovenantID = id; } - const std::string& getEstateName() const; + std::string getEstateName() const; void setEstateName(const std::string& name); - const std::string& getOwnerName() const; + std::string getOwnerName() const; void setOwnerName(const std::string& name); void setCovenantTextEditor(const std::string& text); diff --git a/indra/newview/llpanelpermissions.cpp b/indra/newview/llpanelpermissions.cpp index 9d1df930c..9f3414448 100644 --- a/indra/newview/llpanelpermissions.cpp +++ b/indra/newview/llpanelpermissions.cpp @@ -381,16 +381,25 @@ void LLPanelPermissions::refresh() // Update creator text field getChildView("Creator:")->setEnabled(TRUE); +// [RLVa:KB] - Checked: 2010-11-02 (RLVa-1.2.2a) | Modified: RLVa-1.2.2a + BOOL creators_identical = FALSE; +// [/RLVa:KB] std::string creator_name; - bool creators_identical = LLSelectMgr::getInstance()->selectGetCreator(mCreatorID, creator_name); +// [RLVa:KB] - Checked: 2010-11-02 (RLVa-1.2.2a) | Modified: RLVa-1.2.2a + creators_identical = LLSelectMgr::getInstance()->selectGetCreator(mCreatorID, creator_name); +// [/RLVa:KB] +// LLSelectMgr::getInstance()->selectGetCreator(mCreatorID, creator_name); - getChild("Creator Name")->setValue(creator_name); - getChildView("Creator Name")->setEnabled(TRUE); - getChildView("button creator profile")->setEnabled(creators_identical && mCreatorID.notNull()); +// getChild("Creator Name")->setValue(creator_name); +// getChildView("Creator Name")->setEnabled(TRUE); +// [RLVa:KB] - Moved further down to avoid an annoying flicker when the text is set twice in a row // Update owner text field getChildView("Owner:")->setEnabled(TRUE); + // Update last owner text field + getChildView("Last Owner:")->setEnabled(TRUE); + std::string owner_name; const BOOL owners_identical = LLSelectMgr::getInstance()->selectGetOwner(mOwnerID, owner_name); @@ -419,31 +428,52 @@ void LLPanelPermissions::refresh() } } } +// getChild("Owner Name")->setValue(owner_name); +// getChildView("Owner Name")->setEnabled(TRUE); +// [RLVa:KB] - Moved further down to avoid an annoying flicker when the text is set twice in a row -// [RLVa:KB] - Checked: 2009-07-08 (RLVa-1.0.0e) +// [RLVa:KB] - Checked: 2010-11-02 (RLVa-1.2.2a) | Modified: RLVa-1.2.2a bool fRlvEnableOwner = true; - if ( (rlv_handler_t::isEnabled()) && (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) ) + bool fRlvEnableCreator = true; + bool fRlvEnableLastOwner = true; + if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) { - // Only filter the owner name if: the selection is all owned by the same avie and not group owned - if ( (owners_identical) && (!LLSelectMgr::getInstance()->selectIsGroupOwned()) ) + // Only anonymize the creator if all of the selection was created by the same avie who's also the owner or they're a nearby avie + if ( (creators_identical) && (mCreatorID != gAgent.getID()) && ((mCreatorID == mOwnerID) || (RlvUtil::isNearbyAgent(mCreatorID))) ) + { + creator_name = RlvStrings::getAnonym(creator_name); + fRlvEnableOwner = false; + } + + // Only anonymize the owner name if all of the selection is owned by the same avie and isn't group owned + if ( (owners_identical) && (!LLSelectMgr::getInstance()->selectIsGroupOwned()) && (mOwnerID != gAgent.getID()) ) { owner_name = RlvStrings::getAnonym(owner_name); - fRlvEnableOwner = false; + fRlvEnableCreator = false; + } + + if (RlvUtil::isNearbyAgent(mLastOwnerID)) + { + creator_name = RlvStrings::getAnonym(creator_name); + fRlvEnableLastOwner = false; } } // [/RLVa:KB] + getChild("Creator Name")->setValue(creator_name); + getChildView("Creator Name")->setEnabled(TRUE); getChild("Owner Name")->setValue(owner_name); getChildView("Owner Name")->setEnabled(TRUE); // childSetEnabled("button owner profile",owners_identical && (mOwnerID.notNull() || LLSelectMgr::getInstance()->selectIsGroupOwned())); +// getChildView("button last owner profile")->setEnabled(owners_identical && mLastOwnerID.notNull()); // [RLVa:KB] - Checked: 2009-07-08 (RLVa-1.0.0e) - childSetEnabled("button owner profile", - fRlvEnableOwner && owners_identical && (mOwnerID.notNull() || LLSelectMgr::getInstance()->selectIsGroupOwned())); + getChildView("button owner profile")->setEnabled(fRlvEnableOwner && owners_identical && (mOwnerID.notNull() || LLSelectMgr::getInstance()->selectIsGroupOwned())); + getChildView("button creator profile")->setEnabled(fRlvEnableCreator && creators_identical && mCreatorID.notNull()); + getChildView("button last owner profile")->setEnabled(fRlvEnableLastOwner && owners_identical && mLastOwnerID.notNull()); // [/RLVa:KB] getChild("Last Owner Name")->setValue(last_owner_name); getChildView("Last Owner Name")->setEnabled(TRUE); - getChildView("button last owner profile")->setEnabled(owners_identical && mLastOwnerID.notNull()); // update group text field getChildView("Group:")->setEnabled(TRUE); @@ -620,12 +650,10 @@ void LLPanelPermissions::refresh() BOOL valid_base_perms = LLSelectMgr::getInstance()->selectGetPerm(PERM_BASE, &base_mask_on, &base_mask_off); - //BOOL valid_owner_perms =// LLSelectMgr::getInstance()->selectGetPerm(PERM_OWNER, &owner_mask_on, &owner_mask_off); - BOOL valid_group_perms = LLSelectMgr::getInstance()->selectGetPerm(PERM_GROUP, &group_mask_on, &group_mask_off); @@ -1037,10 +1065,9 @@ void LLPanelPermissions::onClickGroup() if(owners_identical && (owner_id == gAgent.getID())) { LLFloaterGroupPicker* fg = LLFloaterGroupPicker::showInstance(LLSD(gAgent.getID())); - if (fg) { - fg->setSelectCallback( cbGroupID, this ); + fg->setSelectGroupCallback( boost::bind(&LLPanelPermissions::cbGroupID, this, _1) ); if (parent_floater) { @@ -1059,13 +1086,11 @@ void LLPanelPermissions::onClickOpenGroup() LLGroupActions::show(group_id); } -// static -void LLPanelPermissions::cbGroupID(LLUUID group_id, void* userdata) +void LLPanelPermissions::cbGroupID(LLUUID group_id) { - LLPanelPermissions* self = (LLPanelPermissions*)userdata; - if(self->mLabelGroupName) + if(mLabelGroupName) { - self->mLabelGroupName->setNameID(group_id, TRUE); + mLabelGroupName->setNameID(group_id, TRUE); } LLSelectMgr::getInstance()->sendGroup(group_id); } diff --git a/indra/newview/llpanelpermissions.h b/indra/newview/llpanelpermissions.h index da87e1196..58b6dbac9 100644 --- a/indra/newview/llpanelpermissions.h +++ b/indra/newview/llpanelpermissions.h @@ -63,7 +63,7 @@ protected: void onClickLastOwner(); void onClickGroup(); static void onClickOpenGroup(); - static void cbGroupID(LLUUID group_id, void* userdata); + void cbGroupID(LLUUID group_id); static void onClickDeedToGroup(void*); static void onClickCopyObjKey(); diff --git a/indra/newview/skins/default/xui/de/floater_choose_group.xml b/indra/newview/skins/default/xui/de/floater_choose_group.xml index 0c6ae13f4..4dd2947a5 100644 --- a/indra/newview/skins/default/xui/de/floater_choose_group.xml +++ b/indra/newview/skins/default/xui/de/floater_choose_group.xml @@ -4,5 +4,4 @@