From 05807055de638259fc1da5b2e2cb694b80996f59 Mon Sep 17 00:00:00 2001 From: Vadim Savchuk Date: Fri, 5 Mar 2010 18:41:32 +0200 Subject: WIP on EXT-5687 (Classifieds are missing the clickthrough data). Fixed displaying profile clicks. --HG-- branch : product-engine --- indra/newview/skins/default/xui/en/panel_classified_info.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra') 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 869a05f27d..80cbad1a0e 100644 --- a/indra/newview/skins/default/xui/en/panel_classified_info.xml +++ b/indra/newview/skins/default/xui/en/panel_classified_info.xml @@ -24,7 +24,7 @@ - [TELEPORT] teleport, [MAP] map, [MAP] profile + [TELEPORT] teleport, [MAP] map, [PROFILE] profile -- cgit v1.2.3 From 739dee86c9bd1d6853d4042aa88e6ffaeaf81229 Mon Sep 17 00:00:00 2001 From: Vadim Savchuk Date: Fri, 5 Mar 2010 18:50:38 +0200 Subject: WIP on EXT-5687 (Classifieds are missing the clickthrough data). Removed a stub clickthrough info dispatcher. --HG-- branch : product-engine --- indra/newview/llpanelpicks.cpp | 30 ------------------------------ indra/newview/llpanelpicks.h | 3 --- 2 files changed, 33 deletions(-) (limited to 'indra') diff --git a/indra/newview/llpanelpicks.cpp b/indra/newview/llpanelpicks.cpp index 2ff2597f08..f6fcb5a304 100644 --- a/indra/newview/llpanelpicks.cpp +++ b/indra/newview/llpanelpicks.cpp @@ -174,31 +174,6 @@ LLClassifiedHandler gClassifiedHandler; ////////////////////////////////////////////////////////////////////////// -/** - * Copy&Pasted from old LLPanelClassified. This class does nothing at the moment. - * Subscribing to "classifiedclickthrough" removes a few warnings. - */ -class LLClassifiedClickThrough : public LLDispatchHandler -{ -public: - - // "classifiedclickthrough" - // strings[0] = classified_id - // strings[1] = teleport_clicks - // strings[2] = map_clicks - // strings[3] = profile_clicks - virtual bool operator()( - const LLDispatcher* dispatcher, - const std::string& key, - const LLUUID& invoice, - const sparam_t& strings) - { - if (strings.size() != 4) - return false; - - return true; - } -}; //----------------------------------------------------------------------------- // LLPanelPicks @@ -217,12 +192,9 @@ LLPanelPicks::LLPanelPicks() mClassifiedsAccTab(NULL), mPanelClassifiedInfo(NULL), mPanelClassifiedEdit(NULL), - mClickThroughDisp(NULL), mNoClassifieds(false), mNoPicks(false) { - mClickThroughDisp = new LLClassifiedClickThrough(); - gGenericDispatcher.addHandler("classifiedclickthrough", mClickThroughDisp); } LLPanelPicks::~LLPanelPicks() @@ -231,8 +203,6 @@ LLPanelPicks::~LLPanelPicks() { LLAvatarPropertiesProcessor::getInstance()->removeObserver(getAvatarId(),this); } - - delete mClickThroughDisp; } void* LLPanelPicks::create(void* data /* = NULL */) diff --git a/indra/newview/llpanelpicks.h b/indra/newview/llpanelpicks.h index 3f757e482e..b82f1f8d86 100644 --- a/indra/newview/llpanelpicks.h +++ b/indra/newview/llpanelpicks.h @@ -55,7 +55,6 @@ class LLPanelPickEdit; class LLToggleableMenu; class LLPanelClassifiedInfo; class LLPanelClassifiedEdit; -class LLClassifiedClickThrough; // *TODO // Panel Picks has been consolidated with Classifieds (EXT-2095), give LLPanelPicks @@ -159,8 +158,6 @@ private: LLAccordionCtrlTab* mPicksAccTab; LLAccordionCtrlTab* mClassifiedsAccTab; - LLClassifiedClickThrough* mClickThroughDisp; - //true if picks list is empty after processing picks bool mNoPicks; //true if classifieds list is empty after processing classifieds -- cgit v1.2.3 From eeb6e89e60df4c61c299c6ac344e32c7d3040d04 Mon Sep 17 00:00:00 2001 From: Vadim Savchuk Date: Fri, 5 Mar 2010 19:03:00 +0200 Subject: WIP on EXT-5687 (Classifieds are missing the clickthrough data). Updating click stats on: * opening classified info * clicking "Map" or "Teleport" buttons in classified info * clicking "Details" in the web-based search floater --HG-- branch : product-engine --- indra/newview/llpanelclassified.cpp | 76 ++++++++++++++++++++++++++++++++++--- indra/newview/llpanelclassified.h | 13 +++++++ indra/newview/llpanelpicks.cpp | 27 ++++++------- indra/newview/llpanelpicks.h | 4 +- indra/newview/llpanelprofile.cpp | 10 ++--- 5 files changed, 99 insertions(+), 31 deletions(-) (limited to 'indra') diff --git a/indra/newview/llpanelclassified.cpp b/indra/newview/llpanelclassified.cpp index 6f0b7df935..49614348d0 100644 --- a/indra/newview/llpanelclassified.cpp +++ b/indra/newview/llpanelclassified.cpp @@ -114,6 +114,23 @@ public: }; static LLDispatchClassifiedClickThrough sClassifiedClickThrough; +// Just to debug errors. Can be thrown away later. +class LLClassifiedClickMessageResponder : public LLHTTPClient::Responder +{ + LOG_CLASS(LLClassifiedClickMessageResponder); + +public: + // If we get back an error (not found, etc...), handle it here + virtual void errorWithContent( + U32 status, + const std::string& reason, + const LLSD& content) + { + llwarns << "Sending click message failed (" << status << "): [" << reason << "]" << llendl; + llwarns << "Content: [" << content << "]" << llendl; + } +}; + /* Re-expose this if we need to have classified ad HTML detail pages. JC @@ -1234,7 +1251,7 @@ void LLPanelClassifiedInfo::reshape(S32 width, S32 height, BOOL called_from_pare void LLPanelClassifiedInfo::onOpen(const LLSD& key) { - LLUUID avatar_id = key["avatar_id"]; + LLUUID avatar_id = key["classified_creator_id"]; if(avatar_id.isNull()) { return; @@ -1251,9 +1268,12 @@ void LLPanelClassifiedInfo::onOpen(const LLSD& key) resetControls(); setClassifiedId(key["classified_id"]); - setClassifiedName(key["name"]); - setDescription(key["desc"]); - setSnapshotId(key["snapshot_id"]); + setClassifiedName(key["classified_name"]); + setDescription(key["classified_desc"]); + setSnapshotId(key["classified_snapshot_id"]); + setFromSearch(key["from_search"]); + + llinfos << "Opening classified [" << getClassifiedName() << "] (" << getClassifiedId() << ")" << llendl; LLAvatarPropertiesProcessor::getInstance()->addObserver(getAvatarId(), this); LLAvatarPropertiesProcessor::getInstance()->sendClassifiedInfoRequest(getClassifiedId()); @@ -1270,6 +1290,10 @@ void LLPanelClassifiedInfo::onOpen(const LLSD& key) LLHTTPClient::post(url, body, new LLClassifiedStatsResponder(getClassifiedId())); } + // Update classified click stats. + // *TODO: Should we do this when opening not from search? + sendClickMessage("profile"); + setInfoLoaded(false); } @@ -1285,6 +1309,8 @@ void LLPanelClassifiedInfo::processProperties(void* data, EAvatarProcessorType t setSnapshotId(c_info->snapshot_id); setParcelId(c_info->parcel_id); setPosGlobal(c_info->pos_global); + setSimName(c_info->sim_name); + setClassifiedLocation(createLocationText(c_info->parcel_name, c_info->sim_name, c_info->pos_global)); childSetValue("category", LLClassifiedInfo::sCategories[c_info->category]); @@ -1316,7 +1342,19 @@ void LLPanelClassifiedInfo::resetData() setClassifiedLocation(LLStringUtil::null); setClassifiedId(LLUUID::null); setSnapshotId(LLUUID::null); - mPosGlobal.clearVec(); + setPosGlobal(LLVector3d::zero); + setParcelId(LLUUID::null); + setSimName(LLStringUtil::null); + setFromSearch(false); + + // reset click stats + mTeleportClicksOld = 0; + mMapClicksOld = 0; + mProfileClicksOld = 0; + mTeleportClicksNew = 0; + mMapClicksNew = 0; + mProfileClicksNew = 0; + childSetValue("category", LLStringUtil::null); childSetValue("content_type", LLStringUtil::null); childSetText("click_through_text", LLStringUtil::null); @@ -1433,8 +1471,14 @@ void LLPanelClassifiedInfo::setClickThrough( 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()); + // *HACK: remove this when there is enough room for click stats in the info panel + self->childSetToolTip("click_through_text", ct_str.getString()); + + llinfos << "teleport: " << llformat("%d", self->mTeleportClicksNew + self->mTeleportClicksOld) + << ", map: " << llformat("%d", self->mMapClicksNew + self->mMapClicksOld) + << ", profile: " << llformat("%d", self->mProfileClicksNew + self->mProfileClicksOld) + << llendl; } } @@ -1504,8 +1548,27 @@ void LLPanelClassifiedInfo::stretchSnapshot() mSnapshotStreched = true; } +void LLPanelClassifiedInfo::sendClickMessage(const std::string& type) +{ + // You're allowed to click on your own ads to reassure yourself + // that the system is working. + LLSD body; + body["type"] = type; + body["from_search"] = fromSearch(); + body["classified_id"] = getClassifiedId(); + body["parcel_id"] = getParcelId(); + body["dest_pos_global"] = getPosGlobal().getValue(); + body["region_name"] = getSimName(); + + std::string url = gAgent.getRegion()->getCapability("SearchStatTracking"); + llinfos << "Sending click msg via capability (url=" << url << ")" << llendl; + llinfos << "body: [" << body << "]" << llendl; + LLHTTPClient::post(url, body, new LLClassifiedClickMessageResponder()); +} + void LLPanelClassifiedInfo::onMapClick() { + sendClickMessage("map"); LLFloaterWorldMap::getInstance()->trackLocation(getPosGlobal()); LLFloaterReg::showInstance("world_map", "center"); } @@ -1514,6 +1577,7 @@ void LLPanelClassifiedInfo::onTeleportClick() { if (!getPosGlobal().isExactlyZero()) { + sendClickMessage("teleport"); gAgent.teleportViaLocation(getPosGlobal()); LLFloaterWorldMap::getInstance()->trackLocation(getPosGlobal()); } diff --git a/indra/newview/llpanelclassified.h b/indra/newview/llpanelclassified.h index 43b47d4e3e..04dea00e5f 100644 --- a/indra/newview/llpanelclassified.h +++ b/indra/newview/llpanelclassified.h @@ -204,6 +204,7 @@ private: class LLPanelClassifiedInfo : public LLPanel, public LLAvatarPropertiesObserver { + LOG_CLASS(LLPanelClassifiedInfo); public: static LLPanelClassifiedInfo* create(); @@ -246,6 +247,14 @@ public: LLUUID getParcelId() { return mParcelId; } + void setSimName(const std::string& sim_name) { mSimName = sim_name; } + + std::string getSimName() { return mSimName; } + + void setFromSearch(bool val) { mFromSearch = val; } + + bool fromSearch() { return mFromSearch; } + bool getInfoLoaded() { return mInfoLoaded; } void setInfoLoaded(bool loaded) { mInfoLoaded = loaded; } @@ -279,6 +288,7 @@ protected: const LLVector3d& pos_global); void stretchSnapshot(); + void sendClickMessage(const std::string& type); void onMapClick(); void onTeleportClick(); @@ -290,6 +300,8 @@ private: LLUUID mClassifiedId; LLVector3d mPosGlobal; LLUUID mParcelId; + std::string mSimName; + bool mFromSearch; bool mInfoLoaded; bool mSnapshotStreched; @@ -315,6 +327,7 @@ private: class LLPanelClassifiedEdit : public LLPanelClassifiedInfo { + LOG_CLASS(LLPanelClassifiedEdit); public: static LLPanelClassifiedEdit* create(); diff --git a/indra/newview/llpanelpicks.cpp b/indra/newview/llpanelpicks.cpp index f6fcb5a304..59642c6a67 100644 --- a/indra/newview/llpanelpicks.cpp +++ b/indra/newview/llpanelpicks.cpp @@ -140,10 +140,11 @@ public: params["open_tab_name"] = "panel_picks"; params["show_tab_panel"] = "classified_details"; params["classified_id"] = c_info->classified_id; - params["classified_avatar_id"] = c_info->creator_id; + params["classified_creator_id"] = c_info->creator_id; params["classified_snapshot_id"] = c_info->snapshot_id; params["classified_name"] = c_info->name; params["classified_desc"] = c_info->description; + params["from_search"] = true; LLSideTray::getInstance()->showPanel("panel_profile_view", params); } @@ -726,26 +727,20 @@ void LLPanelPicks::openClassifiedInfo() if (selected_value.isUndefined()) return; LLClassifiedItem* c_item = getSelectedClassifiedItem(); + LLSD params; + params["classified_id"] = c_item->getClassifiedId(); + params["classified_creator_id"] = c_item->getAvatarId(); + params["classified_snapshot_id"] = c_item->getSnapshotId(); + params["classified_name"] = c_item->getClassifiedName(); + params["classified_desc"] = c_item->getDescription(); + params["from_search"] = false; - openClassifiedInfo(c_item->getClassifiedId(), c_item->getAvatarId(), - c_item->getSnapshotId(), c_item->getClassifiedName(), - c_item->getDescription()); + openClassifiedInfo(params); } -void LLPanelPicks::openClassifiedInfo(const LLUUID &classified_id, - const LLUUID &avatar_id, - const LLUUID &snapshot_id, - const std::string &name, const std::string &desc) +void LLPanelPicks::openClassifiedInfo(const LLSD ¶ms) { createClassifiedInfoPanel(); - - LLSD params; - params["classified_id"] = classified_id; - params["avatar_id"] = avatar_id; - params["snapshot_id"] = snapshot_id; - params["name"] = name; - params["desc"] = desc; - getProfilePanel()->openPanel(mPanelClassifiedInfo, params); } diff --git a/indra/newview/llpanelpicks.h b/indra/newview/llpanelpicks.h index b82f1f8d86..11e811275b 100644 --- a/indra/newview/llpanelpicks.h +++ b/indra/newview/llpanelpicks.h @@ -119,9 +119,7 @@ private: void openPickInfo(); void openClassifiedInfo(); - void openClassifiedInfo(const LLUUID &classified_id, const LLUUID &avatar_id, - const LLUUID &snapshot_id, const std::string &name, - const std::string &desc); + void openClassifiedInfo(const LLSD& params); friend class LLPanelProfile; void showAccordion(const std::string& name, bool show); diff --git a/indra/newview/llpanelprofile.cpp b/indra/newview/llpanelprofile.cpp index b5d85dfd4b..18da8dd48c 100644 --- a/indra/newview/llpanelprofile.cpp +++ b/indra/newview/llpanelprofile.cpp @@ -171,15 +171,13 @@ void LLPanelProfile::onOpen(const LLSD& key) } else if (panel == "classified_details") { - LLUUID classified_id = key["classified_id"].asUUID(); - LLUUID avatar_id = key["classified_avatar_id"].asUUID(); - LLUUID snapshot_id = key["classified_snapshot_id"].asUUID(); - std::string name = key["classified_name"].asString(); - std::string desc = key["classified_desc"].asString(); LLPanelPicks* picks = dynamic_cast(getTabContainer()[PANEL_PICKS]); if (picks) { - picks->openClassifiedInfo(classified_id, avatar_id, snapshot_id, name, desc); + LLSD params = key; + params.erase("show_tab_panel"); + params.erase("open_tab_name"); + picks->openClassifiedInfo(params); } } } -- cgit v1.2.3 From b60274fad4a7cfdb1ab383bd9f822ef75caa285a Mon Sep 17 00:00:00 2001 From: Vadim Savchuk Date: Fri, 5 Mar 2010 19:30:31 +0200 Subject: WIP on EXT-5687 (Classifieds are missing the clickthrough data). Updating classieifed click stats when user presses "Teleport" or "Map" button in the picks/classifieds list side panel. --HG-- branch : product-engine --- indra/newview/llpanelclassified.cpp | 32 ++++++++++++++++++++++++++------ indra/newview/llpanelclassified.h | 8 ++++++++ indra/newview/llpanelpicks.cpp | 8 ++++++++ 3 files changed, 42 insertions(+), 6 deletions(-) (limited to 'indra') diff --git a/indra/newview/llpanelclassified.cpp b/indra/newview/llpanelclassified.cpp index 49614348d0..03c4da93c4 100644 --- a/indra/newview/llpanelclassified.cpp +++ b/indra/newview/llpanelclassified.cpp @@ -1548,17 +1548,25 @@ void LLPanelClassifiedInfo::stretchSnapshot() mSnapshotStreched = true; } -void LLPanelClassifiedInfo::sendClickMessage(const std::string& type) +// static +// *TODO: move out of the panel +void LLPanelClassifiedInfo::sendClickMessage( + const std::string& type, + bool from_search, + const LLUUID& classified_id, + const LLUUID& parcel_id, + const LLVector3d& global_pos, + const std::string& sim_name) { // You're allowed to click on your own ads to reassure yourself // that the system is working. LLSD body; body["type"] = type; - body["from_search"] = fromSearch(); - body["classified_id"] = getClassifiedId(); - body["parcel_id"] = getParcelId(); - body["dest_pos_global"] = getPosGlobal().getValue(); - body["region_name"] = getSimName(); + body["from_search"] = from_search; + body["classified_id"] = classified_id; + body["parcel_id"] = parcel_id; + body["dest_pos_global"] = global_pos.getValue(); + body["region_name"] = sim_name; std::string url = gAgent.getRegion()->getCapability("SearchStatTracking"); llinfos << "Sending click msg via capability (url=" << url << ")" << llendl; @@ -1566,6 +1574,18 @@ void LLPanelClassifiedInfo::sendClickMessage(const std::string& type) LLHTTPClient::post(url, body, new LLClassifiedClickMessageResponder()); } + +void LLPanelClassifiedInfo::sendClickMessage(const std::string& type) +{ + sendClickMessage( + type, + fromSearch(), + getClassifiedId(), + getParcelId(), + getPosGlobal(), + getSimName()); +} + void LLPanelClassifiedInfo::onMapClick() { sendClickMessage("map"); diff --git a/indra/newview/llpanelclassified.h b/indra/newview/llpanelclassified.h index 04dea00e5f..31f585e9cc 100644 --- a/indra/newview/llpanelclassified.h +++ b/indra/newview/llpanelclassified.h @@ -266,6 +266,14 @@ public: S32 profile, bool from_new_table); + static void sendClickMessage( + const std::string& type, + bool from_search, + const LLUUID& classified_id, + const LLUUID& parcel_id, + const LLVector3d& global_pos, + const std::string& sim_name); + void setExitCallback(const commit_callback_t& cb); void setEditClassifiedCallback(const commit_callback_t& cb); diff --git a/indra/newview/llpanelpicks.cpp b/indra/newview/llpanelpicks.cpp index 59642c6a67..f0860e7027 100644 --- a/indra/newview/llpanelpicks.cpp +++ b/indra/newview/llpanelpicks.cpp @@ -578,7 +578,11 @@ void LLPanelPicks::onClickTeleport() if(pick_item) pos = pick_item->getPosGlobal(); else if(c_item) + { pos = c_item->getPosGlobal(); + LLPanelClassifiedInfo::sendClickMessage("teleport", false, + c_item->getClassifiedId(), LLUUID::null, pos, LLStringUtil::null); + } if (!pos.isExactlyZero()) { @@ -597,7 +601,11 @@ void LLPanelPicks::onClickMap() if (pick_item) pos = pick_item->getPosGlobal(); else if(c_item) + { + LLPanelClassifiedInfo::sendClickMessage("map", false, + c_item->getClassifiedId(), LLUUID::null, pos, LLStringUtil::null); pos = c_item->getPosGlobal(); + } LLFloaterWorldMap::getInstance()->trackLocation(pos); LLFloaterReg::showInstance("world_map", "center"); -- cgit v1.2.3 From 48fd4c8d14172ab9780d88bf204d1e4e56f2004e Mon Sep 17 00:00:00 2001 From: Eugene Mutavchi Date: Fri, 5 Mar 2010 21:36:41 +0200 Subject: Working on major bug EXT-4820([NUX] Viewer dimensions on first-run) - moved LLDisplayInfo to llwindow, implemented getting the width/height of screen for mac os and linux. --HG-- branch : product-engine --- indra/llcommon/llsys.cpp | 27 ----------------------- indra/llcommon/llsys.h | 16 -------------- indra/llwindow/llwindow.cpp | 27 +++++++++++++++++++++++ indra/llwindow/llwindow.h | 15 +++++++++++++ indra/llwindow/llwindowmacosx-objc.h | 1 + indra/llwindow/llwindowmacosx-objc.mm | 9 ++++++++ indra/llwindow/llwindowmacosx.cpp | 20 +++++++++++++++++ indra/llwindow/llwindowmacosx.h | 2 ++ indra/llwindow/llwindowsdl.cpp | 41 +++++++++++++++++++++++++++++++++++ indra/llwindow/llwindowsdl.h | 3 +++ indra/llwindow/llwindowwin32.cpp | 11 ++++++++++ indra/llwindow/llwindowwin32.h | 3 +++ indra/newview/llappviewer.cpp | 6 ++--- 13 files changed, 135 insertions(+), 46 deletions(-) (limited to 'indra') diff --git a/indra/llcommon/llsys.cpp b/indra/llcommon/llsys.cpp index 0ed700b9da..0272c55db2 100644 --- a/indra/llcommon/llsys.cpp +++ b/indra/llcommon/llsys.cpp @@ -775,33 +775,6 @@ void LLMemoryInfo::stream(std::ostream& s) const #endif } -S32 LLDisplayInfo::getDisplayWidth() const -{ -#if LL_WINDOWS - return ::GetSystemMetrics(SM_CXVIRTUALSCREEN); -#elif LL_DARWIN - return 1024; //*FIXME -#elif LL_SOLARIS - return 1024; //*FIXME -#else - return 1024; //*FIXME -#endif -} - -S32 LLDisplayInfo::getDisplayHeight() const -{ -#if LL_WINDOWS - return ::GetSystemMetrics(SM_CYVIRTUALSCREEN); -#elif LL_DARWIN - return 768; //*FIXME -#elif LL_SOLARIS - return 768; //*FIXME -#else - return 768; //*FIXME -#endif -} - - std::ostream& operator<<(std::ostream& s, const LLOSInfo& info) { info.stream(s); diff --git a/indra/llcommon/llsys.h b/indra/llcommon/llsys.h index aa3fdd485b..f1dda1b2e2 100644 --- a/indra/llcommon/llsys.h +++ b/indra/llcommon/llsys.h @@ -122,22 +122,6 @@ public: U32 getPhysicalMemoryClamped() const; ///< Memory size in clamped bytes }; -//============================================================================= -// -// CLASS LLDisplayInfo -class LL_COMMON_API LLDisplayInfo - -/*! @brief Class to query the information about some display settings -*/ -{ -public: - LLDisplayInfo(){}; ///< Default constructor - - S32 getDisplayWidth() const; ///< display width - S32 getDisplayHeight() const; ///< display height - -}; - LL_COMMON_API std::ostream& operator<<(std::ostream& s, const LLOSInfo& info); LL_COMMON_API std::ostream& operator<<(std::ostream& s, const LLCPUInfo& info); LL_COMMON_API std::ostream& operator<<(std::ostream& s, const LLMemoryInfo& info); diff --git a/indra/llwindow/llwindow.cpp b/indra/llwindow/llwindow.cpp index 1c6c9e6e9d..b77deb003f 100644 --- a/indra/llwindow/llwindow.cpp +++ b/indra/llwindow/llwindow.cpp @@ -407,3 +407,30 @@ BOOL LLWindowManager::isWindowValid(LLWindow *window) { return sWindowList.find(window) != sWindowList.end(); } + +S32 LLDisplayInfo::getDisplayWidth() const +{ +#if LL_WINDOWS + return LLWindowWin32::getDisplayWidth(); +#elif LL_DARWIN + return LLWindowMacOSX::getDisplayWidth(); +#elif LL_SDL + return LLWindowSDL::getDisplayWidth(); +#else + return 1024; //*FIXME +#endif +} + +S32 LLDisplayInfo::getDisplayHeight() const +{ +#if LL_WINDOWS + return LLWindowWin32::getDisplayHeight(); +#elif LL_DARWIN + return LLWindowMacOSX::getDisplayHeight(); +#elif LL_SDL + return LLWindowSDL::getDisplayHeight(); +#else + return 768; //*FIXME +#endif +} + diff --git a/indra/llwindow/llwindow.h b/indra/llwindow/llwindow.h index 55b221e716..b769f5071b 100644 --- a/indra/llwindow/llwindow.h +++ b/indra/llwindow/llwindow.h @@ -281,4 +281,19 @@ extern const std::string gURLProtocolWhitelistHandler[]; void simpleEscapeString ( std::string& stringIn ); +//============================================================================= +// +// CLASS LLDisplayInfo +class LLDisplayInfo + +/*! @brief Class to query the information about some display settings +*/ +{ +public: + LLDisplayInfo(){}; ///< Default constructor + + S32 getDisplayWidth() const; ///< display width + S32 getDisplayHeight() const; ///< display height +}; + #endif // _LL_window_h_ diff --git a/indra/llwindow/llwindowmacosx-objc.h b/indra/llwindow/llwindowmacosx-objc.h index ed5d7b1e74..66851300d4 100644 --- a/indra/llwindow/llwindowmacosx-objc.h +++ b/indra/llwindow/llwindowmacosx-objc.h @@ -40,4 +40,5 @@ void setupCocoa(); CursorRef createImageCursor(const char *fullpath, int hotspotX, int hotspotY); OSErr releaseImageCursor(CursorRef ref); OSErr setImageCursor(CursorRef ref); +void getScreenSize(int* width, int* height); diff --git a/indra/llwindow/llwindowmacosx-objc.mm b/indra/llwindow/llwindowmacosx-objc.mm index 59b25e1726..6eca24ec1d 100644 --- a/indra/llwindow/llwindowmacosx-objc.mm +++ b/indra/llwindow/llwindowmacosx-objc.mm @@ -116,3 +116,12 @@ OSErr setImageCursor(CursorRef ref) return noErr; } +void getScreenSize(int* width, int* height) +{ + NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; + NSRect screen_rect = [[NSScreen mainScreen] frame]; + if (width) *width = (int)(screen_rect.size.width); + if (height) *height = (int)(screen_rect.size.height); + [pool release]; +} + diff --git a/indra/llwindow/llwindowmacosx.cpp b/indra/llwindow/llwindowmacosx.cpp index ad97bc45fc..5b21e06fe2 100644 --- a/indra/llwindow/llwindowmacosx.cpp +++ b/indra/llwindow/llwindowmacosx.cpp @@ -3464,6 +3464,26 @@ MASK LLWindowMacOSX::modifiersToMask(SInt16 modifiers) return mask; } +// static +S32 LLWindowMacOSX::getDisplayWidth() +{ + S32 width = 1024; + // Need to invoke cocoa before use getScreenSize() + setupCocoa(); + getScreenSize(&width, NULL); + return width; +} + +// static +S32 LLWindowMacOSX::getDisplayHeight() +{ + S32 height = 768; + // Need to invoke cocoa before use getScreenSize() + setupCocoa(); + getScreenSize(NULL, &height); + return height; +} + #if LL_OS_DRAGDROP_ENABLED OSErr LLWindowMacOSX::dragTrackingHandler(DragTrackingMessage message, WindowRef theWindow, diff --git a/indra/llwindow/llwindowmacosx.h b/indra/llwindow/llwindowmacosx.h index 7c6b324029..86036a261c 100644 --- a/indra/llwindow/llwindowmacosx.h +++ b/indra/llwindow/llwindowmacosx.h @@ -123,6 +123,8 @@ public: // Provide native key event data /*virtual*/ LLSD getNativeKeyData(); + static S32 getDisplayWidth(); + static S32 getDisplayHeight(); protected: LLWindowMacOSX(LLWindowCallbacks* callbacks, diff --git a/indra/llwindow/llwindowsdl.cpp b/indra/llwindow/llwindowsdl.cpp index 1f705f9e60..fe0ada5b09 100644 --- a/indra/llwindow/llwindowsdl.cpp +++ b/indra/llwindow/llwindowsdl.cpp @@ -187,6 +187,47 @@ Display* LLWindowSDL::get_SDL_Display(void) } #endif // LL_X11 +// static +S32 LLWindowSDL::getDisplayWidth() +{ +#if LL_GTK + if (LLWindowSDL::ll_try_gtk_init()) + { + return gdk_screen_width(); + } +#endif // LL_GTK + +#if LL_X11 + Display *display = XOpenDisplay(NULL); + int screen_num = DefaultScreen(display); + S32 width = DisplayWidth(display, screen_num); + XCloseDisplay(display); + return width; +#endif //LL_X11 + + return 1024; +} + +// static +S32 LLWindowSDL::getDisplayHeight() +{ +#if LL_GTK + if (LLWindowSDL::ll_try_gtk_init()) + { + return gdk_screen_height(); + } +#endif // LL_GTK + +#if LL_X11 + Display *display = XOpenDisplay(NULL); + int screen_num = DefaultScreen(display); + S32 height = DisplayHeight(display, screen_num); + XCloseDisplay(display); + return height; +#endif //LL_X11 + + return 768; +} LLWindowSDL::LLWindowSDL(LLWindowCallbacks* callbacks, const std::string& title, S32 x, S32 y, S32 width, diff --git a/indra/llwindow/llwindowsdl.h b/indra/llwindow/llwindowsdl.h index e6bdd46a77..2311a361fa 100644 --- a/indra/llwindow/llwindowsdl.h +++ b/indra/llwindow/llwindowsdl.h @@ -148,6 +148,9 @@ public: static Display* get_SDL_Display(void); #endif // LL_X11 + static S32 getDisplayWidth(); + static S32 getDisplayHeight(); + protected: LLWindowSDL(LLWindowCallbacks* callbacks, const std::string& title, int x, int y, int width, int height, U32 flags, diff --git a/indra/llwindow/llwindowwin32.cpp b/indra/llwindow/llwindowwin32.cpp index c80392ad45..4be5d06c2b 100644 --- a/indra/llwindow/llwindowwin32.cpp +++ b/indra/llwindow/llwindowwin32.cpp @@ -3714,5 +3714,16 @@ std::vector LLWindowWin32::getDynamicFallbackFontList() return std::vector(); } +// static +S32 LLWindowWin32::getDisplayWidth() +{ + return ::GetSystemMetrics(SM_CXVIRTUALSCREEN); +} + +// static +S32 LLWindowWin32::getDisplayHeight() +{ + return ::GetSystemMetrics(SM_CYVIRTUALSCREEN); +} #endif // LL_WINDOWS diff --git a/indra/llwindow/llwindowwin32.h b/indra/llwindow/llwindowwin32.h index 9d57735772..c221ec0192 100644 --- a/indra/llwindow/llwindowwin32.h +++ b/indra/llwindow/llwindowwin32.h @@ -120,6 +120,9 @@ public: static std::vector getDynamicFallbackFontList(); + static S32 getDisplayWidth(); + static S32 getDisplayHeight(); + protected: LLWindowWin32(LLWindowCallbacks* callbacks, const std::string& title, const std::string& name, int x, int y, int width, int height, U32 flags, diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 6d4c90c2b9..8b3f3aa28e 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -305,7 +305,7 @@ static std::string gLaunchFileOnQuit; // Used on Win32 for other apps to identify our window (eg, win_setup) const char* const VIEWER_WINDOW_CLASSNAME = "Second Life"; static const S32 FIRST_RUN_WINDOW_WIDTH = 1024; -static const S32 FIRST_RUN_WINDOW_HRIGHT = 768; +static const S32 FIRST_RUN_WINDOW_HIGHT = 768; //---------------------------------------------------------------------------- // List of entries from strings.xml to always replace @@ -2375,12 +2375,12 @@ bool LLAppViewer::initWindow() if (first_run)//for first login { window_width = FIRST_RUN_WINDOW_WIDTH;//yep hardcoded - window_height = FIRST_RUN_WINDOW_HRIGHT; + window_height = FIRST_RUN_WINDOW_HIGHT; //if screen resolution is lower then 1024*768 then show maximized LLDisplayInfo display_info; if(display_info.getDisplayWidth() <= FIRST_RUN_WINDOW_WIDTH - || display_info.getDisplayHeight()<=FIRST_RUN_WINDOW_HRIGHT) + || display_info.getDisplayHeight()<=FIRST_RUN_WINDOW_HIGHT) { show_maximized = true; } -- cgit v1.2.3 From 92025836edd66992fecd6b25c3fd3880bba9be67 Mon Sep 17 00:00:00 2001 From: Eugene Mutavchi Date: Fri, 5 Mar 2010 21:36:41 +0200 Subject: Working on major bug EXT-4820([NUX] Viewer dimensions on first-run) - implemented LLWindowSDL::maximize() method --HG-- branch : product-engine --- indra/llwindow/llwindowsdl.cpp | 161 ++++++++++++++++++++++++++++++++++++++++- 1 file changed, 159 insertions(+), 2 deletions(-) (limited to 'indra') diff --git a/indra/llwindow/llwindowsdl.cpp b/indra/llwindow/llwindowsdl.cpp index fe0ada5b09..cb4e04511c 100644 --- a/indra/llwindow/llwindowsdl.cpp +++ b/indra/llwindow/llwindowsdl.cpp @@ -950,7 +950,68 @@ BOOL LLWindowSDL::getMaximized() if (mWindow) { - // TODO +#if LL_X11 + if (mSDL_Display) + { + maybe_lock_display(); + + // Return data in the specified format, XA_ATOM. + U8* prop; + // Actual format of the property. + int format; + // Actual number of items stored in the prop return data. + unsigned long nitems; + // Number of bytes remaining to be read in the property if a partial read was performed. + unsigned long bytes_after; + // Atom identifier that defines the actual type of the property. + Atom type; + + // Atom used to obtain list of hints describing the window state. + Atom wm_state = XInternAtom(mSDL_Display, "_NET_WM_STATE", False); + + // Atoms indicates that the window is vertically/horizontally maximized. + Atom max_vert = XInternAtom(mSDL_Display, "_NET_WM_STATE_MAXIMIZED_VERT", False); + Atom max_horz = XInternAtom(mSDL_Display, "_NET_WM_STATE_MAXIMIZED_HORZ", False); + + // How many atoms in which we interested are present in list of hints. + U32 pass = 0; + + do + { + nitems = 0; + bytes_after = 0; + type = None; + if ( (XGetWindowProperty (mSDL_Display, + mSDL_XWindowID, + wm_state, + 0, UINT_MAX, + False, XA_ATOM, + &type, &format, + &nitems, &bytes_after, + &prop) == Success) + && type != None ) + { + Atom *atoms = (Atom *)prop; + for (unsigned long i=0; i 0); + + result = (pass == 2); + + maybe_unlock_display(); + } +#endif // LL_X11 } return(result); @@ -958,7 +1019,103 @@ BOOL LLWindowSDL::getMaximized() BOOL LLWindowSDL::maximize() { - // TODO +#if LL_X11 + if (mSDL_Display && !mFullscreen) + { + maybe_lock_display(); + + BOOL is_maximize_allowed = FALSE; + + // Check if maximize is allowed + { + // Return data in the specified format, XA_ATOM. + U8* prop; + // Actual format of the property. + int format; + // Actual number of items stored in the prop return data. + unsigned long nitems; + // Number of bytes remaining to be read in the property if a partial read was performed. + unsigned long bytes_after; + // Atom identifier that defines the actual type of the property. + Atom type; + + // Atom used to obtain a list of atoms indicating user operations that the Window Manager supports for this window. + Atom allowed_act = XInternAtom(mSDL_Display, "_NET_WM_ALLOWED_ACTIONS", False); + + // Atoms that indicates that the window may be vertically/horizontally maximized. + Atom max_vert_act = XInternAtom(mSDL_Display, "_NET_WM_ACTION_MAXIMIZE_HORZ", False); + Atom max_horz_act = XInternAtom(mSDL_Display, "_NET_WM_ACTION_MAXIMIZE_VERT", False); + + // How many atoms in which we interested are present in list of hints. + U32 pass = 0; + + do + { + nitems = 0; + bytes_after = 0; + type = None; + if ( (XGetWindowProperty (mSDL_Display, + mSDL_XWindowID, + allowed_act, + 0, UINT_MAX, + False, XA_ATOM, + &type, &format, + &nitems, &bytes_after, + &prop) == Success) + && type != None ) + { + Atom *atoms = (Atom *)prop; + for (unsigned long i=0; i 0); + + is_maximize_allowed = (pass == 2); + } + + // Send maximize event to X11 system + if (is_maximize_allowed) + { + XEvent xev; + + // Atom describing the window state. + Atom wm_state = XInternAtom(mSDL_Display, "_NET_WM_STATE", False); + + // Atoms indicates that the window is vertically/horizontally maximized. + Atom max_vert = XInternAtom(mSDL_Display, "_NET_WM_STATE_MAXIMIZED_VERT", False); + Atom max_horz = XInternAtom(mSDL_Display, "_NET_WM_STATE_MAXIMIZED_HORZ", False); + + memset(&xev, 0, sizeof(xev)); + xev.type = ClientMessage; + xev.xclient.window = mSDL_XWindowID; + xev.xclient.message_type = wm_state; + xev.xclient.format = 32; + xev.xclient.data.l[0] = 1; // add/set property + xev.xclient.data.l[1] = max_vert; + xev.xclient.data.l[2] = max_horz; + xev.xclient.data.l[3] = 0; + xev.xclient.data.l[4] = 0; + + XSendEvent(mSDL_Display, + DefaultRootWindow(mSDL_Display), + False, + SubstructureNotifyMask, &xev); + } + + maybe_unlock_display(); + return is_maximize_allowed; + } +#endif // LL_X11 return FALSE; } -- cgit v1.2.3 From 870dcca7871a1903d688c3f6a8f2b30d7cf62b7e Mon Sep 17 00:00:00 2001 From: Eugene Mutavchi Date: Fri, 5 Mar 2010 21:36:41 +0200 Subject: Working on major bug EXT-4820([NUX] Viewer dimensions on first-run) - implemented LLWindowMacOSX::maximize() method --HG-- branch : product-engine --- indra/llwindow/llwindowmacosx-objc.h | 2 +- indra/llwindow/llwindowmacosx-objc.mm | 10 ++++++++++ indra/llwindow/llwindowmacosx.cpp | 28 +++++++++++++++++++++++++++- 3 files changed, 38 insertions(+), 2 deletions(-) (limited to 'indra') diff --git a/indra/llwindow/llwindowmacosx-objc.h b/indra/llwindow/llwindowmacosx-objc.h index 66851300d4..ed8c874dcb 100644 --- a/indra/llwindow/llwindowmacosx-objc.h +++ b/indra/llwindow/llwindowmacosx-objc.h @@ -41,4 +41,4 @@ CursorRef createImageCursor(const char *fullpath, int hotspotX, int hotspotY); OSErr releaseImageCursor(CursorRef ref); OSErr setImageCursor(CursorRef ref); void getScreenSize(int* width, int* height); - +void getVisibleScreen(int *x, int *y, int* width, int* height); diff --git a/indra/llwindow/llwindowmacosx-objc.mm b/indra/llwindow/llwindowmacosx-objc.mm index 6eca24ec1d..5cab2619fd 100644 --- a/indra/llwindow/llwindowmacosx-objc.mm +++ b/indra/llwindow/llwindowmacosx-objc.mm @@ -125,3 +125,13 @@ void getScreenSize(int* width, int* height) [pool release]; } +void getVisibleScreen(int *x, int *y, int* width, int* height) +{ + NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; + NSRect visible_rect = [[NSScreen mainScreen] visibleFrame]; + if (width) *width = (int)(visible_rect.size.width); + if (height) *height = (int)(visible_rect.size.height); + if (x) *x = (int)(visible_rect.origin.x); + if (y) *y = (int)(visible_rect.origin.y); + [pool release]; +} diff --git a/indra/llwindow/llwindowmacosx.cpp b/indra/llwindow/llwindowmacosx.cpp index 5b21e06fe2..924acaf148 100644 --- a/indra/llwindow/llwindowmacosx.cpp +++ b/indra/llwindow/llwindowmacosx.cpp @@ -1122,7 +1122,33 @@ BOOL LLWindowMacOSX::getMaximized() BOOL LLWindowMacOSX::maximize() { - // TODO + if (mWindow) + { + // *HACK: Because Mac OSX doesn't have a concept of a "maximized" window, we just + // stretch it out to the visible screen size. + Rect win_rect; + + int visible_x; + int visible_y; + int visible_width; + int visible_height; + int screen_width; + int screen_height; + + getScreenSize(&screen_width, &screen_height); + getVisibleScreen(&visible_x, &visible_y, &visible_width, &visible_height); + + int mac_os_menu_bar_height = screen_height - (visible_height + visible_y); + ::SetRect(&win_rect, + visible_x, + mac_os_menu_bar_height, + visible_width + visible_x, + visible_height + mac_os_menu_bar_height); + + ::SetWindowBounds(mWindow, kWindowStructureRgn, &win_rect); + + return TRUE; + } return FALSE; } -- cgit v1.2.3 From 8ae52e2b90e9767787c14f0ac8a0bc6cc5f1df73 Mon Sep 17 00:00:00 2001 From: Andrew Dyukov Date: Sat, 6 Mar 2010 00:17:16 +0200 Subject: Partially implemented nice-to have sub-task EXT-4706 (Add maturity icons to About Land). - Added maturity icons to General and Covenant tabs. --HG-- branch : product-engine --- indra/newview/llfloaterland.cpp | 43 +++++++++++++++++++++- .../skins/default/xui/en/floater_about_land.xml | 12 ++++++ 2 files changed, 53 insertions(+), 2 deletions(-) (limited to 'indra') diff --git a/indra/newview/llfloaterland.cpp b/indra/newview/llfloaterland.cpp index 26c6db9652..fa7d7e3a38 100644 --- a/indra/newview/llfloaterland.cpp +++ b/indra/newview/llfloaterland.cpp @@ -102,6 +102,10 @@ public: virtual void changed() { LLFloaterLand::refreshAll(); } }; +// fills target textbox with maturity info(icon and text) +// names_floater - pointer to floater which contains strings with maturity icons filenames +void FillMaturityTextBox(LLTextBox* target_textbox, LLFloater* names_floater); + //--------------------------------------------------------------------------- // LLFloaterLand //--------------------------------------------------------------------------- @@ -554,7 +558,7 @@ void LLPanelLandGeneral::refresh() if (regionp) { - mContentRating->setText(regionp->getSimAccessString()); + FillMaturityTextBox(mContentRating, gFloaterView->getParentFloater(this)); mLandType->setText(regionp->getSimProductName()); } @@ -2858,7 +2862,7 @@ void LLPanelLandCovenant::refresh() LLTextBox* region_maturity = getChild("region_maturity_text"); if (region_maturity) { - region_maturity->setText(region->getSimAccessString()); + FillMaturityTextBox(region_maturity, gFloaterView->getParentFloater(this)); } LLTextBox* resellable_clause = getChild("resellable_clause"); @@ -2939,3 +2943,38 @@ void LLPanelLandCovenant::updateEstateOwnerName(const std::string& name) if (editor) editor->setText(name); } } + +// fills target textbox with maturity info(icon and text) +// names_floater - pointer to floater which contains strings with maturity icons filenames +void FillMaturityTextBox(LLTextBox* target_textbox, LLFloater* names_floater) +{ + LLViewerRegion* region = LLViewerParcelMgr::getInstance()->getSelectionRegion(); + if (!region) + return; + + LLStyle::Params style; + + U8 sim_access = region->getSimAccess(); + + switch(sim_access) + { + case SIM_ACCESS_PG: + style.image(LLUI::getUIImage(names_floater->getString("maturity_icon_general"))); + break; + + case SIM_ACCESS_ADULT: + style.image(LLUI::getUIImage(names_floater->getString("maturity_icon_adult"))); + break; + + case SIM_ACCESS_MATURE: + style.image(LLUI::getUIImage(names_floater->getString("maturity_icon_moderate"))); + break; + + default: + break; + } + + // any text may be here instead of "icon" except "" + target_textbox->setText(std::string("icon"),style); + target_textbox->appendText(LLViewerParcelMgr::getInstance()->getSelectionRegion()->getSimAccessString(), false); +} \ No newline at end of file diff --git a/indra/newview/skins/default/xui/en/floater_about_land.xml b/indra/newview/skins/default/xui/en/floater_about_land.xml index 29c6ae8009..8d45bdd4aa 100644 --- a/indra/newview/skins/default/xui/en/floater_about_land.xml +++ b/indra/newview/skins/default/xui/en/floater_about_land.xml @@ -8,6 +8,18 @@ save_rect="true" title="ABOUT LAND" width="490"> + + "Parcel_PG_Dark" + + + "Parcel_M_Dark" + + + "Parcel_R_Dark" + [MINUTES] minutes -- cgit v1.2.3 From 24810564a3332c63edbed0f447e1244e33a45e17 Mon Sep 17 00:00:00 2001 From: Andrew Dyukov Date: Sat, 6 Mar 2010 00:22:46 +0200 Subject: Fixed linux build --HG-- branch : product-engine --- indra/newview/llfloaterland.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra') diff --git a/indra/newview/llfloaterland.cpp b/indra/newview/llfloaterland.cpp index fa7d7e3a38..7051447409 100644 --- a/indra/newview/llfloaterland.cpp +++ b/indra/newview/llfloaterland.cpp @@ -2977,4 +2977,4 @@ void FillMaturityTextBox(LLTextBox* target_textbox, LLFloater* names_floater) // any text may be here instead of "icon" except "" target_textbox->setText(std::string("icon"),style); target_textbox->appendText(LLViewerParcelMgr::getInstance()->getSelectionRegion()->getSimAccessString(), false); -} \ No newline at end of file +} -- cgit v1.2.3 From bf265a25fc52c7c9469c7e50ede1a95f1f774a94 Mon Sep 17 00:00:00 2001 From: Sergei Litovchuk Date: Sat, 6 Mar 2010 01:14:33 +0200 Subject: (EXT-4705) Show maturity icon on Region/Estate tab - Added items names to match localized XUI. --HG-- branch : product-engine --- indra/newview/skins/default/xui/en/panel_region_general.xml | 3 +++ 1 file changed, 3 insertions(+) (limited to 'indra') diff --git a/indra/newview/skins/default/xui/en/panel_region_general.xml b/indra/newview/skins/default/xui/en/panel_region_general.xml index 4acfa42c23..ca9579284b 100644 --- a/indra/newview/skins/default/xui/en/panel_region_general.xml +++ b/indra/newview/skins/default/xui/en/panel_region_general.xml @@ -187,6 +187,7 @@ pad_left="3"/> Date: Sat, 6 Mar 2010 01:16:56 +0200 Subject: Fixed major bug (EXT-6033) Parcel, Region,and Estate areas of 'PlaceProfile' are corrupted. - Added height attribute value to accordion tabs. --HG-- branch : product-engine --- indra/newview/skins/default/xui/en/panel_place_profile.xml | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'indra') diff --git a/indra/newview/skins/default/xui/en/panel_place_profile.xml b/indra/newview/skins/default/xui/en/panel_place_profile.xml index 01a27a08c7..1e7c51259c 100644 --- a/indra/newview/skins/default/xui/en/panel_place_profile.xml +++ b/indra/newview/skins/default/xui/en/panel_place_profile.xml @@ -325,6 +325,7 @@ top_pad="10" width="313"> @@ -537,6 +538,7 @@ @@ -664,6 +666,7 @@ @@ -753,6 +756,7 @@ -- cgit v1.2.3 From f499260782a0c94c4f164a743da9d2690240dad7 Mon Sep 17 00:00:00 2001 From: Sergei Litovchuk Date: Sat, 6 Mar 2010 01:17:34 +0200 Subject: Implemented (EXT-4715) Add maturity icons to Classifieds - create and details. --HG-- branch : product-engine --- indra/llui/llcombobox.cpp | 33 ++++++++++----- indra/llui/llcombobox.h | 3 +- indra/newview/llpanelclassified.cpp | 10 +++-- .../skins/default/xui/en/panel_classified_info.xml | 24 +++++++++-- .../skins/default/xui/en/panel_edit_classified.xml | 48 ++++++++++++++-------- 5 files changed, 85 insertions(+), 33 deletions(-) (limited to 'indra') diff --git a/indra/llui/llcombobox.cpp b/indra/llui/llcombobox.cpp index 98c9217306..e223e1c0bf 100644 --- a/indra/llui/llcombobox.cpp +++ b/indra/llui/llcombobox.cpp @@ -320,15 +320,19 @@ void LLComboBox::setValue(const LLSD& value) LLScrollListItem* item = mList->getFirstSelected(); if (item) { - setLabel( mList->getSelectedItemLabel() ); + setLabel(getSelectedItemLabel()); } mLastSelectedIndex = mList->getFirstSelectedIndex(); } + else + { + mLastSelectedIndex = -1; + } } const std::string LLComboBox::getSimple() const { - const std::string res = mList->getSelectedItemLabel(); + const std::string res = getSelectedItemLabel(); if (res.empty() && mAllowTextEntry) { return mTextEntry->getText(); @@ -407,7 +411,7 @@ BOOL LLComboBox::remove(S32 index) if (index < mList->getItemCount()) { mList->deleteSingleItem(index); - setLabel(mList->getSelectedItemLabel()); + setLabel(getSelectedItemLabel()); return TRUE; } return FALSE; @@ -448,7 +452,7 @@ BOOL LLComboBox::setCurrentByIndex( S32 index ) BOOL found = mList->selectNthItem( index ); if (found) { - setLabel(mList->getSelectedItemLabel()); + setLabel(getSelectedItemLabel()); mLastSelectedIndex = index; } return found; @@ -905,7 +909,7 @@ void LLComboBox::updateSelection() } else if (mList->selectItemByPrefix(left_wstring, FALSE)) { - LLWString selected_item = utf8str_to_wstring(mList->getSelectedItemLabel()); + LLWString selected_item = utf8str_to_wstring(getSelectedItemLabel()); LLWString wtext = left_wstring + selected_item.substr(left_wstring.size(), selected_item.size()); mTextEntry->setText(wstring_to_utf8str(wtext)); mTextEntry->setSelection(left_wstring.size(), mTextEntry->getWText().size()); @@ -1007,7 +1011,7 @@ BOOL LLComboBox::setCurrentByID(const LLUUID& id) if (found) { - setLabel(mList->getSelectedItemLabel()); + setLabel(getSelectedItemLabel()); mLastSelectedIndex = mList->getFirstSelectedIndex(); } @@ -1023,7 +1027,7 @@ BOOL LLComboBox::setSelectedByValue(const LLSD& value, BOOL selected) BOOL found = mList->setSelectedByValue(value, selected); if (found) { - setLabel(mList->getSelectedItemLabel()); + setLabel(getSelectedItemLabel()); } return found; } @@ -1085,10 +1089,19 @@ void LLIconsComboBox::setValue(const LLSD& value) LLScrollListItem* item = mList->getFirstSelected(); if (item) { - mButton->setImageOverlay(mList->getSelectedItemLabel(mIconColumnIndex), mButton->getImageOverlayHAlign()); - - setLabel(mList->getSelectedItemLabel(mLabelColumnIndex)); + setLabel(getSelectedItemLabel()); } mLastSelectedIndex = mList->getFirstSelectedIndex(); } + else + { + mLastSelectedIndex = -1; + } +} + +const std::string LLIconsComboBox::getSelectedItemLabel(S32 column) const +{ + mButton->setImageOverlay(LLComboBox::getSelectedItemLabel(mIconColumnIndex), mButton->getImageOverlayHAlign()); + + return LLComboBox::getSelectedItemLabel(mLabelColumnIndex); } diff --git a/indra/llui/llcombobox.h b/indra/llui/llcombobox.h index 3cc2a8f5d1..62aab92abc 100644 --- a/indra/llui/llcombobox.h +++ b/indra/llui/llcombobox.h @@ -150,7 +150,7 @@ public: // Get name of current item. Returns an empty string if not found. const std::string getSimple() const; // Get contents of column x of selected row - const std::string getSelectedItemLabel(S32 column = 0) const; + virtual const std::string getSelectedItemLabel(S32 column = 0) const; // Sets the label, which doesn't have to exist in the label. // This is probably a UI abuse. @@ -247,6 +247,7 @@ public: }; /*virtual*/ void setValue(const LLSD& value); + /*virtual*/ const std::string getSelectedItemLabel(S32 column = 0) const; private: enum EColumnIndex diff --git a/indra/newview/llpanelclassified.cpp b/indra/newview/llpanelclassified.cpp index 5c6636676c..115c7a1aa5 100644 --- a/indra/newview/llpanelclassified.cpp +++ b/indra/newview/llpanelclassified.cpp @@ -1325,6 +1325,8 @@ void LLPanelClassifiedInfo::processProperties(void* data, EAvatarProcessorType t bool mature = is_cf_mature(c_info->flags); childSetValue("content_type", mature ? mature_str : pg_str); + getChild("content_type_moderate")->setVisible(mature); + getChild("content_type_general")->setVisible(!mature); std::string auto_renew_str = is_cf_auto_renew(c_info->flags) ? getString("auto_renew_on") : getString("auto_renew_off"); @@ -1369,6 +1371,8 @@ void LLPanelClassifiedInfo::resetData() childSetText("auto_renew", LLStringUtil::null); childSetText("creation_date", LLStringUtil::null); childSetText("click_through_text", LLStringUtil::null); + getChild("content_type_moderate")->setVisible(FALSE); + getChild("content_type_general")->setVisible(FALSE); } void LLPanelClassifiedInfo::resetControls() @@ -1787,7 +1791,7 @@ void LLPanelClassifiedEdit::processProperties(void* data, EAvatarProcessorType t bool mature = is_cf_mature(c_info->flags); bool auto_renew = is_cf_auto_renew(c_info->flags); - getChild("content_type")->setCurrentByIndex(mature ? CB_ITEM_MATURE : CB_ITEM_PG); + getChild("content_type")->setCurrentByIndex(mature ? CB_ITEM_MATURE : CB_ITEM_PG); childSetValue("auto_renew", auto_renew); childSetValue("price_for_listing", c_info->price_for_listing); childSetEnabled("price_for_listing", isNew()); @@ -1846,7 +1850,7 @@ void LLPanelClassifiedEdit::resetControls() LLPanelClassifiedInfo::resetControls(); getChild("category")->setCurrentByIndex(0); - getChild("content_type")->setCurrentByIndex(0); + getChild("content_type")->setCurrentByIndex(0); childSetValue("auto_renew", false); childSetValue("price_for_listing", MINIMUM_PRICE_FOR_LISTING); childSetEnabled("price_for_listing", TRUE); @@ -1910,7 +1914,7 @@ U8 LLPanelClassifiedEdit::getFlags() { bool auto_renew = childGetValue("auto_renew").asBoolean(); - LLComboBox* content_cb = getChild("content_type"); + LLComboBox* content_cb = getChild("content_type"); bool mature = content_cb->getCurrentIndex() == CB_ITEM_MATURE; return pack_classified_flags_request(auto_renew, false, mature, false); 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 e71498f2f8..e3b331799c 100644 --- a/indra/newview/skins/default/xui/en/panel_classified_info.xml +++ b/indra/newview/skins/default/xui/en/panel_classified_info.xml @@ -156,6 +156,24 @@ top_pad="10" value="Content Type:" width="140" /> + + - - - Moderate Content - - - General Content - - + + + + + + + + Date: Fri, 5 Mar 2010 17:38:21 -0800 Subject: added some logging to help track down crash in EXT-5849 --- indra/llui/llview.cpp | 8 ++++++-- indra/llui/llview.h | 4 ++-- indra/newview/llviewerwindow.cpp | 8 ++++---- 3 files changed, 12 insertions(+), 8 deletions(-) (limited to 'indra') diff --git a/indra/llui/llview.cpp b/indra/llui/llview.cpp index db2c460eec..b695731a02 100644 --- a/indra/llui/llview.cpp +++ b/indra/llui/llview.cpp @@ -73,9 +73,9 @@ S32 LLView::sLastBottomXML = S32_MIN; std::vector LLViewDrawContext::sDrawContextStack; -#if LL_DEBUG +//#if LL_DEBUG BOOL LLView::sIsDrawing = FALSE; -#endif +//#endif // Compiler optimization, generate extern template template class LLView* LLView::getChild( @@ -150,6 +150,10 @@ LLView::~LLView() { dirtyRect(); //llinfos << "Deleting view " << mName << ":" << (void*) this << llendl; + if (LLView::isDrawing) + { + llwarns << "Deleting view " << mName << " during UI draw() phase" << llendl; + } // llassert(LLView::sIsDrawing == FALSE); // llassert_always(sDepth == 0); // avoid deleting views while drawing! It can subtly break list iterators diff --git a/indra/llui/llview.h b/indra/llui/llview.h index c4d7313743..efae00f0e5 100644 --- a/indra/llui/llview.h +++ b/indra/llui/llview.h @@ -171,9 +171,9 @@ private: // widgets in general are not copyable LLView(const LLView& other) {}; public: -#if LL_DEBUG +//#if LL_DEBUG static BOOL sIsDrawing; -#endif +//#endif enum ESoundFlags { SILENT = 0, diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index 6c8900df21..d0a1a31ebd 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -2021,9 +2021,9 @@ void LLViewerWindow::drawDebugText() void LLViewerWindow::draw() { -#if LL_DEBUG +//#if LL_DEBUG LLView::sIsDrawing = TRUE; -#endif +//#endif stop_glerror(); LLUI::setLineWidth(1.f); @@ -2135,9 +2135,9 @@ void LLViewerWindow::draw() LLUI::popMatrix(); gGL.popMatrix(); -#if LL_DEBUG +//#if LL_DEBUG LLView::sIsDrawing = FALSE; -#endif +//#endif } // Takes a single keydown event, usually when UI is visible -- cgit v1.2.3 From eee50d1401ff7dfcb9c9fdc2c6e61e6d6281f5e2 Mon Sep 17 00:00:00 2001 From: Monroe Linden Date: Fri, 5 Mar 2010 18:11:55 -0800 Subject: Fix for a crash on startup/shutdown introduced in the tip of viewer-2-0 very recently. list.erase(list.find()) is not safe, because erasing list.end() is undefined. Check to make sure the find succeeded before doing the erase. Reviewed by Richard at http://codereview.lindenlab.com/341001 --- indra/newview/llpopupview.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'indra') diff --git a/indra/newview/llpopupview.cpp b/indra/newview/llpopupview.cpp index 590a45c96c..1668a91eed 100644 --- a/indra/newview/llpopupview.cpp +++ b/indra/newview/llpopupview.cpp @@ -207,7 +207,11 @@ void LLPopupView::addPopup(LLView* popup) { if (popup) { - mPopups.erase(std::find(mPopups.begin(), mPopups.end(), popup->getHandle())); + popup_list_t::iterator iter = std::find(mPopups.begin(), mPopups.end(), popup->getHandle()); + if(iter != mPopups.end()) + { + mPopups.erase(iter); + } mPopups.push_front(popup->getHandle()); } } @@ -220,7 +224,11 @@ void LLPopupView::removePopup(LLView* popup) { gFocusMgr.setKeyboardFocus(NULL); } - mPopups.erase(std::find(mPopups.begin(), mPopups.end(), popup->getHandle())); + popup_list_t::iterator iter = std::find(mPopups.begin(), mPopups.end(), popup->getHandle()); + if(iter != mPopups.end()) + { + mPopups.erase(iter); + } popup->onTopLost(); } } -- cgit v1.2.3 From 4ada9e7f15eed6a462f22a119a724f64799aba54 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Fri, 5 Mar 2010 18:19:29 -0800 Subject: fix --- indra/llui/llview.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra') diff --git a/indra/llui/llview.cpp b/indra/llui/llview.cpp index b695731a02..d34083a384 100644 --- a/indra/llui/llview.cpp +++ b/indra/llui/llview.cpp @@ -150,7 +150,7 @@ LLView::~LLView() { dirtyRect(); //llinfos << "Deleting view " << mName << ":" << (void*) this << llendl; - if (LLView::isDrawing) + if (LLView::sIsDrawing) { llwarns << "Deleting view " << mName << " during UI draw() phase" << llendl; } -- cgit v1.2.3 From 6a8b63e9de7ee78db2e24ed77f855c1e19790af2 Mon Sep 17 00:00:00 2001 From: Xiaohong Bao Date: Sun, 7 Mar 2010 21:18:10 -0700 Subject: partial fix for EXT-5711: Some textures loading from cache seems jammed. This fix should be able to improve the speed of loading texturs from cache noticeably (30% or more). More fix to come. --- indra/newview/lltexturecache.cpp | 78 ++++++++++++++++++++++++++++++++++------ indra/newview/lltexturecache.h | 6 ++++ indra/newview/lltextureview.cpp | 4 +++ indra/newview/llviewertexture.h | 1 + 4 files changed, 79 insertions(+), 10 deletions(-) (limited to 'indra') diff --git a/indra/newview/lltexturecache.cpp b/indra/newview/lltexturecache.cpp index 3116c8feb0..4649b9cbef 100644 --- a/indra/newview/lltexturecache.cpp +++ b/indra/newview/lltexturecache.cpp @@ -751,6 +751,7 @@ LLTextureCache::LLTextureCache(bool threaded) LLTextureCache::~LLTextureCache() { clearDeleteList() ; + writeUpdatedEntries() ; } ////////////////////////////////////////////////////////////////////////////// @@ -758,6 +759,9 @@ LLTextureCache::~LLTextureCache() //virtual S32 LLTextureCache::update(U32 max_time_ms) { + static LLFrameTimer timer ; + static const F32 MAX_TIME_INTERVAL = 300.f ; //seconds. + S32 res; res = LLWorkerThread::update(max_time_ms); @@ -793,6 +797,12 @@ S32 LLTextureCache::update(U32 max_time_ms) responder->completed(success); } + if(!res && timer.getElapsedTimeF32() > MAX_TIME_INTERVAL) + { + timer.reset() ; + writeUpdatedEntries() ; + } + return res; } @@ -1083,6 +1093,8 @@ S32 LLTextureCache::openAndReadEntry(const LLUUID& id, Entry& entry, bool create entry.init(id, time(NULL)); // Update Header writeEntriesHeader(); + + //the new entry, write immediately. // Write Entry S32 offset = sizeof(EntriesInfo) + idx * sizeof(Entry); LLAPRFile* aprfile = openHeaderEntriesFile(false, offset); @@ -1098,12 +1110,20 @@ S32 LLTextureCache::openAndReadEntry(const LLUUID& id, Entry& entry, bool create // Remove this entry from the LRU if it exists mLRU.erase(id); // Read the entry - S32 offset = sizeof(EntriesInfo) + idx * sizeof(Entry); - LLAPRFile* aprfile = openHeaderEntriesFile(true, offset); - S32 bytes_read = aprfile->read((void*)&entry, (S32)sizeof(Entry)); - llassert_always(bytes_read == sizeof(Entry)); + idx_entry_map_t::iterator iter = mUpdatedEntryMap.find(idx) ; + if(iter != mUpdatedEntryMap.end()) + { + entry = iter->second ; + } + else + { + S32 offset = sizeof(EntriesInfo) + idx * sizeof(Entry); + LLAPRFile* aprfile = openHeaderEntriesFile(true, offset); + S32 bytes_read = aprfile->read((void*)&entry, (S32)sizeof(Entry)); + llassert_always(bytes_read == sizeof(Entry)); + closeHeaderEntriesFile(); + } llassert_always(entry.mImageSize == 0 || entry.mImageSize == -1 || entry.mImageSize > entry.mBodySize); - closeHeaderEntriesFile(); } return idx; } @@ -1121,12 +1141,8 @@ void LLTextureCache::writeEntryAndClose(S32 idx, Entry& entry) mTexturesSizeMap[entry.mID] = entry.mBodySize; } // llinfos << "Updating TE: " << idx << ": " << id << " Size: " << entry.mBodySize << " Time: " << entry.mTime << llendl; - S32 offset = sizeof(EntriesInfo) + idx * sizeof(Entry); - LLAPRFile* aprfile = openHeaderEntriesFile(false, offset); - S32 bytes_written = aprfile->write((void*)&entry, (S32)sizeof(Entry)); - llassert_always(bytes_written == sizeof(Entry)); mHeaderEntriesMaxWriteIdx = llmax(mHeaderEntriesMaxWriteIdx, idx); - closeHeaderEntriesFile(); + mUpdatedEntryMap[idx] = entry ; } } } @@ -1141,6 +1157,7 @@ U32 LLTextureCache::openAndReadEntries(std::vector& entries) mTexturesSizeTotal = 0; LLAPRFile* aprfile = openHeaderEntriesFile(false, (S32)sizeof(EntriesInfo)); + updatedHeaderEntriesFile() ; for (U32 idx=0; idx& entries) } } +void LLTextureCache::writeUpdatedEntries() +{ + lockHeaders() ; + if (!mReadOnly && !mUpdatedEntryMap.empty()) + { + openHeaderEntriesFile(false, 0); + updatedHeaderEntriesFile() ; + closeHeaderEntriesFile(); + } + unlockHeaders() ; +} + +//mHeaderMutex is locked and mHeaderAPRFile is created before calling this. +void LLTextureCache::updatedHeaderEntriesFile() +{ + if (!mReadOnly && !mUpdatedEntryMap.empty() && mHeaderAPRFile) + { + //entriesInfo + mHeaderAPRFile->seek(APR_SET, 0); + S32 bytes_written = mHeaderAPRFile->write((U8*)&mHeaderEntriesInfo, sizeof(EntriesInfo)) ; + llassert_always(bytes_written == sizeof(EntriesInfo)); + + //write each updated entry + S32 entry_size = (S32)sizeof(Entry) ; + S32 prev_idx = -1 ; + S32 delta_idx ; + for (idx_entry_map_t::iterator iter = mUpdatedEntryMap.begin(); iter != mUpdatedEntryMap.end(); ++iter) + { + delta_idx = iter->first - prev_idx - 1; + prev_idx = iter->first ; + if(delta_idx) + { + mHeaderAPRFile->seek(APR_CUR, delta_idx * entry_size); + } + + bytes_written = mHeaderAPRFile->write((void*)(&iter->second), entry_size); + llassert_always(bytes_written == entry_size); + } + mUpdatedEntryMap.clear() ; + } +} //---------------------------------------------------------------------------- // Called from either the main thread or the worker thread diff --git a/indra/newview/lltexturecache.h b/indra/newview/lltexturecache.h index 64ec881fc3..b840619c1f 100644 --- a/indra/newview/lltexturecache.h +++ b/indra/newview/lltexturecache.h @@ -68,6 +68,7 @@ private: Entry(const LLUUID& id, S32 imagesize, S32 bodysize, U32 time) : mID(id), mImageSize(imagesize), mBodySize(bodysize), mTime(time) {} void init(const LLUUID& id, U32 time) { mID = id, mImageSize = 0; mBodySize = 0; mTime = time; } + Entry& operator=(const Entry& entry) {mID = entry.mID, mImageSize = entry.mImageSize; mBodySize = entry.mBodySize; mTime = entry.mTime; return *this;} LLUUID mID; // 16 bytes S32 mImageSize; // total size of image if known S32 mBodySize; // size of body file in body cache @@ -166,6 +167,8 @@ private: S32 getHeaderCacheEntry(const LLUUID& id, S32& imagesize); S32 setHeaderCacheEntry(const LLUUID& id, S32 imagesize); bool removeHeaderCacheEntry(const LLUUID& id); + void writeUpdatedEntries() ; + void updatedHeaderEntriesFile() ; void lockHeaders() { mHeaderMutex.lock(); } void unlockHeaders() { mHeaderMutex.unlock(); } @@ -204,6 +207,9 @@ private: S64 mTexturesSizeTotal; LLAtomic32 mDoPurge; + typedef std::map idx_entry_map_t; + idx_entry_map_t mUpdatedEntryMap; + // Statics static F32 sHeaderCacheVersion; static U32 sCacheMaxEntries; diff --git a/indra/newview/lltextureview.cpp b/indra/newview/lltextureview.cpp index 98731f90f4..1b44063840 100644 --- a/indra/newview/lltextureview.cpp +++ b/indra/newview/lltextureview.cpp @@ -683,6 +683,10 @@ void LLTextureView::draw() iter != gTextureList.mImageList.end(); ) { LLPointer imagep = *iter++; + if(!imagep->hasFetcher()) + { + continue ; + } S32 cur_discard = imagep->getDiscardLevel(); S32 desired_discard = imagep->mDesiredDiscardLevel; diff --git a/indra/newview/llviewertexture.h b/indra/newview/llviewertexture.h index 84377198eb..6dc18085e0 100644 --- a/indra/newview/llviewertexture.h +++ b/indra/newview/llviewertexture.h @@ -455,6 +455,7 @@ public: F32 getElapsedLastReferencedSavedRawImageTime() const ; BOOL isFullyLoaded() const; + BOOL hasFetcher() const { return mHasFetcher;} protected: /*virtual*/ void switchToCachedImage(); S32 getCurrentDiscardLevelForFetching() ; -- cgit v1.2.3 From 3ee48a2090a5c009318e2630f38c78e48b556427 Mon Sep 17 00:00:00 2001 From: Xiaohong Bao Date: Sun, 7 Mar 2010 22:55:52 -0700 Subject: trival fix to eliminate unnecessary warnings "LLView::~LLView(): Deleting view " << mName << " during UI draw() phase" caused in lltextureview.cpp (from the texture console). --- indra/newview/lltextureview.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'indra') diff --git a/indra/newview/lltextureview.cpp b/indra/newview/lltextureview.cpp index 1b44063840..a4ca33f10f 100644 --- a/indra/newview/lltextureview.cpp +++ b/indra/newview/lltextureview.cpp @@ -665,12 +665,18 @@ void LLTextureView::draw() // LLViewerObject *objectp; // S32 te; +//#if LL_DEBUG + BOOL drawing = LLView::sIsDrawing; + LLView::sIsDrawing = FALSE; +//#endif for_each(mTextureBars.begin(), mTextureBars.end(), DeletePointer()); mTextureBars.clear(); - - delete mGLTexMemBar; + + delete mGLTexMemBar; mGLTexMemBar = 0; - +//#if LL_DEBUG + LLView::sIsDrawing = drawing ; +//#endif typedef std::multiset display_list_t; display_list_t display_image_list; -- cgit v1.2.3