diff options
author | Alexei Arabadji <aarabadji@productengine.com> | 2010-03-04 14:31:53 +0200 |
---|---|---|
committer | Alexei Arabadji <aarabadji@productengine.com> | 2010-03-04 14:31:53 +0200 |
commit | 4e08de74aeba2f5891d40cda0266927d0c9b59f0 (patch) | |
tree | d0aaf7482798340c2ab724a24d85c8f45b630fbc /indra/newview | |
parent | f54bf2a1eac3bc61222e5cceba77755bd340f996 (diff) | |
parent | c222c6c08a1b51bcc8072baf7d1b66f7ae9908a1 (diff) |
merged with viewer-2-0
Enter commit message. Lines beginning with 'HG:' are removed.
--HG--
branch : product-engine
Diffstat (limited to 'indra/newview')
-rw-r--r-- | indra/newview/llclassifiedstatsresponder.cpp | 24 | ||||
-rw-r--r-- | indra/newview/llclassifiedstatsresponder.h | 3 | ||||
-rw-r--r-- | indra/newview/llimview.cpp | 2 | ||||
-rw-r--r-- | indra/newview/llnotificationhandlerutil.cpp | 2 | ||||
-rw-r--r-- | indra/newview/llpanelclassified.cpp | 97 | ||||
-rw-r--r-- | indra/newview/llpanelclassified.h | 18 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/panel_classified_info.xml | 103 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/panel_group_info_sidetray.xml | 7 |
8 files changed, 216 insertions, 40 deletions
diff --git a/indra/newview/llclassifiedstatsresponder.cpp b/indra/newview/llclassifiedstatsresponder.cpp index ecd1879090..95f17aa7ba 100644 --- a/indra/newview/llclassifiedstatsresponder.cpp +++ b/indra/newview/llclassifiedstatsresponder.cpp @@ -43,11 +43,12 @@ #include "llview.h" #include "message.h" -LLClassifiedStatsResponder::LLClassifiedStatsResponder(LLHandle<LLView> classified_panel_handle, LLUUID classified_id) -: mClassifiedPanelHandle(classified_panel_handle), +LLClassifiedStatsResponder::LLClassifiedStatsResponder(LLUUID classified_id) +: mClassifiedID(classified_id) { } + /*virtual*/ void LLClassifiedStatsResponder::result(const LLSD& content) { @@ -58,17 +59,12 @@ void LLClassifiedStatsResponder::result(const LLSD& content) S32 search_map = content["search_map_clicks"].asInteger(); S32 search_profile = content["search_profile_clicks"].asInteger(); - LLPanelClassified* classified_panelp = (LLPanelClassified*)mClassifiedPanelHandle.get(); - - if(classified_panelp) - { - classified_panelp->setClickThrough(mClassifiedID, - teleport + search_teleport, - map + search_map, - profile + search_profile, - true); - } - + LLPanelClassifiedInfo::setClickThrough( + mClassifiedID, + teleport + search_teleport, + map + search_map, + profile + search_profile, + true); } /*virtual*/ @@ -77,5 +73,3 @@ void LLClassifiedStatsResponder::error(U32 status, const std::string& reason) llinfos << "LLClassifiedStatsResponder::error(" << status << ": " << reason << ")" << llendl; } - - diff --git a/indra/newview/llclassifiedstatsresponder.h b/indra/newview/llclassifiedstatsresponder.h index 9c52ed5ae1..4a74f7b129 100644 --- a/indra/newview/llclassifiedstatsresponder.h +++ b/indra/newview/llclassifiedstatsresponder.h @@ -40,7 +40,7 @@ class LLClassifiedStatsResponder : public LLHTTPClient::Responder { public: - LLClassifiedStatsResponder(LLHandle<LLView> classified_panel_handle, LLUUID classified_id); + LLClassifiedStatsResponder(LLUUID classified_id); //If we get back a normal response, handle it here virtual void result(const LLSD& content); //If we get back an error (not found, etc...), handle it here @@ -48,7 +48,6 @@ public: virtual void error(U32 status, const std::string& reason); protected: - LLHandle<LLView> mClassifiedPanelHandle; LLUUID mClassifiedID; }; diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp index 1dc601e260..b3f085ef6d 100644 --- a/indra/newview/llimview.cpp +++ b/indra/newview/llimview.cpp @@ -1565,7 +1565,7 @@ void LLCallDialog::onOpen(const LLSD& key) LLDockableFloater::onOpen(key); // it should be over the all floaters. EXT-5116 - gFloaterView->bringToFront(this); + gFloaterView->bringToFront(this, FALSE); } void LLCallDialog::setIcon(const LLSD& session_id, const LLSD& participant_id) diff --git a/indra/newview/llnotificationhandlerutil.cpp b/indra/newview/llnotificationhandlerutil.cpp index 1a30eecf01..565016e63c 100644 --- a/indra/newview/llnotificationhandlerutil.cpp +++ b/indra/newview/llnotificationhandlerutil.cpp @@ -82,7 +82,7 @@ void LLSysHandler::removeExclusiveNotifications(const LLNotificationPtr& notif) } bool matches(const LLNotificationPtr notification) const { - for (std::set<std::string>::iterator it = mExclGroup.begin(); it + for (std::set<std::string>::const_iterator it = mExclGroup.begin(); it != mExclGroup.end(); it++) { std::string from_name = LLHandlerUtil::getSubstitutionName(notification); diff --git a/indra/newview/llpanelclassified.cpp b/indra/newview/llpanelclassified.cpp index afdc27e74e..6f0b7df935 100644 --- a/indra/newview/llpanelclassified.cpp +++ b/indra/newview/llpanelclassified.cpp @@ -41,6 +41,7 @@ #include "lldir.h" #include "lldispatcher.h" #include "llfloaterreg.h" +#include "llhttpclient.h" #include "llnotifications.h" #include "llnotificationsutil.h" #include "llparcel.h" @@ -83,6 +84,7 @@ const S32 DECLINE_TO_STATE = 0; //static std::list<LLPanelClassified*> LLPanelClassified::sAllPanels; +std::list<LLPanelClassifiedInfo*> LLPanelClassifiedInfo::sAllPanels; // "classifiedclickthrough" // strings[0] = classified_id @@ -103,10 +105,10 @@ public: S32 teleport_clicks = atoi(strings[1].c_str()); S32 map_clicks = atoi(strings[2].c_str()); S32 profile_clicks = atoi(strings[3].c_str()); - LLPanelClassified::setClickThrough(classified_id, teleport_clicks, - map_clicks, - profile_clicks, - false); + + LLPanelClassifiedInfo::setClickThrough( + classified_id, teleport_clicks, map_clicks, profile_clicks, false); + return true; } }; @@ -497,7 +499,7 @@ void LLPanelClassified::sendClassifiedInfoRequest() if (!url.empty()) { llinfos << "Classified stat request via capability" << llendl; - LLHTTPClient::post(url, body, new LLClassifiedStatsResponder(((LLView*)this)->getHandle(), mClassifiedID)); + LLHTTPClient::post(url, body, new LLClassifiedStatsResponder(mClassifiedID)); } } } @@ -1158,11 +1160,19 @@ LLPanelClassifiedInfo::LLPanelClassifiedInfo() , mScrollingPanelMinHeight(0) , mScrollingPanelWidth(0) , mSnapshotStreched(false) + , mTeleportClicksOld(0) + , mMapClicksOld(0) + , mProfileClicksOld(0) + , mTeleportClicksNew(0) + , mMapClicksNew(0) + , mProfileClicksNew(0) { + sAllPanels.push_back(this); } LLPanelClassifiedInfo::~LLPanelClassifiedInfo() { + sAllPanels.remove(this); } // static @@ -1247,6 +1257,19 @@ void LLPanelClassifiedInfo::onOpen(const LLSD& key) LLAvatarPropertiesProcessor::getInstance()->addObserver(getAvatarId(), this); LLAvatarPropertiesProcessor::getInstance()->sendClassifiedInfoRequest(getClassifiedId()); + gGenericDispatcher.addHandler("classifiedclickthrough", &sClassifiedClickThrough); + + // While we're at it let's get the stats from the new table if that + // capability exists. + std::string url = gAgent.getRegion()->getCapability("SearchStatRequest"); + if (!url.empty()) + { + llinfos << "Classified stat request via capability" << llendl; + LLSD body; + body["classified_id"] = getClassifiedId(); + LLHTTPClient::post(url, body, new LLClassifiedStatsResponder(getClassifiedId())); + } + setInfoLoaded(false); } @@ -1268,6 +1291,7 @@ void LLPanelClassifiedInfo::processProperties(void* data, EAvatarProcessorType t static std::string mature_str = getString("type_mature"); static std::string pg_str = getString("type_pg"); static LLUIString price_str = getString("l$_price"); + static std::string date_fmt = getString("date_fmt"); bool mature = is_cf_mature(c_info->flags); childSetValue("content_type", mature ? mature_str : pg_str); @@ -1276,6 +1300,10 @@ void LLPanelClassifiedInfo::processProperties(void* data, EAvatarProcessorType t price_str.setArg("[PRICE]", llformat("%d", c_info->price_for_listing)); childSetValue("price_for_listing", LLSD(price_str)); + std::string date_str = date_fmt; + LLStringUtil::format(date_str, LLSD().with("datetime", (S32) c_info->creation_date)); + childSetText("creation_date", date_str); + setInfoLoaded(true); } } @@ -1291,6 +1319,7 @@ void LLPanelClassifiedInfo::resetData() mPosGlobal.clearVec(); childSetValue("category", LLStringUtil::null); childSetValue("content_type", LLStringUtil::null); + childSetText("click_through_text", LLStringUtil::null); } void LLPanelClassifiedInfo::resetControls() @@ -1300,6 +1329,7 @@ void LLPanelClassifiedInfo::resetControls() childSetEnabled("edit_btn", is_self); childSetVisible("edit_btn", is_self); childSetVisible("price_layout_panel", is_self); + childSetVisible("clickthrough_layout_panel", is_self); } void LLPanelClassifiedInfo::setClassifiedName(const std::string& name) @@ -1353,6 +1383,62 @@ LLUUID LLPanelClassifiedInfo::getSnapshotId() } // static +void LLPanelClassifiedInfo::setClickThrough( + const LLUUID& classified_id, + S32 teleport, + S32 map, + S32 profile, + bool from_new_table) +{ + llinfos << "Click-through data for classified " << classified_id << " arrived: [" + << teleport << ", " << map << ", " << profile << "] (" + << (from_new_table ? "new" : "old") << ")" << llendl; + + for (panel_list_t::iterator iter = sAllPanels.begin(); iter != sAllPanels.end(); ++iter) + { + LLPanelClassifiedInfo* self = *iter; + if (self->getClassifiedId() != classified_id) + { + continue; + } + + // *HACK: Skip LLPanelClassifiedEdit instances: they don't display clicks data. + // Those instances should not be in the list at all. + if (typeid(*self) != typeid(LLPanelClassifiedInfo)) + { + continue; + } + + llinfos << "Updating classified info panel" << llendl; + + // We need to check to see if the data came from the new stat_table + // or the old classified table. We also need to cache the data from + // the two separate sources so as to display the aggregate totals. + + if (from_new_table) + { + self->mTeleportClicksNew = teleport; + self->mMapClicksNew = map; + self->mProfileClicksNew = profile; + } + else + { + self->mTeleportClicksOld = teleport; + self->mMapClicksOld = map; + self->mProfileClicksOld = profile; + } + + static LLUIString ct_str = self->getString("click_through_text_fmt"); + + ct_str.setArg("[TELEPORT]", llformat("%d", self->mTeleportClicksNew + self->mTeleportClicksOld)); + ct_str.setArg("[MAP]", llformat("%d", self->mMapClicksNew + self->mMapClicksOld)); + ct_str.setArg("[PROFILE]", llformat("%d", self->mProfileClicksNew + self->mProfileClicksOld)); + + self->childSetText("click_through_text", ct_str.getString()); + } +} + +// static std::string LLPanelClassifiedInfo::createLocationText( const std::string& original_name, const std::string& sim_name, @@ -1436,6 +1522,7 @@ void LLPanelClassifiedInfo::onTeleportClick() void LLPanelClassifiedInfo::onExit() { LLAvatarPropertiesProcessor::getInstance()->removeObserver(getAvatarId(), this); + gGenericDispatcher.addHandler("classifiedclickthrough", NULL); // deregister our handler } ////////////////////////////////////////////////////////////////////////// diff --git a/indra/newview/llpanelclassified.h b/indra/newview/llpanelclassified.h index 1942eb5365..43b47d4e3e 100644 --- a/indra/newview/llpanelclassified.h +++ b/indra/newview/llpanelclassified.h @@ -250,6 +250,13 @@ public: void setInfoLoaded(bool loaded) { mInfoLoaded = loaded; } + static void setClickThrough( + const LLUUID& classified_id, + S32 teleport, + S32 map, + S32 profile, + bool from_new_table); + void setExitCallback(const commit_callback_t& cb); void setEditClassifiedCallback(const commit_callback_t& cb); @@ -293,6 +300,17 @@ private: S32 mScrollingPanelMinHeight; S32 mScrollingPanelWidth; + + // Needed for stat tracking + S32 mTeleportClicksOld; + S32 mMapClicksOld; + S32 mProfileClicksOld; + S32 mTeleportClicksNew; + S32 mMapClicksNew; + S32 mProfileClicksNew; + + typedef std::list<LLPanelClassifiedInfo*> panel_list_t; + static panel_list_t sAllPanels; }; class LLPanelClassifiedEdit : public LLPanelClassifiedInfo diff --git a/indra/newview/skins/default/xui/en/panel_classified_info.xml b/indra/newview/skins/default/xui/en/panel_classified_info.xml index 55929c6e27..869a05f27d 100644 --- a/indra/newview/skins/default/xui/en/panel_classified_info.xml +++ b/indra/newview/skins/default/xui/en/panel_classified_info.xml @@ -22,6 +22,14 @@ name="l$_price"> L$[PRICE] </panel.string> +<panel.string + name="click_through_text_fmt"> + [TELEPORT] teleport, [MAP] map, [MAP] profile + </panel.string> + <panel.string + name="date_fmt"> + [mthnum,datetime,slt]/[day,datetime,slt]/[year,datetime,slt] + </panel.string> <button follows="top|right" height="23" @@ -71,10 +79,10 @@ follows="left|top|right" height="197" layout="topleft" - left="11" + left="10" name="classified_snapshot" top="10" - width="286" /> + width="275" /> <text_editor allow_scroll="false" bg_visible="false" @@ -129,7 +137,7 @@ text_color="white" top_pad="0" value="Content Type:" - width="250" /> + width="140" /> <text_editor allow_scroll="false" bg_visible="false" @@ -137,11 +145,11 @@ h_pad="0" height="18" layout="topleft" - left="10" + left_pad="0" name="content_type" read_only="true" - width="290" - top_pad="5" + width="150" + top_pad="-10" v_pad="0" value="[content type]" /> <text @@ -154,7 +162,7 @@ text_color="white" top_pad="0" value="Category:" - width="250" /> + width="140" /> <text_editor allow_html="true" allow_scroll="false" @@ -163,11 +171,11 @@ h_pad="0" height="18" layout="topleft" - left="10" + left_pad="0" name="category" read_only="true" - width="290" - top_pad="5" + width="150" + top_pad="-10" v_pad="0" value="[category]" /> <text @@ -176,11 +184,38 @@ height="10" layout="topleft" left="10" + name="creation_date_label" + text_color="white" + top_pad="0" + value="Creation date:" + width="140" /> + <text_editor + allow_scroll="false" + bg_visible="false" + follows="left|top" + h_pad="0" + halign="left" + height="16" + layout="topleft" + left_pad="0" + name="creation_date" + read_only="true" + top_pad="-10" + tool_tip="Creation date" + v_pad="0" + value="[date]" + width="150" /> + <text + follows="left|top" + font.style="BOLD" + height="10" + layout="topleft" + left="10" name="price_for_listing_label" text_color="white" top_pad="0" value="Price for listing:" - width="250" /> + width="140" /> <text_editor allow_scroll="false" bg_visible="false" @@ -189,14 +224,14 @@ halign="left" height="16" layout="topleft" - left="10" + left_pad="0" name="price_for_listing" read_only="true" - top_pad="5" + top_pad="-10" tool_tip="Price for listing." v_pad="0" value="[price]" - width="105" /> + width="150" /> <layout_stack animate="false" name="descr_stack" @@ -209,6 +244,44 @@ height="250"> <layout_panel auto_resize="false" + name="clickthrough_layout_panel" + layout="topleft" + follows="top|left" + left="0" + top="0" + width="290" + height="26" + user_resize="false"> + <text + follows="left|top" + font.style="BOLD" + height="10" + layout="topleft" + left="0" + name="click_through_label" + text_color="white" + top_pad="0" + value="Clicks:" + width="140" /> + <text_editor + allow_scroll="false" + bg_visible="false" + follows="left|top" + h_pad="0" + halign="left" + height="16" + layout="topleft" + left_pad="0" + name="click_through_text" + read_only="true" + top_pad="-10" + tool_tip="Click through data" + v_pad="0" + value="[clicks]" + width="150" /> + </layout_panel> + <layout_panel + auto_resize="false" name="price_layout_panel" layout="topleft" follows="top|left" @@ -252,7 +325,7 @@ width="250" /> <text_editor allow_html="true" - allow_scroll="false" + allow_scroll="true" bg_visible="false" follows="left|top|right" h_pad="0" diff --git a/indra/newview/skins/default/xui/en/panel_group_info_sidetray.xml b/indra/newview/skins/default/xui/en/panel_group_info_sidetray.xml index 5147bb72d0..701a14e1c5 100644 --- a/indra/newview/skins/default/xui/en/panel_group_info_sidetray.xml +++ b/indra/newview/skins/default/xui/en/panel_group_info_sidetray.xml @@ -44,11 +44,16 @@ background_visible="true" tab_stop="false" top="2" width="23" /> - <text + <text_editor + allow_scroll="false" + bg_visible="false" + read_only = "true" layout="topleft" name="group_name" + v_pad="0" value="(Loading...)" font="SansSerifHugeBold" + h_pad="0" height="26" left_pad="10" text_color="LtGray" |