diff options
Diffstat (limited to 'linden/indra/newview/llfloaterreporter.cpp')
-rw-r--r-- | linden/indra/newview/llfloaterreporter.cpp | 79 |
1 files changed, 47 insertions, 32 deletions
diff --git a/linden/indra/newview/llfloaterreporter.cpp b/linden/indra/newview/llfloaterreporter.cpp index 49c6e83..e8643c0 100644 --- a/linden/indra/newview/llfloaterreporter.cpp +++ b/linden/indra/newview/llfloaterreporter.cpp | |||
@@ -137,8 +137,8 @@ LLFloaterReporter::LLFloaterReporter( | |||
137 | if (pick_btn) | 137 | if (pick_btn) |
138 | { | 138 | { |
139 | // XUI: Why aren't these in viewerart.ini? | 139 | // XUI: Why aren't these in viewerart.ini? |
140 | pick_btn->setImages( "UIImgFaceUUID", | 140 | pick_btn->setImages( std::string("UIImgFaceUUID"), |
141 | "UIImgFaceSelectedUUID" ); | 141 | std::string("UIImgFaceSelectedUUID") ); |
142 | childSetAction("pick_btn", onClickObjPicker, this); | 142 | childSetAction("pick_btn", onClickObjPicker, this); |
143 | } | 143 | } |
144 | 144 | ||
@@ -173,8 +173,8 @@ LLFloaterReporter::LLFloaterReporter( | |||
173 | setVisible(TRUE); | 173 | setVisible(TRUE); |
174 | 174 | ||
175 | // Default text to be blank | 175 | // Default text to be blank |
176 | childSetText("object_name", LLString::null); | 176 | childSetText("object_name", LLStringUtil::null); |
177 | childSetText("owner_name", LLString::null); | 177 | childSetText("owner_name", LLStringUtil::null); |
178 | 178 | ||
179 | childSetFocus("summary_edit"); | 179 | childSetFocus("summary_edit"); |
180 | 180 | ||
@@ -308,7 +308,7 @@ void LLFloaterReporter::getObjectInfo(const LLUUID& object_id) | |||
308 | if (objectp->isAvatar()) | 308 | if (objectp->isAvatar()) |
309 | { | 309 | { |
310 | // we have the information we need | 310 | // we have the information we need |
311 | LLString object_owner; | 311 | std::string object_owner; |
312 | 312 | ||
313 | LLNameValue* firstname = objectp->getNVPair("FirstName"); | 313 | LLNameValue* firstname = objectp->getNVPair("FirstName"); |
314 | LLNameValue* lastname = objectp->getNVPair("LastName"); | 314 | LLNameValue* lastname = objectp->getNVPair("LastName"); |
@@ -389,21 +389,36 @@ void LLFloaterReporter::onClickSend(void *userdata) | |||
389 | // only show copyright alert for abuse reports | 389 | // only show copyright alert for abuse reports |
390 | if ( self->mReportType != BUG_REPORT ) | 390 | if ( self->mReportType != BUG_REPORT ) |
391 | { | 391 | { |
392 | const int IP_CONTENT_REMOVAL = 66; | ||
393 | const int IP_PERMISSONS_EXPLOIT = 37; | ||
394 | LLComboBox* combo = self->getChild<LLComboBox>( "category_combo"); | ||
395 | int category_value = combo->getSelectedValue().asInteger(); | ||
396 | |||
392 | if ( ! self->mCopyrightWarningSeen ) | 397 | if ( ! self->mCopyrightWarningSeen ) |
393 | { | 398 | { |
394 | LLString details_lc = self->childGetText("details_edit"); | 399 | |
395 | LLString::toLower( details_lc ); | 400 | std::string details_lc = self->childGetText("details_edit"); |
396 | LLString summary_lc = self->childGetText("summary_edit"); | 401 | LLStringUtil::toLower( details_lc ); |
397 | LLString::toLower( summary_lc ); | 402 | std::string summary_lc = self->childGetText("summary_edit"); |
403 | LLStringUtil::toLower( summary_lc ); | ||
398 | if ( details_lc.find( "copyright" ) != std::string::npos || | 404 | if ( details_lc.find( "copyright" ) != std::string::npos || |
399 | summary_lc.find( "copyright" ) != std::string::npos ) | 405 | summary_lc.find( "copyright" ) != std::string::npos || |
406 | category_value == IP_CONTENT_REMOVAL || | ||
407 | category_value == IP_PERMISSONS_EXPLOIT) | ||
400 | { | 408 | { |
401 | gViewerWindow->alertXml("HelpReportAbuseContainsCopyright"); | 409 | gViewerWindow->alertXml("HelpReportAbuseContainsCopyright"); |
402 | self->mCopyrightWarningSeen = TRUE; | 410 | self->mCopyrightWarningSeen = TRUE; |
403 | return; | 411 | return; |
404 | }; | 412 | } |
405 | }; | 413 | } |
406 | }; | 414 | else if (category_value == IP_CONTENT_REMOVAL) |
415 | { | ||
416 | // IP_CONTENT_REMOVAL *always* shows the dialog - | ||
417 | // ergo you can never send that abuse report type. | ||
418 | gViewerWindow->alertXml("HelpReportAbuseContainsCopyright"); | ||
419 | return; | ||
420 | } | ||
421 | } | ||
407 | 422 | ||
408 | LLUploadDialog::modalUploadDialog("Uploading...\n\nReport"); | 423 | LLUploadDialog::modalUploadDialog("Uploading...\n\nReport"); |
409 | // *TODO don't upload image if checkbox isn't checked | 424 | // *TODO don't upload image if checkbox isn't checked |
@@ -457,8 +472,8 @@ void LLFloaterReporter::onClickObjPicker(void *userdata) | |||
457 | LLToolObjPicker::getInstance()->setExitCallback(LLFloaterReporter::closePickTool, self); | 472 | LLToolObjPicker::getInstance()->setExitCallback(LLFloaterReporter::closePickTool, self); |
458 | LLToolMgr::getInstance()->setTransientTool(LLToolObjPicker::getInstance()); | 473 | LLToolMgr::getInstance()->setTransientTool(LLToolObjPicker::getInstance()); |
459 | self->mPicking = TRUE; | 474 | self->mPicking = TRUE; |
460 | self->childSetText("object_name", LLString::null); | 475 | self->childSetText("object_name", LLStringUtil::null); |
461 | self->childSetText("owner_name", LLString::null); | 476 | self->childSetText("owner_name", LLStringUtil::null); |
462 | LLButton* pick_btn = self->getChild<LLButton>("pick_btn"); | 477 | LLButton* pick_btn = self->getChild<LLButton>("pick_btn"); |
463 | if (pick_btn) pick_btn->setToggleState(TRUE); | 478 | if (pick_btn) pick_btn->setToggleState(TRUE); |
464 | } | 479 | } |
@@ -517,7 +532,7 @@ void LLFloaterReporter::showFromMenu(EReportType report_type) | |||
517 | } | 532 | } |
518 | 533 | ||
519 | // grab the user's name | 534 | // grab the user's name |
520 | LLString fullname; | 535 | std::string fullname; |
521 | gAgent.buildFullname(fullname); | 536 | gAgent.buildFullname(fullname); |
522 | f->childSetText("reporter_field", fullname); | 537 | f->childSetText("reporter_field", fullname); |
523 | } | 538 | } |
@@ -532,7 +547,7 @@ void LLFloaterReporter::showFromObject(const LLUUID& object_id) | |||
532 | f->setFocus(TRUE); | 547 | f->setFocus(TRUE); |
533 | 548 | ||
534 | // grab the user's name | 549 | // grab the user's name |
535 | LLString fullname; | 550 | std::string fullname; |
536 | gAgent.buildFullname(fullname); | 551 | gAgent.buildFullname(fullname); |
537 | f->childSetText("reporter_field", fullname); | 552 | f->childSetText("reporter_field", fullname); |
538 | 553 | ||
@@ -577,7 +592,7 @@ LLFloaterReporter* LLFloaterReporter::createNewBugReporter() | |||
577 | 592 | ||
578 | 593 | ||
579 | 594 | ||
580 | void LLFloaterReporter::setPickedObjectProperties(const LLString& object_name, const LLString& owner_name, const LLUUID owner_id) | 595 | void LLFloaterReporter::setPickedObjectProperties(const std::string& object_name, const std::string& owner_name, const LLUUID owner_id) |
581 | { | 596 | { |
582 | childSetText("object_name", object_name); | 597 | childSetText("object_name", object_name); |
583 | childSetText("owner_name", owner_name); | 598 | childSetText("owner_name", owner_name); |
@@ -661,7 +676,7 @@ LLSD LLFloaterReporter::gatherReport() | |||
661 | summary << "Preview "; | 676 | summary << "Preview "; |
662 | } | 677 | } |
663 | 678 | ||
664 | LLString category_name; | 679 | std::string category_name; |
665 | LLComboBox* combo = getChild<LLComboBox>( "category_combo"); | 680 | LLComboBox* combo = getChild<LLComboBox>( "category_combo"); |
666 | if (combo) | 681 | if (combo) |
667 | { | 682 | { |
@@ -711,8 +726,8 @@ LLSD LLFloaterReporter::gatherReport() | |||
711 | << LL_VERSION_PATCH << "." | 726 | << LL_VERSION_PATCH << "." |
712 | << LL_VIEWER_BUILD << std::endl << std::endl; | 727 | << LL_VIEWER_BUILD << std::endl << std::endl; |
713 | } | 728 | } |
714 | LLString object_name = childGetText("object_name"); | 729 | std::string object_name = childGetText("object_name"); |
715 | LLString owner_name = childGetText("owner_name"); | 730 | std::string owner_name = childGetText("owner_name"); |
716 | if (!object_name.empty() && !owner_name.empty()) | 731 | if (!object_name.empty() && !owner_name.empty()) |
717 | { | 732 | { |
718 | details << "Object: " << object_name << "\n"; | 733 | details << "Object: " << object_name << "\n"; |
@@ -727,9 +742,8 @@ LLSD LLFloaterReporter::gatherReport() | |||
727 | 742 | ||
728 | details << childGetValue("details_edit").asString(); | 743 | details << childGetValue("details_edit").asString(); |
729 | 744 | ||
730 | char version_string[MAX_STRING]; /* Flawfinder: ignore */ | 745 | std::string version_string; |
731 | snprintf(version_string, /* Flawfinder: ignore */ | 746 | version_string = llformat( |
732 | MAX_STRING, | ||
733 | "%d.%d.%d %s %s %s %s", | 747 | "%d.%d.%d %s %s %s %s", |
734 | LL_VERSION_MAJOR, | 748 | LL_VERSION_MAJOR, |
735 | LL_VERSION_MINOR, | 749 | LL_VERSION_MINOR, |
@@ -794,7 +808,7 @@ void LLFloaterReporter::sendReportViaLegacy(const LLSD & report) | |||
794 | msg->addString("AbuseRegionName", report["abuse-region-name"].asString()); | 808 | msg->addString("AbuseRegionName", report["abuse-region-name"].asString()); |
795 | msg->addUUID("AbuseRegionID", report["abuse-region-id"].asUUID()); | 809 | msg->addUUID("AbuseRegionID", report["abuse-region-id"].asUUID()); |
796 | 810 | ||
797 | msg->addStringFast(_PREHASH_Summary, report["summary"].asString().c_str()); | 811 | msg->addStringFast(_PREHASH_Summary, report["summary"].asString()); |
798 | msg->addString("VersionString", report["version-string"]); | 812 | msg->addString("VersionString", report["version-string"]); |
799 | msg->addStringFast(_PREHASH_Details, report["details"] ); | 813 | msg->addStringFast(_PREHASH_Details, report["details"] ); |
800 | 814 | ||
@@ -908,7 +922,7 @@ void LLFloaterReporter::takeScreenshot() | |||
908 | { | 922 | { |
909 | texture->setImageAssetID(mResourceDatap->mAssetInfo.mUuid); | 923 | texture->setImageAssetID(mResourceDatap->mAssetInfo.mUuid); |
910 | texture->setDefaultImageAssetID(mResourceDatap->mAssetInfo.mUuid); | 924 | texture->setDefaultImageAssetID(mResourceDatap->mAssetInfo.mUuid); |
911 | texture->setCaption("Screenshot"); | 925 | texture->setCaption(std::string("Screenshot")); |
912 | } | 926 | } |
913 | 927 | ||
914 | } | 928 | } |
@@ -937,12 +951,13 @@ void LLFloaterReporter::uploadDoneCallback(const LLUUID &uuid, void *user_data, | |||
937 | 951 | ||
938 | if(result < 0) | 952 | if(result < 0) |
939 | { | 953 | { |
940 | LLStringBase<char>::format_map_t args; | 954 | LLStringUtil::format_map_t args; |
941 | args["[REASON]"] = std::string(LLAssetStorage::getErrorString(result)); | 955 | std::string reason = std::string(LLAssetStorage::getErrorString(result)); |
956 | args["[REASON]"] = reason; | ||
942 | gViewerWindow->alertXml("ErrorUploadingReportScreenshot", args); | 957 | gViewerWindow->alertXml("ErrorUploadingReportScreenshot", args); |
943 | 958 | ||
944 | std::string err_msg("There was a problem uploading a report screenshot"); | 959 | std::string err_msg("There was a problem uploading a report screenshot"); |
945 | err_msg += " due to the following reason: " + args["[REASON]"]; | 960 | err_msg += " due to the following reason: " + reason; |
946 | llwarns << err_msg << llendl; | 961 | llwarns << err_msg << llendl; |
947 | return; | 962 | return; |
948 | } | 963 | } |
@@ -975,14 +990,14 @@ void LLFloaterReporter::uploadDoneCallback(const LLUUID &uuid, void *user_data, | |||
975 | void LLFloaterReporter::setPosBox(const LLVector3d &pos) | 990 | void LLFloaterReporter::setPosBox(const LLVector3d &pos) |
976 | { | 991 | { |
977 | mPosition.setVec(pos); | 992 | mPosition.setVec(pos); |
978 | LLString pos_string = llformat("{%.1f, %.1f, %.1f}", | 993 | std::string pos_string = llformat("{%.1f, %.1f, %.1f}", |
979 | mPosition.mV[VX], | 994 | mPosition.mV[VX], |
980 | mPosition.mV[VY], | 995 | mPosition.mV[VY], |
981 | mPosition.mV[VZ]); | 996 | mPosition.mV[VZ]); |
982 | childSetText("pos_field", pos_string); | 997 | childSetText("pos_field", pos_string); |
983 | } | 998 | } |
984 | 999 | ||
985 | void LLFloaterReporter::setDescription(const LLString& description, LLMeanCollisionData *mcd) | 1000 | void LLFloaterReporter::setDescription(const std::string& description, LLMeanCollisionData *mcd) |
986 | { | 1001 | { |
987 | LLFloaterReporter *self = gReporterInstances[COMPLAINT_REPORT]; | 1002 | LLFloaterReporter *self = gReporterInstances[COMPLAINT_REPORT]; |
988 | if (self) | 1003 | if (self) |
@@ -998,7 +1013,7 @@ void LLFloaterReporter::setDescription(const LLString& description, LLMeanCollis | |||
998 | } | 1013 | } |
999 | } | 1014 | } |
1000 | 1015 | ||
1001 | void LLFloaterReporter::addDescription(const LLString& description, LLMeanCollisionData *mcd) | 1016 | void LLFloaterReporter::addDescription(const std::string& description, LLMeanCollisionData *mcd) |
1002 | { | 1017 | { |
1003 | LLFloaterReporter *self = gReporterInstances[COMPLAINT_REPORT]; | 1018 | LLFloaterReporter *self = gReporterInstances[COMPLAINT_REPORT]; |
1004 | if (self) | 1019 | if (self) |