diff options
Diffstat (limited to 'linden/indra/newview/llfloaterland.cpp')
-rw-r--r-- | linden/indra/newview/llfloaterland.cpp | 169 |
1 files changed, 75 insertions, 94 deletions
diff --git a/linden/indra/newview/llfloaterland.cpp b/linden/indra/newview/llfloaterland.cpp index 0150f44..c5beb5c 100644 --- a/linden/indra/newview/llfloaterland.cpp +++ b/linden/indra/newview/llfloaterland.cpp | |||
@@ -31,6 +31,9 @@ | |||
31 | 31 | ||
32 | #include "llviewerprecompiledheaders.h" | 32 | #include "llviewerprecompiledheaders.h" |
33 | 33 | ||
34 | #include <sstream> | ||
35 | #include <time.h> | ||
36 | |||
34 | #include "llfloaterland.h" | 37 | #include "llfloaterland.h" |
35 | 38 | ||
36 | #include "llcachename.h" | 39 | #include "llcachename.h" |
@@ -70,39 +73,9 @@ | |||
70 | #include "llviewercontrol.h" | 73 | #include "llviewercontrol.h" |
71 | #include "roles_constants.h" | 74 | #include "roles_constants.h" |
72 | 75 | ||
73 | #include <sstream> | 76 | static std::string OWNER_ONLINE = "0"; |
74 | #include <time.h> | 77 | static std::string OWNER_OFFLINE = "1"; |
75 | 78 | static std::string OWNER_GROUP = "2"; | |
76 | static const S32 EDIT_HEIGHT = 16; | ||
77 | static const S32 LEFT = HPAD; | ||
78 | static const S32 BOTTOM = VPAD; | ||
79 | static const S32 RULER0 = LEFT; | ||
80 | static const S32 RULER05 = RULER0 + 24; | ||
81 | static const S32 RULER1 = RULER05 + 16; | ||
82 | static const S32 RULER15 = RULER1 + 20; | ||
83 | static const S32 RULER2 = RULER1 + 32; | ||
84 | static const S32 RULER205= RULER2 + 32; | ||
85 | static const S32 RULER20 = RULER2 + 64; | ||
86 | static const S32 RULER21 = RULER20 + 16; | ||
87 | static const S32 RULER22 = RULER21 + 32; | ||
88 | static const S32 RULER225 = RULER20 + 64; | ||
89 | static const S32 RULER23 = RULER22 + 64; | ||
90 | static const S32 RULER24 = RULER23 + 26; | ||
91 | static const S32 RULER3 = RULER2 + 102; | ||
92 | static const S32 RULER4 = RULER3 + 8; | ||
93 | static const S32 RULER5 = RULER4 + 50; | ||
94 | static const S32 RULER6 = RULER5 + 52; | ||
95 | static const S32 RULER7 = RULER6 + 24; | ||
96 | static const S32 RIGHT = LEFT + 278; | ||
97 | static const S32 FAR_RIGHT = LEFT + 324 + 40; | ||
98 | |||
99 | static const char PRICE[] = "Price:"; | ||
100 | static const char NO_PRICE[] = ""; | ||
101 | static const char AREA[] = "Area:"; | ||
102 | |||
103 | static const char OWNER_ONLINE[] = "0"; | ||
104 | static const char OWNER_OFFLINE[] = "1"; | ||
105 | static const char OWNER_GROUP[] = "2"; | ||
106 | 79 | ||
107 | // constants used in callbacks below - syntactic sugar. | 80 | // constants used in callbacks below - syntactic sugar. |
108 | static const BOOL BUY_GROUP_LAND = TRUE; | 81 | static const BOOL BUY_GROUP_LAND = TRUE; |
@@ -219,11 +192,11 @@ void LLFloaterLand::onClose(bool app_quitting) | |||
219 | 192 | ||
220 | 193 | ||
221 | LLFloaterLand::LLFloaterLand(const LLSD& seed) | 194 | LLFloaterLand::LLFloaterLand(const LLSD& seed) |
222 | : LLFloater("floaterland", "FloaterLandRect5", "About Land") | 195 | : LLFloater(std::string("floaterland"), std::string("FloaterLandRect5"), std::string("About Land")) |
223 | { | 196 | { |
224 | 197 | ||
225 | 198 | ||
226 | std::map<LLString, LLCallbackMap> factory_map; | 199 | LLCallbackMap::map_t factory_map; |
227 | factory_map["land_general_panel"] = LLCallbackMap(createPanelLandGeneral, this); | 200 | factory_map["land_general_panel"] = LLCallbackMap(createPanelLandGeneral, this); |
228 | 201 | ||
229 | 202 | ||
@@ -325,7 +298,7 @@ void* LLFloaterLand::createPanelLandAccess(void* data) | |||
325 | 298 | ||
326 | 299 | ||
327 | LLPanelLandGeneral::LLPanelLandGeneral(LLParcelSelectionHandle& parcel) | 300 | LLPanelLandGeneral::LLPanelLandGeneral(LLParcelSelectionHandle& parcel) |
328 | : LLPanel("land_general_panel"), | 301 | : LLPanel(std::string("land_general_panel")), |
329 | mUncheckedSell(FALSE), | 302 | mUncheckedSell(FALSE), |
330 | mParcel(parcel) | 303 | mParcel(parcel) |
331 | { | 304 | { |
@@ -458,12 +431,12 @@ void LLPanelLandGeneral::refresh() | |||
458 | { | 431 | { |
459 | // nothing selected, disable panel | 432 | // nothing selected, disable panel |
460 | mEditName->setEnabled(FALSE); | 433 | mEditName->setEnabled(FALSE); |
461 | mEditName->setText(LLString::null); | 434 | mEditName->setText(LLStringUtil::null); |
462 | 435 | ||
463 | mEditDesc->setEnabled(FALSE); | 436 | mEditDesc->setEnabled(FALSE); |
464 | mEditDesc->setText(LLString::null); | 437 | mEditDesc->setText(getString("no_selection_text")); |
465 | 438 | ||
466 | mTextSalePending->setText(LLString::null); | 439 | mTextSalePending->setText(LLStringUtil::null); |
467 | mTextSalePending->setEnabled(FALSE); | 440 | mTextSalePending->setEnabled(FALSE); |
468 | 441 | ||
469 | mBtnDeedToGroup->setEnabled(FALSE); | 442 | mBtnDeedToGroup->setEnabled(FALSE); |
@@ -475,13 +448,13 @@ void LLPanelLandGeneral::refresh() | |||
475 | mCheckContributeWithDeed->set(FALSE); | 448 | mCheckContributeWithDeed->set(FALSE); |
476 | mCheckContributeWithDeed->setEnabled(FALSE); | 449 | mCheckContributeWithDeed->setEnabled(FALSE); |
477 | 450 | ||
478 | mTextOwner->setText(LLString::null); | 451 | mTextOwner->setText(LLStringUtil::null); |
479 | mBtnProfile->setLabel(getString("profile_text")); | 452 | mBtnProfile->setLabel(getString("profile_text")); |
480 | mBtnProfile->setEnabled(FALSE); | 453 | mBtnProfile->setEnabled(FALSE); |
481 | 454 | ||
482 | mTextClaimDate->setText(LLString::null); | 455 | mTextClaimDate->setText(LLStringUtil::null); |
483 | mTextGroup->setText(LLString::null); | 456 | mTextGroup->setText(LLStringUtil::null); |
484 | mTextPrice->setText(LLString::null); | 457 | mTextPrice->setText(LLStringUtil::null); |
485 | 458 | ||
486 | mSaleInfoForSale1->setVisible(FALSE); | 459 | mSaleInfoForSale1->setVisible(FALSE); |
487 | mSaleInfoForSale2->setVisible(FALSE); | 460 | mSaleInfoForSale2->setVisible(FALSE); |
@@ -491,8 +464,8 @@ void LLPanelLandGeneral::refresh() | |||
491 | mBtnSellLand->setVisible(FALSE); | 464 | mBtnSellLand->setVisible(FALSE); |
492 | mBtnStopSellLand->setVisible(FALSE); | 465 | mBtnStopSellLand->setVisible(FALSE); |
493 | 466 | ||
494 | mTextPriceLabel->setText(LLString::null); | 467 | mTextPriceLabel->setText(LLStringUtil::null); |
495 | mTextDwell->setText(LLString::null); | 468 | mTextDwell->setText(LLStringUtil::null); |
496 | 469 | ||
497 | mBtnBuyLand->setEnabled(FALSE); | 470 | mBtnBuyLand->setEnabled(FALSE); |
498 | mBtnBuyGroupLand->setEnabled(FALSE); | 471 | mBtnBuyGroupLand->setEnabled(FALSE); |
@@ -528,12 +501,12 @@ void LLPanelLandGeneral::refresh() | |||
528 | // Is it owned? | 501 | // Is it owned? |
529 | if (is_public) | 502 | if (is_public) |
530 | { | 503 | { |
531 | mTextSalePending->setText(LLString::null); | 504 | mTextSalePending->setText(LLStringUtil::null); |
532 | mTextSalePending->setEnabled(FALSE); | 505 | mTextSalePending->setEnabled(FALSE); |
533 | mTextOwner->setText(getString("public_text")); | 506 | mTextOwner->setText(getString("public_text")); |
534 | mTextOwner->setEnabled(FALSE); | 507 | mTextOwner->setEnabled(FALSE); |
535 | mBtnProfile->setEnabled(FALSE); | 508 | mBtnProfile->setEnabled(FALSE); |
536 | mTextClaimDate->setText(LLString::null); | 509 | mTextClaimDate->setText(LLStringUtil::null); |
537 | mTextClaimDate->setEnabled(FALSE); | 510 | mTextClaimDate->setEnabled(FALSE); |
538 | mTextGroup->setText(getString("none_text")); | 511 | mTextGroup->setText(getString("none_text")); |
539 | mTextGroup->setEnabled(FALSE); | 512 | mTextGroup->setEnabled(FALSE); |
@@ -555,7 +528,7 @@ void LLPanelLandGeneral::refresh() | |||
555 | else | 528 | else |
556 | { | 529 | { |
557 | // not the owner, or it is leased | 530 | // not the owner, or it is leased |
558 | mTextSalePending->setText(LLString::null); | 531 | mTextSalePending->setText(LLStringUtil::null); |
559 | mTextSalePending->setEnabled(FALSE); | 532 | mTextSalePending->setEnabled(FALSE); |
560 | } | 533 | } |
561 | //refreshNames(); | 534 | //refreshNames(); |
@@ -584,8 +557,7 @@ void LLPanelLandGeneral::refresh() | |||
584 | // Display claim date | 557 | // Display claim date |
585 | // *TODO:Localize (Time format may need Translating) | 558 | // *TODO:Localize (Time format may need Translating) |
586 | time_t claim_date = parcel->getClaimDate(); | 559 | time_t claim_date = parcel->getClaimDate(); |
587 | char time_buf[TIME_STR_LENGTH]; /*Flawfinder: ignore*/ | 560 | mTextClaimDate->setText(formatted_time(claim_date)); |
588 | mTextClaimDate->setText(LLString(formatted_time(claim_date, time_buf))); | ||
589 | mTextClaimDate->setEnabled(is_leased); | 561 | mTextClaimDate->setEnabled(is_leased); |
590 | 562 | ||
591 | BOOL enable_auction = (gAgent.getGodLevel() >= GOD_LIAISON) | 563 | BOOL enable_auction = (gAgent.getGodLevel() >= GOD_LIAISON) |
@@ -718,11 +690,11 @@ void LLPanelLandGeneral::refreshNames() | |||
718 | LLParcel *parcel = mParcel->getParcel(); | 690 | LLParcel *parcel = mParcel->getParcel(); |
719 | if (!parcel) | 691 | if (!parcel) |
720 | { | 692 | { |
721 | mTextOwner->setText(LLString::null); | 693 | mTextOwner->setText(LLStringUtil::null); |
722 | return; | 694 | return; |
723 | } | 695 | } |
724 | 696 | ||
725 | LLString owner; | 697 | std::string owner; |
726 | if (parcel->getIsGroupOwned()) | 698 | if (parcel->getIsGroupOwned()) |
727 | { | 699 | { |
728 | owner = getString("group_owned_text"); | 700 | owner = getString("group_owned_text"); |
@@ -739,7 +711,7 @@ void LLPanelLandGeneral::refreshNames() | |||
739 | } | 711 | } |
740 | mTextOwner->setText(owner); | 712 | mTextOwner->setText(owner); |
741 | 713 | ||
742 | LLString group; | 714 | std::string group; |
743 | if(!parcel->getGroupID().isNull()) | 715 | if(!parcel->getGroupID().isNull()) |
744 | { | 716 | { |
745 | gCacheName->getGroupName(parcel->getGroupID(), group); | 717 | gCacheName->getGroupName(parcel->getGroupID(), group); |
@@ -749,7 +721,7 @@ void LLPanelLandGeneral::refreshNames() | |||
749 | const LLUUID& auth_buyer_id = parcel->getAuthorizedBuyerID(); | 721 | const LLUUID& auth_buyer_id = parcel->getAuthorizedBuyerID(); |
750 | if(auth_buyer_id.notNull()) | 722 | if(auth_buyer_id.notNull()) |
751 | { | 723 | { |
752 | LLString name; | 724 | std::string name; |
753 | gCacheName->getFullName(auth_buyer_id, name); | 725 | gCacheName->getFullName(auth_buyer_id, name); |
754 | mSaleInfoForSale2->setTextArg("[BUYER]", name); | 726 | mSaleInfoForSale2->setTextArg("[BUYER]", name); |
755 | } | 727 | } |
@@ -885,14 +857,14 @@ void LLPanelLandGeneral::onClickBuyPass(void* data) | |||
885 | if (!parcel) return; | 857 | if (!parcel) return; |
886 | 858 | ||
887 | S32 pass_price = parcel->getPassPrice(); | 859 | S32 pass_price = parcel->getPassPrice(); |
888 | LLString parcel_name = parcel->getName(); | 860 | std::string parcel_name = parcel->getName(); |
889 | F32 pass_hours = parcel->getPassHours(); | 861 | F32 pass_hours = parcel->getPassHours(); |
890 | 862 | ||
891 | char cost[256], time[256]; /*Flawfinder: ignore*/ | 863 | std::string cost, time; |
892 | snprintf(cost, sizeof(cost), "%d", pass_price); /* Flawfinder: ignore */ | 864 | cost = llformat("%d", pass_price); |
893 | snprintf(time, sizeof(time), "%.2f", pass_hours); /* Flawfinder: ignore */ | 865 | time = llformat("%.2f", pass_hours); |
894 | 866 | ||
895 | LLStringBase<char>::format_map_t args; | 867 | LLStringUtil::format_map_t args; |
896 | args["[COST]"] = cost; | 868 | args["[COST]"] = cost; |
897 | args["[PARCEL_NAME]"] = parcel_name; | 869 | args["[PARCEL_NAME]"] = parcel_name; |
898 | args["[TIME]"] = time; | 870 | args["[TIME]"] = time; |
@@ -952,8 +924,8 @@ void LLPanelLandGeneral::onCommitAny(LLUICtrl *ctrl, void *userdata) | |||
952 | // Valid data from UI | 924 | // Valid data from UI |
953 | 925 | ||
954 | // Stuff data into selected parcel | 926 | // Stuff data into selected parcel |
955 | parcel->setName(name.c_str()); | 927 | parcel->setName(name); |
956 | parcel->setDesc(desc.c_str()); | 928 | parcel->setDesc(desc); |
957 | 929 | ||
958 | BOOL allow_deed_to_group= panelp->mCheckDeedToGroup->get(); | 930 | BOOL allow_deed_to_group= panelp->mCheckDeedToGroup->get(); |
959 | BOOL contribute_with_deed = panelp->mCheckContributeWithDeed->get(); | 931 | BOOL contribute_with_deed = panelp->mCheckContributeWithDeed->get(); |
@@ -991,7 +963,7 @@ void LLPanelLandGeneral::onClickStopSellLand(void* data) | |||
991 | // LLPanelLandObjects | 963 | // LLPanelLandObjects |
992 | //--------------------------------------------------------------------------- | 964 | //--------------------------------------------------------------------------- |
993 | LLPanelLandObjects::LLPanelLandObjects(LLParcelSelectionHandle& parcel) | 965 | LLPanelLandObjects::LLPanelLandObjects(LLParcelSelectionHandle& parcel) |
994 | : LLPanel("land_objects_panel"), mParcel(parcel) | 966 | : LLPanel(std::string("land_objects_panel")), mParcel(parcel) |
995 | { | 967 | { |
996 | } | 968 | } |
997 | 969 | ||
@@ -1047,7 +1019,7 @@ BOOL LLPanelLandObjects::postBuild() | |||
1047 | mIconGroup = LLUIImageList::getInstance()->getUIImage("icon_group.tga"); | 1019 | mIconGroup = LLUIImageList::getInstance()->getUIImage("icon_group.tga"); |
1048 | 1020 | ||
1049 | mOwnerList = getChild<LLNameListCtrl>("owner list"); | 1021 | mOwnerList = getChild<LLNameListCtrl>("owner list"); |
1050 | mOwnerList->sortByColumn(3, FALSE); | 1022 | mOwnerList->sortByColumnIndex(3, FALSE); |
1051 | childSetCommitCallback("owner list", onCommitList, this); | 1023 | childSetCommitCallback("owner list", onCommitList, this); |
1052 | mOwnerList->setDoubleClickCallback(onDoubleClickOwner); | 1024 | mOwnerList->setDoubleClickCallback(onDoubleClickOwner); |
1053 | 1025 | ||
@@ -1279,7 +1251,7 @@ void LLPanelLandObjects::callbackReturnOwnerObjects(S32 option, void* userdata) | |||
1279 | if (parcel) | 1251 | if (parcel) |
1280 | { | 1252 | { |
1281 | LLUUID owner_id = parcel->getOwnerID(); | 1253 | LLUUID owner_id = parcel->getOwnerID(); |
1282 | LLString::format_map_t args; | 1254 | LLStringUtil::format_map_t args; |
1283 | if (owner_id == gAgentID) | 1255 | if (owner_id == gAgentID) |
1284 | { | 1256 | { |
1285 | LLNotifyBox::showXml("OwnedObjectsReturned"); | 1257 | LLNotifyBox::showXml("OwnedObjectsReturned"); |
@@ -1312,7 +1284,7 @@ void LLPanelLandObjects::callbackReturnGroupObjects(S32 option, void* userdata) | |||
1312 | { | 1284 | { |
1313 | std::string group_name; | 1285 | std::string group_name; |
1314 | gCacheName->getGroupName(parcel->getGroupID(), group_name); | 1286 | gCacheName->getGroupName(parcel->getGroupID(), group_name); |
1315 | LLString::format_map_t args; | 1287 | LLStringUtil::format_map_t args; |
1316 | args["[GROUPNAME]"] = group_name; | 1288 | args["[GROUPNAME]"] = group_name; |
1317 | LLNotifyBox::showXml("GroupObjectsReturned", args); | 1289 | LLNotifyBox::showXml("GroupObjectsReturned", args); |
1318 | send_return_objects_message(parcel->getLocalID(), RT_GROUP); | 1290 | send_return_objects_message(parcel->getLocalID(), RT_GROUP); |
@@ -1354,7 +1326,7 @@ void LLPanelLandObjects::callbackReturnOwnerList(S32 option, void* userdata) | |||
1354 | uuid_list_t::iterator selected = self->mSelectedOwners.begin(); | 1326 | uuid_list_t::iterator selected = self->mSelectedOwners.begin(); |
1355 | if (selected != self->mSelectedOwners.end()) | 1327 | if (selected != self->mSelectedOwners.end()) |
1356 | { | 1328 | { |
1357 | LLString::format_map_t args; | 1329 | LLStringUtil::format_map_t args; |
1358 | if (self->mSelectedIsGroup) | 1330 | if (self->mSelectedIsGroup) |
1359 | { | 1331 | { |
1360 | args["[GROUPNAME]"] = self->mSelectedName; | 1332 | args["[GROUPNAME]"] = self->mSelectedName; |
@@ -1394,7 +1366,7 @@ void LLPanelLandObjects::onClickReturnOwnerList(void* userdata) | |||
1394 | 1366 | ||
1395 | send_parcel_select_objects(parcelp->getLocalID(), RT_LIST, &(self->mSelectedOwners)); | 1367 | send_parcel_select_objects(parcelp->getLocalID(), RT_LIST, &(self->mSelectedOwners)); |
1396 | 1368 | ||
1397 | LLStringBase<char>::format_map_t args; | 1369 | LLStringUtil::format_map_t args; |
1398 | args["[NAME]"] = self->mSelectedName; | 1370 | args["[NAME]"] = self->mSelectedName; |
1399 | args["[N]"] = llformat("%d",self->mSelectedCount); | 1371 | args["[N]"] = llformat("%d",self->mSelectedCount); |
1400 | if (self->mSelectedIsGroup) | 1372 | if (self->mSelectedIsGroup) |
@@ -1423,7 +1395,7 @@ void LLPanelLandObjects::onClickRefresh(void* userdata) | |||
1423 | 1395 | ||
1424 | // ready the list for results | 1396 | // ready the list for results |
1425 | self->mOwnerList->deleteAllItems(); | 1397 | self->mOwnerList->deleteAllItems(); |
1426 | self->mOwnerList->addCommentText("Searching..."); | 1398 | self->mOwnerList->addCommentText(std::string("Searching...")); // *TODO: Translate |
1427 | self->mOwnerList->setEnabled(FALSE); | 1399 | self->mOwnerList->setEnabled(FALSE); |
1428 | self->mFirstReply = TRUE; | 1400 | self->mFirstReply = TRUE; |
1429 | 1401 | ||
@@ -1458,8 +1430,9 @@ void LLPanelLandObjects::processParcelObjectOwnersReply(LLMessageSystem *msg, vo | |||
1458 | LLUUID owner_id; | 1430 | LLUUID owner_id; |
1459 | BOOL is_group_owned; | 1431 | BOOL is_group_owned; |
1460 | S32 object_count; | 1432 | S32 object_count; |
1433 | U32 most_recent_time = 0; | ||
1461 | BOOL is_online; | 1434 | BOOL is_online; |
1462 | char object_count_str[MAX_STRING]; /*Flawfinder: ignore*/ | 1435 | std::string object_count_str; |
1463 | //BOOL b_need_refresh = FALSE; | 1436 | //BOOL b_need_refresh = FALSE; |
1464 | 1437 | ||
1465 | // If we were waiting for the first reply, clear the "Searching..." text. | 1438 | // If we were waiting for the first reply, clear the "Searching..." text. |
@@ -1475,7 +1448,10 @@ void LLPanelLandObjects::processParcelObjectOwnersReply(LLMessageSystem *msg, vo | |||
1475 | msg->getBOOLFast(_PREHASH_Data, _PREHASH_IsGroupOwned, is_group_owned, i); | 1448 | msg->getBOOLFast(_PREHASH_Data, _PREHASH_IsGroupOwned, is_group_owned, i); |
1476 | msg->getS32Fast (_PREHASH_Data, _PREHASH_Count, object_count, i); | 1449 | msg->getS32Fast (_PREHASH_Data, _PREHASH_Count, object_count, i); |
1477 | msg->getBOOLFast(_PREHASH_Data, _PREHASH_OnlineStatus, is_online, i); | 1450 | msg->getBOOLFast(_PREHASH_Data, _PREHASH_OnlineStatus, is_online, i); |
1478 | 1451 | if(msg->getNumberOfBlocks("DataExtended")) | |
1452 | { | ||
1453 | msg->getU32("DataExtended", "TimeStamp", most_recent_time, i); | ||
1454 | } | ||
1479 | if (owner_id.isNull()) | 1455 | if (owner_id.isNull()) |
1480 | { | 1456 | { |
1481 | continue; | 1457 | continue; |
@@ -1498,10 +1474,13 @@ void LLPanelLandObjects::processParcelObjectOwnersReply(LLMessageSystem *msg, vo | |||
1498 | row->addColumn(OWNER_OFFLINE, FONT); | 1474 | row->addColumn(OWNER_OFFLINE, FONT); |
1499 | } | 1475 | } |
1500 | // Placeholder for name. | 1476 | // Placeholder for name. |
1501 | row->addColumn(LLString::null, FONT); | 1477 | row->addColumn(LLStringUtil::null, FONT); |
1502 | 1478 | ||
1503 | snprintf(object_count_str, sizeof(object_count_str), "%d", object_count); /* Flawfinder: ignore */ | 1479 | object_count_str = llformat("%d", object_count); |
1504 | row->addColumn(object_count_str, FONT); | 1480 | row->addColumn(object_count_str, FONT); |
1481 | |||
1482 | row->addColumn(formatted_time((time_t)most_recent_time), FONT); | ||
1483 | |||
1505 | 1484 | ||
1506 | if (is_group_owned) | 1485 | if (is_group_owned) |
1507 | { | 1486 | { |
@@ -1518,7 +1497,7 @@ void LLPanelLandObjects::processParcelObjectOwnersReply(LLMessageSystem *msg, vo | |||
1518 | // check for no results | 1497 | // check for no results |
1519 | if (0 == self->mOwnerList->getItemCount()) | 1498 | if (0 == self->mOwnerList->getItemCount()) |
1520 | { | 1499 | { |
1521 | self->mOwnerList->addCommentText("None found."); | 1500 | self->mOwnerList->addCommentText(std::string("None found.")); // *TODO: Translate |
1522 | } | 1501 | } |
1523 | else | 1502 | else |
1524 | { | 1503 | { |
@@ -1604,7 +1583,7 @@ void LLPanelLandObjects::onClickReturnOwnerObjects(void* userdata) | |||
1604 | 1583 | ||
1605 | LLUUID owner_id = parcel->getOwnerID(); | 1584 | LLUUID owner_id = parcel->getOwnerID(); |
1606 | 1585 | ||
1607 | LLStringBase<char>::format_map_t args; | 1586 | LLStringUtil::format_map_t args; |
1608 | args["[N]"] = llformat("%d",owned); | 1587 | args["[N]"] = llformat("%d",owned); |
1609 | 1588 | ||
1610 | if (owner_id == gAgent.getID()) | 1589 | if (owner_id == gAgent.getID()) |
@@ -1632,7 +1611,7 @@ void LLPanelLandObjects::onClickReturnGroupObjects(void* userdata) | |||
1632 | std::string group_name; | 1611 | std::string group_name; |
1633 | gCacheName->getGroupName(parcel->getGroupID(), group_name); | 1612 | gCacheName->getGroupName(parcel->getGroupID(), group_name); |
1634 | 1613 | ||
1635 | LLStringBase<char>::format_map_t args; | 1614 | LLStringUtil::format_map_t args; |
1636 | args["[NAME]"] = group_name; | 1615 | args["[NAME]"] = group_name; |
1637 | args["[N]"] = llformat("%d", parcel->getGroupPrimCount()); | 1616 | args["[N]"] = llformat("%d", parcel->getGroupPrimCount()); |
1638 | 1617 | ||
@@ -1653,7 +1632,7 @@ void LLPanelLandObjects::onClickReturnOtherObjects(void* userdata) | |||
1653 | 1632 | ||
1654 | send_parcel_select_objects(parcel->getLocalID(), RT_OTHER); | 1633 | send_parcel_select_objects(parcel->getLocalID(), RT_OTHER); |
1655 | 1634 | ||
1656 | LLStringBase<char>::format_map_t args; | 1635 | LLStringUtil::format_map_t args; |
1657 | args["[N]"] = llformat("%d", other); | 1636 | args["[N]"] = llformat("%d", other); |
1658 | 1637 | ||
1659 | if (parcel->getIsGroupOwned()) | 1638 | if (parcel->getIsGroupOwned()) |
@@ -1709,7 +1688,7 @@ void LLPanelLandObjects::onCommitClean(LLUICtrl *caller, void* user_data) | |||
1709 | //--------------------------------------------------------------------------- | 1688 | //--------------------------------------------------------------------------- |
1710 | 1689 | ||
1711 | LLPanelLandOptions::LLPanelLandOptions(LLParcelSelectionHandle& parcel) | 1690 | LLPanelLandOptions::LLPanelLandOptions(LLParcelSelectionHandle& parcel) |
1712 | : LLPanel("land_options_panel"), | 1691 | : LLPanel(std::string("land_options_panel")), |
1713 | mCheckEditObjects(NULL), | 1692 | mCheckEditObjects(NULL), |
1714 | mCheckEditGroupObjects(NULL), | 1693 | mCheckEditGroupObjects(NULL), |
1715 | mCheckAllObjectEntry(NULL), | 1694 | mCheckAllObjectEntry(NULL), |
@@ -1903,8 +1882,8 @@ void LLPanelLandOptions::refresh() | |||
1903 | mPushRestrictionCtrl->setEnabled(FALSE); | 1882 | mPushRestrictionCtrl->setEnabled(FALSE); |
1904 | 1883 | ||
1905 | // *TODO:Translate | 1884 | // *TODO:Translate |
1906 | const char* none_string = LLParcel::getCategoryUIString(LLParcel::C_NONE); | 1885 | const std::string& none_string = LLParcel::getCategoryUIString(LLParcel::C_NONE); |
1907 | mCategoryCombo->setSimple(LLString(none_string)); | 1886 | mCategoryCombo->setSimple(none_string); |
1908 | mCategoryCombo->setEnabled(FALSE); | 1887 | mCategoryCombo->setEnabled(FALSE); |
1909 | 1888 | ||
1910 | mLandingTypeCombo->setCurrentByIndex(0); | 1889 | mLandingTypeCombo->setCurrentByIndex(0); |
@@ -1975,8 +1954,8 @@ void LLPanelLandOptions::refresh() | |||
1975 | // Set by string in case the order in UI doesn't match the order by index. | 1954 | // Set by string in case the order in UI doesn't match the order by index. |
1976 | // *TODO:Translate | 1955 | // *TODO:Translate |
1977 | LLParcel::ECategory cat = parcel->getCategory(); | 1956 | LLParcel::ECategory cat = parcel->getCategory(); |
1978 | const char* category_string = LLParcel::getCategoryUIString(cat); | 1957 | const std::string& category_string = LLParcel::getCategoryUIString(cat); |
1979 | mCategoryCombo->setSimple(LLString(category_string)); | 1958 | mCategoryCombo->setSimple(category_string); |
1980 | mCategoryCombo->setEnabled( can_change_identity ); | 1959 | mCategoryCombo->setEnabled( can_change_identity ); |
1981 | 1960 | ||
1982 | BOOL can_change_landing_point = LLViewerParcelMgr::isParcelModifiableByAgent(parcel, | 1961 | BOOL can_change_landing_point = LLViewerParcelMgr::isParcelModifiableByAgent(parcel, |
@@ -2188,12 +2167,11 @@ void LLPanelLandOptions::onClickPublishHelp(void*) | |||
2188 | //--------------------------------------------------------------------------- | 2167 | //--------------------------------------------------------------------------- |
2189 | 2168 | ||
2190 | LLPanelLandAccess::LLPanelLandAccess(LLParcelSelectionHandle& parcel) | 2169 | LLPanelLandAccess::LLPanelLandAccess(LLParcelSelectionHandle& parcel) |
2191 | : LLPanel("land_access_panel"), mParcel(parcel) | 2170 | : LLPanel(std::string("land_access_panel")), mParcel(parcel) |
2192 | { | 2171 | { |
2193 | } | 2172 | } |
2194 | 2173 | ||
2195 | 2174 | ||
2196 | |||
2197 | BOOL LLPanelLandAccess::postBuild() | 2175 | BOOL LLPanelLandAccess::postBuild() |
2198 | { | 2176 | { |
2199 | childSetCommitCallback("public_access", onCommitPublicAccess, this); | 2177 | childSetCommitCallback("public_access", onCommitPublicAccess, this); |
@@ -2212,11 +2190,11 @@ BOOL LLPanelLandAccess::postBuild() | |||
2212 | 2190 | ||
2213 | mListAccess = getChild<LLNameListCtrl>("AccessList"); | 2191 | mListAccess = getChild<LLNameListCtrl>("AccessList"); |
2214 | if (mListAccess) | 2192 | if (mListAccess) |
2215 | mListAccess->sortByColumn(0, TRUE); // ascending | 2193 | mListAccess->sortByColumnIndex(0, TRUE); // ascending |
2216 | 2194 | ||
2217 | mListBanned = getChild<LLNameListCtrl>("BannedList"); | 2195 | mListBanned = getChild<LLNameListCtrl>("BannedList"); |
2218 | if (mListBanned) | 2196 | if (mListBanned) |
2219 | mListBanned->sortByColumn(0, TRUE); // ascending | 2197 | mListBanned->sortByColumnIndex(0, TRUE); // ascending |
2220 | 2198 | ||
2221 | return TRUE; | 2199 | return TRUE; |
2222 | } | 2200 | } |
@@ -2260,7 +2238,7 @@ void LLPanelLandAccess::refresh() | |||
2260 | cit != parcel->mAccessList.end(); ++cit) | 2238 | cit != parcel->mAccessList.end(); ++cit) |
2261 | { | 2239 | { |
2262 | const LLAccessEntry& entry = (*cit).second; | 2240 | const LLAccessEntry& entry = (*cit).second; |
2263 | LLString suffix; | 2241 | std::string suffix; |
2264 | if (entry.mTime != 0) | 2242 | if (entry.mTime != 0) |
2265 | { | 2243 | { |
2266 | S32 now = time(NULL); | 2244 | S32 now = time(NULL); |
@@ -2299,7 +2277,7 @@ void LLPanelLandAccess::refresh() | |||
2299 | cit != parcel->mBanList.end(); ++cit) | 2277 | cit != parcel->mBanList.end(); ++cit) |
2300 | { | 2278 | { |
2301 | const LLAccessEntry& entry = (*cit).second; | 2279 | const LLAccessEntry& entry = (*cit).second; |
2302 | LLString suffix; | 2280 | std::string suffix; |
2303 | if (entry.mTime != 0) | 2281 | if (entry.mTime != 0) |
2304 | { | 2282 | { |
2305 | S32 now = time(NULL); | 2283 | S32 now = time(NULL); |
@@ -2366,7 +2344,7 @@ void LLPanelLandAccess::refresh() | |||
2366 | childSetValue("limit_payment", FALSE); | 2344 | childSetValue("limit_payment", FALSE); |
2367 | childSetValue("limit_age_verified", FALSE); | 2345 | childSetValue("limit_age_verified", FALSE); |
2368 | childSetValue("GroupCheck", FALSE); | 2346 | childSetValue("GroupCheck", FALSE); |
2369 | childSetLabelArg("GroupCheck", "[GROUP]", LLString::null ); | 2347 | childSetLabelArg("GroupCheck", "[GROUP]", LLStringUtil::null ); |
2370 | childSetValue("PassCheck", FALSE); | 2348 | childSetValue("PassCheck", FALSE); |
2371 | childSetValue("PriceSpin", (F32)PARCEL_PASS_PRICE_DEFAULT); | 2349 | childSetValue("PriceSpin", (F32)PARCEL_PASS_PRICE_DEFAULT); |
2372 | childSetValue( "HoursSpin", PARCEL_PASS_HOURS_DEFAULT ); | 2350 | childSetValue( "HoursSpin", PARCEL_PASS_HOURS_DEFAULT ); |
@@ -2425,7 +2403,7 @@ void LLPanelLandAccess::refresh_ui() | |||
2425 | } | 2403 | } |
2426 | else | 2404 | else |
2427 | { | 2405 | { |
2428 | childSetToolTip("Only Allow", LLString()); | 2406 | childSetToolTip("Only Allow", std::string()); |
2429 | } | 2407 | } |
2430 | childSetEnabled("GroupCheck", FALSE); | 2408 | childSetEnabled("GroupCheck", FALSE); |
2431 | childSetEnabled("PassCheck", FALSE); | 2409 | childSetEnabled("PassCheck", FALSE); |
@@ -2436,7 +2414,8 @@ void LLPanelLandAccess::refresh_ui() | |||
2436 | { | 2414 | { |
2437 | childSetEnabled("limit_payment", FALSE); | 2415 | childSetEnabled("limit_payment", FALSE); |
2438 | childSetEnabled("limit_age_verified", FALSE); | 2416 | childSetEnabled("limit_age_verified", FALSE); |
2439 | char group_name[MAX_STRING]; /*Flawfinder: ignore*/ | 2417 | |
2418 | std::string group_name; | ||
2440 | if (gCacheName->getGroupName(parcel->getGroupID(), group_name)) | 2419 | if (gCacheName->getGroupName(parcel->getGroupID(), group_name)) |
2441 | { | 2420 | { |
2442 | childSetEnabled("GroupCheck", can_manage_allowed); | 2421 | childSetEnabled("GroupCheck", can_manage_allowed); |
@@ -2454,12 +2433,14 @@ void LLPanelLandAccess::refresh_ui() | |||
2454 | childSetEnabled("AccessList", can_manage_allowed); | 2433 | childSetEnabled("AccessList", can_manage_allowed); |
2455 | S32 allowed_list_count = parcel->mAccessList.size(); | 2434 | S32 allowed_list_count = parcel->mAccessList.size(); |
2456 | childSetEnabled("add_allowed", can_manage_allowed && allowed_list_count < PARCEL_MAX_ACCESS_LIST); | 2435 | childSetEnabled("add_allowed", can_manage_allowed && allowed_list_count < PARCEL_MAX_ACCESS_LIST); |
2457 | childSetEnabled("remove_allowed", can_manage_allowed && allowed_list_count > 0); | 2436 | BOOL has_selected = mListAccess->getSelectionInterface()->getFirstSelectedIndex() >= 0; |
2437 | childSetEnabled("remove_allowed", can_manage_allowed && has_selected); | ||
2458 | 2438 | ||
2459 | childSetEnabled("BannedList", can_manage_banned); | 2439 | childSetEnabled("BannedList", can_manage_banned); |
2460 | S32 banned_list_count = parcel->mBanList.size(); | 2440 | S32 banned_list_count = parcel->mBanList.size(); |
2461 | childSetEnabled("add_banned", can_manage_banned && banned_list_count < PARCEL_MAX_ACCESS_LIST); | 2441 | childSetEnabled("add_banned", can_manage_banned && banned_list_count < PARCEL_MAX_ACCESS_LIST); |
2462 | childSetEnabled("remove_banned", can_manage_banned && banned_list_count > 0); | 2442 | has_selected = mListBanned->getSelectionInterface()->getFirstSelectedIndex() >= 0; |
2443 | childSetEnabled("remove_banned", can_manage_banned && has_selected); | ||
2463 | } | 2444 | } |
2464 | } | 2445 | } |
2465 | 2446 | ||
@@ -2499,7 +2480,7 @@ void LLPanelLandAccess::onCommitPublicAccess(LLUICtrl *ctrl, void *userdata) | |||
2499 | BOOL public_access = self->childGetValue("public_access").asBoolean(); | 2480 | BOOL public_access = self->childGetValue("public_access").asBoolean(); |
2500 | if (public_access == FALSE) | 2481 | if (public_access == FALSE) |
2501 | { | 2482 | { |
2502 | char group_name[MAX_STRING]; /*Flawfinder: ignore*/ | 2483 | std::string group_name; |
2503 | if (gCacheName->getGroupName(parcel->getGroupID(), group_name)) | 2484 | if (gCacheName->getGroupName(parcel->getGroupID(), group_name)) |
2504 | { | 2485 | { |
2505 | self->childSetValue("GroupCheck", public_access ? FALSE : TRUE); | 2486 | self->childSetValue("GroupCheck", public_access ? FALSE : TRUE); |
@@ -2682,7 +2663,7 @@ void LLPanelLandAccess::onClickRemoveBanned(void* data) | |||
2682 | // LLPanelLandCovenant | 2663 | // LLPanelLandCovenant |
2683 | //--------------------------------------------------------------------------- | 2664 | //--------------------------------------------------------------------------- |
2684 | LLPanelLandCovenant::LLPanelLandCovenant(LLParcelSelectionHandle& parcel) | 2665 | LLPanelLandCovenant::LLPanelLandCovenant(LLParcelSelectionHandle& parcel) |
2685 | : LLPanel("land_covenant_panel"), mParcel(parcel) | 2666 | : LLPanel(std::string("land_covenant_panel")), mParcel(parcel) |
2686 | { | 2667 | { |
2687 | } | 2668 | } |
2688 | 2669 | ||