diff --git a/indra/llcommon/CMakeLists.txt b/indra/llcommon/CMakeLists.txt index ab14d3794b3f59ae296479cd2d4eb29acd431cf1..a6353d512ffd34633a023151b65001cf4155a3fe 100755 --- a/indra/llcommon/CMakeLists.txt +++ b/indra/llcommon/CMakeLists.txt @@ -124,7 +124,6 @@ set(llcommon_SOURCE_FILES set(llcommon_HEADER_FILES CMakeLists.txt - ctype_workaround.h fix_macros.h indra_constants.h is_approx_equal_fraction.h @@ -236,8 +235,6 @@ set(llcommon_HEADER_FILES lluri.h lluriparser.h lluuid.h - llwin32headers.h - llwin32headerslean.h llworkerthread.h stdtypes.h stringize.h @@ -245,6 +242,10 @@ set(llcommon_HEADER_FILES u64.h ) +if (WINDOWS) + list(APPEND llcommon_HEADER_FILES llwin32headers.h llwin32headerslean.h) +endif (WINDOWS) + if (DARWIN) list(APPEND llcommon_HEADER_FILES llsys_objc.h) list(APPEND llcommon_SOURCE_FILES llsys_objc.mm) diff --git a/indra/llcommon/ctype_workaround.h b/indra/llcommon/ctype_workaround.h deleted file mode 100755 index 552be9fb90483ad6bef33b2ce540437bc6b242da..0000000000000000000000000000000000000000 --- a/indra/llcommon/ctype_workaround.h +++ /dev/null @@ -1,54 +0,0 @@ -/** - * @file ctype_workaround.h - * @brief The workaround is to create some legacy symbols that point - * to the correct symbols, which avoids link errors. - * - * $LicenseInfo:firstyear=2006&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2010, 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 _CTYPE_WORKAROUND_H_ -#define _CTYPE_WORKAROUND_H_ - -/** - * the CTYPE_WORKAROUND is needed for linux dev stations that don't - * have the broken libc6 packages needed by our out-of-date static - * libs (such as libcrypto and libcurl). - * - * -- Leviathan 20060113 -*/ - -#include <cctype> - -__const unsigned short int *__ctype_b; -__const __int32_t *__ctype_tolower; -__const __int32_t *__ctype_toupper; - -// call this function at the beginning of main() -void ctype_workaround() -{ - __ctype_b = *(__ctype_b_loc()); - __ctype_toupper = *(__ctype_toupper_loc()); - __ctype_tolower = *(__ctype_tolower_loc()); -} - -#endif - diff --git a/indra/llcommon/llhandle.h b/indra/llcommon/llhandle.h index 3072d2edbfc75d05afac4e00a6d58e50102f70bd..b11c39acb18e9edc384cc398f1c29893e28e4b27 100755 --- a/indra/llcommon/llhandle.h +++ b/indra/llcommon/llhandle.h @@ -28,7 +28,6 @@ #define LLHANDLE_H #include "llpointer.h" -#include <boost/utility/enable_if.hpp> /** * Helper object for LLHandle. Don't instantiate these directly, used @@ -85,7 +84,7 @@ public: LLHandle() : mTombStone(getDefaultTombStone()) {} template<typename U> - LLHandle(const LLHandle<U>& other, typename boost::enable_if< typename std::is_convertible<U*, T*> >::type* dummy = 0) + LLHandle(const LLHandle<U>& other, typename std::enable_if<std::is_convertible<U*, T*>::value>::type* dummy = nullptr) : mTombStone(other.mTombStone) {} @@ -194,7 +193,7 @@ public: } template <typename U> - LLHandle<U> getDerivedHandle(typename boost::enable_if< typename std::is_convertible<U*, T*> >::type* dummy = 0) const + LLHandle<U> getDerivedHandle(typename std::enable_if<std::is_convertible<U*, T*>::value>::type* dummy = nullptr) const { LLHandle<U> downcast_handle; downcast_handle.mTombStone = getHandle().mTombStone; diff --git a/indra/llcommon/llinitparam.h b/indra/llcommon/llinitparam.h index 23e95bc0519b3e0cd4b0bfc950f005e52f01bb93..81d610f877c30a00779e27c5686dce4ccbdca83f 100755 --- a/indra/llcommon/llinitparam.h +++ b/indra/llcommon/llinitparam.h @@ -493,7 +493,7 @@ namespace LLInitParam virtual ~Parser(); - template <typename T> bool readValue(T& param, typename boost::disable_if<std::is_enum<T> >::type* dummy = 0) + template <typename T> bool readValue(T& param, typename std::enable_if<!std::is_enum<T>::value>::type* dummy = 0) { parser_read_func_map_t::iterator found_it = mParserReadFuncs->find(&typeid(T)); if (found_it != mParserReadFuncs->end()) @@ -504,7 +504,7 @@ namespace LLInitParam return false; } - template <typename T> bool readValue(T& param, typename boost::enable_if<std::is_enum<T> >::type* dummy = 0) + template <typename T> bool readValue(T& param, typename std::enable_if<std::is_enum<T>::value>::type* dummy = nullptr) { parser_read_func_map_t::iterator found_it = mParserReadFuncs->find(&typeid(T)); if (found_it != mParserReadFuncs->end()) diff --git a/indra/llcommon/llptrto.h b/indra/llcommon/llptrto.h index 507e6845ec79a8deaaaef7d4ed21c55aa5e6bbea..77517cc75fa7567506c6cce19f62c346edea622c 100755 --- a/indra/llcommon/llptrto.h +++ b/indra/llcommon/llptrto.h @@ -34,7 +34,6 @@ #include <type_traits> #include "llpointer.h" #include "llrefcount.h" // LLRefCount -#include <boost/utility/enable_if.hpp> /** * LLPtrTo<TARGET>::type is either of two things: @@ -46,7 +45,7 @@ * This way, a class template can use LLPtrTo<TARGET>::type to select an * appropriate pointer type to store. */ -template <class T, class ENABLE=void> +template <class T, class ENABLE = void> struct LLPtrTo { typedef T* type; @@ -54,14 +53,14 @@ struct LLPtrTo /// specialize for subclasses of LLRefCount template <class T> -struct LLPtrTo<T, typename boost::enable_if< std::is_base_of<LLRefCount, T> >::type> +struct LLPtrTo<T, typename std::enable_if< std::is_base_of<LLRefCount, T>::value>::type> { typedef LLPointer<T> type; }; /// specialize for subclasses of LLThreadSafeRefCount template <class T> -struct LLPtrTo<T, typename boost::enable_if< std::is_base_of<LLThreadSafeRefCount, T> >::type> +struct LLPtrTo<T, typename std::enable_if< std::is_base_of<LLThreadSafeRefCount, T>::value>::type> { typedef LLPointer<T> type; }; diff --git a/indra/llcommon/llsys.cpp b/indra/llcommon/llsys.cpp index f443a352d95f844e902dfce56e51c3501707ec6c..26202322c8a447ddc8871c5514cab030df8b7d0e 100755 --- a/indra/llcommon/llsys.cpp +++ b/indra/llcommon/llsys.cpp @@ -49,7 +49,6 @@ #include <boost/circular_buffer.hpp> #include <boost/regex.hpp> #include <boost/lexical_cast.hpp> -#include <boost/utility/enable_if.hpp> using namespace llsd; @@ -631,7 +630,7 @@ public: // Store every integer type as LLSD::Integer. template <class T> void add(const LLSD::String& name, const T& value, - typename boost::enable_if<std::is_integral<T> >::type* = 0) + typename std::enable_if<std::is_integral<T>::value>::type* = nullptr) { mStats[name] = LLSD::Integer(value); } @@ -639,7 +638,7 @@ public: // Store every floating-point type as LLSD::Real. template <class T> void add(const LLSD::String& name, const T& value, - typename boost::enable_if<std::is_floating_point<T> >::type* = 0) + typename std::enable_if<std::is_floating_point<T>::value>::type* = nullptr) { mStats[name] = LLSD::Real(value); } diff --git a/indra/newview/llchatutilities.cpp b/indra/newview/llchatutilities.cpp index 763390cdb3e4cb6142f4d5cdaf2a7323b100d512..63f90907d0e43bec6b1eb8cce00df3a1ab564145 100644 --- a/indra/newview/llchatutilities.cpp +++ b/indra/newview/llchatutilities.cpp @@ -38,7 +38,7 @@ // legacy callback glue extern void send_chat_from_viewer(const std::string& utf8_out_text, EChatType type, S32 channel); -/* static */ std::unordered_map<std::string, EChatType> sChatTypeTriggers = { +const std::map<std::string, EChatType> sChatTypeTriggers = { {LLStringExplicit("/whisper"), CHAT_TYPE_WHISPER}, {LLStringExplicit("/shout"), CHAT_TYPE_SHOUT} }; @@ -115,7 +115,7 @@ EChatType LLChatUtilities::processChatTypeTriggers(EChatType type, std::string & if (!LLStringUtil::compareInsensitive(trigger, ti.first)) { - U32 trigger_length = ti.first.length(); + size_t trigger_length = ti.first.length(); // It's to remove space after trigger name if (length > trigger_length && str[trigger_length] == ' ') diff --git a/indra/newview/llchatutilities.h b/indra/newview/llchatutilities.h index cc1e0fcd732ff96807bcb5f89de6c42b8fdbfb30..0196ddc28abab13bc6658c545a23ab8bcd63a83b 100644 --- a/indra/newview/llchatutilities.h +++ b/indra/newview/llchatutilities.h @@ -27,12 +27,9 @@ #define LL_CHATUTILITIES_H #include "llchat.h" -#include <unordered_map> namespace LLChatUtilities { - static std::unordered_map<std::string, EChatType> sChatTypeTriggers; - // Send a chat (after stripping /20foo channel chats). // "Animate" means the nodding animation for regular text. void sendChatFromViewer(const LLWString &wtext, EChatType type, BOOL animate); diff --git a/indra/newview/lldebugview.h b/indra/newview/lldebugview.h index a6490c876c03893c1a5a2c6486a594a98950dc38..4710385f0858325cffbd4b15399cd78d5c362721 100755 --- a/indra/newview/lldebugview.h +++ b/indra/newview/lldebugview.h @@ -33,12 +33,8 @@ #include "llview.h" // declarations -class LLButton; -class LLStatusPanel; class LLFastTimerView; class LLConsole; -class LLTextureView; -class LLFloaterStats; class LLDebugView : public LLView { diff --git a/indra/newview/llfloatercolorpicker.cpp b/indra/newview/llfloatercolorpicker.cpp index ab2c1996624ae43b8dad17e9499752b6ad18c1a5..1707c0da0b52382f78d30ed438969c510aa55000 100755 --- a/indra/newview/llfloatercolorpicker.cpp +++ b/indra/newview/llfloatercolorpicker.cpp @@ -203,10 +203,10 @@ void LLFloaterColorPicker::showUI () BOOL LLFloaterColorPicker::postBuild() { mCancelBtn = getChild<LLButton>( "cancel_btn" ); - mCancelBtn->setClickedCallback ( onClickCancel, this ); + mCancelBtn->setCommitCallback(boost::bind(&LLFloaterColorPicker::onClickCancel, this)); mSelectBtn = getChild<LLButton>( "select_btn"); - mSelectBtn->setClickedCallback ( onClickSelect, this ); + mSelectBtn->setCommitCallback(boost::bind(&LLFloaterColorPicker::onClickSelect, this)); mSelectBtn->setFocus ( TRUE ); mPipetteBtn = getChild<LLButton>("color_pipette" ); @@ -381,35 +381,19 @@ void LLFloaterColorPicker::getCurHsl ( F32& curHOut, F32& curSOut, F32& curLOut ////////////////////////////////////////////////////////////////////////////// // called when 'cancel' clicked -void LLFloaterColorPicker::onClickCancel ( void* data ) +void LLFloaterColorPicker::onClickCancel() { - if (data) - { - LLFloaterColorPicker* self = ( LLFloaterColorPicker* )data; - - if ( self ) - { - self->cancelSelection (); - self->closeFloater(); - } - } + cancelSelection(); + closeFloater(); } ////////////////////////////////////////////////////////////////////////////// // called when 'select' clicked -void LLFloaterColorPicker::onClickSelect ( void* data ) +void LLFloaterColorPicker::onClickSelect() { - if (data) - { - LLFloaterColorPicker* self = ( LLFloaterColorPicker* )data; - - if ( self ) - { - // apply to selection - LLColorSwatchCtrl::onColorChanged ( self->getSwatch (), LLColorSwatchCtrl::COLOR_SELECT ); - self->closeFloater(); - } - } + // apply to selection + LLColorSwatchCtrl::onColorChanged(getSwatch(), LLColorSwatchCtrl::COLOR_SELECT); + closeFloater(); } void LLFloaterColorPicker::onClickPipette( ) diff --git a/indra/newview/llfloatercolorpicker.h b/indra/newview/llfloatercolorpicker.h index 0102d6976524a98590abd1a9704a2f70199d182d..29f807cf03a3acccad9eec141a2cd365aec5d0d9 100755 --- a/indra/newview/llfloatercolorpicker.h +++ b/indra/newview/llfloatercolorpicker.h @@ -112,8 +112,8 @@ class LLFloaterColorPicker protected: // callbacks - static void onClickCancel ( void* data ); - static void onClickSelect ( void* data ); + void onClickCancel(); + void onClickSelect(); void onClickPipette ( ); static void onTextCommit ( LLUICtrl* ctrl, void* data ); void onImmediateCheck (); diff --git a/indra/newview/llfloaterland.cpp b/indra/newview/llfloaterland.cpp index c44841f2e4f4540f5a41ccc2c6ec240f2e99c64a..a1a402f28325f77b73d1b70a18d5b1f160704767 100755 --- a/indra/newview/llfloaterland.cpp +++ b/indra/newview/llfloaterland.cpp @@ -279,7 +279,12 @@ LLFloaterLand::LLFloaterLand(const LLSD& seed) } BOOL LLFloaterLand::postBuild() -{ +{ + if (!mParcelMsgSignalSlot.connected()) + { + mParcelMsgSignalSlot = LLViewerParcelMgr::getInstance()->addParcelMsgCallback( + boost::bind(&LLFloaterLand::selectiveRefresh, this)); + } setVisibleCallback(boost::bind(&LLFloaterLand::onVisibilityChanged, this, _2)); LLTabContainer* tab = getChild<LLTabContainer>("landtab"); @@ -298,6 +303,9 @@ BOOL LLFloaterLand::postBuild() // virtual LLFloaterLand::~LLFloaterLand() { + if (mParcelMsgSignalSlot.connected()) + mParcelMsgSignalSlot.disconnect(); + LLViewerParcelMgr::getInstance()->removeObserver( sObserver ); delete sObserver; sObserver = NULL; @@ -315,6 +323,13 @@ void LLFloaterLand::refresh() mPanelExperiences->refresh(); } +// public +void LLFloaterLand::selectiveRefresh() +{ + mPanelAccess->refresh(); + mPanelGeneral->refresh(); +} + // static void* LLFloaterLand::createPanelLandGeneral(void* data) { @@ -422,7 +437,7 @@ BOOL LLPanelLandGeneral::postBuild() mBtnDeedToGroup = getChild<LLButton>("Deed..."); - mBtnDeedToGroup->setClickedCallback(onClickDeed, this); + mBtnDeedToGroup->setCommitCallback(boost::bind(&LLPanelLandGeneral::onClickDeed, this)); mCheckContributeWithDeed = getChild<LLCheckBoxCtrl>( "check contrib"); @@ -435,7 +450,7 @@ BOOL LLPanelLandGeneral::postBuild() mBtnSellLand = getChild<LLButton>("Sell Land..."); - mBtnSellLand->setClickedCallback(onClickSellLand, this); + mBtnSellLand->setCommitCallback(boost::bind(&LLPanelLandGeneral::onClickSellLand, this)); mSaleInfoForSale2 = getChild<LLTextBox>("For sale to"); @@ -445,7 +460,7 @@ BOOL LLPanelLandGeneral::postBuild() mBtnStopSellLand = getChild<LLButton>("Cancel Land Sale"); - mBtnStopSellLand->setClickedCallback(onClickStopSellLand, this); + mBtnStopSellLand->setCommitCallback(boost::bind(&LLPanelLandGeneral::onClickStopSellLand, this)); mTextClaimDateLabel = getChild<LLTextBox>("Claimed:"); @@ -468,7 +483,7 @@ BOOL LLPanelLandGeneral::postBuild() std::string url = gAgent.getRegion()->getCapability("LandResources"); if (!url.empty()) { - mBtnScriptLimits->setClickedCallback(onClickScriptLimits, this); + mBtnScriptLimits->setCommitCallback(boost::bind(&LLPanelLandGeneral::onClickScriptLimits, this)); } else { @@ -483,13 +498,13 @@ BOOL LLPanelLandGeneral::postBuild() mBtnBuyPass->setClickedCallback(onClickBuyPass, this); mBtnReleaseLand = getChild<LLButton>("Abandon Land..."); - mBtnReleaseLand->setClickedCallback(onClickRelease, NULL); + mBtnReleaseLand->setCommitCallback(boost::bind(&LLPanelLandGeneral::onClickRelease, this)); mBtnReclaimLand = getChild<LLButton>("Reclaim Land..."); - mBtnReclaimLand->setClickedCallback(onClickReclaim, NULL); + mBtnReclaimLand->setCommitCallback(boost::bind(&LLPanelLandGeneral::onClickReclaim, this)); mBtnStartAuction = getChild<LLButton>("Linden Sale..."); - mBtnStartAuction->setClickedCallback(onClickStartAuction, this); + mBtnStartAuction->setCommitCallback(boost::bind(&LLPanelLandGeneral::onClickStartAuction, this)); return TRUE; } @@ -923,19 +938,16 @@ void LLPanelLandGeneral::onClickBuyLand(void* data) LLViewerParcelMgr::getInstance()->startBuyLand(*for_group); } -// static -void LLPanelLandGeneral::onClickScriptLimits(void* data) +void LLPanelLandGeneral::onClickScriptLimits() { - LLPanelLandGeneral* panelp = (LLPanelLandGeneral*)data; - LLParcel* parcel = panelp->mParcel->getParcel(); + LLParcel* parcel = mParcel->getParcel(); if(parcel != NULL) { LLFloaterReg::showInstance("script_limits"); } } -// static -void LLPanelLandGeneral::onClickDeed(void*) +void LLPanelLandGeneral::onClickDeed() { //LLParcel* parcel = mParcel->getParcel(); //if (parcel) @@ -944,14 +956,12 @@ void LLPanelLandGeneral::onClickDeed(void*) //} } -// static -void LLPanelLandGeneral::onClickRelease(void*) +void LLPanelLandGeneral::onClickRelease() { LLViewerParcelMgr::getInstance()->startReleaseLand(); } -// static -void LLPanelLandGeneral::onClickReclaim(void*) +void LLPanelLandGeneral::onClickReclaim() { LL_DEBUGS() << "LLPanelLandGeneral::onClickReclaim()" << LL_ENDL; LLViewerParcelMgr::getInstance()->reclaimParcel(); @@ -992,11 +1002,9 @@ void LLPanelLandGeneral::onClickBuyPass(void* data) LLNotificationsUtil::add("LandBuyPass", args, LLSD(), cbBuyPass); } -// static -void LLPanelLandGeneral::onClickStartAuction(void* data) +void LLPanelLandGeneral::onClickStartAuction() { - LLPanelLandGeneral* panelp = (LLPanelLandGeneral*)data; - LLParcel* parcelp = panelp->mParcel->getParcel(); + LLParcel* parcelp = mParcel->getParcel(); if(parcelp) { if(parcelp->getForSale()) @@ -1056,19 +1064,15 @@ void LLPanelLandGeneral::onCommitAny() refresh(); } -// static -void LLPanelLandGeneral::onClickSellLand(void* data) +void LLPanelLandGeneral::onClickSellLand() { LLViewerParcelMgr::getInstance()->startSellLand(); - LLPanelLandGeneral *panelp = (LLPanelLandGeneral *)data; - panelp->refresh(); + refresh(); } -// static -void LLPanelLandGeneral::onClickStopSellLand(void* data) +void LLPanelLandGeneral::onClickStopSellLand() { - LLPanelLandGeneral* panelp = (LLPanelLandGeneral*)data; - LLParcel* parcel = panelp->mParcel->getParcel(); + LLParcel* parcel = mParcel->getParcel(); parcel->setParcelFlag(PF_FOR_SALE, FALSE); parcel->setSalePrice(0); @@ -1113,7 +1117,6 @@ LLPanelLandObjects::LLPanelLandObjects(LLParcelSelectionHandle& parcel) BOOL LLPanelLandObjects::postBuild() { - mFirstReply = TRUE; mParcelObjectBonus = getChild<LLTextBox>("parcel_object_bonus"); mSWTotalObjects = getChild<LLTextBox>("objects_available"); @@ -1122,24 +1125,24 @@ BOOL LLPanelLandObjects::postBuild() mOwnerObjects = getChild<LLTextBox>("owner_objects_text"); mBtnShowOwnerObjects = getChild<LLButton>("ShowOwner"); - mBtnShowOwnerObjects->setClickedCallback(onClickShowOwnerObjects, this); + mBtnShowOwnerObjects->setCommitCallback(boost::bind(&LLPanelLandObjects::onClickShowOwnerObjects, this)); mBtnReturnOwnerObjects = getChild<LLButton>("ReturnOwner..."); - mBtnReturnOwnerObjects->setClickedCallback(onClickReturnOwnerObjects, this); + mBtnReturnOwnerObjects->setCommitCallback(boost::bind(&LLPanelLandObjects::onClickReturnOwnerObjects, this)); mGroupObjects = getChild<LLTextBox>("group_objects_text"); mBtnShowGroupObjects = getChild<LLButton>("ShowGroup"); - mBtnShowGroupObjects->setClickedCallback(onClickShowGroupObjects, this); + mBtnShowGroupObjects->setCommitCallback(boost::bind(&LLPanelLandObjects::onClickShowGroupObjects, this)); mBtnReturnGroupObjects = getChild<LLButton>("ReturnGroup..."); - mBtnReturnGroupObjects->setClickedCallback(onClickReturnGroupObjects, this); + mBtnReturnGroupObjects->setCommitCallback(boost::bind(&LLPanelLandObjects::onClickReturnGroupObjects, this)); mOtherObjects = getChild<LLTextBox>("other_objects_text"); mBtnShowOtherObjects = getChild<LLButton>("ShowOther"); - mBtnShowOtherObjects->setClickedCallback(onClickShowOtherObjects, this); + mBtnShowOtherObjects->setCommitCallback(boost::bind(&LLPanelLandObjects::onClickShowOtherObjects, this)); mBtnReturnOtherObjects = getChild<LLButton>("ReturnOther..."); - mBtnReturnOtherObjects->setClickedCallback(onClickReturnOtherObjects, this); + mBtnReturnOtherObjects->setCommitCallback(boost::bind(&LLPanelLandObjects::onClickReturnOtherObjects, this)); mSelectedObjects = getChild<LLTextBox>("selected_objects_text"); mCleanOtherObjectsTime = getChild<LLLineEditor>("clean other time"); @@ -1149,10 +1152,10 @@ BOOL LLPanelLandObjects::postBuild() getChild<LLLineEditor>("clean other time")->setPrevalidate(LLTextValidate::validateNonNegativeS32); mBtnRefresh = getChild<LLButton>("Refresh List"); - mBtnRefresh->setClickedCallback(onClickRefresh, this); + mBtnRefresh->setCommitCallback(boost::bind(&LLPanelLandObjects::onClickRefresh, this)); mBtnReturnOwnerList = getChild<LLButton>("Return objects..."); - mBtnReturnOwnerList->setClickedCallback(onClickReturnOwnerList, this); + mBtnReturnOwnerList->setCommitCallback(boost::bind(&LLPanelLandObjects::onClickReturnOwnerList, this)); mIconAvatarOnline = LLUIImageList::getInstance()->getUIImage("icon_avatar_online.tga", 0); mIconAvatarOffline = LLUIImageList::getInstance()->getUIImage("icon_avatar_offline.tga", 0); @@ -1160,26 +1163,20 @@ BOOL LLPanelLandObjects::postBuild() mOwnerList = getChild<LLNameListCtrl>("owner list"); mOwnerList->sortByColumnIndex(3, FALSE); - childSetCommitCallback("owner list", onCommitList, this); - mOwnerList->setDoubleClickCallback(onDoubleClickOwner, this); + getChild<LLUICtrl>("owner list")->setCommitCallback(boost::bind(&LLPanelLandObjects::onCommitList, this, _1)); + mOwnerList->setDoubleClickCallback(boost::bind(&LLPanelLandObjects::onDoubleClickOwner, this)); mOwnerList->setContextMenu(LLScrollListCtrl::MENU_AVATAR); return TRUE; } - - - // virtual LLPanelLandObjects::~LLPanelLandObjects() { } -// static -void LLPanelLandObjects::onDoubleClickOwner(void *userdata) +void LLPanelLandObjects::onDoubleClickOwner() { - LLPanelLandObjects *self = (LLPanelLandObjects *)userdata; - - LLScrollListItem* item = self->mOwnerList->getFirstSelected(); + LLScrollListItem* item = mOwnerList->getFirstSelected(); if (item) { LLUUID owner_id = item->getUUID(); @@ -1485,59 +1482,51 @@ bool LLPanelLandObjects::callbackReturnOwnerList(const LLSD& notification, const return false; } - -// static -void LLPanelLandObjects::onClickReturnOwnerList(void* userdata) +void LLPanelLandObjects::onClickReturnOwnerList() { - LLPanelLandObjects *self = (LLPanelLandObjects *)userdata; - - LLParcel* parcelp = self->mParcel->getParcel(); + LLParcel* parcelp = mParcel->getParcel(); if (!parcelp) return; // Make sure we have something selected. - if (self->mSelectedOwners.empty()) + if (mSelectedOwners.empty()) { return; } //uuid_list_t::iterator selected_itr = self->mSelectedOwners.begin(); //if (selected_itr == self->mSelectedOwners.end()) return; - send_parcel_select_objects(parcelp->getLocalID(), RT_LIST, &(self->mSelectedOwners)); + send_parcel_select_objects(parcelp->getLocalID(), RT_LIST, &mSelectedOwners); LLSD args; - args["NAME"] = self->mSelectedName; - args["N"] = llformat("%d",self->mSelectedCount); - if (self->mSelectedIsGroup) + args["NAME"] = mSelectedName; + args["N"] = std::to_string(mSelectedCount); + if (mSelectedIsGroup) { - LLNotificationsUtil::add("ReturnObjectsDeededToGroup", args, LLSD(), boost::bind(&LLPanelLandObjects::callbackReturnOwnerList, self, _1, _2)); + LLNotificationsUtil::add("ReturnObjectsDeededToGroup", args, LLSD(), boost::bind(&LLPanelLandObjects::callbackReturnOwnerList, this, _1, _2)); } else { - LLNotificationsUtil::add("ReturnObjectsOwnedByUser", args, LLSD(), boost::bind(&LLPanelLandObjects::callbackReturnOwnerList, self, _1, _2)); + LLNotificationsUtil::add("ReturnObjectsOwnedByUser", args, LLSD(), boost::bind(&LLPanelLandObjects::callbackReturnOwnerList, this, _1, _2)); } } - -// static -void LLPanelLandObjects::onClickRefresh(void* userdata) +void LLPanelLandObjects::onClickRefresh() { - LLPanelLandObjects *self = (LLPanelLandObjects*)userdata; - LLMessageSystem *msg = gMessageSystem; - LLParcel* parcel = self->mParcel->getParcel(); + LLParcel* parcel = mParcel->getParcel(); if (!parcel) return; LLViewerRegion* region = LLViewerParcelMgr::getInstance()->getSelectionRegion(); if (!region) return; - self->mBtnRefresh->setEnabled(false); + mBtnRefresh->setEnabled(false); // ready the list for results - self->mOwnerList->deleteAllItems(); - self->mOwnerList->setCommentText(LLTrans::getString("Searching")); - self->mOwnerList->setEnabled(FALSE); - self->mFirstReply = TRUE; + mOwnerList->deleteAllItems(); + mOwnerList->setCommentText(LLTrans::getString("Searching")); + mOwnerList->setEnabled(FALSE); + mFirstReply = TRUE; // send the message msg->newMessageFast(_PREHASH_ParcelObjectOwnersRequest); @@ -1646,15 +1635,13 @@ void LLPanelLandObjects::processParcelObjectOwnersReply(LLMessageSystem *msg, vo } // static -void LLPanelLandObjects::onCommitList(LLUICtrl* ctrl, void* data) +void LLPanelLandObjects::onCommitList(LLUICtrl* ctrl) { - LLPanelLandObjects* self = (LLPanelLandObjects*)data; - - if (FALSE == self->mOwnerList->getCanSelect()) + if (mOwnerList->getCanSelect() == FALSE) { return; } - LLScrollListItem *item = self->mOwnerList->getFirstSelected(); + LLScrollListItem *item = mOwnerList->getFirstSelected(); if (item) { // Look up the selected name, for future dialog box use. @@ -1665,19 +1652,19 @@ void LLPanelLandObjects::onCommitList(LLUICtrl* ctrl, void* data) return; } // Is this a group? - self->mSelectedIsGroup = cell->getValue().asString() == OWNER_GROUP; + mSelectedIsGroup = cell->getValue().asString() == OWNER_GROUP; cell = item->getColumn(2); - self->mSelectedName = cell->getValue().asString(); + mSelectedName = cell->getValue().asString(); cell = item->getColumn(3); - self->mSelectedCount = std::stoi(cell->getValue().asString()); + mSelectedCount = std::stoi(cell->getValue().asString()); // Set the selection, and enable the return button. - self->mSelectedOwners.clear(); - self->mSelectedOwners.insert(item->getUUID()); - self->mBtnReturnOwnerList->setEnabled(TRUE); + mSelectedOwners.clear(); + mSelectedOwners.insert(item->getUUID()); + mBtnReturnOwnerList->setEnabled(TRUE); // Highlight this user's objects - clickShowCore(self, RT_LIST, &(self->mSelectedOwners)); + clickShowCore(this, RT_LIST, &mSelectedOwners); } } @@ -1690,31 +1677,26 @@ void LLPanelLandObjects::clickShowCore(LLPanelLandObjects* self, S32 return_type send_parcel_select_objects(parcel->getLocalID(), return_type, list); } -// static -void LLPanelLandObjects::onClickShowOwnerObjects(void* userdata) +void LLPanelLandObjects::onClickShowOwnerObjects() { - clickShowCore((LLPanelLandObjects*)userdata, RT_OWNER); + clickShowCore(this, RT_OWNER); } -// static -void LLPanelLandObjects::onClickShowGroupObjects(void* userdata) +void LLPanelLandObjects::onClickShowGroupObjects() { - clickShowCore((LLPanelLandObjects*)userdata, (RT_GROUP)); + clickShowCore(this, (RT_GROUP)); } -// static -void LLPanelLandObjects::onClickShowOtherObjects(void* userdata) +void LLPanelLandObjects::onClickShowOtherObjects() { - clickShowCore((LLPanelLandObjects*)userdata, RT_OTHER); + clickShowCore(this, RT_OTHER); } -// static -void LLPanelLandObjects::onClickReturnOwnerObjects(void* userdata) +void LLPanelLandObjects::onClickReturnOwnerObjects() { S32 owned = 0; - LLPanelLandObjects* panelp = (LLPanelLandObjects*)userdata; - LLParcel* parcel = panelp->mParcel->getParcel(); + LLParcel* parcel = mParcel->getParcel(); if (!parcel) return; owned = parcel->getOwnerPrimCount(); @@ -1724,24 +1706,22 @@ void LLPanelLandObjects::onClickReturnOwnerObjects(void* userdata) LLUUID owner_id = parcel->getOwnerID(); LLSD args; - args["N"] = llformat("%d",owned); + args["N"] = std::to_string(owned); if (owner_id == gAgent.getID()) { - LLNotificationsUtil::add("ReturnObjectsOwnedBySelf", args, LLSD(), boost::bind(&LLPanelLandObjects::callbackReturnOwnerObjects, panelp, _1, _2)); + LLNotificationsUtil::add("ReturnObjectsOwnedBySelf", args, LLSD(), boost::bind(&LLPanelLandObjects::callbackReturnOwnerObjects, this, _1, _2)); } else { args["NAME"] = LLSLURL("agent", owner_id, "completename").getSLURLString(); - LLNotificationsUtil::add("ReturnObjectsOwnedByUser", args, LLSD(), boost::bind(&LLPanelLandObjects::callbackReturnOwnerObjects, panelp, _1, _2)); + LLNotificationsUtil::add("ReturnObjectsOwnedByUser", args, LLSD(), boost::bind(&LLPanelLandObjects::callbackReturnOwnerObjects, this, _1, _2)); } } -// static -void LLPanelLandObjects::onClickReturnGroupObjects(void* userdata) +void LLPanelLandObjects::onClickReturnGroupObjects() { - LLPanelLandObjects* panelp = (LLPanelLandObjects*)userdata; - LLParcel* parcel = panelp->mParcel->getParcel(); + LLParcel* parcel = mParcel->getParcel(); if (!parcel) return; send_parcel_select_objects(parcel->getLocalID(), RT_GROUP); @@ -1754,16 +1734,14 @@ void LLPanelLandObjects::onClickReturnGroupObjects(void* userdata) args["N"] = llformat("%d", parcel->getGroupPrimCount()); // create and show confirmation textbox - LLNotificationsUtil::add("ReturnObjectsDeededToGroup", args, LLSD(), boost::bind(&LLPanelLandObjects::callbackReturnGroupObjects, panelp, _1, _2)); + LLNotificationsUtil::add("ReturnObjectsDeededToGroup", args, LLSD(), boost::bind(&LLPanelLandObjects::callbackReturnGroupObjects, this, _1, _2)); } -// static -void LLPanelLandObjects::onClickReturnOtherObjects(void* userdata) +void LLPanelLandObjects::onClickReturnOtherObjects() { S32 other = 0; - LLPanelLandObjects* panelp = (LLPanelLandObjects*)userdata; - LLParcel* parcel = panelp->mParcel->getParcel(); + LLParcel* parcel = mParcel->getParcel(); if (!parcel) return; other = parcel->getOtherPrimCount(); @@ -1779,7 +1757,7 @@ void LLPanelLandObjects::onClickReturnOtherObjects(void* userdata) gCacheName->getGroupName(parcel->getGroupID(), group_name); args["NAME"] = group_name; - LLNotificationsUtil::add("ReturnObjectsNotOwnedByGroup", args, LLSD(), boost::bind(&LLPanelLandObjects::callbackReturnOtherObjects, panelp, _1, _2)); + LLNotificationsUtil::add("ReturnObjectsNotOwnedByGroup", args, LLSD(), boost::bind(&LLPanelLandObjects::callbackReturnOtherObjects, this, _1, _2)); } else { @@ -1787,12 +1765,12 @@ void LLPanelLandObjects::onClickReturnOtherObjects(void* userdata) if (owner_id == gAgent.getID()) { - LLNotificationsUtil::add("ReturnObjectsNotOwnedBySelf", args, LLSD(), boost::bind(&LLPanelLandObjects::callbackReturnOtherObjects, panelp, _1, _2)); + LLNotificationsUtil::add("ReturnObjectsNotOwnedBySelf", args, LLSD(), boost::bind(&LLPanelLandObjects::callbackReturnOtherObjects, this, _1, _2)); } else { args["NAME"] = LLSLURL("agent", owner_id, "completename").getSLURLString(); - LLNotificationsUtil::add("ReturnObjectsNotOwnedByUser", args, LLSD(), boost::bind(&LLPanelLandObjects::callbackReturnOtherObjects, panelp, _1, _2)); + LLNotificationsUtil::add("ReturnObjectsNotOwnedByUser", args, LLSD(), boost::bind(&LLPanelLandObjects::callbackReturnOtherObjects, this, _1, _2)); } } } @@ -1928,11 +1906,11 @@ BOOL LLPanelLandOptions::postBuild() mLocationText = getChild<LLTextBox>("landing_point"); mSetBtn = getChild<LLButton>("Set"); - mSetBtn->setClickedCallback(onClickSet, this); + mSetBtn->setCommitCallback(boost::bind(&LLPanelLandOptions::onClickSet, this)); mClearBtn = getChild<LLButton>("Clear"); - mClearBtn->setClickedCallback(onClickClear, this); + mClearBtn->setCommitCallback(boost::bind(&LLPanelLandOptions::onClickClear, this)); mLandingTypeCombo = getChild<LLComboBox>( "landing type"); @@ -2301,13 +2279,9 @@ void LLPanelLandOptions::onCommitAny() refresh(); } - -// static -void LLPanelLandOptions::onClickSet(void* userdata) +void LLPanelLandOptions::onClickSet() { - LLPanelLandOptions* self = (LLPanelLandOptions*)userdata; - - LLParcel* selected_parcel = self->mParcel->getParcel(); + LLParcel* selected_parcel = mParcel->getParcel(); if (!selected_parcel) return; LLParcel* agent_parcel = LLViewerParcelMgr::getInstance()->getAgentParcel(); @@ -2325,14 +2299,12 @@ void LLPanelLandOptions::onClickSet(void* userdata) LLViewerParcelMgr::getInstance()->sendParcelPropertiesUpdate(selected_parcel); - self->refresh(); + refresh(); } -void LLPanelLandOptions::onClickClear(void* userdata) +void LLPanelLandOptions::onClickClear() { - LLPanelLandOptions* self = (LLPanelLandOptions*)userdata; - - LLParcel* selected_parcel = self->mParcel->getParcel(); + LLParcel* selected_parcel = mParcel->getParcel(); if (!selected_parcel) return; // yes, this magic number of 0,0,0 means that it is clear @@ -2342,7 +2314,7 @@ void LLPanelLandOptions::onClickClear(void* userdata) LLViewerParcelMgr::getInstance()->sendParcelPropertiesUpdate(selected_parcel); - self->refresh(); + refresh(); } @@ -2359,19 +2331,19 @@ LLPanelLandAccess::LLPanelLandAccess(LLParcelSelectionHandle& parcel) BOOL LLPanelLandAccess::postBuild() { - childSetCommitCallback("public_access", onCommitPublicAccess, this); + getChild<LLUICtrl>("public_access")->setCommitCallback(boost::bind(&LLPanelLandAccess::onCommitPublicAccess, this, _1)); getChild<LLUICtrl>("limit_payment")->setCommitCallback(boost::bind(&LLPanelLandAccess::onCommitAny, this)); getChild<LLUICtrl>("limit_age_verified")->setCommitCallback(boost::bind(&LLPanelLandAccess::onCommitAny, this)); - childSetCommitCallback("GroupCheck", onCommitGroupCheck, this); + getChild<LLUICtrl>("GroupCheck")->setCommitCallback(boost::bind(&LLPanelLandAccess::onCommitGroupCheck, this, _1)); getChild<LLUICtrl>("PassCheck")->setCommitCallback(boost::bind(&LLPanelLandAccess::onCommitAny, this)); getChild<LLUICtrl>("pass_combo")->setCommitCallback(boost::bind(&LLPanelLandAccess::onCommitAny, this)); getChild<LLUICtrl>("PriceSpin")->setCommitCallback(boost::bind(&LLPanelLandAccess::onCommitAny, this)); getChild<LLUICtrl>("HoursSpin")->setCommitCallback(boost::bind(&LLPanelLandAccess::onCommitAny, this)); childSetAction("add_allowed", boost::bind(&LLPanelLandAccess::onClickAddAccess, this)); - childSetAction("remove_allowed", onClickRemoveAccess, this); + getChild<LLUICtrl>("remove_allowed")->setCommitCallback(boost::bind(&LLPanelLandAccess::onClickRemoveAccess, this)); childSetAction("add_banned", boost::bind(&LLPanelLandAccess::onClickAddBanned, this)); - childSetAction("remove_banned", onClickRemoveBanned, this); + getChild<LLUICtrl>("remove_banned")->setCommitCallback(boost::bind(&LLPanelLandAccess::onClickRemoveBanned, this)); mListAccess = getChild<LLNameListCtrl>("AccessList"); if (mListAccess) @@ -2677,43 +2649,37 @@ void LLPanelLandAccess::draw() LLPanel::draw(); } -// static -void LLPanelLandAccess::onCommitPublicAccess(LLUICtrl *ctrl, void *userdata) +void LLPanelLandAccess::onCommitPublicAccess(LLUICtrl *ctrl) { - LLPanelLandAccess *self = (LLPanelLandAccess *)userdata; - LLParcel* parcel = self->mParcel->getParcel(); + LLParcel* parcel = mParcel->getParcel(); if (!parcel) { return; } - self->onCommitAny(); + onCommitAny(); } -void LLPanelLandAccess::onCommitGroupCheck(LLUICtrl *ctrl, void *userdata) +void LLPanelLandAccess::onCommitGroupCheck(LLUICtrl *ctrl) { - LLPanelLandAccess *self = (LLPanelLandAccess *)userdata; - LLParcel* parcel = self->mParcel->getParcel(); + LLParcel* parcel = mParcel->getParcel(); if (!parcel) { return; } - BOOL use_pass_list = !self->getChild<LLUICtrl>("public_access")->getValue().asBoolean(); - BOOL use_access_group = self->getChild<LLUICtrl>("GroupCheck")->getValue().asBoolean(); - LLCtrlSelectionInterface* passcombo = self->childGetSelectionInterface("pass_combo"); - if (passcombo) + BOOL use_pass_list = !getChild<LLUICtrl>("public_access")->getValue().asBoolean(); + BOOL use_access_group = getChild<LLUICtrl>("GroupCheck")->getValue().asBoolean(); + LLCtrlSelectionInterface* passcombo = childGetSelectionInterface("pass_combo"); + if (passcombo && use_access_group && use_pass_list) { - if (use_access_group && use_pass_list) + if (passcombo->getSelectedValue().asString() == "group") { - if (passcombo->getSelectedValue().asString() == "group") - { - passcombo->selectByValue("anyone"); - } + passcombo->selectByValue("anyone"); } } - self->onCommitAny(); + onCommitAny(); } void LLPanelLandAccess::onCommitAny() @@ -2818,15 +2784,14 @@ void LLPanelLandAccess::callbackAvatarCBAccess(const uuid_vec_t& ids) } // static -void LLPanelLandAccess::onClickRemoveAccess(void* data) +void LLPanelLandAccess::onClickRemoveAccess() { - LLPanelLandAccess* panelp = (LLPanelLandAccess*)data; - if (panelp && panelp->mListAccess) + if (mListAccess) { - LLParcel* parcel = panelp->mParcel->getParcel(); + LLParcel* parcel = mParcel->getParcel(); if (parcel) { - std::vector<LLScrollListItem*> names = panelp->mListAccess->getAllSelected(); + std::vector<LLScrollListItem*> names = mListAccess->getAllSelected(); for (std::vector<LLScrollListItem*>::iterator iter = names.begin(); iter != names.end(); ) { @@ -2835,7 +2800,7 @@ void LLPanelLandAccess::onClickRemoveAccess(void* data) parcel->removeFromAccessList(agent_id); } LLViewerParcelMgr::getInstance()->sendParcelAccessListUpdate(AL_ACCESS); - panelp->refresh(); + refresh(); } } } @@ -2875,16 +2840,14 @@ void LLPanelLandAccess::callbackAvatarCBBanned(const uuid_vec_t& ids) } } -// static -void LLPanelLandAccess::onClickRemoveBanned(void* data) +void LLPanelLandAccess::onClickRemoveBanned() { - LLPanelLandAccess* panelp = (LLPanelLandAccess*)data; - if (panelp && panelp->mListBanned) + if (mListBanned) { - LLParcel* parcel = panelp->mParcel->getParcel(); + LLParcel* parcel = mParcel->getParcel(); if (parcel) { - std::vector<LLScrollListItem*> names = panelp->mListBanned->getAllSelected(); + std::vector<LLScrollListItem*> names = mListBanned->getAllSelected(); for (std::vector<LLScrollListItem*>::iterator iter = names.begin(); iter != names.end(); ) { @@ -2893,7 +2856,7 @@ void LLPanelLandAccess::onClickRemoveBanned(void* data) parcel->removeFromBanList(agent_id); } LLViewerParcelMgr::getInstance()->sendParcelAccessListUpdate(AL_BAN); - panelp->refresh(); + refresh(); } } } diff --git a/indra/newview/llfloaterland.h b/indra/newview/llfloaterland.h index fbd707afb7dfef55d1d714fbcd35aa8d3fadcef4..1b9c2777cc8fea497a90d91d6d82f8616f4e226b 100755 --- a/indra/newview/llfloaterland.h +++ b/indra/newview/llfloaterland.h @@ -30,7 +30,6 @@ #include "llfloater.h" #include "llpointer.h" // LLPointer<> -//#include "llviewertexturelist.h" #include "llsafehandle.h" typedef std::set<LLUUID, lluuid_less> uuid_list_t; @@ -87,10 +86,13 @@ private: virtual ~LLFloaterLand(); void onVisibilityChanged(const LLSD& visible); + + boost::signals2::connection mParcelMsgSignalSlot; protected: /*virtual*/ void refresh(); + void selectiveRefresh(); static void* createPanelLandGeneral(void* data); static void* createPanelLandCovenant(void* data); @@ -139,14 +141,14 @@ public: void setGroup(const LLUUID& group_id); void onClickProfile(); void onClickSetGroup(); - static void onClickDeed(void*); static void onClickBuyLand(void* data); - static void onClickScriptLimits(void* data); - static void onClickRelease(void*); - static void onClickReclaim(void*); static void onClickBuyPass(void* deselect_when_done); + void onClickDeed(); + void onClickScriptLimits(); + void onClickRelease(); + void onClickReclaim(); static BOOL enableBuyPass(void*); - void onCommitAny(); + void onCommitAny(); static void finalizeCommit(void * userdata); static void onForSaleChange(LLUICtrl *ctrl, void * userdata); static void finalizeSetSellChange(void * userdata); @@ -154,15 +156,15 @@ public: static bool cbBuyPass(const LLSD& notification, const LLSD& response); - static void onClickSellLand(void* data); - static void onClickStopSellLand(void* data); - static void onClickSet(void* data); - static void onClickClear(void* data); - static void onClickShow(void* data); + void onClickSellLand(); + void onClickStopSellLand(); + void onClickSet(); + void onClickClear(); + void onClickShow(); static void callbackAvatarPick(const std::vector<std::string>& names, const uuid_vec_t& ids, void* data); static void finalizeAvatarPick(void* data); static void callbackHighlightTransferable(S32 option, void* userdata); - static void onClickStartAuction(void*); + void onClickStartAuction(); // sale change confirmed when "is for sale", "sale price", "sell to whom" fields are changed static void confirmSaleChange(S32 landSize, S32 salePrice, std::string authorizedName, void(*callback)(void*), void* userdata); static void callbackConfirmSaleChange(S32 option, void* userdata); @@ -249,19 +251,19 @@ public: bool callbackReturnOwnerList(const LLSD& notification, const LLSD& response); static void clickShowCore(LLPanelLandObjects* panelp, S32 return_type, uuid_list_t* list = 0); - static void onClickShowOwnerObjects(void*); - static void onClickShowGroupObjects(void*); - static void onClickShowOtherObjects(void*); + void onClickShowOwnerObjects(); + void onClickShowGroupObjects(); + void onClickShowOtherObjects(); - static void onClickReturnOwnerObjects(void*); - static void onClickReturnGroupObjects(void*); - static void onClickReturnOtherObjects(void*); - static void onClickReturnOwnerList(void*); - static void onClickRefresh(void*); + void onClickReturnOwnerObjects(); + void onClickReturnGroupObjects(); + void onClickReturnOtherObjects(); + void onClickReturnOwnerList(); + void onClickRefresh(); - static void onDoubleClickOwner(void*); + void onDoubleClickOwner(); - static void onCommitList(LLUICtrl* ctrl, void* data); + void onCommitList(LLUICtrl* ctrl); static void onLostFocus(LLFocusableElement* caller, void* user_data); void onCommitClean(); static void processParcelObjectOwnersReply(LLMessageSystem *msg, void **); @@ -320,8 +322,8 @@ private: void refreshSearch(); void onCommitAny(); - static void onClickSet(void* userdata); - static void onClickClear(void* userdata); + void onClickSet(); + void onClickClear(); private: LLCheckBoxCtrl* mCheckEditObjects; @@ -363,11 +365,11 @@ public: void refreshNames(); virtual void draw(); - static void onCommitPublicAccess(LLUICtrl* ctrl, void *userdata); - void onCommitAny(); - static void onCommitGroupCheck(LLUICtrl* ctrl, void *userdata); - static void onClickRemoveAccess(void*); - static void onClickRemoveBanned(void*); + void onCommitPublicAccess(LLUICtrl* ctrl); + void onCommitAny(); + void onCommitGroupCheck(LLUICtrl* ctrl); + void onClickRemoveAccess(); + void onClickRemoveBanned(); virtual BOOL postBuild(); diff --git a/indra/newview/llfloatermediasettings.cpp b/indra/newview/llfloatermediasettings.cpp index 6fb55ef18c8155b8f4e9782302cd39160608bb12..5baca64b77c4c3050a97171c450a33e32e0118a6 100755 --- a/indra/newview/llfloatermediasettings.cpp +++ b/indra/newview/llfloatermediasettings.cpp @@ -83,13 +83,13 @@ LLFloaterMediaSettings::~LLFloaterMediaSettings() BOOL LLFloaterMediaSettings::postBuild() { mApplyBtn = getChild<LLButton>("Apply"); - mApplyBtn->setClickedCallback(onBtnApply, this); + mApplyBtn->setCommitCallback(boost::bind(&LLFloaterMediaSettings::onBtnApply, this)); mCancelBtn = getChild<LLButton>("Cancel"); - mCancelBtn->setClickedCallback(onBtnCancel, this); + mCancelBtn->setCommitCallback(boost::bind(&LLFloaterMediaSettings::onBtnCancel, this)); mOKBtn = getChild<LLButton>("OK"); - mOKBtn->setClickedCallback(onBtnOK, this); + mOKBtn->setCommitCallback(boost::bind(&LLFloaterMediaSettings::onBtnOK, this)); mTabContainer = getChild<LLTabContainer>( "tab_container" ); @@ -220,37 +220,31 @@ void LLFloaterMediaSettings::clearValues( bool editable) } } -//////////////////////////////////////////////////////////////////////////////// -// static -void LLFloaterMediaSettings::onBtnOK( void* userdata ) +void LLFloaterMediaSettings::onBtnOK() { - sInstance->commitFields(); + commitFields(); - sInstance->apply(); + apply(); - sInstance->closeFloater(); + closeFloater(); } -//////////////////////////////////////////////////////////////////////////////// -// static -void LLFloaterMediaSettings::onBtnApply( void* userdata ) +void LLFloaterMediaSettings::onBtnApply() { - sInstance->commitFields(); + commitFields(); - sInstance->apply(); + apply(); - sInstance->mInitialValues.clear(); - sInstance->mPanelMediaSettingsGeneral->getValues( sInstance->mInitialValues ); - sInstance->mPanelMediaSettingsSecurity->getValues( sInstance->mInitialValues ); - sInstance->mPanelMediaSettingsPermissions->getValues( sInstance->mInitialValues ); + mInitialValues.clear(); + mPanelMediaSettingsGeneral->getValues( mInitialValues ); + mPanelMediaSettingsSecurity->getValues( mInitialValues ); + mPanelMediaSettingsPermissions->getValues( mInitialValues ); } -//////////////////////////////////////////////////////////////////////////////// -// static -void LLFloaterMediaSettings::onBtnCancel( void* userdata ) +void LLFloaterMediaSettings::onBtnCancel() { - sInstance->closeFloater(); + closeFloater(); } //////////////////////////////////////////////////////////////////////////////// @@ -315,5 +309,3 @@ bool LLFloaterMediaSettings::instanceExists() { return LLFloaterReg::findTypedInstance<LLFloaterMediaSettings>("media_settings"); } - - diff --git a/indra/newview/llfloatermediasettings.h b/indra/newview/llfloatermediasettings.h index fe69b5dac982f4ec80aa8ccaca106e1a807d83c0..e1a9d2c9cb23e0ad349231f2ea2c229b0e497af3 100755 --- a/indra/newview/llfloatermediasettings.h +++ b/indra/newview/llfloatermediasettings.h @@ -56,9 +56,12 @@ public: virtual void draw(); - bool mIdenticalHasMediaInfo; - bool mMultipleMedia; - bool mMultipleValidMedia; + bool getIdenticalHasMediaInfo() const { return mIdenticalHasMediaInfo; } + bool getMultipleMedia() const { return mMultipleMedia; } + bool getMultipleValidMedia() const { return mMultipleValidMedia; } + void setIdenticalHasMediaInfo(bool m) { mIdenticalHasMediaInfo = m; } + void setMultipleMedia(bool m) { mMultipleMedia = m; } + void setMultipleValidMedia(bool m) { mMultipleValidMedia = m; } protected: LLButton *mOKBtn; @@ -70,9 +73,9 @@ protected: LLPanelMediaSettingsSecurity* mPanelMediaSettingsSecurity; LLPanelMediaSettingsPermissions* mPanelMediaSettingsPermissions; - static void onBtnOK(void*); - static void onBtnCancel(void*); - static void onBtnApply(void*); + void onBtnOK(); + void onBtnCancel(); + void onBtnApply(); static void onTabChanged(void* user_data, bool from_click); void commitFields(); @@ -83,6 +86,10 @@ private: bool haveValuesChanged() const; LLSD mInitialValues; + + bool mIdenticalHasMediaInfo; + bool mMultipleMedia; + bool mMultipleValidMedia; }; #endif // LL_LLFLOATERMEDIASETTINGS_H diff --git a/indra/newview/llfloaternotificationsconsole.cpp b/indra/newview/llfloaternotificationsconsole.cpp index 88057d3b4e7345572725f150cdf56ee47a76993f..64fd443e4a04abc2519c4a04271e0af19b3c7d09 100755 --- a/indra/newview/llfloaternotificationsconsole.cpp +++ b/indra/newview/llfloaternotificationsconsole.cpp @@ -45,7 +45,7 @@ public: private: bool update(const LLSD& payload); - static void toggleClick(void* user_data); + void toggleClick(); static void onClickNotification(void* user_data); LLNotificationChannelPtr mChannelPtr; }; @@ -75,7 +75,7 @@ BOOL LLNotificationChannelPanel::postBuild() { LLButton* header_button = getChild<LLButton>("header"); header_button->setLabel(mChannelPtr->getName()); - header_button->setClickedCallback(toggleClick, this); + header_button->setCommitCallback(boost::bind(&LLNotificationChannelPanel::toggleClick, this)); mChannelPtr->connectChanged(boost::bind(&LLNotificationChannelPanel::update, this, _1)); @@ -85,23 +85,19 @@ BOOL LLNotificationChannelPanel::postBuild() return TRUE; } -//static -void LLNotificationChannelPanel::toggleClick(void *user_data) +void LLNotificationChannelPanel::toggleClick() { - LLNotificationChannelPanel* self = (LLNotificationChannelPanel*)user_data; - if (!self) return; - - LLButton* header_button = self->getChild<LLButton>("header"); + LLButton* header_button = getChild<LLButton>("header"); - LLLayoutStack* stack = dynamic_cast<LLLayoutStack*>(self->getParent()); + LLLayoutStack* stack = dynamic_cast<LLLayoutStack*>(getParent()); if (stack) { - stack->collapsePanel(self, header_button->getToggleState()); + stack->collapsePanel(this, header_button->getToggleState()); } // turn off tab stop for collapsed panel - self->getChild<LLScrollListCtrl>("notifications_list")->setTabStop(!header_button->getToggleState()); - self->getChild<LLScrollListCtrl>("notifications_list")->setVisible(!header_button->getToggleState()); + getChild<LLScrollListCtrl>("notifications_list")->setTabStop(!header_button->getToggleState()); + getChild<LLScrollListCtrl>("notifications_list")->setVisible(!header_button->getToggleState()); } /*static*/ diff --git a/indra/newview/llfloatertools.cpp b/indra/newview/llfloatertools.cpp index 4d23e61029f8f39c0e33a150b98ff45a963a4cd4..bf869fccb6b94acefa31067617025daca58995f9 100755 --- a/indra/newview/llfloatertools.cpp +++ b/indra/newview/llfloatertools.cpp @@ -1308,7 +1308,7 @@ void LLFloaterTools::getMediaState() // check if all faces have media(or, all dont have media) - LLFloaterMediaSettings::getInstance()->mIdenticalHasMediaInfo = selected_objects->getSelectedTEValue( &func, bool_has_media ); + LLFloaterMediaSettings::getInstance()->setIdenticalHasMediaInfo(selected_objects->getSelectedTEValue( &func, bool_has_media )); const LLMediaEntry default_media_data; @@ -1330,7 +1330,7 @@ void LLFloaterTools::getMediaState() } func_media_data(default_media_data); LLMediaEntry media_data_get; - LLFloaterMediaSettings::getInstance()->mMultipleMedia = !(selected_objects->getSelectedTEValue( &func_media_data, media_data_get )); + LLFloaterMediaSettings::getInstance()->setMultipleMedia(!(selected_objects->getSelectedTEValue( &func_media_data, media_data_get ))); std::string multi_media_info_str = LLTrans::getString("Multiple Media"); std::string media_title = ""; @@ -1340,12 +1340,12 @@ void LLFloaterTools::getMediaState() getChildView("Add_Media")->setEnabled(editable); // IF all the faces have media (or all dont have media) - if ( LLFloaterMediaSettings::getInstance()->mIdenticalHasMediaInfo ) + if ( LLFloaterMediaSettings::getInstance()->getIdenticalHasMediaInfo() ) { // TODO: get media title and set it. media_info->clear(); // if identical is set, all faces are same (whether all empty or has the same media) - if(!(LLFloaterMediaSettings::getInstance()->mMultipleMedia) ) + if(!(LLFloaterMediaSettings::getInstance()->getMultipleMedia()) ) { // Media data is valid if(media_data_get!=default_media_data) @@ -1366,7 +1366,7 @@ void LLFloaterTools::getMediaState() } getChildView("media_tex")->setEnabled(bool_has_media && editable); - getChildView("edit_media")->setEnabled(bool_has_media && LLFloaterMediaSettings::getInstance()->mIdenticalHasMediaInfo && editable ); + getChildView("edit_media")->setEnabled(bool_has_media && LLFloaterMediaSettings::getInstance()->getIdenticalHasMediaInfo() && editable ); getChildView("delete_media")->setEnabled(bool_has_media && editable ); getChildView("add_media")->setEnabled(editable); // TODO: display a list of all media on the face - use 'identical' flag @@ -1374,9 +1374,9 @@ void LLFloaterTools::getMediaState() else // not all face has media but at least one does. { // seleted faces have not identical value - LLFloaterMediaSettings::getInstance()->mMultipleValidMedia = selected_objects->isMultipleTEValue(&func_media_data, default_media_data ); + LLFloaterMediaSettings::getInstance()->setMultipleValidMedia(selected_objects->isMultipleTEValue(&func_media_data, default_media_data)); - if(LLFloaterMediaSettings::getInstance()->mMultipleValidMedia) + if(LLFloaterMediaSettings::getInstance()->getMultipleValidMedia()) { media_title = multi_media_info_str; mNeedMediaTitle = false; @@ -1396,7 +1396,7 @@ void LLFloaterTools::getMediaState() } getChildView("media_tex")->setEnabled(TRUE); - getChildView("edit_media")->setEnabled(LLFloaterMediaSettings::getInstance()->mIdenticalHasMediaInfo); + getChildView("edit_media")->setEnabled(LLFloaterMediaSettings::getInstance()->getIdenticalHasMediaInfo()); getChildView("delete_media")->setEnabled(TRUE); getChildView("add_media")->setEnabled(editable); } diff --git a/indra/newview/lljoystickbutton.cpp b/indra/newview/lljoystickbutton.cpp index 59e14e6cc01c902d2e256f0e324bd6d96afedd7a..106e5d5c918d51fd2994d4c40b051c65588d8966 100755 --- a/indra/newview/lljoystickbutton.cpp +++ b/indra/newview/lljoystickbutton.cpp @@ -80,7 +80,7 @@ LLJoystick::LLJoystick(const LLJoystick::Params& p) mHeldDownTimer(), mInitialQuadrant(p.quadrant) { - setHeldDownCallback(&LLJoystick::onBtnHeldDown, this); + setHeldDownCallback(boost::bind(&LLJoystick::onBtnHeldDown, this)); } diff --git a/indra/newview/llpanelface.cpp b/indra/newview/llpanelface.cpp index a1c71ac967da1281aff5765c8887b277eb454d7c..2e89f973283be7fb2ef894cb49a602656b5cac74 100755 --- a/indra/newview/llpanelface.cpp +++ b/indra/newview/llpanelface.cpp @@ -80,6 +80,22 @@ const S32 ALPHAMODE_MASK = 2; // Alpha masking mode const S32 BUMPY_TEXTURE = 18; // use supplied normal map const S32 SHINY_TEXTURE = 4; // use supplied specular map +template<class T, typename std::enable_if<std::is_integral<T>::value>::type* = nullptr> +T normalize(const T value, const T start, const T end) +{ + const T width = end - start; + const T offset_val = value - start; + return (offset_val - ((offset_val / width) * width)) + start; +} + +template<class T, typename std::enable_if<std::is_floating_point<T>::value>::type* = nullptr> +T normalize(const T value, const T start, const T end) +{ + const T width = end - start; + const T offset_val = value - start; + return (offset_val - (llfloor(offset_val / width) * width)) + start; +} + // // "Use texture" label for normal/specular type comboboxes // Filled in at initialization from translated strings @@ -1811,9 +1827,9 @@ void LLPanelFace::alignMaterialProperties() F32 tex_scale_u = getCurrentTextureScaleU(); F32 tex_scale_v = getCurrentTextureScaleV(); - F32 tex_offset_u = getCurrentTextureOffsetU(); - F32 tex_offset_v = getCurrentTextureOffsetV(); - F32 tex_rot = getCurrentTextureRot(); + F32 tex_offset_u = normalize(getCurrentTextureOffsetU(), 0.f, 1.f); + F32 tex_offset_v = normalize(getCurrentTextureOffsetV(), 0.f, 1.f); + F32 tex_rot = normalize(getCurrentTextureRot(), 0.f, 360.f); bool identical_planar_texgen = isIdenticalPlanarTexgen(); diff --git a/indra/newview/llpanelgroup.cpp b/indra/newview/llpanelgroup.cpp index feac7a7211eea515d080562aeb6c56e4e2b0e78f..bc6d1506725096b3574fec45f76e39276cd2b609 100755 --- a/indra/newview/llpanelgroup.cpp +++ b/indra/newview/llpanelgroup.cpp @@ -147,21 +147,21 @@ BOOL LLPanelGroup::postBuild() LLButton* button; button = getChild<LLButton>("btn_apply"); - button->setClickedCallback(onBtnApply, this); + button->setCommitCallback(boost::bind(&LLPanelGroup::onBtnApply, this)); button->setVisible(true); button->setEnabled(false); button = getChild<LLButton>("btn_call"); - button->setClickedCallback(onBtnGroupCallClicked, this); + button->setCommitCallback(boost::bind(&LLPanelGroup::callGroup, this)); button = getChild<LLButton>("btn_chat"); - button->setClickedCallback(onBtnGroupChatClicked, this); + button->setCommitCallback(boost::bind(&LLPanelGroup::chatGroup, this)); button = getChild<LLButton>("btn_cancel"); button->setVisible(false); button->setEnabled(true); button = getChild<LLButton>("btn_refresh"); - button->setClickedCallback(onBtnRefresh, this); + button->setCommitCallback(boost::bind(&LLPanelGroup::refreshData, this)); getChild<LLButton>("btn_create")->setVisible(false); @@ -268,30 +268,12 @@ void LLPanelGroup::onBtnCreate() } } -void LLPanelGroup::onBtnRefresh(void* user_data) +void LLPanelGroup::onBtnApply() { - LLPanelGroup* self = static_cast<LLPanelGroup*>(user_data); - self->refreshData(); + apply(); + refreshData(); } -void LLPanelGroup::onBtnApply(void* user_data) -{ - LLPanelGroup* self = static_cast<LLPanelGroup*>(user_data); - self->apply(); - self->refreshData(); -} - -void LLPanelGroup::onBtnGroupCallClicked(void* user_data) -{ - LLPanelGroup* self = static_cast<LLPanelGroup*>(user_data); - self->callGroup(); -} - -void LLPanelGroup::onBtnGroupChatClicked(void* user_data) -{ - LLPanelGroup* self = static_cast<LLPanelGroup*>(user_data); - self->chatGroup(); -} void LLPanelGroup::onBtnJoin() { diff --git a/indra/newview/llpanelgroup.h b/indra/newview/llpanelgroup.h index 0c7423a2c6df7429ec75b8b48bb01663067aab13..083681be26d158e221b3050991ba452cbb019f49 100755 --- a/indra/newview/llpanelgroup.h +++ b/indra/newview/llpanelgroup.h @@ -96,11 +96,7 @@ protected: void onBackBtnClick(); void onBtnJoin(); void onBtnCancel(); - - static void onBtnApply(void*); - static void onBtnRefresh(void*); - static void onBtnGroupCallClicked(void*); - static void onBtnGroupChatClicked(void*); + void onBtnApply(); void reposButton(const std::string& name); void reposButtons(); diff --git a/indra/newview/llpanelgroupbulk.cpp b/indra/newview/llpanelgroupbulk.cpp index a18e45725e67cdaab76cb505fd6c3ed53b355374..d8781ad1cb47028223bf7ba0a8726bd0aeefe616 100644 --- a/indra/newview/llpanelgroupbulk.cpp +++ b/indra/newview/llpanelgroupbulk.cpp @@ -114,7 +114,7 @@ void LLPanelGroupBulkImpl::callbackClickCancel(void* userdata) (*(selfp->mCloseCallback))(selfp->mCloseCallbackUserData); } -void LLPanelGroupBulkImpl::callbackSelect(LLUICtrl* ctrl, void* userdata) +void LLPanelGroupBulkImpl::callbackSelect(void* userdata) { LLPanelGroupBulkImpl* selfp = (LLPanelGroupBulkImpl*)userdata; if (selfp) diff --git a/indra/newview/llpanelgroupbulkban.cpp b/indra/newview/llpanelgroupbulkban.cpp index f34244e27147f547821b4ec6a959bf95de22d109..f892715daebee1912ca56d625021a4f58ac4ca42 100644 --- a/indra/newview/llpanelgroupbulkban.cpp +++ b/indra/newview/llpanelgroupbulkban.cpp @@ -63,7 +63,7 @@ BOOL LLPanelGroupBulkBan::postBuild() if ( mImplementation->mBulkAgentList ) { mImplementation->mBulkAgentList->setCommitOnSelectionChange(TRUE); - mImplementation->mBulkAgentList->setCommitCallback(LLPanelGroupBulkImpl::callbackSelect, mImplementation); + mImplementation->mBulkAgentList->setCommitCallback(boost::bind(&LLPanelGroupBulkImpl::callbackSelect, this)); } LLButton* button = getChild<LLButton>("add_button", recurse); @@ -71,14 +71,14 @@ BOOL LLPanelGroupBulkBan::postBuild() { // default to opening avatarpicker automatically // (*impl::callbackClickAdd)((void*)this); - button->setClickedCallback(LLPanelGroupBulkImpl::callbackClickAdd, this); + button->setCommitCallback(boost::bind(&LLPanelGroupBulkImpl::callbackClickAdd, this)); } mImplementation->mRemoveButton = getChild<LLButton>("remove_button", recurse); if ( mImplementation->mRemoveButton ) { - mImplementation->mRemoveButton->setClickedCallback(LLPanelGroupBulkImpl::callbackClickRemove, mImplementation); + mImplementation->mRemoveButton->setCommitCallback(boost::bind(&LLPanelGroupBulkImpl::callbackClickRemove, mImplementation)); mImplementation->mRemoveButton->setEnabled(FALSE); } @@ -86,14 +86,14 @@ BOOL LLPanelGroupBulkBan::postBuild() getChild<LLButton>("ban_button", recurse); if ( mImplementation->mOKButton ) { - mImplementation->mOKButton->setClickedCallback(LLPanelGroupBulkBan::callbackClickSubmit, this); + mImplementation->mOKButton->setCommitCallback(boost::bind(&LLPanelGroupBulkBan::callbackClickSubmit, this)); mImplementation->mOKButton->setEnabled(FALSE); } button = getChild<LLButton>("cancel_button", recurse); if ( button ) { - button->setClickedCallback(LLPanelGroupBulkImpl::callbackClickCancel, mImplementation); + button->setCommitCallback(boost::bind(&LLPanelGroupBulkImpl::callbackClickCancel, mImplementation)); } mImplementation->mTooManySelected = getString("ban_selection_too_large"); diff --git a/indra/newview/llpanelgroupbulkimpl.h b/indra/newview/llpanelgroupbulkimpl.h index d3a48e5a9a3fb462c4df5eb8d16bcb32d94d3952..a4ef4414729e21455623eb2783a67953500f177b 100644 --- a/indra/newview/llpanelgroupbulkimpl.h +++ b/indra/newview/llpanelgroupbulkimpl.h @@ -49,7 +49,7 @@ public: static void callbackClickCancel(void* userdata); - static void callbackSelect(LLUICtrl* ctrl, void* userdata); + static void callbackSelect(void* userdata); static void callbackAddUsers(const uuid_vec_t& agent_ids, void* user_data); static void onAvatarNameCache(const LLUUID& agent_id, const LLAvatarName& av_name, void* user_data); diff --git a/indra/newview/llpanelgroupinvite.cpp b/indra/newview/llpanelgroupinvite.cpp index 2c7ef760909abff55fe96f0c1b8da7a54888ec99..876e13c917edc350c8750900dde5ca88a7f62c89 100755 --- a/indra/newview/llpanelgroupinvite.cpp +++ b/indra/newview/llpanelgroupinvite.cpp @@ -645,14 +645,14 @@ BOOL LLPanelGroupInvite::postBuild() { // default to opening avatarpicker automatically // (*impl::callbackClickAdd)((void*)this); - button->setClickedCallback(impl::callbackClickAdd, this); + button->setCommitCallback(boost::bind(impl::callbackClickAdd, this)); } mImplementation->mRemoveButton = getChild<LLButton>("remove_button", recurse); if ( mImplementation->mRemoveButton ) { - mImplementation->mRemoveButton->setClickedCallback(impl::callbackClickRemove, mImplementation); + mImplementation->mRemoveButton->setCommitCallback(boost::bind(impl::callbackClickRemove, mImplementation)); mImplementation->mRemoveButton->setEnabled(FALSE); } @@ -660,14 +660,14 @@ BOOL LLPanelGroupInvite::postBuild() getChild<LLButton>("invite_button", recurse); if ( mImplementation->mOKButton ) { - mImplementation->mOKButton->setClickedCallback(impl::callbackClickOK, mImplementation); + mImplementation->mOKButton->setCommitCallback(boost::bind(impl::callbackClickOK, mImplementation)); mImplementation->mOKButton->setEnabled(FALSE); } button = getChild<LLButton>("cancel_button", recurse); if ( button ) { - button->setClickedCallback(impl::callbackClickCancel, mImplementation); + button->setCommitCallback(boost::bind(impl::callbackClickCancel, mImplementation)); } mImplementation->mOwnerWarning = getString("confirm_invite_owner_str"); diff --git a/indra/newview/llpanelgrouplandmoney.cpp b/indra/newview/llpanelgrouplandmoney.cpp index 5e2e979c68c14b911669c80dbb2a305878359846..b3c455f4ecd132b660d6019960726222cb5a86a4 100755 --- a/indra/newview/llpanelgrouplandmoney.cpp +++ b/indra/newview/llpanelgrouplandmoney.cpp @@ -717,7 +717,7 @@ BOOL LLPanelGroupLandMoney::postBuild() if ( mImplementationp->mMapButtonp ) { - mImplementationp->mMapButtonp->setClickedCallback(LLPanelGroupLandMoney::impl::mapCallback, mImplementationp); + mImplementationp->mMapButtonp->setCommitCallback(boost::bind(LLPanelGroupLandMoney::impl::mapCallback, mImplementationp)); } if ( mImplementationp->mGroupOverLimitTextp ) @@ -927,12 +927,12 @@ LLGroupMoneyTabEventHandler::LLGroupMoneyTabEventHandler(LLButton* earlier_butto if ( earlier_buttonp ) { - earlier_buttonp->setClickedCallback(clickEarlierCallback, this); + earlier_buttonp->setCommitCallback(boost::bind(&LLGroupMoneyTabEventHandler::clickEarlierCallback, this)); } if ( later_buttonp ) { - later_buttonp->setClickedCallback(clickLaterCallback, this); + later_buttonp->setCommitCallback(boost::bind(&LLGroupMoneyTabEventHandler::clickLaterCallback, this)); } mImplementationp->updateButtons(); @@ -1552,7 +1552,7 @@ void LLPanelGroupLandMoney::setGroupID(const LLUUID& id) if ( mImplementationp->mMapButtonp ) { - mImplementationp->mMapButtonp->setClickedCallback(LLPanelGroupLandMoney::impl::mapCallback, mImplementationp); + mImplementationp->mMapButtonp->setCommitCallback(boost::bind(&LLPanelGroupLandMoney::impl::mapCallback, mImplementationp)); } if ( mImplementationp->mGroupOverLimitTextp ) diff --git a/indra/newview/llpanelgroupnotices.cpp b/indra/newview/llpanelgroupnotices.cpp index 5260714ae945d67d7e8fd8f12c56dc4c245dcc58..01958bebfb968dedf3b447cc97e7e27f005842f4 100755 --- a/indra/newview/llpanelgroupnotices.cpp +++ b/indra/newview/llpanelgroupnotices.cpp @@ -248,11 +248,11 @@ BOOL LLPanelGroupNotices::postBuild() mNoticesList->setCommitCallback(boost::bind(&LLPanelGroupNotices::onSelectNotice, this)); mBtnNewMessage = getChild<LLButton>("create_new_notice",recurse); - mBtnNewMessage->setClickedCallback(onClickNewMessage, this); + mBtnNewMessage->setCommitCallback(boost::bind(&LLPanelGroupNotices::onClickNewMessage, this)); mBtnNewMessage->setEnabled(gAgent.hasPowerInGroup(mGroupID, GP_NOTICES_SEND)); mBtnGetPastNotices = getChild<LLButton>("refresh_notices",recurse); - mBtnGetPastNotices->setClickedCallback(onClickRefreshNotices, this); + mBtnGetPastNotices->setClickedCallback(boost::bind(&LLPanelGroupNotices::onClickRefreshNotices, this)); // Create mCreateSubject = getChild<LLLineEditor>("create_subject",recurse); @@ -266,10 +266,10 @@ BOOL LLPanelGroupNotices::postBuild() mCreateInventoryIcon->setVisible(FALSE); mBtnSendMessage = getChild<LLButton>("send_notice",recurse); - mBtnSendMessage->setClickedCallback(onClickSendMessage, this); + mBtnSendMessage->setClickedCallback(boost::bind(&LLPanelGroupNotices::onClickSendMessage, this)); mBtnRemoveAttachment = getChild<LLButton>("remove_attachment",recurse); - mBtnRemoveAttachment->setClickedCallback(onClickRemoveAttachment, this); + mBtnRemoveAttachment->setClickedCallback(boost::bind(&LLPanelGroupNotices::onClickRemoveAttachment, this)); mBtnRemoveAttachment->setEnabled(FALSE); // View @@ -284,7 +284,7 @@ BOOL LLPanelGroupNotices::postBuild() mViewInventoryIcon->setVisible(FALSE); mBtnOpenAttachment = getChild<LLButton>("open_attachment",recurse); - mBtnOpenAttachment->setClickedCallback(onClickOpenAttachment, this); + mBtnOpenAttachment->setClickedCallback(boost::bind(&LLPanelGroupNotices::onClickOpenAttachment, this)); mNoNoticesStr = getString("no_notices_text"); diff --git a/indra/newview/llpanelgrouproles.cpp b/indra/newview/llpanelgrouproles.cpp index 0bccc34c33dffd62966b132207d0974ff50b174f..2905e834c3bd5ee817c28a15adaaef67f5c3e4d5 100755 --- a/indra/newview/llpanelgrouproles.cpp +++ b/indra/newview/llpanelgrouproles.cpp @@ -843,7 +843,7 @@ BOOL LLPanelGroupMembersSubTab::postBuildSubTab(LLView* root) LLButton* button = parent->getChild<LLButton>("member_invite", recurse); if ( button ) { - button->setClickedCallback(onInviteMember, this); + button->setCommitCallback(boost::bind(&LLPanelGroupMembersSubTab::onInviteMember, this)); button->setEnabled(gAgent.hasPowerInGroup(mGroupID, GP_MEMBER_INVITE)); } @@ -857,14 +857,14 @@ BOOL LLPanelGroupMembersSubTab::postBuildSubTab(LLView* root) mEjectBtn = parent->getChild<LLButton>("member_eject", recurse); if ( mEjectBtn ) { - mEjectBtn->setClickedCallback(onEjectMembers, this); + mEjectBtn->setClickedCallback(boost::bind(&LLPanelGroupMembersSubTab::onEjectMembers, this)); mEjectBtn->setEnabled(FALSE); } mBanBtn = parent->getChild<LLButton>("member_ban", recurse); if(mBanBtn) { - mBanBtn->setClickedCallback(onBanMember, this); + mBanBtn->setClickedCallback(boost::bind(&LLPanelGroupMembersSubTab::onBanMember, this)); mBanBtn->setEnabled(FALSE); } @@ -1996,7 +1996,7 @@ BOOL LLPanelGroupRolesSubTab::postBuildSubTab(LLView* root) parent->getChild<LLButton>("role_create", recurse); if ( mCreateRoleButton ) { - mCreateRoleButton->setClickedCallback(onCreateRole, this); + mCreateRoleButton->setCommitCallback(boost::bind(&LLPanelGroupRolesSubTab::onCreateRole, this)); mCreateRoleButton->setEnabled(FALSE); } @@ -2004,7 +2004,7 @@ BOOL LLPanelGroupRolesSubTab::postBuildSubTab(LLView* root) parent->getChild<LLButton>("role_delete", recurse); if ( mDeleteRoleButton ) { - mDeleteRoleButton->setClickedCallback(onDeleteRole, this); + mDeleteRoleButton->setClickedCallback(boost::bind(&LLPanelGroupRolesSubTab::onDeleteRole, this)); mDeleteRoleButton->setEnabled(FALSE); } diff --git a/indra/newview/llpanelmediasettingsgeneral.cpp b/indra/newview/llpanelmediasettingsgeneral.cpp index e6c0834dac68cdbe001424bc6d5766008b9e7f10..0b612ff53574523030cc5621a8152018cf07ff9f 100755 --- a/indra/newview/llpanelmediasettingsgeneral.cpp +++ b/indra/newview/llpanelmediasettingsgeneral.cpp @@ -222,9 +222,9 @@ void LLPanelMediaSettingsGeneral::clearValues( void* userdata, bool editable) bool LLPanelMediaSettingsGeneral::isMultiple() { // IF all the faces have media (or all dont have media) - if ( LLFloaterMediaSettings::getInstance()->mIdenticalHasMediaInfo ) + if ( LLFloaterMediaSettings::getInstance()->getIdenticalHasMediaInfo() ) { - if(LLFloaterMediaSettings::getInstance()->mMultipleMedia) + if(LLFloaterMediaSettings::getInstance()->getMultipleMedia()) { return true; } @@ -232,7 +232,7 @@ bool LLPanelMediaSettingsGeneral::isMultiple() } else { - if(LLFloaterMediaSettings::getInstance()->mMultipleValidMedia) + if(LLFloaterMediaSettings::getInstance()->getMultipleValidMedia()) { return true; } diff --git a/indra/newview/llstatusbar.cpp b/indra/newview/llstatusbar.cpp index 86acb98905cf5df82b8be6c53bda9fb722742f7e..20f1d91d219990e624cb5852338c12a169a220d0 100755 --- a/indra/newview/llstatusbar.cpp +++ b/indra/newview/llstatusbar.cpp @@ -162,7 +162,7 @@ BOOL LLStatusBar::postBuild() { gMenuBarView->setRightMouseDownCallback(boost::bind(&show_navbar_context_menu, _1, _2, _3)); - mTextTime = getChild<LLTextBox>("TimeText" ); + mTextTime = getChild<LLTextBox>("TimeText"); mTextFPS = getChild<LLTextBox>("FPSText"); diff --git a/indra/newview/llviewchildren.cpp b/indra/newview/llviewchildren.cpp index 5c5bbdc8f589ab25809a89efb95bf9e8e724bf59..ac6fe3dce13e46e532e2e7953b602274b7d25520 100755 --- a/indra/newview/llviewchildren.cpp +++ b/indra/newview/llviewchildren.cpp @@ -57,8 +57,7 @@ void LLViewChildren::enable(const std::string& id, bool enabled) mParent.getChildView(id)->setEnabled(enabled); } -void LLViewChildren::setText( - const std::string& id, const std::string& text, bool visible) +void LLViewChildren::setText(const std::string& id, const std::string& text, bool visible) { LLTextBox* child = mParent.getChild<LLTextBox>(id); if (child) @@ -89,10 +88,7 @@ void LLViewChildren::setAction(const std::string& id, void(*function)(void*), void* value) { LLButton* button = mParent.getChild<LLButton>(id); - if (button) - { - button->setClickedCallback(function, value); - } + button->setClickedCallback(function, value); } diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index c47356053e5c3f4d81285b06b0dcdb64f246af20..92162b2b9fbe4074b59f94de2630ed7b12503b0b 100755 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -74,6 +74,7 @@ #include "llfloaterpathfindingcharacters.h" #include "llfloaterpathfindinglinksets.h" #include "llfloaterpay.h" +#include "llfloaterregioninfo.h" #include "llfloaterreporter.h" #include "llfloatersearch.h" #include "llfloaterscriptdebug.h" @@ -4122,11 +4123,17 @@ void set_god_level(U8 god_level) show_debug_menus(); // changing god-level can invalidate search results - LLFloaterSearch *search = dynamic_cast<LLFloaterSearch*>(LLFloaterReg::getInstance("search")); + LLFloaterSearch *search = dynamic_cast<LLFloaterSearch*>(LLFloaterReg::findInstance("search")); if (search) { search->godLevelChanged(god_level); } + + LLFloaterRegionInfo *region_info = dynamic_cast<LLFloaterRegionInfo*>(LLFloaterReg::findInstance("region_info")); + if (region_info && region_info->getVisible()) + { + region_info->refresh(); + } } #ifdef TOGGLE_HACKED_GODLIKE_VIEWER diff --git a/indra/newview/llviewerparcelmgr.cpp b/indra/newview/llviewerparcelmgr.cpp index ab99df8674722c542164cd5003a9381f944c2dcf..7a25a492dc993e70ce055e7cca3947f64b3ef731 100755 --- a/indra/newview/llviewerparcelmgr.cpp +++ b/indra/newview/llviewerparcelmgr.cpp @@ -1866,7 +1866,7 @@ void LLViewerParcelMgr::processParcelAccessListReply(LLMessageSystem *msg, void parcel->unpackAccessEntries(msg, &(parcel->mRenterList) ); }*/ - LLViewerParcelMgr::getInstance()->notifyObservers(); + LLViewerParcelMgr::getInstance()->mParcelMsgSignal(); } @@ -1888,7 +1888,7 @@ void LLViewerParcelMgr::processParcelDwellReply(LLMessageSystem* msg, void**) if (local_id == LLViewerParcelMgr::getInstance()->mCurrentParcel->getLocalID()) { LLViewerParcelMgr::getInstance()->mSelectedDwell = dwell; - LLViewerParcelMgr::getInstance()->notifyObservers(); + LLViewerParcelMgr::getInstance()->mParcelMsgSignal(); } } diff --git a/indra/newview/llviewerparcelmgr.h b/indra/newview/llviewerparcelmgr.h index c2d976e74670396eb9fe6d95443fea5f9e746a51..dbb5d687a17b64f4fa185b267d2bdf867bc71266 100755 --- a/indra/newview/llviewerparcelmgr.h +++ b/indra/newview/llviewerparcelmgr.h @@ -128,6 +128,10 @@ public: void addObserver(LLParcelObserver* observer); void removeObserver(LLParcelObserver* observer); void notifyObservers(); + + typedef boost::signals2::signal<void()> parcel_msg_signal_t; + boost::signals2::connection addParcelMsgCallback(const parcel_msg_signal_t::slot_type& cb) + { return mParcelMsgSignal.connect(cb); } void setSelectionVisible(BOOL visible) { mRenderSelection = visible; } @@ -332,6 +336,8 @@ private: LLVector3d mHoverEastNorth; std::vector<LLParcelObserver*> mObservers; + + parcel_msg_signal_t mParcelMsgSignal; BOOL mTeleportInProgress; LLVector3d mTeleportInProgressPosition;