From a5c43859c355afbb5a24d8599756297cad07f590 Mon Sep 17 00:00:00 2001 From: Loren Shih Date: Tue, 16 Mar 2010 17:11:02 -0400 Subject: EXT-5735 : InventorySP doesn't show # of inventory items even when known by viewer Moved # items fetched string into panel_main_inventory (out of floater_inventory) so that it's shared by all inventory views. --- indra/newview/llfloaterinventory.cpp | 36 ------------- indra/newview/llfloaterinventory.h | 4 -- indra/newview/llpanelmaininventory.cpp | 31 ++++++++++- indra/newview/llpanelmaininventory.h | 3 +- .../skins/default/xui/en/floater_inventory.xml | 16 ------ .../skins/default/xui/en/panel_main_inventory.xml | 63 +++++++++++++++------- 6 files changed, 76 insertions(+), 77 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llfloaterinventory.cpp b/indra/newview/llfloaterinventory.cpp index 844f0ac509..6842d3dc74 100644 --- a/indra/newview/llfloaterinventory.cpp +++ b/indra/newview/llfloaterinventory.cpp @@ -64,42 +64,6 @@ BOOL LLFloaterInventory::postBuild() return TRUE; } - -void LLFloaterInventory::draw() -{ - updateTitle(); - LLFloater::draw(); -} - -void LLFloaterInventory::updateTitle() -{ - LLLocale locale(LLLocale::USER_LOCALE); - std::string item_count_string; - LLResMgr::getInstance()->getIntegerString(item_count_string, gInventory.getItemCount()); - - LLStringUtil::format_map_t string_args; - string_args["[ITEM_COUNT]"] = item_count_string; - string_args["[FILTER]"] = mPanelMainInventory->getFilterText(); - - if (LLInventoryModel::backgroundFetchActive()) - { - setTitle(getString("TitleFetching", string_args)); - } - else if (LLInventoryModel::isEverythingFetched()) - { - setTitle(getString("TitleCompleted", string_args)); - } - else - { - setTitle(getString("Title")); - } -} - -void LLFloaterInventory::changed(U32 mask) -{ - updateTitle(); -} - LLInventoryPanel* LLFloaterInventory::getPanel() { if (mPanelMainInventory) diff --git a/indra/newview/llfloaterinventory.h b/indra/newview/llfloaterinventory.h index b661c391a7..473d2b189d 100644 --- a/indra/newview/llfloaterinventory.h +++ b/indra/newview/llfloaterinventory.h @@ -63,13 +63,9 @@ public: static void cleanup(); // Inherited functionality - /*virtual*/ void changed(U32 mask); - /*virtual*/ void draw(); /*virtual*/ void onOpen(const LLSD& key); LLInventoryPanel* getPanel(); -protected: - void updateTitle(); private: LLPanelMainInventory* mPanelMainInventory; }; diff --git a/indra/newview/llpanelmaininventory.cpp b/indra/newview/llpanelmaininventory.cpp index 421c9df9a1..d40141c91d 100644 --- a/indra/newview/llpanelmaininventory.cpp +++ b/indra/newview/llpanelmaininventory.cpp @@ -44,6 +44,7 @@ #include "llfiltereditor.h" #include "llfloaterreg.h" #include "llpreviewtexture.h" +#include "llresmgr.h" #include "llscrollcontainer.h" #include "llsdserialize.h" #include "llspinctrl.h" @@ -538,7 +539,7 @@ BOOL LLPanelMainInventory::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, // virtual void LLPanelMainInventory::changed(U32) { - // empty, but must have this defined for abstract base class. + updateItemcountText(); } @@ -550,6 +551,34 @@ void LLPanelMainInventory::draw() mFilterEditor->setText(mFilterSubString); } LLPanel::draw(); + updateItemcountText(); +} + +void LLPanelMainInventory::updateItemcountText() +{ + LLLocale locale(LLLocale::USER_LOCALE); + std::string item_count_string; + LLResMgr::getInstance()->getIntegerString(item_count_string, gInventory.getItemCount()); + + LLStringUtil::format_map_t string_args; + string_args["[ITEM_COUNT]"] = item_count_string; + string_args["[FILTER]"] = getFilterText(); + + std::string text = ""; + + if (LLInventoryModel::backgroundFetchActive()) + { + text = getString("ItemcountFetching", string_args); + } + else if (LLInventoryModel::isEverythingFetched()) + { + text = getString("ItemcountCompleted", string_args); + } + else + { + text = getString("ItemcountUnknown"); + } + childSetText("ItemcountText",text); } void LLPanelMainInventory::setFilterTextFromFilter() diff --git a/indra/newview/llpanelmaininventory.h b/indra/newview/llpanelmaininventory.h index d9ea0da2da..b43e057f83 100644 --- a/indra/newview/llpanelmaininventory.h +++ b/indra/newview/llpanelmaininventory.h @@ -113,7 +113,8 @@ protected: void setSortBy(const LLSD& userdata); void saveTexture(const LLSD& userdata); bool isSaveTextureEnabled(const LLSD& userdata); - + void updateItemcountText(); + private: LLFloaterInventoryFinder* getFinder(); diff --git a/indra/newview/skins/default/xui/en/floater_inventory.xml b/indra/newview/skins/default/xui/en/floater_inventory.xml index 0d381fe5cb..ba2e0d3277 100644 --- a/indra/newview/skins/default/xui/en/floater_inventory.xml +++ b/indra/newview/skins/default/xui/en/floater_inventory.xml @@ -14,22 +14,6 @@ single_instance="false" title="MY INVENTORY" width="467"> - - MY INVENTORY - - - MY INVENTORY (Fetching [ITEM_COUNT] Items...) [FILTER] - - - MY INVENTORY ([ITEM_COUNT] Items) [FILTER] - - - Fetched - - Things + name="Itemcount"> + + Fetching [ITEM_COUNT] Items... [FILTER] + + + [ITEM_COUNT] Items [FILTER] + + + + + + Items: + + follows="all" + halign="center" + height="300" + layout="topleft" + left="6" + name="inventory filter tabs" + tab_height="30" + tab_position="top" + tab_min_width="100" + top_pad="10" + width="315">