From 1b68f71348ecf3983b76b40d7940da8377f049b7 Mon Sep 17 00:00:00 2001 From: Andrey Lihatskiy Date: Mon, 29 Apr 2024 07:43:28 +0300 Subject: #824 Process source files in bulk: replace tabs with spaces, convert CRLF to LF, and trim trailing whitespaces as needed --- indra/newview/llfloaterexperienceprofile.cpp | 188 +++++++++++++-------------- 1 file changed, 94 insertions(+), 94 deletions(-) (limited to 'indra/newview/llfloaterexperienceprofile.cpp') diff --git a/indra/newview/llfloaterexperienceprofile.cpp b/indra/newview/llfloaterexperienceprofile.cpp index f6afdd29fb..0966eaa1bf 100644 --- a/indra/newview/llfloaterexperienceprofile.cpp +++ b/indra/newview/llfloaterexperienceprofile.cpp @@ -1,25 +1,25 @@ -/** +/** * @file llfloaterexperienceprofile.cpp * @brief llfloaterexperienceprofile and related class definitions * * $LicenseInfo:firstyear=2013&license=viewerlgpl$ * Second Life Viewer Source Code * Copyright (C) 2013, 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$ */ @@ -147,8 +147,8 @@ BOOL LLFloaterExperienceProfile::postBuild() { LLExperienceCache::instance().fetch(mExperienceId, true); LLExperienceCache::instance().get(mExperienceId, boost::bind(&LLFloaterExperienceProfile::experienceCallback, - getDerivedHandle(), _1)); - + getDerivedHandle(), _1)); + LLViewerRegion* region = gAgent.getRegion(); if (region) { @@ -162,17 +162,17 @@ 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_SET_GROUP, boost::bind(&LLFloaterExperienceProfile::onPickGroup, this)); - childSetAction(BTN_REPORT, boost::bind(&LLFloaterExperienceProfile::onReportExperience, 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)); + childSetAction(BTN_REPORT, boost::bind(&LLFloaterExperienceProfile::onReportExperience, this)); getChild(EDIT TF_DESC)->setKeystrokeCallback(boost::bind(&LLFloaterExperienceProfile::onFieldChanged, this)); getChild(EDIT TF_MATURITY)->setCommitCallback(boost::bind(&LLFloaterExperienceProfile::onFieldChanged, this)); getChild(EDIT TF_MRKT)->setKeystrokeCallback(boost::bind(&LLFloaterExperienceProfile::onFieldChanged, this), NULL); getChild(EDIT TF_NAME)->setKeystrokeCallback(boost::bind(&LLFloaterExperienceProfile::onFieldChanged, this), NULL); - + childSetCommitCallback(EDIT BTN_ENABLE, boost::bind(&LLFloaterExperienceProfile::onFieldChanged, this), NULL); childSetCommitCallback(EDIT BTN_PRIVATE, boost::bind(&LLFloaterExperienceProfile::onFieldChanged, this), NULL); @@ -181,7 +181,7 @@ BOOL LLFloaterExperienceProfile::postBuild() getChild(EDIT TF_DESC)->setCommitOnFocusLost(TRUE); - LLEventPumps::instance().obtain("experience_permission").listen(mExperienceId.asString()+"-profile", + LLEventPumps::instance().obtain("experience_permission").listen(mExperienceId.asString()+"-profile", boost::bind(&LLFloaterExperienceProfile::experiencePermission, getDerivedHandle(this), _1)); if (mPostEdit && mExperienceId.notNull()) @@ -296,7 +296,7 @@ bool LLFloaterExperienceProfile::setMaturityString( U8 maturity, LLTextBox* chil child->appendImageSegment(style); child->appendText(access, false); - + return true; } @@ -310,8 +310,8 @@ void LLFloaterExperienceProfile::refreshExperience( const LLSD& experience ) LLLayoutPanel* imagePanel = getChild(PNL_IMAGE); LLLayoutPanel* descriptionPanel = getChild(PNL_DESC); LLLayoutPanel* locationPanel = getChild(PNL_LOC); - LLLayoutPanel* marketplacePanel = getChild(PNL_MRKT); - LLLayoutPanel* topPanel = getChild(PNL_TOP); + LLLayoutPanel* marketplacePanel = getChild(PNL_MRKT); + LLLayoutPanel* topPanel = getChild(PNL_TOP); imagePanel->setVisible(FALSE); @@ -323,11 +323,11 @@ void LLFloaterExperienceProfile::refreshExperience( const LLSD& experience ) LLTextBox* child = getChild(TF_NAME); //child->setText(experience[LLExperienceCache::NAME].asString()); - child->setText(LLSLURL("experience", experience[LLExperienceCache::EXPERIENCE_ID], "profile").getSLURLString()); - + child->setText(LLSLURL("experience", experience[LLExperienceCache::EXPERIENCE_ID], "profile").getSLURLString()); + LLLineEditor* linechild = getChild(EDIT TF_NAME); linechild->setText(experience[LLExperienceCache::NAME].asString()); - + std::string value = experience[LLExperienceCache::DESCRIPTION].asString(); LLExpandableTextBox* exchild = getChild(TF_DESC); exchild->setText(value); @@ -335,7 +335,7 @@ void LLFloaterExperienceProfile::refreshExperience( const LLSD& experience ) LLTextEditor* edit_child = getChild(EDIT TF_DESC); edit_child->setText(value); - + mLocationSLURL = experience[LLExperienceCache::SLURL].asString(); child = getChild(TF_SLURL); bool has_slurl = mLocationSLURL.length()>0; @@ -353,7 +353,7 @@ void LLFloaterExperienceProfile::refreshExperience( const LLSD& experience ) { child->setText(getString("empty_slurl")); } - + setMaturityString((U8)(experience[LLExperienceCache::MATURITY].asInteger()), getChild(TF_MATURITY), getChild(EDIT TF_MATURITY)); LLUUID id = experience[LLExperienceCache::AGENT_ID].asUUID(); @@ -363,22 +363,22 @@ void LLFloaterExperienceProfile::refreshExperience( const LLSD& experience ) id = experience[LLExperienceCache::GROUP_ID].asUUID(); - bool id_null = id.isNull(); + bool id_null = id.isNull(); child = getChild(TF_GROUP); value = LLSLURL("group", id, "inspect").getSLURLString(); child->setText(value); getChild(PNL_GROUP)->setVisible(!id_null); - setEditGroup(id); + setEditGroup(id); + + getChild(BTN_SET_GROUP)->setEnabled(experience[LLExperienceCache::AGENT_ID].asUUID() == gAgent.getID()); - getChild(BTN_SET_GROUP)->setEnabled(experience[LLExperienceCache::AGENT_ID].asUUID() == gAgent.getID()); - LLCheckBoxCtrl* enable = getChild(EDIT BTN_ENABLE); S32 properties = mExperienceDetails[LLExperienceCache::PROPERTIES].asInteger(); - enable->set(!(properties & LLExperienceCache::PROPERTY_DISABLED)); + enable->set(!(properties & LLExperienceCache::PROPERTY_DISABLED)); enable = getChild(EDIT BTN_PRIVATE); - enable->set(properties & LLExperienceCache::PROPERTY_PRIVATE); + enable->set(properties & LLExperienceCache::PROPERTY_PRIVATE); topPanel->setVisible(TRUE); child=getChild(TF_GRID_WIDE); @@ -388,15 +388,15 @@ void LLFloaterExperienceProfile::refreshExperience( const LLSD& experience ) { child->setText(LLTrans::getString("Grid-Scope")); } - else - { + else + { child->setText(LLTrans::getString("Land-Scope")); - } + } - if(getChild(BTN_EDIT)->getVisible()) - { - topPanel->setVisible(TRUE); - } + if(getChild(BTN_EDIT)->getVisible()) + { + topPanel->setVisible(TRUE); + } if(properties & LLExperienceCache::PROPERTY_PRIVILEGED) { @@ -412,11 +412,11 @@ void LLFloaterExperienceProfile::refreshExperience( const LLSD& experience ) &LLFloaterExperienceProfile::experiencePermissionResults, mExperienceId, _1)); } } - + value=experience[LLExperienceCache::METADATA].asString(); if(value.empty()) return; - + LLPointer parser = new LLSDXMLParser(); LLSD data; @@ -444,7 +444,7 @@ void LLFloaterExperienceProfile::refreshExperience( const LLSD& experience ) { marketplacePanel->setVisible(FALSE); } - + linechild = getChild(EDIT TF_MRKT); linechild->setText(value); @@ -510,10 +510,10 @@ void LLFloaterExperienceProfile::onFieldChanged() { updatePackage(); - if(!getChild(BTN_EDIT)->getVisible()) - { - return; - } + if(!getChild(BTN_EDIT)->getVisible()) + { + return; + } LLSD::map_const_iterator st = mExperienceDetails.beginMap(); LLSD::map_const_iterator dt = mPackage.beginMap(); @@ -590,7 +590,7 @@ void LLFloaterExperienceProfile::doSave( int success_action ) return; LLExperienceCache::instance().updateExperience(mPackage, boost::bind( - &LLFloaterExperienceProfile::experienceUpdateResult, + &LLFloaterExperienceProfile::experienceUpdateResult, getDerivedHandle(), _1)); } @@ -598,34 +598,34 @@ void LLFloaterExperienceProfile::onSaveComplete( const LLSD& content ) { LLUUID id = getExperienceId(); - if(content.has("removed")) - { - const LLSD& removed = content["removed"]; - LLSD::map_const_iterator it = removed.beginMap(); - for(/**/; it != removed.endMap(); ++it) - { - const std::string& field = it->first; - if(field == LLExperienceCache::EXPERIENCE_ID) - { - //this message should be removed by the experience api - continue; - } - const LLSD& data = it->second; - std::string error_tag = data["error_tag"].asString()+ "ExperienceProfileMessage"; - LLSD fields; - if( LLNotifications::instance().getTemplate(error_tag)) - { - fields["field"] = field; - fields["extra_info"] = data["extra_info"]; - LLNotificationsUtil::add(error_tag, fields); - } - else - { - fields["MESSAGE"]=data["en"]; - LLNotificationsUtil::add("GenericAlert", fields); - } - } - } + if(content.has("removed")) + { + const LLSD& removed = content["removed"]; + LLSD::map_const_iterator it = removed.beginMap(); + for(/**/; it != removed.endMap(); ++it) + { + const std::string& field = it->first; + if(field == LLExperienceCache::EXPERIENCE_ID) + { + //this message should be removed by the experience api + continue; + } + const LLSD& data = it->second; + std::string error_tag = data["error_tag"].asString()+ "ExperienceProfileMessage"; + LLSD fields; + if( LLNotifications::instance().getTemplate(error_tag)) + { + fields["field"] = field; + fields["extra_info"] = data["extra_info"]; + LLNotificationsUtil::add(error_tag, fields); + } + else + { + fields["MESSAGE"]=data["en"]; + LLNotificationsUtil::add("GenericAlert", fields); + } + } + } if(!content.has("experience_keys")) { @@ -647,7 +647,7 @@ void LLFloaterExperienceProfile::onSaveComplete( const LLSD& content ) LL_WARNS() << "LLFloaterExperienceProfile::onSaveComplete called with unexpected experience id" << LL_ENDL; return; } - + refreshExperience(*it); LLExperienceCache::instance().insert(*it); LLExperienceCache::instance().fetch(id, true); @@ -660,7 +660,7 @@ void LLFloaterExperienceProfile::onSaveComplete( const LLSD& content ) else if(mSaveCompleteAction == CLOSE) { closeFloater(); - } + } } void LLFloaterExperienceProfile::changeToView() @@ -692,7 +692,7 @@ void LLFloaterExperienceProfile::onClickLocation() if(region) { LLTextBox* child = getChild(EDIT TF_SLURL); - mLocationSLURL = LLSLURL(region->getName(), gAgent.getPositionGlobal()).getSLURLString(); + mLocationSLURL = LLSLURL(region->getName(), gAgent.getPositionGlobal()).getSLURLString(); child->setText(mLocationSLURL); onFieldChanged(); } @@ -701,7 +701,7 @@ void LLFloaterExperienceProfile::onClickLocation() void LLFloaterExperienceProfile::onClickClear() { LLTextBox* child = getChild(EDIT TF_SLURL); - mLocationSLURL = ""; + mLocationSLURL = ""; child->setText(getString("empty_slurl")); onFieldChanged(); } @@ -781,7 +781,7 @@ void LLFloaterExperienceProfile::updatePackage() { mPackage[LLExperienceCache::NAME] = getChild(EDIT TF_NAME)->getText(); mPackage[LLExperienceCache::DESCRIPTION] = getChild(EDIT TF_DESC)->getText(); - if(mLocationSLURL.empty()) + if(mLocationSLURL.empty()) { mPackage[LLExperienceCache::SLURL] = LLStringUtil::null; } @@ -831,33 +831,33 @@ void LLFloaterExperienceProfile::updatePackage() void LLFloaterExperienceProfile::onPickGroup() { - LLFloater* parent_floater = gFloaterView->getParentFloater(this); + LLFloater* parent_floater = gFloaterView->getParentFloater(this); - LLFloaterGroupPicker* widget = LLFloaterReg::showTypedInstance("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); - } - } + LLFloaterGroupPicker* widget = LLFloaterReg::showTypedInstance("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(EDIT TF_GROUP); - std::string value = LLSLURL("group", group_id, "inspect").getSLURLString(); - child->setText(value); - mPackage[LLExperienceCache::GROUP_ID] = group_id; - onFieldChanged(); + LLTextBox* child = getChild(EDIT TF_GROUP); + std::string value = LLSLURL("group", group_id, "inspect").getSLURLString(); + child->setText(value); + mPackage[LLExperienceCache::GROUP_ID] = group_id; + onFieldChanged(); } void LLFloaterExperienceProfile::onReportExperience() { - LLFloaterReporter::showFromExperience(mExperienceId); + LLFloaterReporter::showFromExperience(mExperienceId); } /*static*/ -- cgit v1.2.3