diff --git a/indra/llui/llcombobox.cpp b/indra/llui/llcombobox.cpp index 8f50e2b030484f9fa18344a29a6f7f2cd9807a30..b4a8df4d3136696d179d07574e56d040cc496f5d 100755 --- a/indra/llui/llcombobox.cpp +++ b/indra/llui/llcombobox.cpp @@ -1066,7 +1066,7 @@ BOOL LLComboBox::setCurrentByID(const LLUUID& id) LLUUID LLComboBox::getCurrentID() const { - return mList->getStringUUIDSelectedItem(); + return mList->getSelectedValue().asUUID(); } BOOL LLComboBox::setSelectedByValue(const LLSD& value, BOOL selected) { diff --git a/indra/llui/llscrolllistctrl.h b/indra/llui/llscrolllistctrl.h index 4609882eb7d12270905eef6b0d1653d1e626151e..14975b30b60187255218293a95e95e1ccf50ab2e 100755 --- a/indra/llui/llscrolllistctrl.h +++ b/indra/llui/llscrolllistctrl.h @@ -184,8 +184,8 @@ public: LLCtrlScrollInterface* getScrollInterface() { return (LLCtrlScrollInterface*)this; } // DEPRECATED: Use setSelectedByValue() below. - BOOL setCurrentByID( const LLUUID& id ) { return selectByID(id); } - virtual LLUUID getCurrentID() const { return getStringUUIDSelectedItem(); } + BOOL DEPRECATED(setCurrentByID( const LLUUID& id )) { return selectByID(id); } + virtual LLUUID DEPRECATED(getCurrentID() const) { return getStringUUIDSelectedItem(); } BOOL operateOnSelection(EOperation op); BOOL operateOnAll(EOperation op); @@ -253,7 +253,7 @@ public: // "StringUUID" interface: use this when you're creating a list that contains non-unique strings each of which // has an associated, unique UUID, and only one of which can be selected at a time. LLScrollListItem* addStringUUIDItem(const std::string& item_text, const LLUUID& id, EAddPosition pos = ADD_BOTTOM, BOOL enabled = TRUE); - LLUUID getStringUUIDSelectedItem() const; + LLUUID DEPRECATED(getStringUUIDSelectedItem() const); LLScrollListItem* getFirstSelected() const; virtual S32 getFirstSelectedIndex() const; diff --git a/indra/newview/llfloaterbuyland.cpp b/indra/newview/llfloaterbuyland.cpp index 0a0e5ffc0619e96779b64b7eaa0cc691616e07c5..26b1f3b55c339cd950baca1b6c2d2c8fa4589c3b 100755 --- a/indra/newview/llfloaterbuyland.cpp +++ b/indra/newview/llfloaterbuyland.cpp @@ -162,7 +162,6 @@ public: void updateAgentInfo(); void updateParcelInfo(); void updateCovenantInfo(); - static void onChangeAgreeCovenant(LLUICtrl* ctrl, void* user_data); void updateFloaterCovenantText(const std::string& string, const LLUUID &asset_id); void updateFloaterEstateName(const std::string& name); void updateFloaterLastModified(const std::string& text); @@ -563,7 +562,7 @@ void LLFloaterBuyLandUI::updateCovenantInfo() { check->set(false); check->setEnabled(true); - check->setCommitCallback(onChangeAgreeCovenant, this); + check->setCommitCallback(boost::bind(&LLFloaterBuyLandUI::refreshUI, this)); } LLTextBox* box = getChild<LLTextBox>("covenant_text"); @@ -581,16 +580,6 @@ void LLFloaterBuyLandUI::updateCovenantInfo() msg->sendReliable(region->getHost()); } -// static -void LLFloaterBuyLandUI::onChangeAgreeCovenant(LLUICtrl* ctrl, void* user_data) -{ - LLFloaterBuyLandUI* self = (LLFloaterBuyLandUI*)user_data; - if(self) - { - self->refreshUI(); - } -} - void LLFloaterBuyLandUI::updateFloaterCovenantText(const std::string &string, const LLUUID& asset_id) { LLViewerTextEditor* editor = getChild<LLViewerTextEditor>("covenant_editor"); diff --git a/indra/newview/llfloatercolorpicker.cpp b/indra/newview/llfloatercolorpicker.cpp index 535cb368bdbdefe7adeb6c8f831612f6c14d946f..6dd3fdf60ce51bebdabeec809f7ab608ce796037 100755 --- a/indra/newview/llfloatercolorpicker.cpp +++ b/indra/newview/llfloatercolorpicker.cpp @@ -218,7 +218,7 @@ BOOL LLFloaterColorPicker::postBuild() mApplyImmediateCheck = getChild<LLCheckBoxCtrl>("apply_immediate"); mApplyImmediateCheck->set(gSavedSettings.getBOOL("ApplyColorImmediately")); - mApplyImmediateCheck->setCommitCallback(onImmediateCheck, this); + mApplyImmediateCheck->setCommitCallback(boost::bind(&LLFloaterColorPicker::onImmediateCheck, this)); childSetCommitCallback("rspin", onTextCommit, (void*)this ); childSetCommitCallback("gspin", onTextCommit, (void*)this ); @@ -441,17 +441,13 @@ void LLFloaterColorPicker::onTextCommit ( LLUICtrl* ctrl, void* data ) } } -void LLFloaterColorPicker::onImmediateCheck( LLUICtrl* ctrl, void* data) +void LLFloaterColorPicker::onImmediateCheck() { - LLFloaterColorPicker* self = ( LLFloaterColorPicker* )data; - if (self) - { - gSavedSettings.setBOOL("ApplyColorImmediately", self->mApplyImmediateCheck->get()); + gSavedSettings.setBOOL("ApplyColorImmediately", mApplyImmediateCheck->get()); - if (self->mApplyImmediateCheck->get()) - { - LLColorSwatchCtrl::onColorChanged ( self->getSwatch (), LLColorSwatchCtrl::COLOR_CHANGE ); - } + if (mApplyImmediateCheck->get()) + { + LLColorSwatchCtrl::onColorChanged ( getSwatch(), LLColorSwatchCtrl::COLOR_CHANGE ); } } diff --git a/indra/newview/llfloatercolorpicker.h b/indra/newview/llfloatercolorpicker.h index 8c16ebdf0343c2843f166ee50524cc33751d003a..d90f7239f3fcdd283a7953ce18cb61ca53896f8b 100755 --- a/indra/newview/llfloatercolorpicker.h +++ b/indra/newview/llfloatercolorpicker.h @@ -119,7 +119,7 @@ class LLFloaterColorPicker static void onClickSelect ( void* data ); void onClickPipette ( ); static void onTextCommit ( LLUICtrl* ctrl, void* data ); - static void onImmediateCheck ( LLUICtrl* ctrl, void* data ); + void onImmediateCheck (); void onColorSelect( const class LLTextureEntry& te ); private: // mutators for color values, can raise event to preview changes at object diff --git a/indra/newview/llfloaterland.cpp b/indra/newview/llfloaterland.cpp index d824c0fc50b7f58921698972afffcf2ef6c82f74..3e1ffc9c6c258179fdfd896d0d57a0292f8634f8 100755 --- a/indra/newview/llfloaterland.cpp +++ b/indra/newview/llfloaterland.cpp @@ -399,12 +399,12 @@ LLPanelLandGeneral::LLPanelLandGeneral(LLParcelSelectionHandle& parcel) BOOL LLPanelLandGeneral::postBuild() { mEditName = getChild<LLLineEditor>("Name"); - mEditName->setCommitCallback(onCommitAny, this); + mEditName->setCommitCallback(boost::bind(&LLPanelLandGeneral::onCommitAny, this)); getChild<LLLineEditor>("Name")->setPrevalidate(LLTextValidate::validateASCIIPrintableNoPipe); mEditDesc = getChild<LLTextEditor>("Description"); mEditDesc->setCommitOnFocusLost(TRUE); - mEditDesc->setCommitCallback(onCommitAny, this); + mEditDesc->setCommitCallback(boost::bind(&LLPanelLandGeneral::onCommitAny, this)); // No prevalidate function - historically the prevalidate function was broken, // allowing residents to put in characters like U+2661 WHITE HEART SUIT, so // preserve that ability. @@ -429,7 +429,7 @@ BOOL LLPanelLandGeneral::postBuild() mCheckDeedToGroup = getChild<LLCheckBoxCtrl>( "check deed"); - childSetCommitCallback("check deed", onCommitAny, this); + mCheckDeedToGroup->setCommitCallback(boost::bind(&LLPanelLandGeneral::onCommitAny, this)); mBtnDeedToGroup = getChild<LLButton>("Deed..."); @@ -437,8 +437,7 @@ BOOL LLPanelLandGeneral::postBuild() mCheckContributeWithDeed = getChild<LLCheckBoxCtrl>( "check contrib"); - childSetCommitCallback("check contrib", onCommitAny, this); - + mCheckContributeWithDeed->setCommitCallback(boost::bind(&LLPanelLandGeneral::onCommitAny, this)); mSaleInfoNotForSale = getChild<LLTextBox>("Not for sale."); @@ -1044,20 +1043,17 @@ bool LLPanelLandGeneral::cbBuyPass(const LLSD& notification, const LLSD& respons return false; } -// static -void LLPanelLandGeneral::onCommitAny(LLUICtrl *ctrl, void *userdata) +void LLPanelLandGeneral::onCommitAny() { - LLPanelLandGeneral *panelp = (LLPanelLandGeneral *)userdata; - - LLParcel* parcel = panelp->mParcel->getParcel(); + LLParcel* parcel = mParcel->getParcel(); if (!parcel) { return; } // Extract data from UI - std::string name = panelp->mEditName->getText(); - std::string desc = panelp->mEditDesc->getText(); + std::string name = mEditName->getText(); + std::string desc = mEditDesc->getText(); // Valid data from UI @@ -1065,8 +1061,8 @@ void LLPanelLandGeneral::onCommitAny(LLUICtrl *ctrl, void *userdata) parcel->setName(name); parcel->setDesc(desc); - BOOL allow_deed_to_group= panelp->mCheckDeedToGroup->get(); - BOOL contribute_with_deed = panelp->mCheckContributeWithDeed->get(); + BOOL allow_deed_to_group= mCheckDeedToGroup->get(); + BOOL contribute_with_deed = mCheckContributeWithDeed->get(); parcel->setParcelFlag(PF_ALLOW_DEED_TO_GROUP, allow_deed_to_group); parcel->setContributeWithDeed(contribute_with_deed); @@ -1075,7 +1071,7 @@ void LLPanelLandGeneral::onCommitAny(LLUICtrl *ctrl, void *userdata) LLViewerParcelMgr::getInstance()->sendParcelPropertiesUpdate( parcel ); // Might have changed properties, so let's redraw! - panelp->refresh(); + refresh(); } // static @@ -1167,7 +1163,7 @@ BOOL LLPanelLandObjects::postBuild() mCleanOtherObjectsTime = getChild<LLLineEditor>("clean other time"); mCleanOtherObjectsTime->setFocusLostCallback(boost::bind(onLostFocus, _1, this)); - mCleanOtherObjectsTime->setCommitCallback(onCommitClean, this); + mCleanOtherObjectsTime->setCommitCallback(boost::bind(&LLPanelLandObjects::onCommitClean, this)); getChild<LLLineEditor>("clean other time")->setPrevalidate(LLTextValidate::validateNonNegativeS32); mBtnRefresh = getChild<LLButton>("Refresh List"); @@ -1822,24 +1818,23 @@ void LLPanelLandObjects::onClickReturnOtherObjects(void* userdata) // static void LLPanelLandObjects::onLostFocus(LLFocusableElement* caller, void* user_data) { - onCommitClean((LLUICtrl*)caller, user_data); + LLPanelLandObjects *lop = static_cast<LLPanelLandObjects*>(user_data); + if (lop) lop->onCommitClean(); } -// static -void LLPanelLandObjects::onCommitClean(LLUICtrl *caller, void* user_data) +void LLPanelLandObjects::onCommitClean() { - LLPanelLandObjects *lop = (LLPanelLandObjects *)user_data; - LLParcel* parcel = lop->mParcel->getParcel(); + LLParcel* parcel = mParcel->getParcel(); if (parcel) { - S32 return_time = atoi(lop->mCleanOtherObjectsTime->getText().c_str()); + S32 return_time = atoi(mCleanOtherObjectsTime->getText().c_str()); // Only send return time if it has changed - if (return_time != lop->mOtherTime) + if (return_time != mOtherTime) { - lop->mOtherTime = return_time; + mOtherTime = return_time; - parcel->setCleanOtherTime(lop->mOtherTime); - send_other_clean_time_message(parcel->getLocalID(), lop->mOtherTime); + parcel->setCleanOtherTime(mOtherTime); + send_other_clean_time_message(parcel->getLocalID(), mOtherTime); } } } @@ -1877,49 +1872,49 @@ LLPanelLandOptions::LLPanelLandOptions(LLParcelSelectionHandle& parcel) BOOL LLPanelLandOptions::postBuild() { mCheckEditObjects = getChild<LLCheckBoxCtrl>( "edit objects check"); - childSetCommitCallback("edit objects check", onCommitAny, this); + mCheckEditObjects->setCommitCallback(boost::bind(&LLPanelLandOptions::onCommitAny, this)); mCheckEditGroupObjects = getChild<LLCheckBoxCtrl>( "edit group objects check"); - childSetCommitCallback("edit group objects check", onCommitAny, this); + mCheckEditGroupObjects->setCommitCallback(boost::bind(&LLPanelLandOptions::onCommitAny, this)); mCheckAllObjectEntry = getChild<LLCheckBoxCtrl>( "all object entry check"); - childSetCommitCallback("all object entry check", onCommitAny, this); + mCheckAllObjectEntry->setCommitCallback(boost::bind(&LLPanelLandOptions::onCommitAny, this)); mCheckGroupObjectEntry = getChild<LLCheckBoxCtrl>( "group object entry check"); - childSetCommitCallback("group object entry check", onCommitAny, this); + mCheckGroupObjectEntry->setCommitCallback(boost::bind(&LLPanelLandOptions::onCommitAny, this)); mCheckGroupScripts = getChild<LLCheckBoxCtrl>( "check group scripts"); - childSetCommitCallback("check group scripts", onCommitAny, this); + mCheckGroupScripts->setCommitCallback(boost::bind(&LLPanelLandOptions::onCommitAny, this)); mCheckFly = getChild<LLCheckBoxCtrl>( "check fly"); - childSetCommitCallback("check fly", onCommitAny, this); + mCheckFly->setCommitCallback(boost::bind(&LLPanelLandOptions::onCommitAny, this)); mCheckOtherScripts = getChild<LLCheckBoxCtrl>( "check other scripts"); - childSetCommitCallback("check other scripts", onCommitAny, this); + mCheckOtherScripts->setCommitCallback(boost::bind(&LLPanelLandOptions::onCommitAny, this)); mCheckSafe = getChild<LLCheckBoxCtrl>( "check safe"); - childSetCommitCallback("check safe", onCommitAny, this); + mCheckSafe->setCommitCallback(boost::bind(&LLPanelLandOptions::onCommitAny, this)); mPushRestrictionCtrl = getChild<LLCheckBoxCtrl>( "PushRestrictCheck"); - childSetCommitCallback("PushRestrictCheck", onCommitAny, this); + mPushRestrictionCtrl->setCommitCallback(boost::bind(&LLPanelLandOptions::onCommitAny, this)); mSeeAvatarsCtrl = getChild<LLCheckBoxCtrl>( "SeeAvatarsCheck"); - childSetCommitCallback("SeeAvatarsCheck", onCommitAny, this); + mSeeAvatarsCtrl->setCommitCallback(boost::bind(&LLPanelLandOptions::onCommitAny, this)); mCheckShowDirectory = getChild<LLCheckBoxCtrl>( "ShowDirectoryCheck"); - childSetCommitCallback("ShowDirectoryCheck", onCommitAny, this); + mCheckShowDirectory->setCommitCallback(boost::bind(&LLPanelLandOptions::onCommitAny, this)); mCategoryCombo = getChild<LLComboBox>( "land category"); - childSetCommitCallback("land category", onCommitAny, this); + mCategoryCombo->setCommitCallback(boost::bind(&LLPanelLandOptions::onCommitAny, this)); mMatureCtrl = getChild<LLCheckBoxCtrl>( "MatureCheck"); - childSetCommitCallback("MatureCheck", onCommitAny, this); + mMatureCtrl->setCommitCallback(boost::bind(&LLPanelLandOptions::onCommitAny, this)); if (gAgent.wantsPGOnly()) { @@ -1932,7 +1927,7 @@ BOOL LLPanelLandOptions::postBuild() mSnapshotCtrl = getChild<LLTextureCtrl>("snapshot_ctrl"); if (mSnapshotCtrl) { - mSnapshotCtrl->setCommitCallback( onCommitAny, this ); + mSnapshotCtrl->setCommitCallback(boost::bind(&LLPanelLandOptions::onCommitAny, this)); mSnapshotCtrl->setAllowNoTexture ( TRUE ); mSnapshotCtrl->setImmediateFilterPermMask(PERM_COPY | PERM_TRANSFER); mSnapshotCtrl->setDnDFilterPermMask(PERM_COPY | PERM_TRANSFER); @@ -1955,7 +1950,7 @@ BOOL LLPanelLandOptions::postBuild() mLandingTypeCombo = getChild<LLComboBox>( "landing type"); - childSetCommitCallback("landing type", onCommitAny, this); + mLandingTypeCombo->setCommitCallback(boost::bind(&LLPanelLandOptions::onCommitAny, this)); return TRUE; } @@ -2244,37 +2239,34 @@ void LLPanelLandOptions::refreshSearch() } -// static -void LLPanelLandOptions::onCommitAny(LLUICtrl *ctrl, void *userdata) +void LLPanelLandOptions::onCommitAny() { - LLPanelLandOptions *self = (LLPanelLandOptions *)userdata; - - LLParcel* parcel = self->mParcel->getParcel(); + LLParcel* parcel = mParcel->getParcel(); if (!parcel) { return; } // Extract data from UI - BOOL create_objects = self->mCheckEditObjects->get(); - BOOL create_group_objects = self->mCheckEditGroupObjects->get() || self->mCheckEditObjects->get(); - BOOL all_object_entry = self->mCheckAllObjectEntry->get(); - BOOL group_object_entry = self->mCheckGroupObjectEntry->get() || self->mCheckAllObjectEntry->get(); - BOOL allow_terraform = false; // removed from UI so always off now - self->mCheckEditLand->get(); - BOOL allow_damage = !self->mCheckSafe->get(); - BOOL allow_fly = self->mCheckFly->get(); + BOOL create_objects = mCheckEditObjects->get(); + BOOL create_group_objects = mCheckEditGroupObjects->get() || mCheckEditObjects->get(); + BOOL all_object_entry = mCheckAllObjectEntry->get(); + BOOL group_object_entry = mCheckGroupObjectEntry->get() || mCheckAllObjectEntry->get(); + BOOL allow_terraform = false; // removed from UI so always off now - mCheckEditLand->get(); + BOOL allow_damage = !mCheckSafe->get(); + BOOL allow_fly = mCheckFly->get(); BOOL allow_landmark = TRUE; // cannot restrict landmark creation - BOOL allow_other_scripts = self->mCheckOtherScripts->get(); - BOOL allow_group_scripts = self->mCheckGroupScripts->get() || allow_other_scripts; + BOOL allow_other_scripts = mCheckOtherScripts->get(); + BOOL allow_group_scripts = mCheckGroupScripts->get() || allow_other_scripts; BOOL allow_publish = FALSE; - BOOL mature_publish = self->mMatureCtrl->get(); - BOOL push_restriction = self->mPushRestrictionCtrl->get(); - BOOL see_avs = self->mSeeAvatarsCtrl->get(); - BOOL show_directory = self->mCheckShowDirectory->get(); + BOOL mature_publish = mMatureCtrl->get(); + BOOL push_restriction = mPushRestrictionCtrl->get(); + BOOL see_avs = mSeeAvatarsCtrl->get(); + BOOL show_directory = mCheckShowDirectory->get(); // we have to get the index from a lookup, not from the position in the dropdown! - S32 category_index = LLParcel::getCategoryFromString(self->mCategoryCombo->getSelectedValue()); - S32 landing_type_index = self->mLandingTypeCombo->getCurrentIndex(); - LLUUID snapshot_id = self->mSnapshotCtrl->getImageAssetID(); + S32 category_index = LLParcel::getCategoryFromString(mCategoryCombo->getSelectedValue()); + S32 landing_type_index = mLandingTypeCombo->getCurrentIndex(); + LLUUID snapshot_id = mSnapshotCtrl->getImageAssetID(); LLViewerRegion* region; region = LLViewerParcelMgr::getInstance()->getSelectionRegion(); @@ -2283,8 +2275,8 @@ void LLPanelLandOptions::onCommitAny(LLUICtrl *ctrl, void *userdata) if ( (!allow_other_scripts && parcel->getParcelFlag(PF_ALLOW_OTHER_SCRIPTS)) || (!allow_group_scripts && parcel->getParcelFlag(PF_ALLOW_GROUP_SCRIPTS)) ) { // Don't allow turning off "Run Scripts" if damage is allowed in the region - self->mCheckOtherScripts->set(parcel->getParcelFlag(PF_ALLOW_OTHER_SCRIPTS)); // Restore UI to actual settings - self->mCheckGroupScripts->set(parcel->getParcelFlag(PF_ALLOW_GROUP_SCRIPTS)); + mCheckOtherScripts->set(parcel->getParcelFlag(PF_ALLOW_OTHER_SCRIPTS)); // Restore UI to actual settings + mCheckGroupScripts->set(parcel->getParcelFlag(PF_ALLOW_GROUP_SCRIPTS)); LLNotificationsUtil::add("UnableToDisableOutsideScripts"); return; } @@ -2314,7 +2306,7 @@ void LLPanelLandOptions::onCommitAny(LLUICtrl *ctrl, void *userdata) LLViewerParcelMgr::getInstance()->sendParcelPropertiesUpdate( parcel ); // Might have changed properties, so let's redraw! - self->refresh(); + refresh(); } @@ -2376,13 +2368,13 @@ LLPanelLandAccess::LLPanelLandAccess(LLParcelSelectionHandle& parcel) BOOL LLPanelLandAccess::postBuild() { childSetCommitCallback("public_access", onCommitPublicAccess, this); - childSetCommitCallback("limit_payment", onCommitAny, this); - childSetCommitCallback("limit_age_verified", onCommitAny, this); + 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); - childSetCommitCallback("PassCheck", onCommitAny, this); - childSetCommitCallback("pass_combo", onCommitAny, this); - childSetCommitCallback("PriceSpin", onCommitAny, this); - childSetCommitCallback("HoursSpin", onCommitAny, this); + 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); @@ -2700,7 +2692,7 @@ void LLPanelLandAccess::onCommitPublicAccess(LLUICtrl *ctrl, void *userdata) return; } - onCommitAny(ctrl, userdata); + self->onCommitAny(); } void LLPanelLandAccess::onCommitGroupCheck(LLUICtrl *ctrl, void *userdata) @@ -2726,23 +2718,20 @@ void LLPanelLandAccess::onCommitGroupCheck(LLUICtrl *ctrl, void *userdata) } } - onCommitAny(ctrl, userdata); + self->onCommitAny(); } -// static -void LLPanelLandAccess::onCommitAny(LLUICtrl *ctrl, void *userdata) +void LLPanelLandAccess::onCommitAny() { - LLPanelLandAccess *self = (LLPanelLandAccess *)userdata; - - LLParcel* parcel = self->mParcel->getParcel(); + LLParcel* parcel = mParcel->getParcel(); if (!parcel) { return; } // Extract data from UI - BOOL public_access = self->getChild<LLUICtrl>("public_access")->getValue().asBoolean(); - BOOL use_access_group = self->getChild<LLUICtrl>("GroupCheck")->getValue().asBoolean(); + BOOL public_access = getChild<LLUICtrl>("public_access")->getValue().asBoolean(); + BOOL use_access_group = getChild<LLUICtrl>("GroupCheck")->getValue().asBoolean(); if (use_access_group) { std::string group_name; @@ -2759,14 +2748,14 @@ void LLPanelLandAccess::onCommitAny(LLUICtrl *ctrl, void *userdata) if (public_access) { use_access_list = FALSE; - limit_payment = self->getChild<LLUICtrl>("limit_payment")->getValue().asBoolean(); - limit_age_verified = self->getChild<LLUICtrl>("limit_age_verified")->getValue().asBoolean(); + limit_payment = getChild<LLUICtrl>("limit_payment")->getValue().asBoolean(); + limit_age_verified = getChild<LLUICtrl>("limit_age_verified")->getValue().asBoolean(); } else { use_access_list = TRUE; - use_pass_list = self->getChild<LLUICtrl>("PassCheck")->getValue().asBoolean(); - LLCtrlSelectionInterface* passcombo = self->childGetSelectionInterface("pass_combo"); + use_pass_list = getChild<LLUICtrl>("PassCheck")->getValue().asBoolean(); + LLCtrlSelectionInterface* passcombo = childGetSelectionInterface("pass_combo"); if (passcombo) { if (use_access_group && use_pass_list) @@ -2779,8 +2768,8 @@ void LLPanelLandAccess::onCommitAny(LLUICtrl *ctrl, void *userdata) } } - S32 pass_price = llfloor((F32)self->getChild<LLUICtrl>("PriceSpin")->getValue().asReal()); - F32 pass_hours = (F32)self->getChild<LLUICtrl>("HoursSpin")->getValue().asReal(); + S32 pass_price = llfloor((F32)getChild<LLUICtrl>("PriceSpin")->getValue().asReal()); + F32 pass_hours = (F32)getChild<LLUICtrl>("HoursSpin")->getValue().asReal(); // Push data into current parcel parcel->setParcelFlag(PF_USE_ACCESS_GROUP, use_access_group); @@ -2797,7 +2786,7 @@ void LLPanelLandAccess::onCommitAny(LLUICtrl *ctrl, void *userdata) LLViewerParcelMgr::getInstance()->sendParcelPropertiesUpdate( parcel ); // Might have changed properties, so let's redraw! - self->refresh(); + refresh(); } void LLPanelLandAccess::onClickAddAccess() diff --git a/indra/newview/llfloaterland.h b/indra/newview/llfloaterland.h index 8e8b61c333a6db0f2fe8486392e7cde448e2960b..06ae3d73c50dc95d0798fcd949fa4a9fca7c9553 100755 --- a/indra/newview/llfloaterland.h +++ b/indra/newview/llfloaterland.h @@ -151,7 +151,7 @@ public: static void onClickReclaim(void*); static void onClickBuyPass(void* deselect_when_done); static BOOL enableBuyPass(void*); - static void onCommitAny(LLUICtrl* ctrl, void *userdata); + void onCommitAny(); static void finalizeCommit(void * userdata); static void onForSaleChange(LLUICtrl *ctrl, void * userdata); static void finalizeSetSellChange(void * userdata); @@ -268,7 +268,7 @@ public: static void onCommitList(LLUICtrl* ctrl, void* data); static void onLostFocus(LLFocusableElement* caller, void* user_data); - static void onCommitClean(LLUICtrl* caller, void* user_data); + void onCommitClean(); static void processParcelObjectOwnersReply(LLMessageSystem *msg, void **); virtual BOOL postBuild(); @@ -324,7 +324,7 @@ private: // Refresh the "show in search" checkbox and category selector. void refreshSearch(); - static void onCommitAny(LLUICtrl* ctrl, void *userdata); + void onCommitAny(); static void onClickSet(void* userdata); static void onClickClear(void* userdata); @@ -368,7 +368,7 @@ public: virtual void draw(); static void onCommitPublicAccess(LLUICtrl* ctrl, void *userdata); - static void onCommitAny(LLUICtrl* ctrl, void *userdata); + void onCommitAny(); static void onCommitGroupCheck(LLUICtrl* ctrl, void *userdata); static void onClickRemoveAccess(void*); static void onClickRemoveBanned(void*); diff --git a/indra/newview/llfloaternotificationsconsole.cpp b/indra/newview/llfloaternotificationsconsole.cpp index fd03efa06108f7fbf5b07d5982ab0969ad655a26..ad5a16004e274b6368689adff71d5db53fcf1ac4 100755 --- a/indra/newview/llfloaternotificationsconsole.cpp +++ b/indra/newview/llfloaternotificationsconsole.cpp @@ -253,7 +253,7 @@ BOOL LLFloaterNotification::postBuild() return TRUE; } - responses_combo->setCommitCallback(onCommitResponse, this); + responses_combo->setCommitCallback(boost::bind(&LLFloaterNotification::respond, this)); LLSD form_sd = form->asLLSD(); diff --git a/indra/newview/llfloaternotificationsconsole.h b/indra/newview/llfloaternotificationsconsole.h index 4e92b7d857dd693f3e2f2c745d91beef5fa4fa68..eba33de2ddbeeb4e86dfc1d69c2b4caf6029a9a7 100755 --- a/indra/newview/llfloaternotificationsconsole.h +++ b/indra/newview/llfloaternotificationsconsole.h @@ -68,7 +68,6 @@ public: void respond(); private: - static void onCommitResponse(LLUICtrl* ctrl, void* data) { ((LLFloaterNotification*)data)->respond(); } LLNotification* mNote; }; #endif diff --git a/indra/newview/llpanelgroupgeneral.cpp b/indra/newview/llpanelgroupgeneral.cpp index 794c3c21024c7702247362f9acca9d67e8782afc..285dd369cf84df7da3fe5ecd89be4710dd9e7566 100755 --- a/indra/newview/llpanelgroupgeneral.cpp +++ b/indra/newview/llpanelgroupgeneral.cpp @@ -91,51 +91,34 @@ BOOL LLPanelGroupGeneral::postBuild() bool recurse = true; mEditCharter = getChild<LLTextEditor>("charter", recurse); - if(mEditCharter) - { - mEditCharter->setCommitCallback(onCommitAny, this); - mEditCharter->setFocusReceivedCallback(boost::bind(onFocusEdit, _1, this)); - mEditCharter->setFocusChangedCallback(boost::bind(onFocusEdit, _1, this)); - } + mEditCharter->setCommitCallback(boost::bind(&LLPanelGroupGeneral::onCommitAny, this)); + mEditCharter->setFocusReceivedCallback(boost::bind(onFocusEdit, _1, this)); + mEditCharter->setFocusChangedCallback(boost::bind(onFocusEdit, _1, this)); // Options mCtrlShowInGroupList = getChild<LLCheckBoxCtrl>("show_in_group_list", recurse); - if (mCtrlShowInGroupList) - { - mCtrlShowInGroupList->setCommitCallback(onCommitAny, this); - } + mCtrlShowInGroupList->setCommitCallback(boost::bind(&LLPanelGroupGeneral::onCommitAny, this)); - mComboMature = getChild<LLComboBox>("group_mature_check", recurse); - if(mComboMature) + mComboMature = getChild<LLComboBox>("group_mature_check", recurse); + mComboMature->setCurrentByIndex(0); + mComboMature->setCommitCallback(boost::bind(&LLPanelGroupGeneral::onCommitAny, this)); + if (gAgent.isTeen()) { - mComboMature->setCurrentByIndex(0); - mComboMature->setCommitCallback(onCommitAny, this); - if (gAgent.isTeen()) - { - // Teens don't get to set mature flag. JC - mComboMature->setVisible(FALSE); - mComboMature->setCurrentByIndex(NON_MATURE_CONTENT); - } + // Teens don't get to set mature flag. JC + mComboMature->setVisible(FALSE); + mComboMature->setCurrentByIndex(NON_MATURE_CONTENT); } + mCtrlOpenEnrollment = getChild<LLCheckBoxCtrl>("open_enrollement", recurse); - if (mCtrlOpenEnrollment) - { - mCtrlOpenEnrollment->setCommitCallback(onCommitAny, this); - } + mCtrlOpenEnrollment->setCommitCallback(boost::bind(&LLPanelGroupGeneral::onCommitAny, this)); mCtrlEnrollmentFee = getChild<LLCheckBoxCtrl>("check_enrollment_fee", recurse); - if (mCtrlEnrollmentFee) - { - mCtrlEnrollmentFee->setCommitCallback(onCommitEnrollment, this); - } + mCtrlEnrollmentFee->setCommitCallback(boost::bind(&LLPanelGroupGeneral::onCommitEnrollment, this)); mSpinEnrollmentFee = getChild<LLSpinCtrl>("spin_enrollment_fee", recurse); - if (mSpinEnrollmentFee) - { - mSpinEnrollmentFee->setCommitCallback(onCommitAny, this); - mSpinEnrollmentFee->setPrecision(0); - mSpinEnrollmentFee->resetDirty(); - } + mSpinEnrollmentFee->setCommitCallback(boost::bind(&LLPanelGroupGeneral::onCommitAny, this)); + mSpinEnrollmentFee->setPrecision(0); + mSpinEnrollmentFee->resetDirty(); BOOL accept_notices = FALSE; BOOL list_in_profile = FALSE; @@ -146,29 +129,20 @@ BOOL LLPanelGroupGeneral::postBuild() list_in_profile = data.mListInProfile; } mCtrlReceiveNotices = getChild<LLCheckBoxCtrl>("receive_notices", recurse); - if (mCtrlReceiveNotices) - { - mCtrlReceiveNotices->setCommitCallback(onCommitUserOnly, this); - mCtrlReceiveNotices->set(accept_notices); - mCtrlReceiveNotices->setEnabled(data.mID.notNull()); - } + mCtrlReceiveNotices->setCommitCallback(boost::bind(&LLPanelGroupGeneral::onCommitUserOnly, this)); + mCtrlReceiveNotices->set(accept_notices); + mCtrlReceiveNotices->setEnabled(data.mID.notNull()); mCtrlListGroup = getChild<LLCheckBoxCtrl>("list_groups_in_profile", recurse); - if (mCtrlListGroup) - { - mCtrlListGroup->setCommitCallback(onCommitUserOnly, this); - mCtrlListGroup->set(list_in_profile); - mCtrlListGroup->setEnabled(data.mID.notNull()); - mCtrlListGroup->resetDirty(); - } + mCtrlListGroup->setCommitCallback(boost::bind(&LLPanelGroupGeneral::onCommitUserOnly, this)); + mCtrlListGroup->set(list_in_profile); + mCtrlListGroup->setEnabled(data.mID.notNull()); + mCtrlListGroup->resetDirty(); mActiveTitleLabel = getChild<LLTextBox>("active_title_label", recurse); mComboActiveTitle = getChild<LLComboBox>("active_title", recurse); - if (mComboActiveTitle) - { - mComboActiveTitle->setCommitCallback(onCommitAny, this); - } + mComboActiveTitle->setCommitCallback(boost::bind(&LLPanelGroupGeneral::onCommitAny, this)); mIncompleteMemberDataStr = getString("incomplete_member_data_str"); @@ -191,17 +165,12 @@ BOOL LLPanelGroupGeneral::postBuild() void LLPanelGroupGeneral::setupCtrls(LLPanel* panel_group) { mInsignia = getChild<LLTextureCtrl>("insignia"); - if (mInsignia) - { - mInsignia->setCommitCallback(onCommitAny, this); - } + mInsignia->setCommitCallback(boost::bind(&LLPanelGroupGeneral::onCommitAny, this)); mFounderName = getChild<LLTextBox>("founder_name"); mGroupNameEditor = panel_group->getChild<LLLineEditor>("group_name_editor"); mGroupNameEditor->setPrevalidate( LLTextValidate::validateASCII ); - - } // static @@ -212,50 +181,43 @@ void LLPanelGroupGeneral::onFocusEdit(LLFocusableElement* ctrl, void* data) self->notifyObservers(); } -// static -void LLPanelGroupGeneral::onCommitAny(LLUICtrl* ctrl, void* data) +void LLPanelGroupGeneral::onCommitAny() { - LLPanelGroupGeneral* self = (LLPanelGroupGeneral*)data; - self->updateChanged(); - self->notifyObservers(); + updateChanged(); + notifyObservers(); } -// static -void LLPanelGroupGeneral::onCommitUserOnly(LLUICtrl* ctrl, void* data) +void LLPanelGroupGeneral::onCommitUserOnly() { - LLPanelGroupGeneral* self = (LLPanelGroupGeneral*)data; - self->mChanged = TRUE; - self->notifyObservers(); + mChanged = TRUE; + notifyObservers(); } - -// static -void LLPanelGroupGeneral::onCommitEnrollment(LLUICtrl* ctrl, void* data) +void LLPanelGroupGeneral::onCommitEnrollment() { - onCommitAny(ctrl, data); - - LLPanelGroupGeneral* self = (LLPanelGroupGeneral*)data; + onCommitAny(); + // Make sure both enrollment related widgets are there. - if (!self->mCtrlEnrollmentFee || !self->mSpinEnrollmentFee) + if (!mCtrlEnrollmentFee || !mSpinEnrollmentFee) { return; } // Make sure the agent can change enrollment info. - if (!gAgent.hasPowerInGroup(self->mGroupID,GP_MEMBER_OPTIONS) - || !self->mAllowEdit) + if (!gAgent.hasPowerInGroup(mGroupID,GP_MEMBER_OPTIONS) + || !mAllowEdit) { return; } - if (self->mCtrlEnrollmentFee->get()) + if (mCtrlEnrollmentFee->get()) { - self->mSpinEnrollmentFee->setEnabled(TRUE); + mSpinEnrollmentFee->setEnabled(TRUE); } else { - self->mSpinEnrollmentFee->setEnabled(FALSE); - self->mSpinEnrollmentFee->set(0); + mSpinEnrollmentFee->setEnabled(FALSE); + mSpinEnrollmentFee->set(0); } } diff --git a/indra/newview/llpanelgroupgeneral.h b/indra/newview/llpanelgroupgeneral.h index 11972bafa98fc260537501209690d79f27746aca..01b7c1e17964168bc3ab29ecd4904e540e5483d9 100755 --- a/indra/newview/llpanelgroupgeneral.h +++ b/indra/newview/llpanelgroupgeneral.h @@ -67,10 +67,10 @@ private: void resetDirty(); + void onCommitAny(); + void onCommitUserOnly(); + void onCommitEnrollment(); static void onFocusEdit(LLFocusableElement* ctrl, void* data); - static void onCommitAny(LLUICtrl* ctrl, void* data); - static void onCommitUserOnly(LLUICtrl* ctrl, void* data); - static void onCommitEnrollment(LLUICtrl* ctrl, void* data); static void onClickInfo(void* userdata); static void onReceiveNotices(LLUICtrl* ctrl, void* data); diff --git a/indra/newview/llpanelgroupnotices.cpp b/indra/newview/llpanelgroupnotices.cpp index 54728885c1aaf6cea6207b93d7e9e3c787ecbfe3..5260714ae945d67d7e8fd8f12c56dc4c245dcc58 100755 --- a/indra/newview/llpanelgroupnotices.cpp +++ b/indra/newview/llpanelgroupnotices.cpp @@ -245,7 +245,7 @@ BOOL LLPanelGroupNotices::postBuild() mNoticesList = getChild<LLScrollListCtrl>("notice_list",recurse); mNoticesList->setCommitOnSelectionChange(TRUE); - mNoticesList->setCommitCallback(onSelectNotice, this); + mNoticesList->setCommitCallback(boost::bind(&LLPanelGroupNotices::onSelectNotice, this)); mBtnNewMessage = getChild<LLButton>("create_new_notice",recurse); mBtnNewMessage->setClickedCallback(onClickNewMessage, this); @@ -578,12 +578,9 @@ void LLPanelGroupNotices::processNotices(LLMessageSystem* msg) mNoticesList->updateSort(); } -void LLPanelGroupNotices::onSelectNotice(LLUICtrl* ctrl, void* data) +void LLPanelGroupNotices::onSelectNotice() { - LLPanelGroupNotices* self = (LLPanelGroupNotices*)data; - - if(!self) return; - LLScrollListItem* item = self->mNoticesList->getFirstSelected(); + LLScrollListItem* item = mNoticesList->getFirstSelected(); if (!item) return; LLMessageSystem* msg = gMessageSystem; diff --git a/indra/newview/llpanelgroupnotices.h b/indra/newview/llpanelgroupnotices.h index 04629b5f6bfb7312ba810301c097305f66fabc05..207bf74fef712ca000145ebdf0b58dd80c2dfec9 100755 --- a/indra/newview/llpanelgroupnotices.h +++ b/indra/newview/llpanelgroupnotices.h @@ -75,7 +75,7 @@ private: static void onClickRefreshNotices(void* data); void processNotices(LLMessageSystem* msg); - static void onSelectNotice(LLUICtrl* ctrl, void* data); + void onSelectNotice(); enum ENoticeView { diff --git a/indra/newview/llpanelgrouproles.cpp b/indra/newview/llpanelgrouproles.cpp index 8eff890b485d897869af4cdbe7162f11c46ee648..30029897b89588b35a66b5d86f948a29687fc363 100755 --- a/indra/newview/llpanelgrouproles.cpp +++ b/indra/newview/llpanelgrouproles.cpp @@ -832,7 +832,7 @@ BOOL LLPanelGroupMembersSubTab::postBuildSubTab(LLView* root) // We want to be notified whenever a member is selected. mMembersList->setCommitOnSelectionChange(TRUE); - mMembersList->setCommitCallback(onMemberSelect, this); + mMembersList->setCommitCallback(boost::bind(&LLPanelGroupMembersSubTab::handleMemberSelect, this)); // Show the member's profile on double click. mMembersList->setDoubleClickCallback(onMemberDoubleClick, this); mMembersList->setContextMenu(LLScrollListCtrl::MENU_AVATAR); @@ -889,13 +889,6 @@ void LLPanelGroupMembersSubTab::setGroupID(const LLUUID& id) LLPanelGroupSubTab::setGroupID(id); } -// static -void LLPanelGroupMembersSubTab::onMemberSelect(LLUICtrl* ctrl, void* user_data) -{ - LLPanelGroupMembersSubTab* self = static_cast<LLPanelGroupMembersSubTab*>(user_data); - self->handleMemberSelect(); -} - void LLPanelGroupMembersSubTab::handleMemberSelect() { LL_DEBUGS() << "LLPanelGroupMembersSubTab::handleMemberSelect" << LL_ENDL; @@ -1062,7 +1055,7 @@ void LLPanelGroupMembersSubTab::handleMemberSelect() // Extract the checkbox that was created. LLScrollListCheck* check_cell = (LLScrollListCheck*) item->getColumn(0); LLCheckBoxCtrl* check = check_cell->getCheckBox(); - check->setCommitCallback(onRoleCheck, this); + check->setCommitCallback(boost::bind(&LLPanelGroupMembersSubTab::onRoleCheck, this, _2)); check->set( count > 0 ); check->setTentative( (0 != count) @@ -1333,23 +1326,18 @@ void LLPanelGroupMembersSubTab::handleRoleCheck(const LLUUID& role_id, FALSE); } -// static -void LLPanelGroupMembersSubTab::onRoleCheck(LLUICtrl* ctrl, void* user_data) +void LLPanelGroupMembersSubTab::onRoleCheck(const LLSD& userdata) { - LLPanelGroupMembersSubTab* self = static_cast<LLPanelGroupMembersSubTab*>(user_data); - LLCheckBoxCtrl* check_box = static_cast<LLCheckBoxCtrl*>(ctrl); - if (!check_box || !self) return; - LLScrollListItem* first_selected = - self->mAssignedRolesList->getFirstSelected(); + LLScrollListItem* first_selected = mAssignedRolesList->getFirstSelected(); if (first_selected) { LLUUID role_id = first_selected->getUUID(); - LLRoleMemberChangeType change_type = (check_box->get() ? - RMC_ADD : - RMC_REMOVE); + LLRoleMemberChangeType change_type = (userdata.asBoolean() + ? RMC_ADD + : RMC_REMOVE); - self->handleRoleCheck(role_id, change_type); + handleRoleCheck(role_id, change_type); } } @@ -2002,11 +1990,11 @@ BOOL LLPanelGroupRolesSubTab::postBuildSubTab(LLView* root) } mRolesList->setCommitOnSelectionChange(TRUE); - mRolesList->setCommitCallback(onRoleSelect, this); + mRolesList->setCommitCallback(boost::bind(&LLPanelGroupRolesSubTab::handleRoleSelect, this)); mAssignedMembersList->setContextMenu(LLScrollListCtrl::MENU_AVATAR); - mMemberVisibleCheck->setCommitCallback(onMemberVisibilityChange, this); + mMemberVisibleCheck->setCommitCallback(boost::bind(&LLPanelGroupRolesSubTab::handleMemberVisibilityChange, this, _2)); mAllowedActionsList->setCommitOnSelectionChange(TRUE); @@ -2229,16 +2217,6 @@ void LLPanelGroupRolesSubTab::update(LLGroupChange gc) } } -// static -void LLPanelGroupRolesSubTab::onRoleSelect(LLUICtrl* ctrl, void* user_data) -{ - LLPanelGroupRolesSubTab* self = static_cast<LLPanelGroupRolesSubTab*>(user_data); - if (!self) - return; - - self->handleRoleSelect(); -} - void LLPanelGroupRolesSubTab::handleRoleSelect() { BOOL can_delete = TRUE; @@ -2578,17 +2556,7 @@ void LLPanelGroupRolesSubTab::onDescriptionCommit(LLUICtrl* ctrl, void* user_dat self->notifyObservers(); } -// static -void LLPanelGroupRolesSubTab::onMemberVisibilityChange(LLUICtrl* ctrl, void* user_data) -{ - LLPanelGroupRolesSubTab* self = static_cast<LLPanelGroupRolesSubTab*>(user_data); - LLCheckBoxCtrl* check = static_cast<LLCheckBoxCtrl*>(ctrl); - if (!check || !self) return; - - self->handleMemberVisibilityChange(check->get()); -} - -void LLPanelGroupRolesSubTab::handleMemberVisibilityChange(bool value) +void LLPanelGroupRolesSubTab::handleMemberVisibilityChange(const LLSD& value) { LL_DEBUGS() << "LLPanelGroupRolesSubTab::handleMemberVisibilityChange()" << LL_ENDL; @@ -2606,7 +2574,7 @@ void LLPanelGroupRolesSubTab::handleMemberVisibilityChange(bool value) return; } - if (value) + if (value.asBoolean()) { gdatap->addRolePower(role_item->getUUID(),GP_MEMBER_VISIBLE_IN_DIR); } diff --git a/indra/newview/llpanelgrouproles.h b/indra/newview/llpanelgrouproles.h index 205b3db09b4b259f180de81df1ec26aaf97e8e7d..a61592c94be9f1c91c64eeb52d768b587a1e90b4 100755 --- a/indra/newview/llpanelgrouproles.h +++ b/indra/newview/llpanelgrouproles.h @@ -158,7 +158,6 @@ public: virtual BOOL postBuildSubTab(LLView* root); - static void onMemberSelect(LLUICtrl*, void*); void handleMemberSelect(); static void onMemberDoubleClick(void*); @@ -173,7 +172,7 @@ public: bool handleEjectCallback(const LLSD& notification, const LLSD& response); void commitEjectMembers(uuid_vec_t& selected_members); - static void onRoleCheck(LLUICtrl* check, void* user_data); + void onRoleCheck(const LLSD& userdata); void handleRoleCheck(const LLUUID& role_id, LLRoleMemberChangeType type); @@ -248,7 +247,6 @@ public: bool matchesSearchFilter(std::string rolename, std::string roletitle); virtual void update(LLGroupChange gc); - static void onRoleSelect(LLUICtrl*, void*); void handleRoleSelect(); void buildMembersList(); @@ -261,8 +259,7 @@ public: static void onDescriptionCommit(LLUICtrl*, void*); - static void onMemberVisibilityChange(LLUICtrl*, void*); - void handleMemberVisibilityChange(bool value); + void handleMemberVisibilityChange(const LLSD& value); static void onCreateRole(void*); void handleCreateRole(); diff --git a/indra/newview/llpanellandaudio.cpp b/indra/newview/llpanellandaudio.cpp index e7bdc51b4a56597068511cd89d1b66c4b93ed4a0..a52021fcf0f3f83027f4213a8c094285d80874d0 100755 --- a/indra/newview/llpanellandaudio.cpp +++ b/indra/newview/llpanellandaudio.cpp @@ -77,25 +77,25 @@ LLPanelLandAudio::~LLPanelLandAudio() BOOL LLPanelLandAudio::postBuild() { mCheckSoundLocal = getChild<LLCheckBoxCtrl>("check sound local"); - childSetCommitCallback("check sound local", onCommitAny, this); + mCheckSoundLocal->setCommitCallback(boost::bind(&LLPanelLandAudio::onCommitAny, this)); mCheckParcelEnableVoice = getChild<LLCheckBoxCtrl>("parcel_enable_voice_channel"); - childSetCommitCallback("parcel_enable_voice_channel", onCommitAny, this); + mCheckParcelEnableVoice->setCommitCallback(boost::bind(&LLPanelLandAudio::onCommitAny, this)); // This one is always disabled so no need for a commit callback mCheckEstateDisabledVoice = getChild<LLCheckBoxCtrl>("parcel_enable_voice_channel_is_estate_disabled"); mCheckParcelVoiceLocal = getChild<LLCheckBoxCtrl>("parcel_enable_voice_channel_local"); - childSetCommitCallback("parcel_enable_voice_channel_local", onCommitAny, this); + mCheckParcelVoiceLocal->setCommitCallback(boost::bind(&LLPanelLandAudio::onCommitAny, this)); mMusicURLEdit = getChild<LLLineEditor>("music_url"); - childSetCommitCallback("music_url", onCommitAny, this); + mMusicURLEdit->setCommitCallback(boost::bind(&LLPanelLandAudio::onCommitAny, this)); mCheckAVSoundAny = getChild<LLCheckBoxCtrl>("all av sound check"); - childSetCommitCallback("all av sound check", onCommitAny, this); + mCheckAVSoundAny->setCommitCallback(boost::bind(&LLPanelLandAudio::onCommitAny, this)); mCheckAVSoundGroup = getChild<LLCheckBoxCtrl>("group av sound check"); - childSetCommitCallback("group av sound check", onCommitAny, this); + mCheckAVSoundGroup->setCommitCallback(boost::bind(&LLPanelLandAudio::onCommitAny, this)); return TRUE; } @@ -160,28 +160,26 @@ void LLPanelLandAudio::refresh() } } // static -void LLPanelLandAudio::onCommitAny(LLUICtrl*, void *userdata) +void LLPanelLandAudio::onCommitAny() { - LLPanelLandAudio *self = (LLPanelLandAudio *)userdata; - - LLParcel* parcel = self->mParcel->getParcel(); + LLParcel* parcel = mParcel->getParcel(); if (!parcel) { return; } // Extract data from UI - BOOL sound_local = self->mCheckSoundLocal->get(); - std::string music_url = self->mMusicURLEdit->getText(); + BOOL sound_local = mCheckSoundLocal->get(); + std::string music_url = mMusicURLEdit->getText(); - BOOL voice_enabled = self->mCheckParcelEnableVoice->get(); - BOOL voice_estate_chan = !self->mCheckParcelVoiceLocal->get(); + BOOL voice_enabled = mCheckParcelEnableVoice->get(); + BOOL voice_estate_chan = !mCheckParcelVoiceLocal->get(); - BOOL any_av_sound = self->mCheckAVSoundAny->get(); + BOOL any_av_sound = mCheckAVSoundAny->get(); BOOL group_av_sound = TRUE; // If set to "Everyone" then group is checked as well if (!any_av_sound) { // If "Everyone" is off, use the value from the checkbox - group_av_sound = self->mCheckAVSoundGroup->get(); + group_av_sound = mCheckAVSoundGroup->get(); } // Remove leading/trailing whitespace (common when copying/pasting) @@ -199,5 +197,5 @@ void LLPanelLandAudio::onCommitAny(LLUICtrl*, void *userdata) LLViewerParcelMgr::getInstance()->sendParcelPropertiesUpdate( parcel ); // Might have changed properties, so let's redraw! - self->refresh(); + refresh(); } diff --git a/indra/newview/llpanellandaudio.h b/indra/newview/llpanellandaudio.h index 7e4fce80e412e38a86585abad2513e44742dde25..9830cca4f400f46d9fd3c202b521d410a28461ef 100755 --- a/indra/newview/llpanellandaudio.h +++ b/indra/newview/llpanellandaudio.h @@ -43,7 +43,7 @@ public: void refresh(); private: - static void onCommitAny(LLUICtrl* ctrl, void *userdata); + void onCommitAny(); private: LLCheckBoxCtrl* mCheckSoundLocal; diff --git a/indra/newview/llpanellandmedia.cpp b/indra/newview/llpanellandmedia.cpp index 26cd3ff1c19b509fe65cf726258b6bec772b6d96..7a454258956ebdb80cbf59218964b4d36101be87 100755 --- a/indra/newview/llpanellandmedia.cpp +++ b/indra/newview/llpanellandmedia.cpp @@ -82,32 +82,32 @@ BOOL LLPanelLandMedia::postBuild() { mMediaTextureCtrl = getChild<LLTextureCtrl>("media texture"); - mMediaTextureCtrl->setCommitCallback( onCommitAny, this ); + mMediaTextureCtrl->setCommitCallback(boost::bind(&LLPanelLandMedia::onCommitAny, this)); mMediaTextureCtrl->setAllowNoTexture ( TRUE ); mMediaTextureCtrl->setImmediateFilterPermMask(PERM_COPY | PERM_TRANSFER); mMediaTextureCtrl->setDnDFilterPermMask(PERM_COPY | PERM_TRANSFER); mMediaTextureCtrl->setNonImmediateFilterPermMask(PERM_COPY | PERM_TRANSFER); mMediaAutoScaleCheck = getChild<LLCheckBoxCtrl>("media_auto_scale"); - childSetCommitCallback("media_auto_scale", onCommitAny, this); + mMediaAutoScaleCheck->setCommitCallback(boost::bind(&LLPanelLandMedia::onCommitAny, this)); mMediaLoopCheck = getChild<LLCheckBoxCtrl>("media_loop"); - childSetCommitCallback("media_loop", onCommitAny, this ); + mMediaLoopCheck->setCommitCallback(boost::bind(&LLPanelLandMedia::onCommitAny, this)); mMediaURLEdit = getChild<LLLineEditor>("media_url"); - childSetCommitCallback("media_url", onCommitAny, this ); + mMediaURLEdit->setCommitCallback(boost::bind(&LLPanelLandMedia::onCommitAny, this)); mMediaDescEdit = getChild<LLLineEditor>("url_description"); - childSetCommitCallback("url_description", onCommitAny, this); + mMediaDescEdit->setCommitCallback(boost::bind(&LLPanelLandMedia::onCommitAny, this)); mMediaTypeCombo = getChild<LLComboBox>("media type"); childSetCommitCallback("media type", onCommitType, this); populateMIMECombo(); mMediaWidthCtrl = getChild<LLSpinCtrl>("media_size_width"); - childSetCommitCallback("media_size_width", onCommitAny, this); + mMediaWidthCtrl->setCommitCallback(boost::bind(&LLPanelLandMedia::onCommitAny, this)); mMediaHeightCtrl = getChild<LLSpinCtrl>("media_size_height"); - childSetCommitCallback("media_size_height", onCommitAny, this); + mMediaHeightCtrl->setCommitCallback(boost::bind(&LLPanelLandMedia::onCommitAny, this)); mMediaSizeCtrlLabel = getChild<LLTextBox>("media_size"); mSetURLButton = getChild<LLButton>("set_media_url"); @@ -258,33 +258,30 @@ void LLPanelLandMedia::onCommitType(LLUICtrl *ctrl, void *userdata) { self->getChild<LLUICtrl>("mime_type")->setValue(LLMIMETypes::findDefaultMimeType(new_type)); } - onCommitAny(ctrl, userdata); + self->onCommitAny(); } -// static -void LLPanelLandMedia::onCommitAny(LLUICtrl*, void *userdata) +void LLPanelLandMedia::onCommitAny() { - LLPanelLandMedia *self = (LLPanelLandMedia *)userdata; - - LLParcel* parcel = self->mParcel->getParcel(); + LLParcel* parcel = mParcel->getParcel(); if (!parcel) { return; } // Extract data from UI - std::string media_url = self->mMediaURLEdit->getText(); - std::string media_desc = self->mMediaDescEdit->getText(); - std::string mime_type = self->getChild<LLUICtrl>("mime_type")->getValue().asString(); - U8 media_auto_scale = self->mMediaAutoScaleCheck->get(); - U8 media_loop = self->mMediaLoopCheck->get(); - S32 media_width = (S32)self->mMediaWidthCtrl->get(); - S32 media_height = (S32)self->mMediaHeightCtrl->get(); - LLUUID media_id = self->mMediaTextureCtrl->getImageAssetID(); + std::string media_url = mMediaURLEdit->getText(); + std::string media_desc = mMediaDescEdit->getText(); + std::string mime_type = getChild<LLUICtrl>("mime_type")->getValue().asString(); + U8 media_auto_scale = mMediaAutoScaleCheck->get(); + U8 media_loop = mMediaLoopCheck->get(); + S32 media_width = (S32)mMediaWidthCtrl->get(); + S32 media_height = (S32)mMediaHeightCtrl->get(); + LLUUID media_id = mMediaTextureCtrl->getImageAssetID(); - self->getChild<LLUICtrl>("mime_type")->setValue(mime_type); + getChild<LLUICtrl>("mime_type")->setValue(mime_type); // Remove leading/trailing whitespace (common when copying/pasting) LLStringUtil::trim(media_url); @@ -303,7 +300,7 @@ void LLPanelLandMedia::onCommitAny(LLUICtrl*, void *userdata) LLViewerParcelMgr::getInstance()->sendParcelPropertiesUpdate( parcel ); // Might have changed properties, so let's redraw! - self->refresh(); + refresh(); } // static void LLPanelLandMedia::onSetBtn(void *userdata) diff --git a/indra/newview/llpanellandmedia.h b/indra/newview/llpanellandmedia.h index 63cfa01470f495676aa1afe5ed2999ba2cca32b2..466d1adace3a0d0ae8882edfdb4d1daf11c50d5d 100755 --- a/indra/newview/llpanellandmedia.h +++ b/indra/newview/llpanellandmedia.h @@ -47,7 +47,7 @@ public: private: void populateMIMECombo(); - static void onCommitAny(LLUICtrl* ctrl, void *userdata); + void onCommitAny(); static void onCommitType(LLUICtrl* ctrl, void *userdata); static void onSetBtn(void* userdata); static void onResetBtn(void* userdata); diff --git a/indra/newview/llpanelprofilelegacy.cpp b/indra/newview/llpanelprofilelegacy.cpp index 961b4796ade54cc71be5dc8e49ba578c5c8b108d..78ff15deb639dcea84e4d1e2102627160061186f 100644 --- a/indra/newview/llpanelprofilelegacy.cpp +++ b/indra/newview/llpanelprofilelegacy.cpp @@ -104,12 +104,12 @@ BOOL LLPanelProfileLegacy::postBuild() mPanelPicks = static_cast<LLPanelProfileLegacy::LLPanelProfilePicks*>(getChild<LLUICtrl>("picks_tab_panel")); mPanelPicks->setProfilePanel(this); - getChild<LLButton>("back")->setCommitCallback(boost::bind(&LLPanelProfileLegacy::onBackBtnClick, this), nullptr); - getChild<LLTextEditor>("sl_about")->setCommitCallback(boost::bind(&LLPanelProfileLegacy::onCommitAvatarProperties, this), nullptr); - getChild<LLTextEditor>("fl_about")->setCommitCallback(boost::bind(&LLPanelProfileLegacy::onCommitAvatarProperties, this), nullptr); - getChild<LLTextureCtrl>("sl_profile_pic")->setCommitCallback(boost::bind(&LLPanelProfileLegacy::onCommitAvatarProperties, this), nullptr); - getChild<LLTextureCtrl>("fl_profile_pic")->setCommitCallback(boost::bind(&LLPanelProfileLegacy::onCommitAvatarProperties, this), nullptr); - getChild<LLTextEditor>("notes")->setCommitCallback(boost::bind(&LLPanelProfileLegacy::onCommitNotes, this, _1), nullptr); + getChild<LLButton>("back")->setCommitCallback(boost::bind(&LLPanelProfileLegacy::onBackBtnClick, this)); + getChild<LLTextEditor>("sl_about")->setCommitCallback(boost::bind(&LLPanelProfileLegacy::onCommitAvatarProperties, this)); + getChild<LLTextEditor>("fl_about")->setCommitCallback(boost::bind(&LLPanelProfileLegacy::onCommitAvatarProperties, this)); + getChild<LLTextureCtrl>("sl_profile_pic")->setCommitCallback(boost::bind(&LLPanelProfileLegacy::onCommitAvatarProperties, this)); + getChild<LLTextureCtrl>("fl_profile_pic")->setCommitCallback(boost::bind(&LLPanelProfileLegacy::onCommitAvatarProperties, this)); + getChild<LLTextEditor>("notes")->setCommitCallback(boost::bind(&LLPanelProfileLegacy::onCommitNotes, this, _1)); getChild<LLTextEditor>("avatar_name")->setDoubleClickCallback(boost::bind(&LLPanelProfileLegacy::onDoubleClickName, this)); return TRUE; } diff --git a/indra/newview/lltexturectrl.cpp b/indra/newview/lltexturectrl.cpp index d9704c1f2fd5c09ba6705b4a819d5105be1a7eb6..2eabd8836259c218e329291a2a06538fdbb8e62b 100755 --- a/indra/newview/lltexturectrl.cpp +++ b/indra/newview/lltexturectrl.cpp @@ -148,11 +148,11 @@ public: static void onApplyImmediateCheck(LLUICtrl* ctrl, void* userdata); void onTextureSelect( const LLTextureEntry& te ); - static void onModeSelect(LLUICtrl* ctrl, void *userdata); + void onModeSelect(); static void onBtnAdd(void* userdata); static void onBtnRemove(void* userdata); static void onBtnUpload(void* userdata); - static void onLocalScrollCommit(LLUICtrl* ctrl, void* userdata); + void onLocalScrollCommit(); static void onApplyUUID(void* userdata); @@ -470,7 +470,7 @@ BOOL LLFloaterTexturePicker::postBuild() } mModeSelector = getChild<LLRadioGroup>("mode_selection"); - mModeSelector->setCommitCallback(onModeSelect, this); + mModeSelector->setCommitCallback(boost::bind(&LLFloaterTexturePicker::onModeSelect, this)); mModeSelector->setSelectedIndex(0, 0); childSetAction("l_add_btn", LLFloaterTexturePicker::onBtnAdd, this); @@ -478,7 +478,7 @@ BOOL LLFloaterTexturePicker::postBuild() childSetAction("l_upl_btn", LLFloaterTexturePicker::onBtnUpload, this); mLocalScrollCtrl = getChild<LLScrollListCtrl>("l_name_list"); - mLocalScrollCtrl->setCommitCallback(onLocalScrollCommit, this); + mLocalScrollCtrl->setCommitCallback(boost::bind(&LLFloaterTexturePicker::onLocalScrollCommit, this)); LLLocalBitmapMgr::feedScrollList(mLocalScrollCtrl); getChild<LLLineEditor>("uuid_editor")->setCommitCallback(boost::bind(&onApplyUUID, this)); @@ -863,29 +863,27 @@ void LLFloaterTexturePicker::onSelectionChange(const std::deque<LLFolderViewItem } } -// static -void LLFloaterTexturePicker::onModeSelect(LLUICtrl* ctrl, void *userdata) +void LLFloaterTexturePicker::onModeSelect() { - LLFloaterTexturePicker* self = (LLFloaterTexturePicker*) userdata; - bool mode = (self->mModeSelector->getSelectedIndex() == 0); - - self->getChild<LLButton>("Default")->setVisible(mode); - self->getChild<LLButton>("Transparent")->setVisible(mode); // <alchemy/> - self->getChild<LLButton>("Blank")->setVisible(mode); - self->getChild<LLButton>("None")->setVisible(mode); - self->getChild<LLButton>("Pipette")->setVisible(mode); - self->getChild<LLFilterEditor>("inventory search editor")->setVisible(mode); - self->getChild<LLInventoryPanel>("inventory panel")->setVisible(mode); - self->getChild<LLLineEditor>("uuid_editor")->setVisible(mode); - self->getChild<LLButton>("apply_uuid_btn")->setVisible(mode); - - /*self->getChild<LLCheckBox>("show_folders_check")->setVisible(mode); + bool mode = (mModeSelector->getSelectedIndex() == 0); + + getChild<LLButton>("Default")->setVisible(mode); + getChild<LLButton>("Transparent")->setVisible(mode); // <alchemy/> + getChild<LLButton>("Blank")->setVisible(mode); + getChild<LLButton>("None")->setVisible(mode); + getChild<LLButton>("Pipette")->setVisible(mode); + getChild<LLFilterEditor>("inventory search editor")->setVisible(mode); + getChild<LLInventoryPanel>("inventory panel")->setVisible(mode); + getChild<LLLineEditor>("uuid_editor")->setVisible(mode); + getChild<LLButton>("apply_uuid_btn")->setVisible(mode); + + /*getChild<LLCheckBox>("show_folders_check")->setVisible(mode); no idea under which conditions the above is even shown, needs testing. */ - self->getChild<LLButton>("l_add_btn")->setVisible(!mode); - self->getChild<LLButton>("l_rem_btn")->setVisible(!mode); - self->getChild<LLButton>("l_upl_btn")->setVisible(!mode); - self->getChild<LLScrollListCtrl>("l_name_list")->setVisible(!mode); + getChild<LLButton>("l_add_btn")->setVisible(!mode); + getChild<LLButton>("l_rem_btn")->setVisible(!mode); + getChild<LLButton>("l_upl_btn")->setVisible(!mode); + getChild<LLScrollListCtrl>("l_name_list")->setVisible(!mode); } // static @@ -948,26 +946,24 @@ void LLFloaterTexturePicker::onBtnUpload(void* userdata) } -//static -void LLFloaterTexturePicker::onLocalScrollCommit(LLUICtrl* ctrl, void* userdata) +void LLFloaterTexturePicker::onLocalScrollCommit() { - LLFloaterTexturePicker* self = (LLFloaterTexturePicker*) userdata; - std::vector<LLScrollListItem*> selected_items = self->mLocalScrollCtrl->getAllSelected(); + std::vector<LLScrollListItem*> selected_items = mLocalScrollCtrl->getAllSelected(); bool has_selection = !selected_items.empty(); - self->getChild<LLButton>("l_rem_btn")->setEnabled(has_selection); - self->getChild<LLButton>("l_upl_btn")->setEnabled(has_selection && (selected_items.size() < 2)); + getChild<LLButton>("l_rem_btn")->setEnabled(has_selection); + getChild<LLButton>("l_upl_btn")->setEnabled(has_selection && (selected_items.size() < 2)); /* since multiple-localbitmap upload is not implemented, upl button gets disabled if more than one is selected. */ if (has_selection) { - LLUUID tracking_id = (LLUUID)self->mLocalScrollCtrl->getSelectedItemLabel(LOCAL_TRACKING_ID_COLUMN); + LLUUID tracking_id = LLUUID(mLocalScrollCtrl->getSelectedItemLabel(LOCAL_TRACKING_ID_COLUMN)); LLUUID inworld_id = LLLocalBitmapMgr::getWorldID(tracking_id); - self->mOwner->setImageAssetID(inworld_id); + mOwner->setImageAssetID(inworld_id); - if (self->childGetValue("apply_immediate_check").asBoolean()) + if (childGetValue("apply_immediate_check").asBoolean()) { - self->mOwner->onFloaterCommit(LLTextureCtrl::TEXTURE_CHANGE, inworld_id); + mOwner->onFloaterCommit(LLTextureCtrl::TEXTURE_CHANGE, inworld_id); } } }