diff options
author | Jacek Antonelli | 2008-09-06 18:24:57 -0500 |
---|---|---|
committer | Jacek Antonelli | 2008-09-06 18:25:07 -0500 |
commit | 798d367d54a6c6379ad355bd8345fa40e31e7fe9 (patch) | |
tree | 1921f1708cd0240648c97bc02df2c2ab5f2fc41e /linden/indra/newview/llpanelclassified.cpp | |
parent | Second Life viewer sources 1.20.15 (diff) | |
download | meta-impy-798d367d54a6c6379ad355bd8345fa40e31e7fe9.zip meta-impy-798d367d54a6c6379ad355bd8345fa40e31e7fe9.tar.gz meta-impy-798d367d54a6c6379ad355bd8345fa40e31e7fe9.tar.bz2 meta-impy-798d367d54a6c6379ad355bd8345fa40e31e7fe9.tar.xz |
Second Life viewer sources 1.21.0-RC
Diffstat (limited to '')
-rw-r--r-- | linden/indra/newview/llpanelclassified.cpp | 68 |
1 files changed, 31 insertions, 37 deletions
diff --git a/linden/indra/newview/llpanelclassified.cpp b/linden/indra/newview/llpanelclassified.cpp index 45ceeba..8228a97 100644 --- a/linden/indra/newview/llpanelclassified.cpp +++ b/linden/indra/newview/llpanelclassified.cpp | |||
@@ -148,7 +148,7 @@ LLClassifiedTeleportHandler gClassifiedTeleportHandler; | |||
148 | */ | 148 | */ |
149 | 149 | ||
150 | LLPanelClassified::LLPanelClassified(bool in_finder, bool from_search) | 150 | LLPanelClassified::LLPanelClassified(bool in_finder, bool from_search) |
151 | : LLPanel("Classified Panel"), | 151 | : LLPanel(std::string("Classified Panel")), |
152 | mInFinder(in_finder), | 152 | mInFinder(in_finder), |
153 | mFromSearch(from_search), | 153 | mFromSearch(from_search), |
154 | mDirty(false), | 154 | mDirty(false), |
@@ -313,7 +313,7 @@ BOOL LLPanelClassified::titleIsValid() | |||
313 | { | 313 | { |
314 | // Disallow leading spaces, punctuation, etc. that screw up | 314 | // Disallow leading spaces, punctuation, etc. that screw up |
315 | // sort order. | 315 | // sort order. |
316 | const LLString& name = mNameEditor->getText(); | 316 | const std::string& name = mNameEditor->getText(); |
317 | if (name.empty()) | 317 | if (name.empty()) |
318 | { | 318 | { |
319 | gViewerWindow->alertXml("BlankClassifiedName"); | 319 | gViewerWindow->alertXml("BlankClassifiedName"); |
@@ -379,7 +379,7 @@ BOOL LLPanelClassified::canClose() | |||
379 | if (mForceClose || !checkDirty()) | 379 | if (mForceClose || !checkDirty()) |
380 | return TRUE; | 380 | return TRUE; |
381 | 381 | ||
382 | LLString::format_map_t args; | 382 | LLStringUtil::format_map_t args; |
383 | args["[NAME]"] = mNameEditor->getText(); | 383 | args["[NAME]"] = mNameEditor->getText(); |
384 | LLAlertDialog::showXml("ClassifiedSave", args, saveCallback, this); | 384 | LLAlertDialog::showXml("ClassifiedSave", args, saveCallback, this); |
385 | return FALSE; | 385 | return FALSE; |
@@ -576,33 +576,27 @@ void LLPanelClassified::processClassifiedInfoReply(LLMessageSystem *msg, void ** | |||
576 | LLUUID parcel_id; | 576 | LLUUID parcel_id; |
577 | msg->getUUIDFast(_PREHASH_Data, _PREHASH_ParcelID, parcel_id); | 577 | msg->getUUIDFast(_PREHASH_Data, _PREHASH_ParcelID, parcel_id); |
578 | 578 | ||
579 | char name[DB_PARCEL_NAME_SIZE]; /*Flawfinder: ignore*/ | 579 | std::string name; |
580 | msg->getStringFast(_PREHASH_Data, _PREHASH_Name, DB_PARCEL_NAME_SIZE, name); | 580 | msg->getStringFast(_PREHASH_Data, _PREHASH_Name, name); |
581 | 581 | ||
582 | char desc[DB_PICK_DESC_SIZE]; /*Flawfinder: ignore*/ | 582 | std::string desc; |
583 | msg->getStringFast(_PREHASH_Data, _PREHASH_Desc, DB_PICK_DESC_SIZE, desc); | 583 | msg->getStringFast(_PREHASH_Data, _PREHASH_Desc, desc); |
584 | 584 | ||
585 | LLUUID snapshot_id; | 585 | LLUUID snapshot_id; |
586 | msg->getUUIDFast(_PREHASH_Data, _PREHASH_SnapshotID, snapshot_id); | 586 | msg->getUUIDFast(_PREHASH_Data, _PREHASH_SnapshotID, snapshot_id); |
587 | 587 | ||
588 | // "Location text" is actually the original | 588 | // "Location text" is actually the original |
589 | // name that owner gave the parcel, and the location. | 589 | // name that owner gave the parcel, and the location. |
590 | char buffer[256]; /*Flawfinder: ignore*/ | 590 | std::string location_text; |
591 | LLString location_text; | ||
592 | 591 | ||
593 | msg->getStringFast(_PREHASH_Data, _PREHASH_ParcelName, 256, buffer); | 592 | msg->getStringFast(_PREHASH_Data, _PREHASH_ParcelName, location_text); |
594 | if (buffer[0] != '\0') | 593 | if (!location_text.empty()) |
595 | { | 594 | { |
596 | location_text.assign(buffer); | ||
597 | location_text.append(", "); | 595 | location_text.append(", "); |
598 | } | 596 | } |
599 | else | ||
600 | { | ||
601 | location_text.assign(""); | ||
602 | } | ||
603 | 597 | ||
604 | char sim_name[256]; /*Flawfinder: ignore*/ | 598 | std::string sim_name; |
605 | msg->getStringFast(_PREHASH_Data, _PREHASH_SimName, 256, sim_name); | 599 | msg->getStringFast(_PREHASH_Data, _PREHASH_SimName, sim_name); |
606 | 600 | ||
607 | LLVector3d pos_global; | 601 | LLVector3d pos_global; |
608 | msg->getVector3dFast(_PREHASH_Data, _PREHASH_PosGlobal, pos_global); | 602 | msg->getVector3dFast(_PREHASH_Data, _PREHASH_PosGlobal, pos_global); |
@@ -610,8 +604,8 @@ void LLPanelClassified::processClassifiedInfoReply(LLMessageSystem *msg, void ** | |||
610 | S32 region_x = llround((F32)pos_global.mdV[VX]) % REGION_WIDTH_UNITS; | 604 | S32 region_x = llround((F32)pos_global.mdV[VX]) % REGION_WIDTH_UNITS; |
611 | S32 region_y = llround((F32)pos_global.mdV[VY]) % REGION_WIDTH_UNITS; | 605 | S32 region_y = llround((F32)pos_global.mdV[VY]) % REGION_WIDTH_UNITS; |
612 | S32 region_z = llround((F32)pos_global.mdV[VZ]); | 606 | S32 region_z = llround((F32)pos_global.mdV[VZ]); |
613 | 607 | ||
614 | snprintf(buffer, sizeof(buffer), "%s (%d, %d, %d)", sim_name, region_x, region_y, region_z); /* Flawfinder: ignore */ | 608 | std::string buffer = llformat("%s (%d, %d, %d)", sim_name.c_str(), region_x, region_y, region_z); |
615 | location_text.append(buffer); | 609 | location_text.append(buffer); |
616 | 610 | ||
617 | U8 flags; | 611 | U8 flags; |
@@ -654,8 +648,8 @@ void LLPanelClassified::processClassifiedInfoReply(LLMessageSystem *msg, void ** | |||
654 | self->mPosGlobal = pos_global; | 648 | self->mPosGlobal = pos_global; |
655 | 649 | ||
656 | // Update UI controls | 650 | // Update UI controls |
657 | self->mNameEditor->setText(LLString(name)); | 651 | self->mNameEditor->setText(name); |
658 | self->mDescEditor->setText(LLString(desc)); | 652 | self->mDescEditor->setText(desc); |
659 | self->mSnapshotCtrl->setImageAssetID(snapshot_id); | 653 | self->mSnapshotCtrl->setImageAssetID(snapshot_id); |
660 | self->mLocationEditor->setText(location_text); | 654 | self->mLocationEditor->setText(location_text); |
661 | self->mLocationChanged = false; | 655 | self->mLocationChanged = false; |
@@ -674,8 +668,8 @@ void LLPanelClassified::processClassifiedInfoReply(LLMessageSystem *msg, void ** | |||
674 | self->mAutoRenewCheck->set(auto_renew); | 668 | self->mAutoRenewCheck->set(auto_renew); |
675 | } | 669 | } |
676 | 670 | ||
677 | LLString datestr = llformat("%02d/%02d/%d", now->tm_mon+1, now->tm_mday, now->tm_year+1900); | 671 | std::string datestr = llformat("%02d/%02d/%d", now->tm_mon+1, now->tm_mday, now->tm_year+1900); |
678 | LLString::format_map_t string_args; | 672 | LLStringUtil::format_map_t string_args; |
679 | string_args["[DATE]"] = datestr; | 673 | string_args["[DATE]"] = datestr; |
680 | string_args["[AMT]"] = llformat("%d", price_for_listing); | 674 | string_args["[AMT]"] = llformat("%d", price_for_listing); |
681 | self->childSetText("classified_info_text", self->getString("ad_placed_paid", string_args)); | 675 | self->childSetText("classified_info_text", self->getString("ad_placed_paid", string_args)); |
@@ -790,7 +784,7 @@ void LLPanelClassified::onClickUpdate(void* data) | |||
790 | // If user has not set mature, do not allow publish | 784 | // If user has not set mature, do not allow publish |
791 | if(self->mMatureCombo->getCurrentIndex() == DECLINE_TO_STATE) | 785 | if(self->mMatureCombo->getCurrentIndex() == DECLINE_TO_STATE) |
792 | { | 786 | { |
793 | LLString::format_map_t args; | 787 | LLStringUtil::format_map_t args; |
794 | gViewerWindow->alertXml("SetClassifiedMature", &callbackConfirmMature, self); | 788 | gViewerWindow->alertXml("SetClassifiedMature", &callbackConfirmMature, self); |
795 | return; | 789 | return; |
796 | } | 790 | } |
@@ -845,7 +839,7 @@ void LLPanelClassified::gotMature() | |||
845 | } | 839 | } |
846 | 840 | ||
847 | // static | 841 | // static |
848 | void LLPanelClassified::callbackGotPriceForListing(S32 option, LLString text, void* data) | 842 | void LLPanelClassified::callbackGotPriceForListing(S32 option, std::string text, void* data) |
849 | { | 843 | { |
850 | LLPanelClassified* self = (LLPanelClassified*)data; | 844 | LLPanelClassified* self = (LLPanelClassified*)data; |
851 | 845 | ||
@@ -855,8 +849,8 @@ void LLPanelClassified::callbackGotPriceForListing(S32 option, LLString text, vo | |||
855 | S32 price_for_listing = strtol(text.c_str(), NULL, 10); | 849 | S32 price_for_listing = strtol(text.c_str(), NULL, 10); |
856 | if (price_for_listing < MINIMUM_PRICE_FOR_LISTING) | 850 | if (price_for_listing < MINIMUM_PRICE_FOR_LISTING) |
857 | { | 851 | { |
858 | LLString::format_map_t args; | 852 | LLStringUtil::format_map_t args; |
859 | LLString price_text = llformat("%d", MINIMUM_PRICE_FOR_LISTING); | 853 | std::string price_text = llformat("%d", MINIMUM_PRICE_FOR_LISTING); |
860 | args["[MIN_PRICE]"] = price_text; | 854 | args["[MIN_PRICE]"] = price_text; |
861 | 855 | ||
862 | gViewerWindow->alertXml("MinClassifiedPrice", args); | 856 | gViewerWindow->alertXml("MinClassifiedPrice", args); |
@@ -867,7 +861,7 @@ void LLPanelClassified::callbackGotPriceForListing(S32 option, LLString text, vo | |||
867 | // update send | 861 | // update send |
868 | self->mPriceForListing = price_for_listing; | 862 | self->mPriceForListing = price_for_listing; |
869 | 863 | ||
870 | LLString::format_map_t args; | 864 | LLStringUtil::format_map_t args; |
871 | args["[AMOUNT]"] = llformat("%d", price_for_listing); | 865 | args["[AMOUNT]"] = llformat("%d", price_for_listing); |
872 | gViewerWindow->alertXml("PublishClassified", args, &callbackConfirmPublish, self); | 866 | gViewerWindow->alertXml("PublishClassified", args, &callbackConfirmPublish, self); |
873 | 867 | ||
@@ -907,7 +901,7 @@ void LLPanelClassified::confirmPublish(S32 option) | |||
907 | { | 901 | { |
908 | // TODO: enable this | 902 | // TODO: enable this |
909 | //LLPanelDirClassifieds* panel = (LLPanelDirClassifieds*)getParent(); | 903 | //LLPanelDirClassifieds* panel = (LLPanelDirClassifieds*)getParent(); |
910 | //panel->renameClassified(mClassifiedID, mNameEditor->getText().c_str()); | 904 | //panel->renameClassified(mClassifiedID, mNameEditor->getText()); |
911 | } | 905 | } |
912 | else | 906 | else |
913 | { | 907 | { |
@@ -963,7 +957,7 @@ void LLPanelClassified::onClickProfile(void* data) | |||
963 | void LLPanelClassified::onClickLandmark(void* data) | 957 | void LLPanelClassified::onClickLandmark(void* data) |
964 | { | 958 | { |
965 | LLPanelClassified* self = (LLPanelClassified*)data; | 959 | LLPanelClassified* self = (LLPanelClassified*)data; |
966 | create_landmark(self->mNameEditor->getText().c_str(), "", self->mPosGlobal); | 960 | create_landmark(self->mNameEditor->getText(), "", self->mPosGlobal); |
967 | } | 961 | } |
968 | */ | 962 | */ |
969 | 963 | ||
@@ -975,7 +969,7 @@ void LLPanelClassified::onClickSet(void* data) | |||
975 | // Save location for later. | 969 | // Save location for later. |
976 | self->mPosGlobal = gAgent.getPositionGlobal(); | 970 | self->mPosGlobal = gAgent.getPositionGlobal(); |
977 | 971 | ||
978 | LLString location_text; | 972 | std::string location_text; |
979 | location_text.assign("(will update after publish)"); | 973 | location_text.assign("(will update after publish)"); |
980 | location_text.append(", "); | 974 | location_text.append(", "); |
981 | 975 | ||
@@ -1029,7 +1023,7 @@ void LLPanelClassified::focusReceived(LLFocusableElement* ctrl, void* data) | |||
1029 | } | 1023 | } |
1030 | 1024 | ||
1031 | 1025 | ||
1032 | void LLPanelClassified::sendClassifiedClickMessage(const char* type) | 1026 | void LLPanelClassified::sendClassifiedClickMessage(const std::string& type) |
1033 | { | 1027 | { |
1034 | // You're allowed to click on your own ads to reassure yourself | 1028 | // You're allowed to click on your own ads to reassure yourself |
1035 | // that the system is working. | 1029 | // that the system is working. |
@@ -1049,7 +1043,7 @@ void LLPanelClassified::sendClassifiedClickMessage(const char* type) | |||
1049 | //////////////////////////////////////////////////////////////////////////////////////////// | 1043 | //////////////////////////////////////////////////////////////////////////////////////////// |
1050 | 1044 | ||
1051 | LLFloaterPriceForListing::LLFloaterPriceForListing() | 1045 | LLFloaterPriceForListing::LLFloaterPriceForListing() |
1052 | : LLFloater("PriceForListing"), | 1046 | : LLFloater(std::string("PriceForListing")), |
1053 | mCallback(NULL), | 1047 | mCallback(NULL), |
1054 | mUserData(NULL) | 1048 | mUserData(NULL) |
1055 | { } | 1049 | { } |
@@ -1065,7 +1059,7 @@ BOOL LLFloaterPriceForListing::postBuild() | |||
1065 | if (edit) | 1059 | if (edit) |
1066 | { | 1060 | { |
1067 | edit->setPrevalidate(LLLineEditor::prevalidateNonNegativeS32); | 1061 | edit->setPrevalidate(LLLineEditor::prevalidateNonNegativeS32); |
1068 | LLString min_price = llformat("%d", MINIMUM_PRICE_FOR_LISTING); | 1062 | std::string min_price = llformat("%d", MINIMUM_PRICE_FOR_LISTING); |
1069 | edit->setText(min_price); | 1063 | edit->setText(min_price); |
1070 | edit->selectAll(); | 1064 | edit->selectAll(); |
1071 | edit->setFocus(TRUE); | 1065 | edit->setFocus(TRUE); |
@@ -1080,7 +1074,7 @@ BOOL LLFloaterPriceForListing::postBuild() | |||
1080 | } | 1074 | } |
1081 | 1075 | ||
1082 | //static | 1076 | //static |
1083 | void LLFloaterPriceForListing::show( void (*callback)(S32, LLString, void*), void* userdata) | 1077 | void LLFloaterPriceForListing::show( void (*callback)(S32, std::string, void*), void* userdata) |
1084 | { | 1078 | { |
1085 | LLFloaterPriceForListing *self = new LLFloaterPriceForListing(); | 1079 | LLFloaterPriceForListing *self = new LLFloaterPriceForListing(); |
1086 | 1080 | ||
@@ -1111,7 +1105,7 @@ void LLFloaterPriceForListing::buttonCore(S32 button, void* data) | |||
1111 | 1105 | ||
1112 | if (self->mCallback) | 1106 | if (self->mCallback) |
1113 | { | 1107 | { |
1114 | LLString text = self->childGetText("price_edit"); | 1108 | std::string text = self->childGetText("price_edit"); |
1115 | self->mCallback(button, text, self->mUserData); | 1109 | self->mCallback(button, text, self->mUserData); |
1116 | self->close(); | 1110 | self->close(); |
1117 | } | 1111 | } |