From cd17687f01420952712a500107e0f93e7ab8d5f8 Mon Sep 17 00:00:00 2001 From: Jacek Antonelli Date: Fri, 15 Aug 2008 23:45:34 -0500 Subject: Second Life viewer sources 1.19.1.0 --- linden/indra/newview/llfloaterland.cpp | 474 ++++++++------------------------- 1 file changed, 109 insertions(+), 365 deletions(-) (limited to 'linden/indra/newview/llfloaterland.cpp') diff --git a/linden/indra/newview/llfloaterland.cpp b/linden/indra/newview/llfloaterland.cpp index 447571d..c75917b 100644 --- a/linden/indra/newview/llfloaterland.cpp +++ b/linden/indra/newview/llfloaterland.cpp @@ -31,8 +31,6 @@ #include "llviewerprecompiledheaders.h" -#include - #include "llfloaterland.h" #include "llcachename.h" @@ -53,6 +51,7 @@ #include "lllineeditor.h" #include "llnamelistctrl.h" #include "llnotify.h" +#include "llpanellandmedia.h" #include "llradiogroup.h" #include "llscrolllistctrl.h" #include "llselectmgr.h" @@ -68,10 +67,39 @@ #include "llviewerstats.h" #include "llviewertexteditor.h" #include "llviewerwindow.h" -#include "llmediaengine.h" #include "llviewercontrol.h" #include "roles_constants.h" +#include +#include + +static const S32 EDIT_HEIGHT = 16; +static const S32 LEFT = HPAD; +static const S32 BOTTOM = VPAD; +static const S32 RULER0 = LEFT; +static const S32 RULER05 = RULER0 + 24; +static const S32 RULER1 = RULER05 + 16; +static const S32 RULER15 = RULER1 + 20; +static const S32 RULER2 = RULER1 + 32; +static const S32 RULER205= RULER2 + 32; +static const S32 RULER20 = RULER2 + 64; +static const S32 RULER21 = RULER20 + 16; +static const S32 RULER22 = RULER21 + 32; +static const S32 RULER225 = RULER20 + 64; +static const S32 RULER23 = RULER22 + 64; +static const S32 RULER24 = RULER23 + 26; +static const S32 RULER3 = RULER2 + 102; +static const S32 RULER4 = RULER3 + 8; +static const S32 RULER5 = RULER4 + 50; +static const S32 RULER6 = RULER5 + 52; +static const S32 RULER7 = RULER6 + 24; +static const S32 RIGHT = LEFT + 278; +static const S32 FAR_RIGHT = LEFT + 324 + 40; + +static const char PRICE[] = "Price:"; +static const char NO_PRICE[] = ""; +static const char AREA[] = "Area:"; + static const char OWNER_ONLINE[] = "0"; static const char OWNER_OFFLINE[] = "1"; static const char OWNER_GROUP[] = "2"; @@ -80,20 +108,11 @@ static const char OWNER_GROUP[] = "2"; static const BOOL BUY_GROUP_LAND = TRUE; static const BOOL BUY_PERSONAL_LAND = FALSE; -// Values for the parcel voice settings radio group -enum -{ - kRadioVoiceChatEstate = 0, - kRadioVoiceChatPrivate = 1, - kRadioVoiceChatDisable = 2 -}; - // Statics -LLFloaterLand* LLFloaterLand::sInstance = NULL; LLParcelSelectionObserver* LLFloaterLand::sObserver = NULL; S32 LLFloaterLand::sLastTab = 0; -LLViewHandle LLPanelLandGeneral::sBuyPassDialogHandle; +LLHandle LLPanelLandGeneral::sBuyPassDialogHandle; // Local classes class LLParcelSelectionObserver : public LLParcelObserver @@ -150,64 +169,38 @@ void send_parcel_select_objects(S32 parcel_local_id, S32 return_type, } -// static -void LLFloaterLand::show() -{ - if (!sInstance) - { - sInstance = new LLFloaterLand(); - - // Select tab from last view - sInstance->mTabLand->selectTab(sLastTab); - - sObserver = new LLParcelSelectionObserver(); - gParcelMgr->addObserver( sObserver ); - } - - sInstance->open(); /*Flawfinder: ignore*/ - - // Done automatically when the selected parcel's properties arrive - // (and hence we have the local id). - // gParcelMgr->sendParcelAccessListRequest(AL_ACCESS | AL_BAN | AL_RENTER); - - sInstance->mParcel = gParcelMgr->getFloatingParcelSelection(); - - // Refresh even if not over a region so we don't get an - // uninitialized dialog. The dialog is 0-region aware. - sInstance->refresh(); -} - //static LLPanelLandObjects* LLFloaterLand::getCurrentPanelLandObjects() { - if (!sInstance) - { - return NULL; - } - - return sInstance->mPanelObjects; + return LLFloaterLand::getInstance()->mPanelObjects; } //static LLPanelLandCovenant* LLFloaterLand::getCurrentPanelLandCovenant() { - if (!sInstance) - { - return NULL; - } - - return sInstance->mPanelCovenant; + return LLFloaterLand::getInstance()->mPanelCovenant; } // static void LLFloaterLand::refreshAll() { - if (sInstance) - { - sInstance->refresh(); - } + LLFloaterLand::getInstance()->refresh(); } +void LLFloaterLand::onOpen() +{ + // Done automatically when the selected parcel's properties arrive + // (and hence we have the local id). + // gParcelMgr->sendParcelAccessListRequest(AL_ACCESS | AL_BAN | AL_RENTER); + + mParcel = gParcelMgr->getFloatingParcelSelection(); + + // Refresh even if not over a region so we don't get an + // uninitialized dialog. The dialog is 0-region aware. + refresh(); +} + + // virtual void LLFloaterLand::onClose(bool app_quitting) { @@ -225,7 +218,7 @@ void LLFloaterLand::onClose(bool app_quitting) } -LLFloaterLand::LLFloaterLand() +LLFloaterLand::LLFloaterLand(const LLSD& seed) : LLFloater("floaterland", "FloaterLandRect5", "About Land") { @@ -240,10 +233,15 @@ LLFloaterLand::LLFloaterLand() factory_map["land_media_panel"] = LLCallbackMap(createPanelLandMedia, this); factory_map["land_access_panel"] = LLCallbackMap(createPanelLandAccess, this); - gUICtrlFactory->buildFloater(this, "floater_about_land.xml", &factory_map); + gUICtrlFactory->buildFloater(this, "floater_about_land.xml", &factory_map, false); + sObserver = new LLParcelSelectionObserver(); + gParcelMgr->addObserver( sObserver ); +} - LLTabContainerCommon* tab = LLUICtrlFactory::getTabContainerByName(this, "landtab"); +BOOL LLFloaterLand::postBuild() +{ + LLTabContainer* tab = LLUICtrlFactory::getTabContainerByName(this, "landtab"); mTabLand = (LLTabContainer*) tab; @@ -252,16 +250,16 @@ LLFloaterLand::LLFloaterLand() { tab->selectTab(sLastTab); } + + return TRUE; } // virtual LLFloaterLand::~LLFloaterLand() { - sInstance = NULL; } - // public void LLFloaterLand::refresh() { @@ -481,7 +479,7 @@ void LLPanelLandGeneral::refresh() mCheckContributeWithDeed->setEnabled(FALSE); mTextOwner->setText(LLString::null); - mBtnProfile->setLabel(childGetText("profile_text")); + mBtnProfile->setLabel(getString("profile_text")); mBtnProfile->setEnabled(FALSE); mTextClaimDate->setText(LLString::null); @@ -535,12 +533,12 @@ void LLPanelLandGeneral::refresh() { mTextSalePending->setText(LLString::null); mTextSalePending->setEnabled(FALSE); - mTextOwner->setText(childGetText("public_text")); + mTextOwner->setText(getString("public_text")); mTextOwner->setEnabled(FALSE); mBtnProfile->setEnabled(FALSE); mTextClaimDate->setText(LLString::null); mTextClaimDate->setEnabled(FALSE); - mTextGroup->setText(childGetText("none_text")); + mTextGroup->setText(getString("none_text")); mTextGroup->setEnabled(FALSE); mBtnStartAuction->setEnabled(FALSE); } @@ -548,12 +546,12 @@ void LLPanelLandGeneral::refresh() { if(!is_leased && (owner_id == gAgent.getID())) { - mTextSalePending->setText(childGetText("need_tier_to_modify")); + mTextSalePending->setText(getString("need_tier_to_modify")); mTextSalePending->setEnabled(TRUE); } else if(parcel->getAuctionID()) { - mTextSalePending->setText(childGetText("auction_id_text")); + mTextSalePending->setText(getString("auction_id_text")); mTextSalePending->setTextArg("[ID]", llformat("%u", parcel->getAuctionID())); mTextSalePending->setEnabled(TRUE); } @@ -572,15 +570,15 @@ void LLPanelLandGeneral::refresh() if (parcel->getGroupID().isNull()) { // Not group owned, so "Profile" - mBtnProfile->setLabel(childGetText("profile_text")); + mBtnProfile->setLabel(getString("profile_text")); - mTextGroup->setText(childGetText("none_text")); + mTextGroup->setText(getString("none_text")); mTextGroup->setEnabled(FALSE); } else { // Group owned, so "Info" - mBtnProfile->setLabel(childGetText("info_text")); + mBtnProfile->setLabel(getString("info_text")); //mTextGroup->setText("HIPPOS!");//parcel->getGroupName()); mTextGroup->setEnabled(TRUE); @@ -690,9 +688,9 @@ void LLPanelLandGeneral::refresh() &dwell); // Area - LLUIString price = childGetText("area_size_text"); + LLUIString price = getString("area_size_text"); price.setArg("[AREA]", llformat("%d",area)); - mTextPriceLabel->setText(childGetText("area_text")); + mTextPriceLabel->setText(getString("area_text")); mTextPrice->setText(price.getString()); mTextDwell->setText(llformat("%.0f", dwell)); @@ -730,29 +728,24 @@ void LLPanelLandGeneral::refreshNames() LLString owner; if (parcel->getIsGroupOwned()) { - owner = childGetText("group_owned_text"); + owner = getString("group_owned_text"); } else { // Figure out the owner's name - char owner_first[MAX_STRING]; /*Flawfinder: ignore*/ - char owner_last[MAX_STRING]; /*Flawfinder: ignore*/ - gCacheName->getName(parcel->getOwnerID(), owner_first, owner_last); - owner = llformat("%s %s", owner_first, owner_last); + gCacheName->getFullName(parcel->getOwnerID(), owner); } if(LLParcel::OS_LEASE_PENDING == parcel->getOwnershipStatus()) { - owner += childGetText("sale_pending_text"); + owner += getString("sale_pending_text"); } mTextOwner->setText(owner); LLString group; if(!parcel->getGroupID().isNull()) { - char buffer[MAX_STRING]; /*Flawfinder: ignore*/ - gCacheName->getGroupName(parcel->getGroupID(), buffer); - group = buffer; + gCacheName->getGroupName(parcel->getGroupID(), group); } mTextGroup->setText(group); @@ -760,18 +753,12 @@ void LLPanelLandGeneral::refreshNames() if(auth_buyer_id.notNull()) { LLString name; - char firstname[MAX_STRING]; /*Flawfinder: ignore*/ - char lastname[MAX_STRING]; /*Flawfinder: ignore*/ - gCacheName->getName(auth_buyer_id, firstname, lastname); - name.assign(firstname); - name.append(" "); - name.append(lastname); - + gCacheName->getFullName(auth_buyer_id, name); mSaleInfoForSale2->setTextArg("[BUYER]", name); } else { - mSaleInfoForSale2->setTextArg("[BUYER]", childGetText("anyone")); + mSaleInfoForSale2->setTextArg("[BUYER]", getString("anyone")); } } @@ -947,7 +934,7 @@ void LLPanelLandGeneral::cbBuyPass(S32 option, void* data) //static BOOL LLPanelLandGeneral::buyPassDialogVisible() { - return LLFloater::getFloaterByHandle(sBuyPassDialogHandle) != NULL; + return sBuyPassDialogHandle.get() != NULL; } // static @@ -1069,7 +1056,7 @@ BOOL LLPanelLandObjects::postBuild() image_id.set( gViewerArt.getString("icon_group.tga") ); mIconGroup = gImageList.getImage(image_id, MIPMAP_FALSE, TRUE); - mOwnerList = LLUICtrlFactory::getNameListByName(this, "owner list"); + mOwnerList = getChild("owner list"); mOwnerList->sortByColumn(3, FALSE); childSetCommitCallback("owner list", onCommitList, this); mOwnerList->setDoubleClickCallback(onDoubleClickOwner); @@ -1179,12 +1166,12 @@ void LLPanelLandObjects::refresh() if (sw_total > sw_max) { - mSWTotalObjects->setText(childGetText("objects_deleted_text")); + mSWTotalObjects->setText(getString("objects_deleted_text")); mSWTotalObjects->setTextArg("[DELETED]", llformat("%d", sw_total - sw_max)); } else { - mSWTotalObjects->setText(childGetText("objects_available_text")); + mSWTotalObjects->setText(getString("objects_available_text")); mSWTotalObjects->setTextArg("[AVAILABLE]", llformat("%d", sw_max - sw_total)); } mSWTotalObjects->setTextArg("[COUNT]", llformat("%d", sw_total)); @@ -1309,8 +1296,7 @@ void LLPanelLandObjects::callbackReturnOwnerObjects(S32 option, void* userdata) } else { - char first[DB_FIRST_NAME_BUF_SIZE]; /*Flawfinder: ignore*/ - char last[DB_LAST_NAME_BUF_SIZE]; /*Flawfinder: ignore*/ + std::string first, last; gCacheName->getName(owner_id, first, last); args["[FIRST]"] = first; args["[LAST]"] = last; @@ -1334,7 +1320,7 @@ void LLPanelLandObjects::callbackReturnGroupObjects(S32 option, void* userdata) { if (parcel) { - char group_name[MAX_STRING]; /*Flawfinder: ignore*/ + std::string group_name; gCacheName->getGroupName(parcel->getGroupID(), group_name); LLString::format_map_t args; args["[GROUPNAME]"] = group_name; @@ -1637,12 +1623,8 @@ void LLPanelLandObjects::onClickReturnOwnerObjects(void* userdata) } else { - char first[DB_FIRST_NAME_BUF_SIZE]; /*Flawfinder: ignore*/ - char last[DB_LAST_NAME_BUF_SIZE]; /*Flawfinder: ignore*/ - gCacheName->getName(owner_id, first, last); - std::string name = first; - name += " "; - name += last; + std::string name; + gCacheName->getFullName(owner_id, name); args["[NAME]"] = name; gViewerWindow->alertXml("ReturnObjectsOwnedByUser", args, callbackReturnOwnerObjects, userdata); } @@ -1657,7 +1639,7 @@ void LLPanelLandObjects::onClickReturnGroupObjects(void* userdata) send_parcel_select_objects(parcel->getLocalID(), RT_GROUP); - char group_name[MAX_STRING]; /*Flawfinder: ignore*/ + std::string group_name; gCacheName->getGroupName(parcel->getGroupID(), group_name); LLStringBase::format_map_t args; @@ -1686,7 +1668,7 @@ void LLPanelLandObjects::onClickReturnOtherObjects(void* userdata) if (parcel->getIsGroupOwned()) { - char group_name[MAX_STRING]; /*Flawfinder: ignore*/ + std::string group_name; gCacheName->getGroupName(parcel->getGroupID(), group_name); args["[NAME]"] = group_name; @@ -1702,13 +1684,8 @@ void LLPanelLandObjects::onClickReturnOtherObjects(void* userdata) } else { - char first[DB_FIRST_NAME_BUF_SIZE]; /*Flawfinder: ignore*/ - char last[DB_LAST_NAME_BUF_SIZE]; /*Flawfinder: ignore*/ - gCacheName->getName(owner_id, first, last); std::string name; - name += first; - name += " "; - name += last; + gCacheName->getFullName(owner_id, name); args["[NAME]"] = name; gViewerWindow->alertXml("ReturnObjectsNotOwnedByUser", args, callbackReturnOtherObjects, userdata); @@ -1855,7 +1832,7 @@ BOOL LLPanelLandOptions::postBuild() }*/ - mSnapshotCtrl = LLUICtrlFactory::getTexturePickerByName(this, "snapshot_ctrl"); + mSnapshotCtrl = getChild("snapshot_ctrl"); if (mSnapshotCtrl) { mSnapshotCtrl->setCommitCallback( onCommitAny ); @@ -1946,7 +1923,7 @@ void LLPanelLandOptions::refresh() mSnapshotCtrl->setImageAssetID(LLUUID::null); mSnapshotCtrl->setEnabled(FALSE); - mLocationText->setTextArg("[LANDING]", childGetText("landing_point_none")); + mLocationText->setTextArg("[LANDING]", getString("landing_point_none")); mSetBtn->setEnabled(FALSE); mClearBtn->setEnabled(FALSE); @@ -1993,13 +1970,13 @@ void LLPanelLandOptions::refresh() mPushRestrictionCtrl->set( parcel->getRestrictPushObject() ); if(parcel->getRegionPushOverride()) { - mPushRestrictionCtrl->setLabel(childGetText("push_restrict_region_text")); + mPushRestrictionCtrl->setLabel(getString("push_restrict_region_text")); mPushRestrictionCtrl->setEnabled(false); mPushRestrictionCtrl->set(TRUE); } else { - mPushRestrictionCtrl->setLabel(childGetText("push_restrict_text")); + mPushRestrictionCtrl->setLabel(getString("push_restrict_text")); mPushRestrictionCtrl->setEnabled(can_change_options); } @@ -2023,7 +2000,7 @@ void LLPanelLandOptions::refresh() LLVector3 pos = parcel->getUserLocation(); if (pos.isExactlyZero()) { - mLocationText->setTextArg("[LANDING]", childGetText("landing_point_none")); + mLocationText->setTextArg("[LANDING]", getString("landing_point_none")); } else { @@ -2214,240 +2191,8 @@ void LLPanelLandOptions::onClickPublishHelp(void*) } } -//--------------------------------------------------------------------------- -// LLPanelLandMedia -//--------------------------------------------------------------------------- - -LLPanelLandMedia::LLPanelLandMedia(LLParcelSelectionHandle& parcel) -: LLPanel("land_media_panel"), mParcel(parcel) -{ -} - - -BOOL LLPanelLandMedia::postBuild() -{ - - mCheckSoundLocal = LLUICtrlFactory::getCheckBoxByName(this, "check sound local"); - childSetCommitCallback("check sound local", onCommitAny, this); - - mRadioVoiceChat = LLUICtrlFactory::getRadioGroupByName(this, "parcel_voice_channel"); - childSetCommitCallback("parcel_voice_channel", onCommitAny, this); - - mMusicURLEdit = LLUICtrlFactory::getLineEditorByName(this, "music_url"); - childSetCommitCallback("music_url", onCommitAny, this); - - - mMediaTextureCtrl = LLUICtrlFactory::getTexturePickerByName(this, "media texture"); - if (mMediaTextureCtrl) - { - mMediaTextureCtrl->setCommitCallback( onCommitAny ); - mMediaTextureCtrl->setCallbackUserData( this ); - mMediaTextureCtrl->setAllowNoTexture ( TRUE ); - mMediaTextureCtrl->setImmediateFilterPermMask(PERM_COPY | PERM_TRANSFER); - mMediaTextureCtrl->setNonImmediateFilterPermMask(PERM_COPY | PERM_TRANSFER); - } - else - { - llwarns << "LLUICtrlFactory::getTexturePickerByName() returned NULL for 'media texure'" << llendl; - } - - mMediaAutoScaleCheck = LLUICtrlFactory::getCheckBoxByName(this, "media_auto_scale"); - childSetCommitCallback("media_auto_scale", onCommitAny, this); - - mMediaURLEdit = LLUICtrlFactory::getLineEditorByName(this, "media_url"); - childSetCommitCallback("media_url", onCommitAny, this); - - return TRUE; -} - - -// virtual -LLPanelLandMedia::~LLPanelLandMedia() -{ } - - -// public -void LLPanelLandMedia::refresh() -{ - LLParcel *parcel = mParcel->getParcel(); - - if (!parcel) - { - mCheckSoundLocal->set(FALSE); - mCheckSoundLocal->setEnabled(FALSE); - - mRadioVoiceChat->setSelectedIndex(kRadioVoiceChatEstate); - mRadioVoiceChat->setEnabled(FALSE); - - mMusicURLEdit->setText(LLString::null); - mMusicURLEdit->setEnabled(FALSE); - - mMediaURLEdit->setText(LLString::null); - mMediaURLEdit->setEnabled(FALSE); - - mMediaAutoScaleCheck->set ( FALSE ); - mMediaAutoScaleCheck->setEnabled(FALSE); - - mMediaTextureCtrl->clear(); - mMediaTextureCtrl->setEnabled(FALSE); - - #if 0 - mMediaStopButton->setEnabled ( FALSE ); - mMediaStartButton->setEnabled ( FALSE ); - #endif - } - else - { - // something selected, hooray! - - // Display options - BOOL can_change_media = LLViewerParcelMgr::isParcelModifiableByAgent(parcel, GP_LAND_CHANGE_MEDIA); - - mCheckSoundLocal->set( parcel->getSoundLocal() ); - mCheckSoundLocal->setEnabled( can_change_media ); - - LLViewerRegion* selection_region = gParcelMgr->getSelectionRegion(); - BOOL region_allows_voice = FALSE; - if (selection_region) - { - region_allows_voice = selection_region->isVoiceEnabled(); - } - - if(parcel->getVoiceEnabled()) - { - if(parcel->getVoiceUseEstateChannel()) - mRadioVoiceChat->setSelectedIndex(kRadioVoiceChatEstate); - else - mRadioVoiceChat->setSelectedIndex(kRadioVoiceChatPrivate); - } - else - { - mRadioVoiceChat->setSelectedIndex(kRadioVoiceChatDisable); - } - - mRadioVoiceChat->setEnabled( can_change_media && region_allows_voice ); - - // don't display urls if you're not able to change it - // much requested change in forums so people can't 'steal' urls - // NOTE: bug#2009 means this is still vunerable - however, bug - // should be closed since this bug opens up major security issues elsewhere. - if ( can_change_media ) - { - mMusicURLEdit->setDrawAsterixes ( FALSE ); - mMediaURLEdit->setDrawAsterixes ( FALSE ); - } - else - { - mMusicURLEdit->setDrawAsterixes ( TRUE ); - mMediaURLEdit->setDrawAsterixes ( TRUE ); - } - - mMusicURLEdit->setText(parcel->getMusicURL()); - mMusicURLEdit->setEnabled( can_change_media ); - - mMediaURLEdit->setText(parcel->getMediaURL()); - mMediaURLEdit->setEnabled( can_change_media ); - - mMediaAutoScaleCheck->set ( parcel->getMediaAutoScale () ); - mMediaAutoScaleCheck->setEnabled ( can_change_media ); - - LLUUID tmp = parcel->getMediaID(); - mMediaTextureCtrl->setImageAssetID ( parcel->getMediaID() ); - mMediaTextureCtrl->setEnabled( can_change_media ); - - #if 0 - // there is a media url and a media texture selected - if ( ( ! ( std::string ( parcel->getMediaURL() ).empty () ) ) && ( ! ( parcel->getMediaID ().isNull () ) ) ) - { - // turn on transport controls if allowed for this parcel - mMediaStopButton->setEnabled ( editable ); - mMediaStartButton->setEnabled ( editable ); - } - else - { - // no media url or no media texture - mMediaStopButton->setEnabled ( FALSE ); - mMediaStartButton->setEnabled ( FALSE ); - }; - #endif - } -} - -// static -void LLPanelLandMedia::onCommitAny(LLUICtrl *ctrl, void *userdata) -{ - LLPanelLandMedia *self = (LLPanelLandMedia *)userdata; - - LLParcel* parcel = self->mParcel->getParcel(); - if (!parcel) - { - return; - } - - // Extract data from UI - BOOL sound_local = self->mCheckSoundLocal->get(); - int voice_setting = self->mRadioVoiceChat->getSelectedIndex(); - std::string music_url = self->mMusicURLEdit->getText(); - std::string media_url = self->mMediaURLEdit->getText(); - U8 media_auto_scale = self->mMediaAutoScaleCheck->get(); - LLUUID media_id = self->mMediaTextureCtrl->getImageAssetID(); - - BOOL voice_enabled; - BOOL voice_estate_chan; - - switch(voice_setting) - { - default: - case kRadioVoiceChatEstate: - voice_enabled = TRUE; - voice_estate_chan = TRUE; - break; - case kRadioVoiceChatPrivate: - voice_enabled = TRUE; - voice_estate_chan = FALSE; - break; - case kRadioVoiceChatDisable: - voice_enabled = FALSE; - voice_estate_chan = FALSE; - break; - } - - // Remove leading/trailing whitespace (common when copying/pasting) - LLString::trim(music_url); - LLString::trim(media_url); - - // Push data into current parcel - parcel->setParcelFlag(PF_ALLOW_VOICE_CHAT, voice_enabled); - parcel->setParcelFlag(PF_USE_ESTATE_VOICE_CHAN, voice_estate_chan); - parcel->setParcelFlag(PF_SOUND_LOCAL, sound_local); - parcel->setMusicURL(music_url.c_str()); - parcel->setMediaURL(media_url.c_str()); - parcel->setMediaID(media_id); - parcel->setMediaAutoScale ( media_auto_scale ); - - // Send current parcel data upstream to server - gParcelMgr->sendParcelPropertiesUpdate( parcel ); - - // Might have changed properties, so let's redraw! - self->refresh(); -} - -void LLPanelLandMedia::onClickStopMedia ( void* data ) -{ - LLMediaEngine::getInstance ()->stop (); -} - -void LLPanelLandMedia::onClickStartMedia ( void* data ) -{ - // force a commit - gFocusMgr.setKeyboardFocus ( NULL ); - - // force a reload - LLMediaEngine::getInstance ()->convertImageAndLoadUrl ( true, false, std::string()); -} - //--------------------------------------------------------------------------- // LLPanelLandAccess //--------------------------------------------------------------------------- @@ -2475,11 +2220,11 @@ BOOL LLPanelLandAccess::postBuild() childSetAction("add_banned", onClickAddBanned, this); childSetAction("remove_banned", onClickRemoveBanned, this); - mListAccess = LLUICtrlFactory::getNameListByName(this, "AccessList"); + mListAccess = getChild("AccessList"); if (mListAccess) mListAccess->sortByColumn(0, TRUE); // ascending - mListBanned = LLUICtrlFactory::getNameListByName(this, "BannedList"); + mListBanned = getChild("BannedList"); if (mListBanned) mListBanned->sortByColumn(0, TRUE); // ascending @@ -2510,9 +2255,9 @@ void LLPanelLandAccess::refresh() childSetValue("public_access", public_access ); childSetValue("GroupCheck", use_group ); - char group_name[MAX_STRING]; /*Flawfinder: ignore*/ + std::string group_name; gCacheName->getGroupName(parcel->getGroupID(), group_name); - childSetLabelArg("GroupCheck", "[GROUP]", LLString(group_name) ); + childSetLabelArg("GroupCheck", "[GROUP]", group_name ); // Allow list { @@ -2733,13 +2478,12 @@ void LLPanelLandAccess::refresh_ui() void LLPanelLandAccess::refreshNames() { LLParcel* parcel = mParcel->getParcel(); - char group_name[DB_GROUP_NAME_BUF_SIZE]; /*Flawfinder: ignore*/ - group_name[0] = '\0'; + std::string group_name; if(parcel) { gCacheName->getGroupName(parcel->getGroupID(), group_name); } - childSetLabelArg("GroupCheck", "[GROUP]", LLString(group_name)); + childSetLabelArg("GroupCheck", "[GROUP]", group_name); } @@ -2791,7 +2535,7 @@ void LLPanelLandAccess::onCommitAny(LLUICtrl *ctrl, void *userdata) BOOL use_access_group = self->childGetValue("GroupCheck").asBoolean(); if (use_access_group) { - char group_name[MAX_STRING]; /*Flawfinder: ignore*/ + std::string group_name; if (!gCacheName->getGroupName(parcel->getGroupID(), group_name)) { use_access_group = FALSE; @@ -2968,35 +2712,35 @@ void LLPanelLandCovenant::refresh() LLViewerRegion* region = gParcelMgr->getSelectionRegion(); if(!region) return; - LLTextBox* region_name = (LLTextBox*)getChildByName("region_name_text"); + LLTextBox* region_name = getChild("region_name_text"); if (region_name) { region_name->setText(region->getName()); } - LLTextBox* resellable_clause = (LLTextBox*)getChildByName("resellable_clause"); + LLTextBox* resellable_clause = getChild("resellable_clause"); if (resellable_clause) { if (region->getRegionFlags() & REGION_FLAGS_BLOCK_LAND_RESELL) { - resellable_clause->setText(childGetText("can_not_resell")); + resellable_clause->setText(getString("can_not_resell")); } else { - resellable_clause->setText(childGetText("can_resell")); + resellable_clause->setText(getString("can_resell")); } } - LLTextBox* changeable_clause = (LLTextBox*)getChildByName("changeable_clause"); + LLTextBox* changeable_clause = getChild("changeable_clause"); if (changeable_clause) { if (region->getRegionFlags() & REGION_FLAGS_ALLOW_PARCEL_CHANGES) { - changeable_clause->setText(childGetText("can_change")); + changeable_clause->setText(getString("can_change")); } else { - changeable_clause->setText(childGetText("can_not_change")); + changeable_clause->setText(getString("can_not_change")); } } @@ -3015,7 +2759,7 @@ void LLPanelLandCovenant::updateCovenantText(const std::string &string) LLPanelLandCovenant* self = LLFloaterLand::getCurrentPanelLandCovenant(); if (self) { - LLViewerTextEditor* editor = (LLViewerTextEditor*)self->getChildByName("covenant_editor"); + LLViewerTextEditor* editor = self->getChild("covenant_editor"); if (editor) { editor->setHandleEditKeysDirectly(TRUE); @@ -3030,7 +2774,7 @@ void LLPanelLandCovenant::updateEstateName(const std::string& name) LLPanelLandCovenant* self = LLFloaterLand::getCurrentPanelLandCovenant(); if (self) { - LLTextBox* editor = (LLTextBox*)self->getChildByName("estate_name_text"); + LLTextBox* editor = self->getChild("estate_name_text"); if (editor) editor->setText(name); } } @@ -3041,7 +2785,7 @@ void LLPanelLandCovenant::updateLastModified(const std::string& text) LLPanelLandCovenant* self = LLFloaterLand::getCurrentPanelLandCovenant(); if (self) { - LLTextBox* editor = (LLTextBox*)self->getChildByName("covenant_timestamp_text"); + LLTextBox* editor = self->getChild("covenant_timestamp_text"); if (editor) editor->setText(text); } } @@ -3052,7 +2796,7 @@ void LLPanelLandCovenant::updateEstateOwnerName(const std::string& name) LLPanelLandCovenant* self = LLFloaterLand::getCurrentPanelLandCovenant(); if (self) { - LLTextBox* editor = (LLTextBox*)self->getChildByName("estate_owner_text"); + LLTextBox* editor = self->getChild("estate_owner_text"); if (editor) editor->setText(name); } } -- cgit v1.1