aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/llpanelclassified.cpp
diff options
context:
space:
mode:
authorJacek Antonelli2008-08-15 23:45:34 -0500
committerJacek Antonelli2008-08-15 23:45:34 -0500
commitcd17687f01420952712a500107e0f93e7ab8d5f8 (patch)
treece48c2b706f2c1176290e39fb555fbdf6648ce01 /linden/indra/newview/llpanelclassified.cpp
parentSecond Life viewer sources 1.19.0.5 (diff)
downloadmeta-impy-cd17687f01420952712a500107e0f93e7ab8d5f8.zip
meta-impy-cd17687f01420952712a500107e0f93e7ab8d5f8.tar.gz
meta-impy-cd17687f01420952712a500107e0f93e7ab8d5f8.tar.bz2
meta-impy-cd17687f01420952712a500107e0f93e7ab8d5f8.tar.xz
Second Life viewer sources 1.19.1.0
Diffstat (limited to '')
-rw-r--r--linden/indra/newview/llpanelclassified.cpp75
1 files changed, 26 insertions, 49 deletions
diff --git a/linden/indra/newview/llpanelclassified.cpp b/linden/indra/newview/llpanelclassified.cpp
index e8d6b0d..7b9c3f8 100644
--- a/linden/indra/newview/llpanelclassified.cpp
+++ b/linden/indra/newview/llpanelclassified.cpp
@@ -104,6 +104,9 @@ public:
104static LLDispatchClassifiedClickThrough sClassifiedClickThrough; 104static LLDispatchClassifiedClickThrough sClassifiedClickThrough;
105 105
106 106
107/* Re-expose this if we need to have classified ad HTML detail
108 pages. JC
109
107// We need to count classified teleport clicks from the search HTML detail pages, 110// We need to count classified teleport clicks from the search HTML detail pages,
108// so we need have a teleport that also sends a click count message. 111// so we need have a teleport that also sends a click count message.
109class LLClassifiedTeleportHandler : public LLCommandHandler 112class LLClassifiedTeleportHandler : public LLCommandHandler
@@ -139,9 +142,9 @@ public:
139}; 142};
140// Creating the object registers with the dispatcher. 143// Creating the object registers with the dispatcher.
141LLClassifiedTeleportHandler gClassifiedTeleportHandler; 144LLClassifiedTeleportHandler gClassifiedTeleportHandler;
145*/
142 146
143 147LLPanelClassified::LLPanelClassified(bool in_finder, bool from_search)
144LLPanelClassified::LLPanelClassified(BOOL in_finder, bool from_search)
145: LLPanel("Classified Panel"), 148: LLPanel("Classified Panel"),
146 mInFinder(in_finder), 149 mInFinder(in_finder),
147 mFromSearch(from_search), 150 mFromSearch(from_search),
@@ -238,7 +241,7 @@ BOOL LLPanelClassified::postBuild()
238 mDescEditor->setFocusReceivedCallback(onFocusReceived, this); 241 mDescEditor->setFocusReceivedCallback(onFocusReceived, this);
239 mDescEditor->setCommitCallback(onCommitAny); 242 mDescEditor->setCommitCallback(onCommitAny);
240 mDescEditor->setCallbackUserData(this); 243 mDescEditor->setCallbackUserData(this);
241 mDescEditor->setTabToNextField(TRUE); 244 mDescEditor->setTabsToNextField(TRUE);
242 245
243 mLocationEditor = LLViewerUICtrlFactory::getLineEditorByName(this, "location_editor"); 246 mLocationEditor = LLViewerUICtrlFactory::getLineEditorByName(this, "location_editor");
244 247
@@ -400,13 +403,7 @@ void LLPanelClassified::initNewClassified()
400 mCategoryCombo->setCurrentByIndex(0); 403 mCategoryCombo->setCurrentByIndex(0);
401 } 404 }
402 405
403 // default new classifieds to publish 406 mUpdateBtn->setLabel(getString("publish_txt"));
404 //mEnabledCheck->set(TRUE);
405
406 // delay commit until user hits save
407 // sendClassifiedInfoUpdate();
408
409 mUpdateBtn->setLabel(childGetText("publish_txt"));
410} 407}
411 408
412 409
@@ -499,7 +496,7 @@ void LLPanelClassified::sendClassifiedInfoRequest()
499 if (!url.empty()) 496 if (!url.empty())
500 { 497 {
501 llinfos << "Classified stat request via capability" << llendl; 498 llinfos << "Classified stat request via capability" << llendl;
502 LLHTTPClient::post(url, body, new LLClassifiedStatsResponder(this->getHandle(), mClassifiedID)); 499 LLHTTPClient::post(url, body, new LLClassifiedStatsResponder(((LLView*)this)->getHandle(), mClassifiedID));
503 } 500 }
504 } 501 }
505} 502}
@@ -536,8 +533,6 @@ void LLPanelClassified::sendClassifiedInfoUpdate()
536 msg->addUUIDFast(_PREHASH_SnapshotID, mSnapshotCtrl->getImageAssetID()); 533 msg->addUUIDFast(_PREHASH_SnapshotID, mSnapshotCtrl->getImageAssetID());
537 msg->addVector3dFast(_PREHASH_PosGlobal, mPosGlobal); 534 msg->addVector3dFast(_PREHASH_PosGlobal, mPosGlobal);
538 BOOL mature = mMatureCheck->get(); 535 BOOL mature = mMatureCheck->get();
539 // Classifieds are always enabled/published 11/2005 JC
540 //BOOL enabled = mEnabledCheck->get();
541 BOOL auto_renew = FALSE; 536 BOOL auto_renew = FALSE;
542 if (mAutoRenewCheck) 537 if (mAutoRenewCheck)
543 { 538 {
@@ -668,14 +663,15 @@ void LLPanelClassified::processClassifiedInfoReply(LLMessageSystem *msg, void **
668 } 663 }
669 664
670 LLString datestr = llformat("%02d/%02d/%d", now->tm_mon+1, now->tm_mday, now->tm_year+1900); 665 LLString datestr = llformat("%02d/%02d/%d", now->tm_mon+1, now->tm_mday, now->tm_year+1900);
671 self->childSetTextArg("ad_placed_paid", "[DATE]", datestr); 666 LLString::format_map_t string_args;
672 self->childSetTextArg("ad_placed_paid", "[AMT]", llformat("%d", price_for_listing)); 667 string_args["[DATE]"] = datestr;
673 self->childSetText("classified_info_text", self->childGetValue("ad_placed_paid").asString()); 668 string_args["[AMT]"] = llformat("%d", price_for_listing);
669 self->childSetText("classified_info_text", self->getString("ad_placed_paid", string_args));
674 670
675 // If we got data from the database, we know the listing is paid for. 671 // If we got data from the database, we know the listing is paid for.
676 self->mPaidFor = TRUE; 672 self->mPaidFor = TRUE;
677 673
678 self->mUpdateBtn->setLabel(self->childGetText("update_txt")); 674 self->mUpdateBtn->setLabel(self->getString("update_txt"));
679 675
680 self->resetDirty(); 676 self->resetDirty();
681 } 677 }
@@ -726,9 +722,6 @@ void LLPanelClassified::refresh()
726 mCategoryCombo->setEnabled(godlike); 722 mCategoryCombo->setEnabled(godlike);
727 mCategoryCombo->setVisible(godlike); 723 mCategoryCombo->setVisible(godlike);
728 724
729 //mEnabledCheck->setVisible(godlike);
730 //mEnabledCheck->setEnabled(godlike);
731
732 mMatureCheck->setEnabled(godlike); 725 mMatureCheck->setEnabled(godlike);
733 mMatureCheck->setVisible(godlike); 726 mMatureCheck->setVisible(godlike);
734 727
@@ -749,8 +742,6 @@ void LLPanelClassified::refresh()
749 //mPriceEditor->setEnabled(is_self); 742 //mPriceEditor->setEnabled(is_self);
750 mCategoryCombo->setEnabled(is_self); 743 mCategoryCombo->setEnabled(is_self);
751 744
752 //mEnabledCheck->setVisible(FALSE);
753 //mEnabledCheck->setEnabled(is_self);
754 mMatureCheck->setEnabled(is_self); 745 mMatureCheck->setEnabled(is_self);
755 746
756 if (mAutoRenewCheck) 747 if (mAutoRenewCheck)
@@ -863,7 +854,7 @@ void LLPanelClassified::confirmPublish(S32 option)
863 } 854 }
864 else 855 else
865 { 856 {
866 LLTabContainerVertical* tab = (LLTabContainerVertical*)getParent(); 857 LLTabContainer* tab = (LLTabContainer*)getParent();
867 tab->setCurrentTabName(mNameEditor->getText()); 858 tab->setCurrentTabName(mNameEditor->getText());
868 } 859 }
869 860
@@ -887,7 +878,7 @@ void LLPanelClassified::onClickTeleport(void* data)
887 gAgent.teleportViaLocation(self->mPosGlobal); 878 gAgent.teleportViaLocation(self->mPosGlobal);
888 gFloaterWorldMap->trackLocation(self->mPosGlobal); 879 gFloaterWorldMap->trackLocation(self->mPosGlobal);
889 880
890 sendClassifiedClickMessage(self->mClassifiedID, "teleport", self->mFromSearch); 881 self->sendClassifiedClickMessage("teleport");
891 } 882 }
892} 883}
893 884
@@ -899,7 +890,7 @@ void LLPanelClassified::onClickMap(void* data)
899 gFloaterWorldMap->trackLocation(self->mPosGlobal); 890 gFloaterWorldMap->trackLocation(self->mPosGlobal);
900 LLFloaterWorldMap::show(NULL, TRUE); 891 LLFloaterWorldMap::show(NULL, TRUE);
901 892
902 sendClassifiedClickMessage(self->mClassifiedID, "map", self->mFromSearch); 893 self->sendClassifiedClickMessage("map");
903} 894}
904 895
905// static 896// static
@@ -907,7 +898,7 @@ void LLPanelClassified::onClickProfile(void* data)
907{ 898{
908 LLPanelClassified* self = (LLPanelClassified*)data; 899 LLPanelClassified* self = (LLPanelClassified*)data;
909 LLFloaterAvatarInfo::showFromDirectory(self->mCreatorID); 900 LLFloaterAvatarInfo::showFromDirectory(self->mCreatorID);
910 sendClassifiedClickMessage(self->mClassifiedID, "profile", self->mFromSearch); 901 self->sendClassifiedClickMessage("profile");
911} 902}
912 903
913// static 904// static
@@ -981,35 +972,21 @@ void LLPanelClassified::onFocusReceived(LLFocusableElement* ctrl, void* data)
981} 972}
982 973
983 974
984// static 975void LLPanelClassified::sendClassifiedClickMessage(const char* type)
985void LLPanelClassified::sendClassifiedClickMessage(const LLUUID& classified_id,
986 const char* type,
987 bool from_search)
988{ 976{
989 // You're allowed to click on your own ads to reassure yourself 977 // You're allowed to click on your own ads to reassure yourself
990 // that the system is working. 978 // that the system is working.
991 std::vector<std::string> strings;
992 strings.push_back(classified_id.asString());
993 strings.push_back(type);
994 LLUUID no_invoice;
995
996 // New classified click-through handling
997 LLSD body; 979 LLSD body;
998 body["type"] = type; 980 body["type"] = type;
999 body["from_search"] = from_search; 981 body["from_search"] = mFromSearch;
1000 body["classified_id"] = classified_id; 982 body["classified_id"] = mClassifiedID;
1001 std::string url = gAgent.getRegion()->getCapability("SearchStatTracking"); 983 body["parcel_id"] = mParcelID;
984 body["dest_pos_global"] = mPosGlobal.getValue();
985 body["region_name"] = mSimName;
1002 986
1003 // If the capability exists send to the new database, otherwise send to the old one. 987 std::string url = gAgent.getRegion()->getCapability("SearchStatTracking");
1004 if (!url.empty()) 988 llinfos << "LLPanelClassified::sendClassifiedClickMessage via capability" << llendl;
1005 { 989 LLHTTPClient::post(url, body, new LLHTTPClient::Responder());
1006 llinfos << "LLPanelClassified::sendClassifiedClickMessage via capability" << llendl;
1007 LLHTTPClient::post(url, body, new LLHTTPClient::Responder());
1008 }
1009 else
1010 {
1011 send_generic_message("classifiedclick", strings, no_invoice);
1012 }
1013} 990}
1014 991
1015//////////////////////////////////////////////////////////////////////////////////////////// 992////////////////////////////////////////////////////////////////////////////////////////////