diff options
Diffstat (limited to '')
-rw-r--r-- | linden/indra/newview/llfloaterland.cpp | 360 |
1 files changed, 173 insertions, 187 deletions
diff --git a/linden/indra/newview/llfloaterland.cpp b/linden/indra/newview/llfloaterland.cpp index f19baa9..6bb6aff 100644 --- a/linden/indra/newview/llfloaterland.cpp +++ b/linden/indra/newview/llfloaterland.cpp | |||
@@ -113,7 +113,7 @@ static const BOOL BUY_PERSONAL_LAND = FALSE; | |||
113 | LLFloaterLand* LLFloaterLand::sInstance = NULL; | 113 | LLFloaterLand* LLFloaterLand::sInstance = NULL; |
114 | LLParcelSelectionObserver* LLFloaterLand::sObserver = NULL; | 114 | LLParcelSelectionObserver* LLFloaterLand::sObserver = NULL; |
115 | S32 LLFloaterLand::sLastTab = 0; | 115 | S32 LLFloaterLand::sLastTab = 0; |
116 | BOOL LLFloaterLand::sRequestReplyOnUpdate = TRUE; | 116 | |
117 | LLViewHandle LLPanelLandGeneral::sBuyPassDialogHandle; | 117 | LLViewHandle LLPanelLandGeneral::sBuyPassDialogHandle; |
118 | 118 | ||
119 | // Local classes | 119 | // Local classes |
@@ -185,7 +185,7 @@ void LLFloaterLand::show() | |||
185 | gParcelMgr->addObserver( sObserver ); | 185 | gParcelMgr->addObserver( sObserver ); |
186 | } | 186 | } |
187 | 187 | ||
188 | sInstance->open(); | 188 | sInstance->open(); /*Flawfinder: ignore*/ |
189 | 189 | ||
190 | // Done automatically when the selected parcel's properties arrive | 190 | // Done automatically when the selected parcel's properties arrive |
191 | // (and hence we have the local id). | 191 | // (and hence we have the local id). |
@@ -193,13 +193,11 @@ void LLFloaterLand::show() | |||
193 | 193 | ||
194 | // If we've already got the parcel data, fill the | 194 | // If we've already got the parcel data, fill the |
195 | // floater with it. | 195 | // floater with it. |
196 | LLParcel *parcel = gParcelMgr->getSelectedParcel(); | 196 | sInstance->mParcel = gParcelMgr->getFloatingParcelSelection(); |
197 | if (parcel) | 197 | if (sInstance->mParcel->getParcel()) |
198 | { | 198 | { |
199 | sInstance->refresh(); | 199 | sInstance->refresh(); |
200 | } | 200 | } |
201 | |||
202 | sRequestReplyOnUpdate = TRUE; | ||
203 | } | 201 | } |
204 | 202 | ||
205 | //static | 203 | //static |
@@ -233,19 +231,6 @@ void LLFloaterLand::refreshAll() | |||
233 | } | 231 | } |
234 | } | 232 | } |
235 | 233 | ||
236 | |||
237 | // virtual | ||
238 | BOOL LLFloaterLand::canClose() | ||
239 | { | ||
240 | // canClose is checked as the first step of attempting to close | ||
241 | // the window, before focus is released from controls. Since we're | ||
242 | // closing the window and deselecting the land, we | ||
243 | // don't want replies to the upstream messages that get sent | ||
244 | // (because the reply will cause the land to be selected again). | ||
245 | sRequestReplyOnUpdate = FALSE; | ||
246 | return TRUE; | ||
247 | } | ||
248 | |||
249 | // virtual | 234 | // virtual |
250 | void LLFloaterLand::onClose(bool app_quitting) | 235 | void LLFloaterLand::onClose(bool app_quitting) |
251 | { | 236 | { |
@@ -253,10 +238,6 @@ void LLFloaterLand::onClose(bool app_quitting) | |||
253 | delete sObserver; | 238 | delete sObserver; |
254 | sObserver = NULL; | 239 | sObserver = NULL; |
255 | 240 | ||
256 | // Must do this after removing observer, otherwise | ||
257 | // infinite loops notifying and closing. | ||
258 | gParcelMgr->deselectLand(); | ||
259 | |||
260 | // Might have been showing owned objects | 241 | // Might have been showing owned objects |
261 | gSelectMgr->unhighlightAll(); | 242 | gSelectMgr->unhighlightAll(); |
262 | 243 | ||
@@ -321,7 +302,7 @@ void LLFloaterLand::refresh() | |||
321 | void* LLFloaterLand::createPanelLandGeneral(void* data) | 302 | void* LLFloaterLand::createPanelLandGeneral(void* data) |
322 | { | 303 | { |
323 | LLFloaterLand* self = (LLFloaterLand*)data; | 304 | LLFloaterLand* self = (LLFloaterLand*)data; |
324 | self->mPanelGeneral = new LLPanelLandGeneral(); | 305 | self->mPanelGeneral = new LLPanelLandGeneral(self->mParcel); |
325 | return self->mPanelGeneral; | 306 | return self->mPanelGeneral; |
326 | } | 307 | } |
327 | 308 | ||
@@ -331,7 +312,7 @@ void* LLFloaterLand::createPanelLandGeneral(void* data) | |||
331 | void* LLFloaterLand::createPanelLandCovenant(void* data) | 312 | void* LLFloaterLand::createPanelLandCovenant(void* data) |
332 | { | 313 | { |
333 | LLFloaterLand* self = (LLFloaterLand*)data; | 314 | LLFloaterLand* self = (LLFloaterLand*)data; |
334 | self->mPanelCovenant = new LLPanelLandCovenant(); | 315 | self->mPanelCovenant = new LLPanelLandCovenant(self->mParcel); |
335 | return self->mPanelCovenant; | 316 | return self->mPanelCovenant; |
336 | } | 317 | } |
337 | 318 | ||
@@ -340,7 +321,7 @@ void* LLFloaterLand::createPanelLandCovenant(void* data) | |||
340 | void* LLFloaterLand::createPanelLandObjects(void* data) | 321 | void* LLFloaterLand::createPanelLandObjects(void* data) |
341 | { | 322 | { |
342 | LLFloaterLand* self = (LLFloaterLand*)data; | 323 | LLFloaterLand* self = (LLFloaterLand*)data; |
343 | self->mPanelObjects = new LLPanelLandObjects(); | 324 | self->mPanelObjects = new LLPanelLandObjects(self->mParcel); |
344 | return self->mPanelObjects; | 325 | return self->mPanelObjects; |
345 | } | 326 | } |
346 | 327 | ||
@@ -348,7 +329,7 @@ void* LLFloaterLand::createPanelLandObjects(void* data) | |||
348 | void* LLFloaterLand::createPanelLandOptions(void* data) | 329 | void* LLFloaterLand::createPanelLandOptions(void* data) |
349 | { | 330 | { |
350 | LLFloaterLand* self = (LLFloaterLand*)data; | 331 | LLFloaterLand* self = (LLFloaterLand*)data; |
351 | self->mPanelOptions = new LLPanelLandOptions(); | 332 | self->mPanelOptions = new LLPanelLandOptions(self->mParcel); |
352 | return self->mPanelOptions; | 333 | return self->mPanelOptions; |
353 | } | 334 | } |
354 | 335 | ||
@@ -356,7 +337,7 @@ void* LLFloaterLand::createPanelLandOptions(void* data) | |||
356 | void* LLFloaterLand::createPanelLandMedia(void* data) | 337 | void* LLFloaterLand::createPanelLandMedia(void* data) |
357 | { | 338 | { |
358 | LLFloaterLand* self = (LLFloaterLand*)data; | 339 | LLFloaterLand* self = (LLFloaterLand*)data; |
359 | self->mPanelMedia = new LLPanelLandMedia(); | 340 | self->mPanelMedia = new LLPanelLandMedia(self->mParcel); |
360 | return self->mPanelMedia; | 341 | return self->mPanelMedia; |
361 | } | 342 | } |
362 | 343 | ||
@@ -364,7 +345,7 @@ void* LLFloaterLand::createPanelLandMedia(void* data) | |||
364 | void* LLFloaterLand::createPanelLandAccess(void* data) | 345 | void* LLFloaterLand::createPanelLandAccess(void* data) |
365 | { | 346 | { |
366 | LLFloaterLand* self = (LLFloaterLand*)data; | 347 | LLFloaterLand* self = (LLFloaterLand*)data; |
367 | self->mPanelAccess = new LLPanelLandAccess(); | 348 | self->mPanelAccess = new LLPanelLandAccess(self->mParcel); |
368 | return self->mPanelAccess; | 349 | return self->mPanelAccess; |
369 | } | 350 | } |
370 | 351 | ||
@@ -372,7 +353,7 @@ void* LLFloaterLand::createPanelLandAccess(void* data) | |||
372 | void* LLFloaterLand::createPanelLandBan(void* data) | 353 | void* LLFloaterLand::createPanelLandBan(void* data) |
373 | { | 354 | { |
374 | LLFloaterLand* self = (LLFloaterLand*)data; | 355 | LLFloaterLand* self = (LLFloaterLand*)data; |
375 | self->mPanelBan = new LLPanelLandBan(); | 356 | self->mPanelBan = new LLPanelLandBan(self->mParcel); |
376 | return self->mPanelBan; | 357 | return self->mPanelBan; |
377 | } | 358 | } |
378 | 359 | ||
@@ -382,9 +363,10 @@ void* LLFloaterLand::createPanelLandBan(void* data) | |||
382 | //--------------------------------------------------------------------------- | 363 | //--------------------------------------------------------------------------- |
383 | 364 | ||
384 | 365 | ||
385 | LLPanelLandGeneral::LLPanelLandGeneral() | 366 | LLPanelLandGeneral::LLPanelLandGeneral(LLParcelSelectionHandle& parcel) |
386 | : LLPanel("land_general_panel"), | 367 | : LLPanel("land_general_panel"), |
387 | mUncheckedSell(FALSE) | 368 | mUncheckedSell(FALSE), |
369 | mParcel(parcel) | ||
388 | { | 370 | { |
389 | } | 371 | } |
390 | 372 | ||
@@ -471,9 +453,8 @@ BOOL LLPanelLandGeneral::postBuild() | |||
471 | mBtnBuyGroupLand->setClickedCallback(onClickBuyLand, (void*)&BUY_GROUP_LAND); | 453 | mBtnBuyGroupLand->setClickedCallback(onClickBuyLand, (void*)&BUY_GROUP_LAND); |
472 | 454 | ||
473 | 455 | ||
474 | static BOOL deselect_when_done = FALSE; | ||
475 | mBtnBuyPass = LLUICtrlFactory::getButtonByName(this, "Buy Pass..."); | 456 | mBtnBuyPass = LLUICtrlFactory::getButtonByName(this, "Buy Pass..."); |
476 | mBtnBuyPass->setClickedCallback(onClickBuyPass, &deselect_when_done); | 457 | mBtnBuyPass->setClickedCallback(onClickBuyPass, this); |
477 | 458 | ||
478 | mBtnReleaseLand = LLUICtrlFactory::getButtonByName(this, "Abandon Land..."); | 459 | mBtnReleaseLand = LLUICtrlFactory::getButtonByName(this, "Abandon Land..."); |
479 | mBtnReleaseLand->setClickedCallback(onClickRelease, NULL); | 460 | mBtnReleaseLand->setClickedCallback(onClickRelease, NULL); |
@@ -498,7 +479,7 @@ void LLPanelLandGeneral::refresh() | |||
498 | { | 479 | { |
499 | mBtnStartAuction->setVisible(gAgent.isGodlike()); | 480 | mBtnStartAuction->setVisible(gAgent.isGodlike()); |
500 | 481 | ||
501 | LLParcel *parcel = gParcelMgr->getSelectedParcel(); | 482 | LLParcel *parcel = mParcel->getParcel(); |
502 | bool region_owner = false; | 483 | bool region_owner = false; |
503 | LLViewerRegion* regionp = gParcelMgr->getSelectionRegion(); | 484 | LLViewerRegion* regionp = gParcelMgr->getSelectionRegion(); |
504 | if(regionp && (regionp->getOwner() == gAgent.getID())) | 485 | if(regionp && (regionp->getOwner() == gAgent.getID())) |
@@ -607,8 +588,8 @@ void LLPanelLandGeneral::refresh() | |||
607 | } | 588 | } |
608 | else if(parcel->getAuctionID()) | 589 | else if(parcel->getAuctionID()) |
609 | { | 590 | { |
610 | char auction_str[MAX_STRING]; | 591 | char auction_str[MAX_STRING]; /*Flawfinder: ignore*/ |
611 | sprintf(auction_str, "Auction ID: %u", parcel->getAuctionID()); | 592 | snprintf(auction_str, sizeof(auction_str), "Auction ID: %u", parcel->getAuctionID()); /*Flawfinder: ignore*/ |
612 | mTextSalePending->setText(auction_str); | 593 | mTextSalePending->setText(auction_str); |
613 | mTextSalePending->setEnabled(TRUE); | 594 | mTextSalePending->setEnabled(TRUE); |
614 | } | 595 | } |
@@ -645,7 +626,7 @@ void LLPanelLandGeneral::refresh() | |||
645 | 626 | ||
646 | // Display claim date | 627 | // Display claim date |
647 | time_t claim_date = parcel->getClaimDate(); | 628 | time_t claim_date = parcel->getClaimDate(); |
648 | char time_buf[TIME_STR_LENGTH]; | 629 | char time_buf[TIME_STR_LENGTH]; /*Flawfinder: ignore*/ |
649 | mTextClaimDate->setText(formatted_time(claim_date, time_buf)); | 630 | mTextClaimDate->setText(formatted_time(claim_date, time_buf)); |
650 | mTextClaimDate->setEnabled(is_leased); | 631 | mTextClaimDate->setEnabled(is_leased); |
651 | 632 | ||
@@ -735,7 +716,7 @@ void LLPanelLandGeneral::refresh() | |||
735 | gParcelMgr->canAgentBuyParcel(parcel, true)); | 716 | gParcelMgr->canAgentBuyParcel(parcel, true)); |
736 | 717 | ||
737 | // show pricing information | 718 | // show pricing information |
738 | char price[64]; | 719 | char price[64]; /*Flawfinder: ignore*/ |
739 | const char* label = NULL; | 720 | const char* label = NULL; |
740 | S32 area; | 721 | S32 area; |
741 | S32 claim_price; | 722 | S32 claim_price; |
@@ -748,13 +729,13 @@ void LLPanelLandGeneral::refresh() | |||
748 | &dwell); | 729 | &dwell); |
749 | 730 | ||
750 | // Area | 731 | // Area |
751 | sprintf(price, "%d sq. m.", area); | 732 | snprintf(price, sizeof(price), "%d sq. m.", area); /*Flawfinder: ignore*/ |
752 | label = AREA; | 733 | label = AREA; |
753 | 734 | ||
754 | mTextPriceLabel->setText(label); | 735 | mTextPriceLabel->setText(label); |
755 | mTextPrice->setText(price); | 736 | mTextPrice->setText(price); |
756 | 737 | ||
757 | sprintf(price, "%.0f", dwell); | 738 | snprintf(price, sizeof(price), "%.0f", dwell); /*Flawfinder: ignore*/ |
758 | mTextDwell->setText(price); | 739 | mTextDwell->setText(price); |
759 | 740 | ||
760 | if(region_owner) | 741 | if(region_owner) |
@@ -780,31 +761,31 @@ void LLPanelLandGeneral::refresh() | |||
780 | // public | 761 | // public |
781 | void LLPanelLandGeneral::refreshNames() | 762 | void LLPanelLandGeneral::refreshNames() |
782 | { | 763 | { |
783 | LLParcel *parcel = gParcelMgr->getSelectedParcel(); | 764 | LLParcel *parcel = mParcel->getParcel(); |
784 | if (!parcel) | 765 | if (!parcel) |
785 | { | 766 | { |
786 | mTextOwner->setText(""); | 767 | mTextOwner->setText(""); |
787 | return; | 768 | return; |
788 | } | 769 | } |
789 | 770 | ||
790 | char buffer[MAX_STRING]; | 771 | char buffer[MAX_STRING]; /*Flawfinder: ignore*/ |
791 | if (parcel->getIsGroupOwned()) | 772 | if (parcel->getIsGroupOwned()) |
792 | { | 773 | { |
793 | buffer[0] = '\0'; | 774 | buffer[0] = '\0'; |
794 | strcat(buffer, "(Group Owned)"); | 775 | strcat(buffer, "(Group Owned)"); /*Flawfinder: ignore*/ |
795 | } | 776 | } |
796 | else | 777 | else |
797 | { | 778 | { |
798 | // Figure out the owner's name | 779 | // Figure out the owner's name |
799 | char owner_first[MAX_STRING]; | 780 | char owner_first[MAX_STRING]; /*Flawfinder: ignore*/ |
800 | char owner_last[MAX_STRING]; | 781 | char owner_last[MAX_STRING]; /*Flawfinder: ignore*/ |
801 | gCacheName->getName(parcel->getOwnerID(), owner_first, owner_last); | 782 | gCacheName->getName(parcel->getOwnerID(), owner_first, owner_last); |
802 | sprintf(buffer, "%s %s", owner_first, owner_last); | 783 | snprintf(buffer, sizeof(buffer), "%s %s", owner_first, owner_last); /*Flawfinder: ignore*/ |
803 | } | 784 | } |
804 | 785 | ||
805 | if(LLParcel::OS_LEASE_PENDING == parcel->getOwnershipStatus()) | 786 | if(LLParcel::OS_LEASE_PENDING == parcel->getOwnershipStatus()) |
806 | { | 787 | { |
807 | strcat(buffer, " (Sale Pending)"); | 788 | strcat(buffer, " (Sale Pending)"); /*Flawfinder: ignore*/ |
808 | } | 789 | } |
809 | mTextOwner->setText(buffer); | 790 | mTextOwner->setText(buffer); |
810 | 791 | ||
@@ -822,8 +803,8 @@ void LLPanelLandGeneral::refreshNames() | |||
822 | if(auth_buyer_id.notNull()) | 803 | if(auth_buyer_id.notNull()) |
823 | { | 804 | { |
824 | LLString name; | 805 | LLString name; |
825 | char firstname[MAX_STRING]; | 806 | char firstname[MAX_STRING]; /*Flawfinder: ignore*/ |
826 | char lastname[MAX_STRING]; | 807 | char lastname[MAX_STRING]; /*Flawfinder: ignore*/ |
827 | gCacheName->getName(auth_buyer_id, firstname, lastname); | 808 | gCacheName->getName(auth_buyer_id, firstname, lastname); |
828 | name.assign(firstname); | 809 | name.assign(firstname); |
829 | name.append(" "); | 810 | name.append(" "); |
@@ -860,7 +841,8 @@ void LLPanelLandGeneral::onClickSetGroup(void* userdata) | |||
860 | // static | 841 | // static |
861 | void LLPanelLandGeneral::onClickProfile(void* data) | 842 | void LLPanelLandGeneral::onClickProfile(void* data) |
862 | { | 843 | { |
863 | LLParcel* parcel = gParcelMgr->getSelectedParcel(); | 844 | LLPanelLandGeneral* panelp = (LLPanelLandGeneral*)data; |
845 | LLParcel* parcel = panelp->mParcel->getParcel(); | ||
864 | if (!parcel) return; | 846 | if (!parcel) return; |
865 | 847 | ||
866 | if (parcel->getIsGroupOwned()) | 848 | if (parcel->getIsGroupOwned()) |
@@ -885,7 +867,7 @@ void LLPanelLandGeneral::cbGroupID(LLUUID group_id, void* userdata) | |||
885 | // public | 867 | // public |
886 | void LLPanelLandGeneral::setGroup(const LLUUID& group_id) | 868 | void LLPanelLandGeneral::setGroup(const LLUUID& group_id) |
887 | { | 869 | { |
888 | LLParcel* parcel = gParcelMgr->getSelectedParcel(); | 870 | LLParcel* parcel = mParcel->getParcel(); |
889 | if (!parcel) return; | 871 | if (!parcel) return; |
890 | 872 | ||
891 | // Set parcel properties and send message | 873 | // Set parcel properties and send message |
@@ -894,7 +876,7 @@ void LLPanelLandGeneral::setGroup(const LLUUID& group_id) | |||
894 | //mTextGroup->setText(group_name); | 876 | //mTextGroup->setText(group_name); |
895 | 877 | ||
896 | // Send update | 878 | // Send update |
897 | gParcelMgr->sendParcelPropertiesUpdate(parcel, LLFloaterLand::sRequestReplyOnUpdate); | 879 | gParcelMgr->sendParcelPropertiesUpdate(parcel); |
898 | 880 | ||
899 | // Update UI | 881 | // Update UI |
900 | refresh(); | 882 | refresh(); |
@@ -907,16 +889,17 @@ void LLPanelLandGeneral::onClickBuyLand(void* data) | |||
907 | gParcelMgr->startBuyLand(*for_group); | 889 | gParcelMgr->startBuyLand(*for_group); |
908 | } | 890 | } |
909 | 891 | ||
910 | BOOL LLPanelLandGeneral::enableDeedToGroup(void*) | 892 | BOOL LLPanelLandGeneral::enableDeedToGroup(void* data) |
911 | { | 893 | { |
912 | LLParcel* parcel = gParcelMgr->getSelectedParcel(); | 894 | LLPanelLandGeneral* panelp = (LLPanelLandGeneral*)data; |
895 | LLParcel* parcel = panelp->mParcel->getParcel(); | ||
913 | return (parcel != NULL) && (parcel->getParcelFlag(PF_ALLOW_DEED_TO_GROUP)); | 896 | return (parcel != NULL) && (parcel->getParcelFlag(PF_ALLOW_DEED_TO_GROUP)); |
914 | } | 897 | } |
915 | 898 | ||
916 | // static | 899 | // static |
917 | void LLPanelLandGeneral::onClickDeed(void*) | 900 | void LLPanelLandGeneral::onClickDeed(void*) |
918 | { | 901 | { |
919 | //LLParcel* parcel = gParcelMgr->getSelectedParcel(); | 902 | //LLParcel* parcel = mParcel->getParcel(); |
920 | //if (parcel) | 903 | //if (parcel) |
921 | //{ | 904 | //{ |
922 | gParcelMgr->startDeedLandToGroup(); | 905 | gParcelMgr->startDeedLandToGroup(); |
@@ -937,39 +920,43 @@ void LLPanelLandGeneral::onClickReclaim(void*) | |||
937 | } | 920 | } |
938 | 921 | ||
939 | // static | 922 | // static |
940 | BOOL LLPanelLandGeneral::enableBuyPass(void*) | 923 | BOOL LLPanelLandGeneral::enableBuyPass(void* data) |
941 | { | 924 | { |
942 | LLParcel* parcel = gParcelMgr->getSelectedParcel(); | 925 | LLPanelLandGeneral* panelp = (LLPanelLandGeneral*)data; |
926 | LLParcel* parcel = panelp != NULL ? panelp->mParcel->getParcel() : gParcelMgr->getParcelSelection()->getParcel(); | ||
943 | return (parcel != NULL) && (parcel->getParcelFlag(PF_USE_PASS_LIST) && !gParcelMgr->isCollisionBanned()); | 927 | return (parcel != NULL) && (parcel->getParcelFlag(PF_USE_PASS_LIST) && !gParcelMgr->isCollisionBanned()); |
944 | } | 928 | } |
945 | 929 | ||
946 | 930 | ||
947 | // static | 931 | // static |
948 | void LLPanelLandGeneral::onClickBuyPass(void* deselect_when_done) | 932 | void LLPanelLandGeneral::onClickBuyPass(void* data) |
949 | { | 933 | { |
950 | LLParcel* parcel = gParcelMgr->getSelectedParcel(); | 934 | LLPanelLandGeneral* panelp = (LLPanelLandGeneral*)data; |
935 | LLParcel* parcel = panelp != NULL ? panelp->mParcel->getParcel() : gParcelMgr->getParcelSelection()->getParcel(); | ||
936 | |||
951 | if (!parcel) return; | 937 | if (!parcel) return; |
952 | 938 | ||
953 | S32 pass_price = parcel->getPassPrice(); | 939 | S32 pass_price = parcel->getPassPrice(); |
954 | const char* parcel_name = parcel->getName(); | 940 | const char* parcel_name = parcel->getName(); |
955 | F32 pass_hours = parcel->getPassHours(); | 941 | F32 pass_hours = parcel->getPassHours(); |
956 | 942 | ||
957 | char cost[256], time[256]; | 943 | char cost[256], time[256]; /*Flawfinder: ignore*/ |
958 | sprintf(cost, "%d", pass_price); | 944 | snprintf(cost, sizeof(cost), "%d", pass_price); /*Flawfinder: ignore*/ |
959 | sprintf(time, "%.2f", pass_hours); | 945 | snprintf(time, sizeof(time), "%.2f", pass_hours); /*Flawfinder: ignore*/ |
960 | 946 | ||
961 | LLStringBase<char>::format_map_t args; | 947 | LLStringBase<char>::format_map_t args; |
962 | args["[COST]"] = cost; | 948 | args["[COST]"] = cost; |
963 | args["[PARCEL_NAME]"] = parcel_name; | 949 | args["[PARCEL_NAME]"] = parcel_name; |
964 | args["[TIME]"] = time; | 950 | args["[TIME]"] = time; |
965 | 951 | ||
966 | sBuyPassDialogHandle = gViewerWindow->alertXml("LandBuyPass", args, cbBuyPass, deselect_when_done)->getHandle(); | 952 | sBuyPassDialogHandle = gViewerWindow->alertXml("LandBuyPass", args, cbBuyPass)->getHandle(); |
967 | } | 953 | } |
968 | 954 | ||
969 | // static | 955 | // static |
970 | void LLPanelLandGeneral::onClickStartAuction(void*) | 956 | void LLPanelLandGeneral::onClickStartAuction(void* data) |
971 | { | 957 | { |
972 | LLParcel* parcelp = gParcelMgr->getSelectedParcel(); | 958 | LLPanelLandGeneral* panelp = (LLPanelLandGeneral*)data; |
959 | LLParcel* parcelp = panelp->mParcel->getParcel(); | ||
973 | if(parcelp) | 960 | if(parcelp) |
974 | { | 961 | { |
975 | if(parcelp->getForSale()) | 962 | if(parcelp->getForSale()) |
@@ -986,18 +973,11 @@ void LLPanelLandGeneral::onClickStartAuction(void*) | |||
986 | // static | 973 | // static |
987 | void LLPanelLandGeneral::cbBuyPass(S32 option, void* data) | 974 | void LLPanelLandGeneral::cbBuyPass(S32 option, void* data) |
988 | { | 975 | { |
989 | BOOL deselect_when_done = (BOOL)(intptr_t)data; | ||
990 | |||
991 | if (0 == option) | 976 | if (0 == option) |
992 | { | 977 | { |
993 | // User clicked OK | 978 | // User clicked OK |
994 | gParcelMgr->buyPass(); | 979 | gParcelMgr->buyPass(); |
995 | } | 980 | } |
996 | |||
997 | if (deselect_when_done) | ||
998 | { | ||
999 | gParcelMgr->deselectLand(); | ||
1000 | } | ||
1001 | } | 981 | } |
1002 | 982 | ||
1003 | //static | 983 | //static |
@@ -1011,7 +991,7 @@ void LLPanelLandGeneral::onCommitAny(LLUICtrl *ctrl, void *userdata) | |||
1011 | { | 991 | { |
1012 | LLPanelLandGeneral *panelp = (LLPanelLandGeneral *)userdata; | 992 | LLPanelLandGeneral *panelp = (LLPanelLandGeneral *)userdata; |
1013 | 993 | ||
1014 | LLParcel* parcel = gParcelMgr->getSelectedParcel(); | 994 | LLParcel* parcel = panelp->mParcel->getParcel(); |
1015 | if (!parcel) | 995 | if (!parcel) |
1016 | { | 996 | { |
1017 | return; | 997 | return; |
@@ -1034,7 +1014,7 @@ void LLPanelLandGeneral::onCommitAny(LLUICtrl *ctrl, void *userdata) | |||
1034 | parcel->setContributeWithDeed(contribute_with_deed); | 1014 | parcel->setContributeWithDeed(contribute_with_deed); |
1035 | 1015 | ||
1036 | // Send update to server | 1016 | // Send update to server |
1037 | gParcelMgr->sendParcelPropertiesUpdate( parcel, LLFloaterLand::sRequestReplyOnUpdate ); | 1017 | gParcelMgr->sendParcelPropertiesUpdate( parcel ); |
1038 | 1018 | ||
1039 | // Might have changed properties, so let's redraw! | 1019 | // Might have changed properties, so let's redraw! |
1040 | panelp->refresh(); | 1020 | panelp->refresh(); |
@@ -1049,20 +1029,21 @@ void LLPanelLandGeneral::onClickSellLand(void* data) | |||
1049 | // static | 1029 | // static |
1050 | void LLPanelLandGeneral::onClickStopSellLand(void* data) | 1030 | void LLPanelLandGeneral::onClickStopSellLand(void* data) |
1051 | { | 1031 | { |
1052 | LLParcel* parcel = gParcelMgr->getSelectedParcel(); | 1032 | LLPanelLandGeneral* panelp = (LLPanelLandGeneral*)data; |
1033 | LLParcel* parcel = panelp->mParcel->getParcel(); | ||
1053 | 1034 | ||
1054 | parcel->setParcelFlag(PF_FOR_SALE, FALSE); | 1035 | parcel->setParcelFlag(PF_FOR_SALE, FALSE); |
1055 | parcel->setSalePrice(0); | 1036 | parcel->setSalePrice(0); |
1056 | parcel->setAuthorizedBuyerID(LLUUID::null); | 1037 | parcel->setAuthorizedBuyerID(LLUUID::null); |
1057 | 1038 | ||
1058 | gParcelMgr->sendParcelPropertiesUpdate(parcel, LLFloaterLand::sRequestReplyOnUpdate); | 1039 | gParcelMgr->sendParcelPropertiesUpdate(parcel); |
1059 | } | 1040 | } |
1060 | 1041 | ||
1061 | //--------------------------------------------------------------------------- | 1042 | //--------------------------------------------------------------------------- |
1062 | // LLPanelLandObjects | 1043 | // LLPanelLandObjects |
1063 | //--------------------------------------------------------------------------- | 1044 | //--------------------------------------------------------------------------- |
1064 | LLPanelLandObjects::LLPanelLandObjects() | 1045 | LLPanelLandObjects::LLPanelLandObjects(LLParcelSelectionHandle& parcel) |
1065 | : LLPanel("land_objects_panel") | 1046 | : LLPanel("land_objects_panel"), mParcel(parcel) |
1066 | { | 1047 | { |
1067 | } | 1048 | } |
1068 | 1049 | ||
@@ -1230,7 +1211,7 @@ void LLPanelLandObjects::onDoubleClickOwner(void *userdata) | |||
1230 | // public | 1211 | // public |
1231 | void LLPanelLandObjects::refresh() | 1212 | void LLPanelLandObjects::refresh() |
1232 | { | 1213 | { |
1233 | LLParcel *parcel = gParcelMgr->getSelectedParcel(); | 1214 | LLParcel *parcel = mParcel->getParcel(); |
1234 | 1215 | ||
1235 | mBtnShowOwnerObjects->setEnabled(FALSE); | 1216 | mBtnShowOwnerObjects->setEnabled(FALSE); |
1236 | mBtnShowGroupObjects->setEnabled(FALSE); | 1217 | mBtnShowGroupObjects->setEnabled(FALSE); |
@@ -1258,16 +1239,16 @@ void LLPanelLandObjects::refresh() | |||
1258 | } | 1239 | } |
1259 | else | 1240 | else |
1260 | { | 1241 | { |
1261 | char count[MAX_STRING]; | 1242 | char count[MAX_STRING]; /*Flawfinder: ignore*/ |
1262 | S32 sw_max; | 1243 | S32 sw_max = 0; |
1263 | S32 sw_total; | 1244 | S32 sw_total = 0; |
1264 | S32 max; | 1245 | S32 max = 0; |
1265 | S32 total; | 1246 | S32 total = 0; |
1266 | S32 owned; | 1247 | S32 owned = 0; |
1267 | S32 group; | 1248 | S32 group = 0; |
1268 | S32 other; | 1249 | S32 other = 0; |
1269 | S32 selected; | 1250 | S32 selected = 0; |
1270 | F32 parcel_object_bonus; | 1251 | F32 parcel_object_bonus = 0.f; |
1271 | 1252 | ||
1272 | gParcelMgr->getPrimInfo(sw_max, sw_total, | 1253 | gParcelMgr->getPrimInfo(sw_max, sw_total, |
1273 | max, total, owned, group, other, selected, | 1254 | max, total, owned, group, other, selected, |
@@ -1285,7 +1266,7 @@ void LLPanelLandObjects::refresh() | |||
1285 | 1266 | ||
1286 | if (parcel_object_bonus != 1.0f) | 1267 | if (parcel_object_bonus != 1.0f) |
1287 | { | 1268 | { |
1288 | sprintf(count, "Region Object Bonus Factor: %.2f", | 1269 | snprintf(count, sizeof(count), "Region Object Bonus Factor: %.2f", /*Flawfinder: ignore*/ |
1289 | parcel_object_bonus); | 1270 | parcel_object_bonus); |
1290 | mParcelObjectBonus->setText(count); | 1271 | mParcelObjectBonus->setText(count); |
1291 | } | 1272 | } |
@@ -1296,35 +1277,35 @@ void LLPanelLandObjects::refresh() | |||
1296 | 1277 | ||
1297 | if (sw_total > sw_max) | 1278 | if (sw_total > sw_max) |
1298 | { | 1279 | { |
1299 | sprintf(count, "%d out of %d (%d will be deleted)", | 1280 | snprintf(count, sizeof(count), "%d out of %d (%d will be deleted)", /*Flawfinder: ignore*/ |
1300 | sw_total, sw_max, sw_total - sw_max); | 1281 | sw_total, sw_max, sw_total - sw_max); |
1301 | } | 1282 | } |
1302 | else | 1283 | else |
1303 | { | 1284 | { |
1304 | sprintf(count, "%d out of %d (%d available)", | 1285 | snprintf(count, sizeof(count), "%d out of %d (%d available)", /*Flawfinder: ignore*/ |
1305 | sw_total, sw_max, sw_max - sw_total); | 1286 | sw_total, sw_max, sw_max - sw_total); |
1306 | } | 1287 | } |
1307 | mSWTotalObjects->setText(count); | 1288 | mSWTotalObjects->setText(count); |
1308 | 1289 | ||
1309 | sprintf(count, "%d", max); | 1290 | snprintf(count, sizeof(count), "%d", max); /*Flawfinder: ignore*/ |
1310 | mObjectContribution->setText(count); | 1291 | mObjectContribution->setText(count); |
1311 | 1292 | ||
1312 | sprintf(count, "%d", total); | 1293 | snprintf(count, sizeof(count), "%d", total); /*Flawfinder: ignore*/ |
1313 | mTotalObjects->setText(count); | 1294 | mTotalObjects->setText(count); |
1314 | 1295 | ||
1315 | sprintf(count, "%d", owned); | 1296 | snprintf(count, sizeof(count), "%d", owned); /*Flawfinder: ignore*/ |
1316 | mOwnerObjects->setText(count); | 1297 | mOwnerObjects->setText(count); |
1317 | 1298 | ||
1318 | sprintf(count, "%d", group); | 1299 | snprintf(count, sizeof(count), "%d", group); /*Flawfinder: ignore*/ |
1319 | mGroupObjects->setText(count); | 1300 | mGroupObjects->setText(count); |
1320 | 1301 | ||
1321 | sprintf(count, "%d", other); | 1302 | snprintf(count, sizeof(count), "%d", other); /*Flawfinder: ignore*/ |
1322 | mOtherObjects->setText(count); | 1303 | mOtherObjects->setText(count); |
1323 | 1304 | ||
1324 | sprintf(count, "%d", selected); | 1305 | snprintf(count, sizeof(count), "%d", selected); /*Flawfinder: ignore*/ |
1325 | mSelectedObjects->setText(count); | 1306 | mSelectedObjects->setText(count); |
1326 | 1307 | ||
1327 | sprintf(count, "%d", mOtherTime); | 1308 | snprintf(count, sizeof(count), "%d", mOtherTime); /*Flawfinder: ignore*/ |
1328 | mCleanOtherObjectsTime->setText(count); | 1309 | mCleanOtherObjectsTime->setText(count); |
1329 | 1310 | ||
1330 | BOOL can_return_owned = LLViewerParcelMgr::isParcelModifiableByAgent(parcel, GP_LAND_RETURN_GROUP_OWNED); | 1311 | BOOL can_return_owned = LLViewerParcelMgr::isParcelModifiableByAgent(parcel, GP_LAND_RETURN_GROUP_OWNED); |
@@ -1425,7 +1406,7 @@ void send_return_objects_message(S32 parcel_local_id, S32 return_type, | |||
1425 | void LLPanelLandObjects::callbackReturnOwnerObjects(S32 option, void* userdata) | 1406 | void LLPanelLandObjects::callbackReturnOwnerObjects(S32 option, void* userdata) |
1426 | { | 1407 | { |
1427 | LLPanelLandObjects *lop = (LLPanelLandObjects *)userdata; | 1408 | LLPanelLandObjects *lop = (LLPanelLandObjects *)userdata; |
1428 | LLParcel *parcel = gParcelMgr->getSelectedParcel(); | 1409 | LLParcel *parcel = lop->mParcel->getParcel(); |
1429 | if (0 == option) | 1410 | if (0 == option) |
1430 | { | 1411 | { |
1431 | if (parcel) | 1412 | if (parcel) |
@@ -1438,8 +1419,8 @@ void LLPanelLandObjects::callbackReturnOwnerObjects(S32 option, void* userdata) | |||
1438 | } | 1419 | } |
1439 | else | 1420 | else |
1440 | { | 1421 | { |
1441 | char first[DB_FIRST_NAME_BUF_SIZE]; | 1422 | char first[DB_FIRST_NAME_BUF_SIZE]; /*Flawfinder: ignore*/ |
1442 | char last[DB_LAST_NAME_BUF_SIZE]; | 1423 | char last[DB_LAST_NAME_BUF_SIZE]; /*Flawfinder: ignore*/ |
1443 | gCacheName->getName(owner_id, first, last); | 1424 | gCacheName->getName(owner_id, first, last); |
1444 | args["[FIRST]"] = first; | 1425 | args["[FIRST]"] = first; |
1445 | args["[LAST]"] = last; | 1426 | args["[LAST]"] = last; |
@@ -1450,7 +1431,7 @@ void LLPanelLandObjects::callbackReturnOwnerObjects(S32 option, void* userdata) | |||
1450 | } | 1431 | } |
1451 | 1432 | ||
1452 | gSelectMgr->unhighlightAll(); | 1433 | gSelectMgr->unhighlightAll(); |
1453 | gParcelMgr->sendParcelPropertiesUpdate( parcel, LLFloaterLand::sRequestReplyOnUpdate ); | 1434 | gParcelMgr->sendParcelPropertiesUpdate( parcel ); |
1454 | lop->refresh(); | 1435 | lop->refresh(); |
1455 | } | 1436 | } |
1456 | 1437 | ||
@@ -1458,12 +1439,12 @@ void LLPanelLandObjects::callbackReturnOwnerObjects(S32 option, void* userdata) | |||
1458 | void LLPanelLandObjects::callbackReturnGroupObjects(S32 option, void* userdata) | 1439 | void LLPanelLandObjects::callbackReturnGroupObjects(S32 option, void* userdata) |
1459 | { | 1440 | { |
1460 | LLPanelLandObjects *lop = (LLPanelLandObjects *)userdata; | 1441 | LLPanelLandObjects *lop = (LLPanelLandObjects *)userdata; |
1461 | LLParcel *parcel = gParcelMgr->getSelectedParcel(); | 1442 | LLParcel *parcel = lop->mParcel->getParcel(); |
1462 | if (0 == option) | 1443 | if (0 == option) |
1463 | { | 1444 | { |
1464 | if (parcel) | 1445 | if (parcel) |
1465 | { | 1446 | { |
1466 | char group_name[MAX_STRING]; | 1447 | char group_name[MAX_STRING]; /*Flawfinder: ignore*/ |
1467 | gCacheName->getGroupName(parcel->getGroupID(), group_name); | 1448 | gCacheName->getGroupName(parcel->getGroupID(), group_name); |
1468 | LLString::format_map_t args; | 1449 | LLString::format_map_t args; |
1469 | args["[GROUPNAME]"] = group_name; | 1450 | args["[GROUPNAME]"] = group_name; |
@@ -1472,7 +1453,7 @@ void LLPanelLandObjects::callbackReturnGroupObjects(S32 option, void* userdata) | |||
1472 | } | 1453 | } |
1473 | } | 1454 | } |
1474 | gSelectMgr->unhighlightAll(); | 1455 | gSelectMgr->unhighlightAll(); |
1475 | gParcelMgr->sendParcelPropertiesUpdate( parcel, LLFloaterLand::sRequestReplyOnUpdate ); | 1456 | gParcelMgr->sendParcelPropertiesUpdate( parcel ); |
1476 | lop->refresh(); | 1457 | lop->refresh(); |
1477 | } | 1458 | } |
1478 | 1459 | ||
@@ -1480,7 +1461,7 @@ void LLPanelLandObjects::callbackReturnGroupObjects(S32 option, void* userdata) | |||
1480 | void LLPanelLandObjects::callbackReturnOtherObjects(S32 option, void* userdata) | 1461 | void LLPanelLandObjects::callbackReturnOtherObjects(S32 option, void* userdata) |
1481 | { | 1462 | { |
1482 | LLPanelLandObjects *lop = (LLPanelLandObjects *)userdata; | 1463 | LLPanelLandObjects *lop = (LLPanelLandObjects *)userdata; |
1483 | LLParcel *parcel = gParcelMgr->getSelectedParcel(); | 1464 | LLParcel *parcel = lop->mParcel->getParcel(); |
1484 | if (0 == option) | 1465 | if (0 == option) |
1485 | { | 1466 | { |
1486 | if (parcel) | 1467 | if (parcel) |
@@ -1490,7 +1471,7 @@ void LLPanelLandObjects::callbackReturnOtherObjects(S32 option, void* userdata) | |||
1490 | } | 1471 | } |
1491 | } | 1472 | } |
1492 | gSelectMgr->unhighlightAll(); | 1473 | gSelectMgr->unhighlightAll(); |
1493 | gParcelMgr->sendParcelPropertiesUpdate( parcel, LLFloaterLand::sRequestReplyOnUpdate ); | 1474 | gParcelMgr->sendParcelPropertiesUpdate( parcel ); |
1494 | lop->refresh(); | 1475 | lop->refresh(); |
1495 | } | 1476 | } |
1496 | 1477 | ||
@@ -1498,7 +1479,7 @@ void LLPanelLandObjects::callbackReturnOtherObjects(S32 option, void* userdata) | |||
1498 | void LLPanelLandObjects::callbackReturnOwnerList(S32 option, void* userdata) | 1479 | void LLPanelLandObjects::callbackReturnOwnerList(S32 option, void* userdata) |
1499 | { | 1480 | { |
1500 | LLPanelLandObjects *self = (LLPanelLandObjects *)userdata; | 1481 | LLPanelLandObjects *self = (LLPanelLandObjects *)userdata; |
1501 | LLParcel *parcel = gParcelMgr->getSelectedParcel(); | 1482 | LLParcel *parcel = self->mParcel->getParcel(); |
1502 | if (0 == option) | 1483 | if (0 == option) |
1503 | { | 1484 | { |
1504 | if (parcel) | 1485 | if (parcel) |
@@ -1525,7 +1506,7 @@ void LLPanelLandObjects::callbackReturnOwnerList(S32 option, void* userdata) | |||
1525 | } | 1506 | } |
1526 | } | 1507 | } |
1527 | gSelectMgr->unhighlightAll(); | 1508 | gSelectMgr->unhighlightAll(); |
1528 | gParcelMgr->sendParcelPropertiesUpdate( parcel, LLFloaterLand::sRequestReplyOnUpdate ); | 1509 | gParcelMgr->sendParcelPropertiesUpdate( parcel ); |
1529 | self->refresh(); | 1510 | self->refresh(); |
1530 | } | 1511 | } |
1531 | 1512 | ||
@@ -1543,7 +1524,7 @@ void LLPanelLandObjects::onClickReturnOwnerList(void* userdata) | |||
1543 | 1524 | ||
1544 | gParcelMgr->getPrimInfo(sw_max, sw_total, max, total, owned, group, other, selected, parcel_object_bonus, other_time); | 1525 | gParcelMgr->getPrimInfo(sw_max, sw_total, max, total, owned, group, other, selected, parcel_object_bonus, other_time); |
1545 | 1526 | ||
1546 | LLParcel* parcelp = gParcelMgr->getSelectedParcel(); | 1527 | LLParcel* parcelp = self->mParcel->getParcel(); |
1547 | if (!parcelp) return; | 1528 | if (!parcelp) return; |
1548 | 1529 | ||
1549 | // Make sure we have something selected. | 1530 | // Make sure we have something selected. |
@@ -1577,7 +1558,7 @@ void LLPanelLandObjects::onClickRefresh(void* userdata) | |||
1577 | 1558 | ||
1578 | LLMessageSystem *msg = gMessageSystem; | 1559 | LLMessageSystem *msg = gMessageSystem; |
1579 | 1560 | ||
1580 | LLParcel* parcel = gParcelMgr->getSelectedParcel(); | 1561 | LLParcel* parcel = self->mParcel->getParcel(); |
1581 | if (!parcel) return; | 1562 | if (!parcel) return; |
1582 | 1563 | ||
1583 | LLViewerRegion* region = gParcelMgr->getSelectionRegion(); | 1564 | LLViewerRegion* region = gParcelMgr->getSelectionRegion(); |
@@ -1614,7 +1595,7 @@ void LLPanelLandObjects::processParcelObjectOwnersReply(LLMessageSystem *msg, vo | |||
1614 | BOOL is_group_owned; | 1595 | BOOL is_group_owned; |
1615 | S32 object_count; | 1596 | S32 object_count; |
1616 | BOOL is_online; | 1597 | BOOL is_online; |
1617 | char object_count_str[MAX_STRING]; | 1598 | char object_count_str[MAX_STRING]; /*Flawfinder: ignore*/ |
1618 | //BOOL b_need_refresh = FALSE; | 1599 | //BOOL b_need_refresh = FALSE; |
1619 | 1600 | ||
1620 | // If we were waiting for the first reply, clear the "Searching..." text. | 1601 | // If we were waiting for the first reply, clear the "Searching..." text. |
@@ -1655,7 +1636,7 @@ void LLPanelLandObjects::processParcelObjectOwnersReply(LLMessageSystem *msg, vo | |||
1655 | // Placeholder for name. | 1636 | // Placeholder for name. |
1656 | row->addColumn("", FONT, self->mColWidth[2]); | 1637 | row->addColumn("", FONT, self->mColWidth[2]); |
1657 | 1638 | ||
1658 | sprintf(object_count_str, "%d", object_count); | 1639 | snprintf(object_count_str, sizeof(object_count_str), "%d", object_count); /*Flawfinder: ignore*/ |
1659 | row->addColumn(object_count_str, FONT, self->mColWidth[3]); | 1640 | row->addColumn(object_count_str, FONT, self->mColWidth[3]); |
1660 | 1641 | ||
1661 | if (is_group_owned) | 1642 | if (is_group_owned) |
@@ -1730,7 +1711,7 @@ void LLPanelLandObjects::onCommitList(LLUICtrl* ctrl, void* data) | |||
1730 | self->mBtnReturnOwnerList->setEnabled(TRUE); | 1711 | self->mBtnReturnOwnerList->setEnabled(TRUE); |
1731 | 1712 | ||
1732 | // Highlight this user's objects | 1713 | // Highlight this user's objects |
1733 | clickShowCore(RT_LIST, &(self->mSelectedOwners)); | 1714 | clickShowCore(self, RT_LIST, &(self->mSelectedOwners)); |
1734 | } | 1715 | } |
1735 | } | 1716 | } |
1736 | 1717 | ||
@@ -1757,30 +1738,30 @@ void LLPanelLandObjects::onClickName(void* userdata) | |||
1757 | } | 1738 | } |
1758 | 1739 | ||
1759 | // static | 1740 | // static |
1760 | void LLPanelLandObjects::clickShowCore(S32 return_type, uuid_list_t* list) | 1741 | void LLPanelLandObjects::clickShowCore(LLPanelLandObjects* self, S32 return_type, uuid_list_t* list) |
1761 | { | 1742 | { |
1762 | LLParcel* parcel = gParcelMgr->getSelectedParcel(); | 1743 | LLParcel* parcel = self->mParcel->getParcel(); |
1763 | if (!parcel) return; | 1744 | if (!parcel) return; |
1764 | 1745 | ||
1765 | send_parcel_select_objects(parcel->getLocalID(), return_type, list); | 1746 | send_parcel_select_objects(parcel->getLocalID(), return_type, list); |
1766 | } | 1747 | } |
1767 | 1748 | ||
1768 | // static | 1749 | // static |
1769 | void LLPanelLandObjects::onClickShowOwnerObjects(void*) | 1750 | void LLPanelLandObjects::onClickShowOwnerObjects(void* userdata) |
1770 | { | 1751 | { |
1771 | clickShowCore(RT_OWNER); | 1752 | clickShowCore((LLPanelLandObjects*)userdata, RT_OWNER); |
1772 | } | 1753 | } |
1773 | 1754 | ||
1774 | // static | 1755 | // static |
1775 | void LLPanelLandObjects::onClickShowGroupObjects(void*) | 1756 | void LLPanelLandObjects::onClickShowGroupObjects(void* userdata) |
1776 | { | 1757 | { |
1777 | clickShowCore(RT_GROUP); | 1758 | clickShowCore((LLPanelLandObjects*)userdata, (RT_GROUP)); |
1778 | } | 1759 | } |
1779 | 1760 | ||
1780 | // static | 1761 | // static |
1781 | void LLPanelLandObjects::onClickShowOtherObjects(void*) | 1762 | void LLPanelLandObjects::onClickShowOtherObjects(void* userdata) |
1782 | { | 1763 | { |
1783 | clickShowCore(RT_OTHER); | 1764 | clickShowCore((LLPanelLandObjects*)userdata, RT_OTHER); |
1784 | } | 1765 | } |
1785 | 1766 | ||
1786 | // static | 1767 | // static |
@@ -1794,7 +1775,8 @@ void LLPanelLandObjects::onClickReturnOwnerObjects(void* userdata) | |||
1794 | 1775 | ||
1795 | gParcelMgr->getPrimInfo(sw_max, sw_total, max, total, owned, group, other, selected, parcel_object_bonus, other_time); | 1776 | gParcelMgr->getPrimInfo(sw_max, sw_total, max, total, owned, group, other, selected, parcel_object_bonus, other_time); |
1796 | 1777 | ||
1797 | LLParcel* parcel = gParcelMgr->getSelectedParcel(); | 1778 | LLPanelLandObjects* panelp = (LLPanelLandObjects*)userdata; |
1779 | LLParcel* parcel = panelp->mParcel->getParcel(); | ||
1798 | if (!parcel) return; | 1780 | if (!parcel) return; |
1799 | 1781 | ||
1800 | send_parcel_select_objects(parcel->getLocalID(), RT_OWNER); | 1782 | send_parcel_select_objects(parcel->getLocalID(), RT_OWNER); |
@@ -1810,8 +1792,8 @@ void LLPanelLandObjects::onClickReturnOwnerObjects(void* userdata) | |||
1810 | } | 1792 | } |
1811 | else | 1793 | else |
1812 | { | 1794 | { |
1813 | char first[DB_FIRST_NAME_BUF_SIZE]; | 1795 | char first[DB_FIRST_NAME_BUF_SIZE]; /*Flawfinder: ignore*/ |
1814 | char last[DB_LAST_NAME_BUF_SIZE]; | 1796 | char last[DB_LAST_NAME_BUF_SIZE]; /*Flawfinder: ignore*/ |
1815 | gCacheName->getName(owner_id, first, last); | 1797 | gCacheName->getName(owner_id, first, last); |
1816 | std::string name = first; | 1798 | std::string name = first; |
1817 | name += " "; | 1799 | name += " "; |
@@ -1832,12 +1814,13 @@ void LLPanelLandObjects::onClickReturnGroupObjects(void* userdata) | |||
1832 | 1814 | ||
1833 | gParcelMgr->getPrimInfo(sw_max, sw_total, max, total, owned, group, other, selected, parcel_object_bonus, other_time); | 1815 | gParcelMgr->getPrimInfo(sw_max, sw_total, max, total, owned, group, other, selected, parcel_object_bonus, other_time); |
1834 | 1816 | ||
1835 | LLParcel* parcel = gParcelMgr->getSelectedParcel(); | 1817 | LLPanelLandObjects* panelp = (LLPanelLandObjects*)userdata; |
1818 | LLParcel* parcel = panelp->mParcel->getParcel(); | ||
1836 | if (!parcel) return; | 1819 | if (!parcel) return; |
1837 | 1820 | ||
1838 | send_parcel_select_objects(parcel->getLocalID(), RT_GROUP); | 1821 | send_parcel_select_objects(parcel->getLocalID(), RT_GROUP); |
1839 | 1822 | ||
1840 | char group_name[MAX_STRING]; | 1823 | char group_name[MAX_STRING]; /*Flawfinder: ignore*/ |
1841 | gCacheName->getGroupName(parcel->getGroupID(), group_name); | 1824 | gCacheName->getGroupName(parcel->getGroupID(), group_name); |
1842 | 1825 | ||
1843 | LLStringBase<char>::format_map_t args; | 1826 | LLStringBase<char>::format_map_t args; |
@@ -1859,7 +1842,8 @@ void LLPanelLandObjects::onClickReturnOtherObjects(void* userdata) | |||
1859 | 1842 | ||
1860 | gParcelMgr->getPrimInfo(sw_max, sw_total, max, total, owned, group, other, selected, parcel_object_bonus, other_time); | 1843 | gParcelMgr->getPrimInfo(sw_max, sw_total, max, total, owned, group, other, selected, parcel_object_bonus, other_time); |
1861 | 1844 | ||
1862 | LLParcel* parcel = gParcelMgr->getSelectedParcel(); | 1845 | LLPanelLandObjects* panelp = (LLPanelLandObjects*)userdata; |
1846 | LLParcel* parcel = panelp->mParcel->getParcel(); | ||
1863 | if (!parcel) return; | 1847 | if (!parcel) return; |
1864 | 1848 | ||
1865 | send_parcel_select_objects(parcel->getLocalID(), RT_OTHER); | 1849 | send_parcel_select_objects(parcel->getLocalID(), RT_OTHER); |
@@ -1869,7 +1853,7 @@ void LLPanelLandObjects::onClickReturnOtherObjects(void* userdata) | |||
1869 | 1853 | ||
1870 | if (parcel->getIsGroupOwned()) | 1854 | if (parcel->getIsGroupOwned()) |
1871 | { | 1855 | { |
1872 | char group_name[MAX_STRING]; | 1856 | char group_name[MAX_STRING]; /*Flawfinder: ignore*/ |
1873 | gCacheName->getGroupName(parcel->getGroupID(), group_name); | 1857 | gCacheName->getGroupName(parcel->getGroupID(), group_name); |
1874 | args["[NAME]"] = group_name; | 1858 | args["[NAME]"] = group_name; |
1875 | 1859 | ||
@@ -1885,8 +1869,8 @@ void LLPanelLandObjects::onClickReturnOtherObjects(void* userdata) | |||
1885 | } | 1869 | } |
1886 | else | 1870 | else |
1887 | { | 1871 | { |
1888 | char first[DB_FIRST_NAME_BUF_SIZE]; | 1872 | char first[DB_FIRST_NAME_BUF_SIZE]; /*Flawfinder: ignore*/ |
1889 | char last[DB_LAST_NAME_BUF_SIZE]; | 1873 | char last[DB_LAST_NAME_BUF_SIZE]; /*Flawfinder: ignore*/ |
1890 | gCacheName->getName(owner_id, first, last); | 1874 | gCacheName->getName(owner_id, first, last); |
1891 | std::string name; | 1875 | std::string name; |
1892 | name += first; | 1876 | name += first; |
@@ -1903,7 +1887,7 @@ void LLPanelLandObjects::onClickReturnOtherObjects(void* userdata) | |||
1903 | void LLPanelLandObjects::onLostFocus(LLLineEditor *caller, void* user_data) | 1887 | void LLPanelLandObjects::onLostFocus(LLLineEditor *caller, void* user_data) |
1904 | { | 1888 | { |
1905 | LLPanelLandObjects *lop = (LLPanelLandObjects *)user_data; | 1889 | LLPanelLandObjects *lop = (LLPanelLandObjects *)user_data; |
1906 | LLParcel *parcel = gParcelMgr->getSelectedParcel(); | 1890 | LLParcel* parcel = lop->mParcel->getParcel(); |
1907 | if (parcel) | 1891 | if (parcel) |
1908 | { | 1892 | { |
1909 | lop->mOtherTime = atoi(lop->mCleanOtherObjectsTime->getText().c_str()); | 1893 | lop->mOtherTime = atoi(lop->mCleanOtherObjectsTime->getText().c_str()); |
@@ -1918,7 +1902,7 @@ void LLPanelLandObjects::onLostFocus(LLLineEditor *caller, void* user_data) | |||
1918 | // LLPanelLandOptions | 1902 | // LLPanelLandOptions |
1919 | //--------------------------------------------------------------------------- | 1903 | //--------------------------------------------------------------------------- |
1920 | 1904 | ||
1921 | LLPanelLandOptions::LLPanelLandOptions() | 1905 | LLPanelLandOptions::LLPanelLandOptions(LLParcelSelectionHandle& parcel) |
1922 | : LLPanel("land_options_panel"), | 1906 | : LLPanel("land_options_panel"), |
1923 | mCheckEditObjects(NULL), | 1907 | mCheckEditObjects(NULL), |
1924 | mCheckEditGroupObjects(NULL), | 1908 | mCheckEditGroupObjects(NULL), |
@@ -1940,7 +1924,8 @@ LLPanelLandOptions::LLPanelLandOptions() | |||
1940 | mAllowPublishCtrl(NULL), | 1924 | mAllowPublishCtrl(NULL), |
1941 | mMatureCtrl(NULL), | 1925 | mMatureCtrl(NULL), |
1942 | mPushRestrictionCtrl(NULL), | 1926 | mPushRestrictionCtrl(NULL), |
1943 | mPublishHelpButton(NULL) | 1927 | mPublishHelpButton(NULL), |
1928 | mParcel(parcel) | ||
1944 | { | 1929 | { |
1945 | 1930 | ||
1946 | } | 1931 | } |
@@ -2073,7 +2058,7 @@ LLPanelLandOptions::~LLPanelLandOptions() | |||
2073 | // public | 2058 | // public |
2074 | void LLPanelLandOptions::refresh() | 2059 | void LLPanelLandOptions::refresh() |
2075 | { | 2060 | { |
2076 | LLParcel *parcel = gParcelMgr->getSelectedParcel(); | 2061 | LLParcel *parcel = mParcel->getParcel(); |
2077 | 2062 | ||
2078 | if (!parcel) | 2063 | if (!parcel) |
2079 | { | 2064 | { |
@@ -2208,8 +2193,8 @@ void LLPanelLandOptions::refresh() | |||
2208 | } | 2193 | } |
2209 | else | 2194 | else |
2210 | { | 2195 | { |
2211 | char buffer[256]; | 2196 | char buffer[256]; /*Flawfinder: ignore*/ |
2212 | sprintf(buffer, "Landing Point: %d, %d, %d", | 2197 | snprintf(buffer, sizeof(buffer), "Landing Point: %d, %d, %d", /*Flawfinder: ignore*/ |
2213 | llround(pos.mV[VX]), | 2198 | llround(pos.mV[VX]), |
2214 | llround(pos.mV[VY]), | 2199 | llround(pos.mV[VY]), |
2215 | llround(pos.mV[VZ])); | 2200 | llround(pos.mV[VZ])); |
@@ -2244,7 +2229,7 @@ void LLPanelLandOptions::onCommitAny(LLUICtrl *ctrl, void *userdata) | |||
2244 | { | 2229 | { |
2245 | LLPanelLandOptions *self = (LLPanelLandOptions *)userdata; | 2230 | LLPanelLandOptions *self = (LLPanelLandOptions *)userdata; |
2246 | 2231 | ||
2247 | LLParcel* parcel = gParcelMgr->getSelectedParcel(); | 2232 | LLParcel* parcel = self->mParcel->getParcel(); |
2248 | if (!parcel) | 2233 | if (!parcel) |
2249 | { | 2234 | { |
2250 | return; | 2235 | return; |
@@ -2298,7 +2283,7 @@ void LLPanelLandOptions::onCommitAny(LLUICtrl *ctrl, void *userdata) | |||
2298 | parcel->setSnapshotID(snapshot_id); | 2283 | parcel->setSnapshotID(snapshot_id); |
2299 | 2284 | ||
2300 | // Send current parcel data upstream to server | 2285 | // Send current parcel data upstream to server |
2301 | gParcelMgr->sendParcelPropertiesUpdate( parcel, LLFloaterLand::sRequestReplyOnUpdate ); | 2286 | gParcelMgr->sendParcelPropertiesUpdate( parcel ); |
2302 | 2287 | ||
2303 | // Might have changed properties, so let's redraw! | 2288 | // Might have changed properties, so let's redraw! |
2304 | self->refresh(); | 2289 | self->refresh(); |
@@ -2310,7 +2295,7 @@ void LLPanelLandOptions::onClickSet(void* userdata) | |||
2310 | { | 2295 | { |
2311 | LLPanelLandOptions* self = (LLPanelLandOptions*)userdata; | 2296 | LLPanelLandOptions* self = (LLPanelLandOptions*)userdata; |
2312 | 2297 | ||
2313 | LLParcel* selected_parcel = gParcelMgr->getSelectedParcel(); | 2298 | LLParcel* selected_parcel = self->mParcel->getParcel(); |
2314 | if (!selected_parcel) return; | 2299 | if (!selected_parcel) return; |
2315 | 2300 | ||
2316 | LLParcel* agent_parcel = gParcelMgr->getAgentParcel(); | 2301 | LLParcel* agent_parcel = gParcelMgr->getAgentParcel(); |
@@ -2326,7 +2311,7 @@ void LLPanelLandOptions::onClickSet(void* userdata) | |||
2326 | selected_parcel->setUserLocation(pos_region); | 2311 | selected_parcel->setUserLocation(pos_region); |
2327 | selected_parcel->setUserLookAt(gAgent.getFrameAgent().getAtAxis()); | 2312 | selected_parcel->setUserLookAt(gAgent.getFrameAgent().getAtAxis()); |
2328 | 2313 | ||
2329 | gParcelMgr->sendParcelPropertiesUpdate(selected_parcel, LLFloaterLand::sRequestReplyOnUpdate); | 2314 | gParcelMgr->sendParcelPropertiesUpdate(selected_parcel); |
2330 | 2315 | ||
2331 | self->refresh(); | 2316 | self->refresh(); |
2332 | } | 2317 | } |
@@ -2335,7 +2320,7 @@ void LLPanelLandOptions::onClickClear(void* userdata) | |||
2335 | { | 2320 | { |
2336 | LLPanelLandOptions* self = (LLPanelLandOptions*)userdata; | 2321 | LLPanelLandOptions* self = (LLPanelLandOptions*)userdata; |
2337 | 2322 | ||
2338 | LLParcel* selected_parcel = gParcelMgr->getSelectedParcel(); | 2323 | LLParcel* selected_parcel = self->mParcel->getParcel(); |
2339 | if (!selected_parcel) return; | 2324 | if (!selected_parcel) return; |
2340 | 2325 | ||
2341 | // yes, this magic number of 0,0,0 means that it is clear | 2326 | // yes, this magic number of 0,0,0 means that it is clear |
@@ -2343,7 +2328,7 @@ void LLPanelLandOptions::onClickClear(void* userdata) | |||
2343 | selected_parcel->setUserLocation(zero_vec); | 2328 | selected_parcel->setUserLocation(zero_vec); |
2344 | selected_parcel->setUserLookAt(zero_vec); | 2329 | selected_parcel->setUserLookAt(zero_vec); |
2345 | 2330 | ||
2346 | gParcelMgr->sendParcelPropertiesUpdate(selected_parcel, LLFloaterLand::sRequestReplyOnUpdate); | 2331 | gParcelMgr->sendParcelPropertiesUpdate(selected_parcel); |
2347 | 2332 | ||
2348 | self->refresh(); | 2333 | self->refresh(); |
2349 | } | 2334 | } |
@@ -2358,8 +2343,8 @@ void LLPanelLandOptions::onClickPublishHelp(void*) | |||
2358 | // LLPanelLandMedia | 2343 | // LLPanelLandMedia |
2359 | //--------------------------------------------------------------------------- | 2344 | //--------------------------------------------------------------------------- |
2360 | 2345 | ||
2361 | LLPanelLandMedia::LLPanelLandMedia() | 2346 | LLPanelLandMedia::LLPanelLandMedia(LLParcelSelectionHandle& parcel) |
2362 | : LLPanel("land_media_panel") | 2347 | : LLPanel("land_media_panel"), mParcel(parcel) |
2363 | { | 2348 | { |
2364 | } | 2349 | } |
2365 | 2350 | ||
@@ -2401,7 +2386,7 @@ LLPanelLandMedia::~LLPanelLandMedia() | |||
2401 | // public | 2386 | // public |
2402 | void LLPanelLandMedia::refresh() | 2387 | void LLPanelLandMedia::refresh() |
2403 | { | 2388 | { |
2404 | LLParcel *parcel = gParcelMgr->getSelectedParcel(); | 2389 | LLParcel *parcel = mParcel->getParcel(); |
2405 | 2390 | ||
2406 | if (!parcel) | 2391 | if (!parcel) |
2407 | { | 2392 | { |
@@ -2486,7 +2471,7 @@ void LLPanelLandMedia::onCommitAny(LLUICtrl *ctrl, void *userdata) | |||
2486 | { | 2471 | { |
2487 | LLPanelLandMedia *self = (LLPanelLandMedia *)userdata; | 2472 | LLPanelLandMedia *self = (LLPanelLandMedia *)userdata; |
2488 | 2473 | ||
2489 | LLParcel* parcel = gParcelMgr->getSelectedParcel(); | 2474 | LLParcel* parcel = self->mParcel->getParcel(); |
2490 | if (!parcel) | 2475 | if (!parcel) |
2491 | { | 2476 | { |
2492 | return; | 2477 | return; |
@@ -2507,7 +2492,7 @@ void LLPanelLandMedia::onCommitAny(LLUICtrl *ctrl, void *userdata) | |||
2507 | parcel->setMediaAutoScale ( media_auto_scale ); | 2492 | parcel->setMediaAutoScale ( media_auto_scale ); |
2508 | 2493 | ||
2509 | // Send current parcel data upstream to server | 2494 | // Send current parcel data upstream to server |
2510 | gParcelMgr->sendParcelPropertiesUpdate( parcel, LLFloaterLand::sRequestReplyOnUpdate ); | 2495 | gParcelMgr->sendParcelPropertiesUpdate( parcel ); |
2511 | 2496 | ||
2512 | // Might have changed properties, so let's redraw! | 2497 | // Might have changed properties, so let's redraw! |
2513 | self->refresh(); | 2498 | self->refresh(); |
@@ -2531,8 +2516,8 @@ void LLPanelLandMedia::onClickStartMedia ( void* data ) | |||
2531 | // LLPanelLandAccess | 2516 | // LLPanelLandAccess |
2532 | //--------------------------------------------------------------------------- | 2517 | //--------------------------------------------------------------------------- |
2533 | 2518 | ||
2534 | LLPanelLandAccess::LLPanelLandAccess() | 2519 | LLPanelLandAccess::LLPanelLandAccess(LLParcelSelectionHandle& parcel) |
2535 | : LLPanel("land_access_panel") | 2520 | : LLPanel("land_access_panel"), mParcel(parcel) |
2536 | { | 2521 | { |
2537 | } | 2522 | } |
2538 | 2523 | ||
@@ -2574,32 +2559,33 @@ BOOL LLPanelLandAccess::postBuild() | |||
2574 | 2559 | ||
2575 | 2560 | ||
2576 | LLPanelLandAccess::~LLPanelLandAccess() | 2561 | LLPanelLandAccess::~LLPanelLandAccess() |
2577 | { } | 2562 | { |
2563 | } | ||
2578 | 2564 | ||
2579 | void LLPanelLandAccess::refresh() | 2565 | void LLPanelLandAccess::refresh() |
2580 | { | 2566 | { |
2581 | mListAccess->deleteAllItems(); | 2567 | mListAccess->deleteAllItems(); |
2582 | 2568 | ||
2583 | LLParcel *parcel = gParcelMgr->getSelectedParcel(); | 2569 | LLParcel *parcel = mParcel->getParcel(); |
2584 | 2570 | ||
2585 | if (parcel) | 2571 | if (parcel) |
2586 | { | 2572 | { |
2587 | char label[256]; | 2573 | char label[256]; /*Flawfinder: ignore*/ |
2588 | 2574 | ||
2589 | // Display options | 2575 | // Display options |
2590 | BOOL use_group = parcel->getParcelFlag(PF_USE_ACCESS_GROUP); | 2576 | BOOL use_group = parcel->getParcelFlag(PF_USE_ACCESS_GROUP); |
2591 | mCheckGroup->set( use_group ); | 2577 | mCheckGroup->set( use_group ); |
2592 | 2578 | ||
2593 | char group_name[MAX_STRING]; | 2579 | char group_name[MAX_STRING]; /*Flawfinder: ignore*/ |
2594 | gCacheName->getGroupName(parcel->getGroupID(), group_name); | 2580 | gCacheName->getGroupName(parcel->getGroupID(), group_name); |
2595 | sprintf(label, "Group: %s", group_name); | 2581 | snprintf(label, sizeof(label), "Group: %s", group_name); /*Flawfinder: ignore*/ |
2596 | mCheckGroup->setLabel( label ); | 2582 | mCheckGroup->setLabel( label ); |
2597 | 2583 | ||
2598 | S32 count = parcel->mAccessList.size(); | 2584 | S32 count = parcel->mAccessList.size(); |
2599 | 2585 | ||
2600 | BOOL use_list = parcel->getParcelFlag(PF_USE_ACCESS_LIST); | 2586 | BOOL use_list = parcel->getParcelFlag(PF_USE_ACCESS_LIST); |
2601 | mCheckAccess->set( use_list ); | 2587 | mCheckAccess->set( use_list ); |
2602 | sprintf(label, "Avatars: (%d listed, %d max)", | 2588 | snprintf(label, sizeof(label), "Avatars: (%d listed, %d max)", /*Flawfinder: ignore*/ |
2603 | count, PARCEL_MAX_ACCESS_LIST); | 2589 | count, PARCEL_MAX_ACCESS_LIST); |
2604 | mCheckAccess->setLabel( label ); | 2590 | mCheckAccess->setLabel( label ); |
2605 | 2591 | ||
@@ -2618,8 +2604,8 @@ void LLPanelLandAccess::refresh() | |||
2618 | suffix.assign(" ("); | 2604 | suffix.assign(" ("); |
2619 | if (seconds >= 120) | 2605 | if (seconds >= 120) |
2620 | { | 2606 | { |
2621 | char buf[30]; | 2607 | char buf[30]; /*Flawfinder: ignore*/ |
2622 | sprintf(buf, "%d minutes", (seconds/60)); | 2608 | snprintf(buf, sizeof(buf), "%d minutes", (seconds/60)); /*Flawfinder: ignore*/ |
2623 | suffix.append(buf); | 2609 | suffix.append(buf); |
2624 | } | 2610 | } |
2625 | else if (seconds >= 60) | 2611 | else if (seconds >= 60) |
@@ -2628,8 +2614,8 @@ void LLPanelLandAccess::refresh() | |||
2628 | } | 2614 | } |
2629 | else | 2615 | else |
2630 | { | 2616 | { |
2631 | char buf[30]; | 2617 | char buf[30]; /*Flawfinder: ignore*/ |
2632 | sprintf(buf, "%d seconds", seconds); | 2618 | snprintf(buf, sizeof(buf), "%d seconds", seconds); /*Flawfinder: ignore*/ |
2633 | suffix.append(buf); | 2619 | suffix.append(buf); |
2634 | } | 2620 | } |
2635 | suffix.append(" remaining)"); | 2621 | suffix.append(" remaining)"); |
@@ -2686,15 +2672,15 @@ void LLPanelLandAccess::refresh() | |||
2686 | // public | 2672 | // public |
2687 | void LLPanelLandAccess::refreshNames() | 2673 | void LLPanelLandAccess::refreshNames() |
2688 | { | 2674 | { |
2689 | LLParcel* parcel = gParcelMgr->getSelectedParcel(); | 2675 | LLParcel* parcel = mParcel->getParcel(); |
2690 | char group_name[DB_GROUP_NAME_BUF_SIZE]; | 2676 | char group_name[DB_GROUP_NAME_BUF_SIZE]; /*Flawfinder: ignore*/ |
2691 | group_name[0] = '\0'; | 2677 | group_name[0] = '\0'; |
2692 | if(parcel) | 2678 | if(parcel) |
2693 | { | 2679 | { |
2694 | gCacheName->getGroupName(parcel->getGroupID(), group_name); | 2680 | gCacheName->getGroupName(parcel->getGroupID(), group_name); |
2695 | } | 2681 | } |
2696 | char label[MAX_STRING]; | 2682 | char label[MAX_STRING]; /*Flawfinder: ignore*/ |
2697 | snprintf(label, MAX_STRING, "Group: %s", group_name); | 2683 | snprintf(label, sizeof(label), "Group: %s", group_name); /*Flawfinder: ignore*/ |
2698 | mCheckGroup->setLabel(label); | 2684 | mCheckGroup->setLabel(label); |
2699 | } | 2685 | } |
2700 | 2686 | ||
@@ -2717,7 +2703,7 @@ void LLPanelLandAccess::onCommitAny(LLUICtrl *ctrl, void *userdata) | |||
2717 | { | 2703 | { |
2718 | LLPanelLandAccess *self = (LLPanelLandAccess *)userdata; | 2704 | LLPanelLandAccess *self = (LLPanelLandAccess *)userdata; |
2719 | 2705 | ||
2720 | LLParcel* parcel = gParcelMgr->getSelectedParcel(); | 2706 | LLParcel* parcel = self->mParcel->getParcel(); |
2721 | if (!parcel) | 2707 | if (!parcel) |
2722 | { | 2708 | { |
2723 | return; | 2709 | return; |
@@ -2750,7 +2736,7 @@ void LLPanelLandAccess::onCommitAny(LLUICtrl *ctrl, void *userdata) | |||
2750 | parcel->setPassHours( pass_hours ); | 2736 | parcel->setPassHours( pass_hours ); |
2751 | 2737 | ||
2752 | // Send current parcel data upstream to server | 2738 | // Send current parcel data upstream to server |
2753 | gParcelMgr->sendParcelPropertiesUpdate( parcel, LLFloaterLand::sRequestReplyOnUpdate ); | 2739 | gParcelMgr->sendParcelPropertiesUpdate( parcel ); |
2754 | 2740 | ||
2755 | // Might have changed properties, so let's redraw! | 2741 | // Might have changed properties, so let's redraw! |
2756 | self->refresh(); | 2742 | self->refresh(); |
@@ -2774,7 +2760,7 @@ void LLPanelLandAccess::callbackAvatarID(const std::vector<std::string>& names, | |||
2774 | 2760 | ||
2775 | void LLPanelLandAccess::addAvatar(LLUUID id) | 2761 | void LLPanelLandAccess::addAvatar(LLUUID id) |
2776 | { | 2762 | { |
2777 | LLParcel* parcel = gParcelMgr->getSelectedParcel(); | 2763 | LLParcel* parcel = mParcel->getParcel(); |
2778 | if (!parcel) return; | 2764 | if (!parcel) return; |
2779 | 2765 | ||
2780 | parcel->addToAccessList(id, 0); | 2766 | parcel->addToAccessList(id, 0); |
@@ -2794,7 +2780,7 @@ void LLPanelLandAccess::onClickRemove(void* data) | |||
2794 | LLScrollListItem* item = self->mListAccess->getFirstSelected(); | 2780 | LLScrollListItem* item = self->mListAccess->getFirstSelected(); |
2795 | if (!item) return; | 2781 | if (!item) return; |
2796 | 2782 | ||
2797 | LLParcel* parcel = gParcelMgr->getSelectedParcel(); | 2783 | LLParcel* parcel = self->mParcel->getParcel(); |
2798 | if (!parcel) return; | 2784 | if (!parcel) return; |
2799 | 2785 | ||
2800 | const LLUUID& agent_id = item->getUUID(); | 2786 | const LLUUID& agent_id = item->getUUID(); |
@@ -2811,8 +2797,8 @@ void LLPanelLandAccess::onClickRemove(void* data) | |||
2811 | //--------------------------------------------------------------------------- | 2797 | //--------------------------------------------------------------------------- |
2812 | // LLPanelLandBan | 2798 | // LLPanelLandBan |
2813 | //--------------------------------------------------------------------------- | 2799 | //--------------------------------------------------------------------------- |
2814 | LLPanelLandBan::LLPanelLandBan() | 2800 | LLPanelLandBan::LLPanelLandBan(LLParcelSelectionHandle& parcel) |
2815 | : LLPanel("land_ban_panel") | 2801 | : LLPanel("land_ban_panel"), mParcel(parcel) |
2816 | { | 2802 | { |
2817 | 2803 | ||
2818 | } | 2804 | } |
@@ -2856,11 +2842,11 @@ void LLPanelLandBan::refresh() | |||
2856 | { | 2842 | { |
2857 | mList->deleteAllItems(); | 2843 | mList->deleteAllItems(); |
2858 | 2844 | ||
2859 | LLParcel *parcel = gParcelMgr->getSelectedParcel(); | 2845 | LLParcel *parcel = mParcel->getParcel(); |
2860 | 2846 | ||
2861 | if (parcel) | 2847 | if (parcel) |
2862 | { | 2848 | { |
2863 | char label[256]; | 2849 | char label[256]; /*Flawfinder: ignore*/ |
2864 | 2850 | ||
2865 | // Display options | 2851 | // Display options |
2866 | 2852 | ||
@@ -2869,7 +2855,7 @@ void LLPanelLandBan::refresh() | |||
2869 | BOOL use_ban = parcel->getParcelFlag(PF_USE_BAN_LIST); | 2855 | BOOL use_ban = parcel->getParcelFlag(PF_USE_BAN_LIST); |
2870 | mCheck->set( use_ban ); | 2856 | mCheck->set( use_ban ); |
2871 | 2857 | ||
2872 | sprintf(label, "Ban these avatars: (%d listed, %d max)", | 2858 | snprintf(label, sizeof(label), "Ban these avatars: (%d listed, %d max)", /*Flawfinder: ignore*/ |
2873 | count, PARCEL_MAX_ACCESS_LIST); | 2859 | count, PARCEL_MAX_ACCESS_LIST); |
2874 | mCheck->setLabel( label ); | 2860 | mCheck->setLabel( label ); |
2875 | 2861 | ||
@@ -2887,8 +2873,8 @@ void LLPanelLandBan::refresh() | |||
2887 | suffix.assign(" ("); | 2873 | suffix.assign(" ("); |
2888 | if (seconds >= 120) | 2874 | if (seconds >= 120) |
2889 | { | 2875 | { |
2890 | char buf[30]; | 2876 | char buf[30]; /*Flawfinder: ignore*/ |
2891 | sprintf(buf, "%d minutes", (seconds/60)); | 2877 | snprintf(buf, sizeof(buf), "%d minutes", (seconds/60)); /*Flawfinder: ignore*/ |
2892 | suffix.append(buf); | 2878 | suffix.append(buf); |
2893 | } | 2879 | } |
2894 | else if (seconds >= 60) | 2880 | else if (seconds >= 60) |
@@ -2897,8 +2883,8 @@ void LLPanelLandBan::refresh() | |||
2897 | } | 2883 | } |
2898 | else | 2884 | else |
2899 | { | 2885 | { |
2900 | char buf[30]; | 2886 | char buf[30]; /*Flawfinder: ignore*/ |
2901 | sprintf(buf, "%d seconds", seconds); | 2887 | snprintf(buf, sizeof(buf), "%d seconds", seconds); /*Flawfinder: ignore*/ |
2902 | suffix.append(buf); | 2888 | suffix.append(buf); |
2903 | } | 2889 | } |
2904 | suffix.append(" remaining)"); | 2890 | suffix.append(" remaining)"); |
@@ -2968,7 +2954,7 @@ void LLPanelLandBan::onCommitAny(LLUICtrl *ctrl, void *userdata) | |||
2968 | { | 2954 | { |
2969 | LLPanelLandBan *self = (LLPanelLandBan*)userdata; | 2955 | LLPanelLandBan *self = (LLPanelLandBan*)userdata; |
2970 | 2956 | ||
2971 | LLParcel* parcel = gParcelMgr->getSelectedParcel(); | 2957 | LLParcel* parcel = self->mParcel->getParcel(); |
2972 | if (!parcel) | 2958 | if (!parcel) |
2973 | { | 2959 | { |
2974 | return; | 2960 | return; |
@@ -2987,7 +2973,7 @@ void LLPanelLandBan::onCommitAny(LLUICtrl *ctrl, void *userdata) | |||
2987 | parcel->setParcelFlag(PF_DENY_TRANSACTED, deny_access_transacted); | 2973 | parcel->setParcelFlag(PF_DENY_TRANSACTED, deny_access_transacted); |
2988 | 2974 | ||
2989 | // Send current parcel data upstream to server | 2975 | // Send current parcel data upstream to server |
2990 | gParcelMgr->sendParcelPropertiesUpdate( parcel, LLFloaterLand::sRequestReplyOnUpdate ); | 2976 | gParcelMgr->sendParcelPropertiesUpdate( parcel ); |
2991 | 2977 | ||
2992 | // Might have changed properties, so let's redraw! | 2978 | // Might have changed properties, so let's redraw! |
2993 | self->refresh(); | 2979 | self->refresh(); |
@@ -3011,7 +2997,7 @@ void LLPanelLandBan::callbackAvatarID(const std::vector<std::string>& names, con | |||
3011 | 2997 | ||
3012 | void LLPanelLandBan::addAvatar(LLUUID id) | 2998 | void LLPanelLandBan::addAvatar(LLUUID id) |
3013 | { | 2999 | { |
3014 | LLParcel* parcel = gParcelMgr->getSelectedParcel(); | 3000 | LLParcel* parcel = mParcel->getParcel(); |
3015 | if (!parcel) return; | 3001 | if (!parcel) return; |
3016 | 3002 | ||
3017 | parcel->addToBanList(id, 0); | 3003 | parcel->addToBanList(id, 0); |
@@ -3031,7 +3017,7 @@ void LLPanelLandBan::onClickRemove(void* data) | |||
3031 | LLScrollListItem* item = self->mList->getFirstSelected(); | 3017 | LLScrollListItem* item = self->mList->getFirstSelected(); |
3032 | if (!item) return; | 3018 | if (!item) return; |
3033 | 3019 | ||
3034 | LLParcel* parcel = gParcelMgr->getSelectedParcel(); | 3020 | LLParcel* parcel = self->mParcel->getParcel(); |
3035 | if (!parcel) return; | 3021 | if (!parcel) return; |
3036 | 3022 | ||
3037 | const LLUUID& agent_id = item->getUUID(); | 3023 | const LLUUID& agent_id = item->getUUID(); |
@@ -3046,8 +3032,8 @@ void LLPanelLandBan::onClickRemove(void* data) | |||
3046 | //--------------------------------------------------------------------------- | 3032 | //--------------------------------------------------------------------------- |
3047 | // LLPanelLandRenters | 3033 | // LLPanelLandRenters |
3048 | //--------------------------------------------------------------------------- | 3034 | //--------------------------------------------------------------------------- |
3049 | LLPanelLandRenters::LLPanelLandRenters() | 3035 | LLPanelLandRenters::LLPanelLandRenters(LLParcelSelectionHandle& parcel) |
3050 | : LLPanel("landrenters", LLRect(0,500,500,0)) | 3036 | : LLPanel("landrenters", LLRect(0,500,500,0)), mParcel(parcel) |
3051 | { | 3037 | { |
3052 | const S32 BTN_WIDTH = 64; | 3038 | const S32 BTN_WIDTH = 64; |
3053 | 3039 | ||
@@ -3122,8 +3108,8 @@ void LLPanelLandRenters::onClickRemove(void*) | |||
3122 | //--------------------------------------------------------------------------- | 3108 | //--------------------------------------------------------------------------- |
3123 | // LLPanelLandCovenant | 3109 | // LLPanelLandCovenant |
3124 | //--------------------------------------------------------------------------- | 3110 | //--------------------------------------------------------------------------- |
3125 | LLPanelLandCovenant::LLPanelLandCovenant() | 3111 | LLPanelLandCovenant::LLPanelLandCovenant(LLParcelSelectionHandle& parcel) |
3126 | : LLPanel("land_covenant_panel") | 3112 | : LLPanel("land_covenant_panel"), mParcel(parcel) |
3127 | { | 3113 | { |
3128 | } | 3114 | } |
3129 | 3115 | ||