From 947260880713f0bd65b03f796f782b167127e294 Mon Sep 17 00:00:00 2001 From: Loren Shih Date: Tue, 8 Dec 2009 18:19:39 -0500 Subject: EXT-3256 : Show help message in Favorites bar if empty --HG-- branch : avatar-pipeline --- indra/newview/llfolderview.cpp | 2 +- indra/newview/llinventoryfilter.cpp | 14 +++++++++++++- indra/newview/llinventoryfilter.h | 21 ++++++++++++++------- indra/newview/llpanellandmarks.cpp | 2 +- indra/newview/skins/default/xui/en/strings.xml | 1 + 5 files changed, 30 insertions(+), 10 deletions(-) diff --git a/indra/newview/llfolderview.cpp b/indra/newview/llfolderview.cpp index 4e77b42187..7cf0104075 100644 --- a/indra/newview/llfolderview.cpp +++ b/indra/newview/llfolderview.cpp @@ -890,7 +890,7 @@ void LLFolderView::draw() } else { - mStatusText = LLTrans::getString("InventoryNoMatchingItems"); + mStatusText = LLTrans::getString(getFilter()->getEmptyLookupMessage()); font->renderUTF8(mStatusText, 0, 2, 1, sSearchStatusColor, LLFontGL::LEFT, LLFontGL::TOP, LLFontGL::NORMAL, LLFontGL::NO_SHADOW, S32_MAX, S32_MAX, NULL, FALSE ); } } diff --git a/indra/newview/llinventoryfilter.cpp b/indra/newview/llinventoryfilter.cpp index 38803b4b8b..81b10f5a62 100644 --- a/indra/newview/llinventoryfilter.cpp +++ b/indra/newview/llinventoryfilter.cpp @@ -63,7 +63,8 @@ LLInventoryFilter::FilterOps::FilterOps() : LLInventoryFilter::LLInventoryFilter(const std::string& name) : mName(name), mModified(FALSE), - mNeedTextRebuild(TRUE) + mNeedTextRebuild(TRUE), + mEmptyLookupMessage("InventoryNoMatchingItems") { mOrder = SO_FOLDERS_BY_NAME; // This gets overridden by a pref immediately @@ -861,3 +862,14 @@ S32 LLInventoryFilter::getMustPassGeneration() const { return mMustPassGeneration; } + +void LLInventoryFilter::setEmptyLookupMessage(const std::string& message) +{ + mEmptyLookupMessage = message; +} + +const std::string& LLInventoryFilter::getEmptyLookupMessage() const +{ + return mEmptyLookupMessage; + +} diff --git a/indra/newview/llinventoryfilter.h b/indra/newview/llinventoryfilter.h index 8cac173fd8..5ca77cb26a 100644 --- a/indra/newview/llinventoryfilter.h +++ b/indra/newview/llinventoryfilter.h @@ -73,13 +73,6 @@ public: LLInventoryFilter(const std::string& name); virtual ~LLInventoryFilter(); - // +-------------------------------------------------------------------+ - // + Execution And Results - // +-------------------------------------------------------------------+ - BOOL check(const LLFolderViewItem* item); - BOOL checkAgainstFilterType(const LLFolderViewItem* item); - std::string::size_type getStringMatchOffset() const; - // +-------------------------------------------------------------------+ // + Parameters // +-------------------------------------------------------------------+ @@ -104,12 +97,25 @@ public: void setHoursAgo(U32 hours); U32 getHoursAgo() const; + // +-------------------------------------------------------------------+ + // + Execution And Results + // +-------------------------------------------------------------------+ + BOOL check(const LLFolderViewItem* item); + BOOL checkAgainstFilterType(const LLFolderViewItem* item); + std::string::size_type getStringMatchOffset() const; + + // +-------------------------------------------------------------------+ + // + Presentation + // +-------------------------------------------------------------------+ void setShowFolderState( EFolderShow state); EFolderShow getShowFolderState() const; void setSortOrder(U32 order); U32 getSortOrder() const; + void setEmptyLookupMessage(const std::string& message); + const std::string& getEmptyLookupMessage() const; + // +-------------------------------------------------------------------+ // + Status // +-------------------------------------------------------------------+ @@ -188,6 +194,7 @@ private: BOOL mModified; BOOL mNeedTextRebuild; std::string mFilterText; + std::string mEmptyLookupMessage; }; #endif diff --git a/indra/newview/llpanellandmarks.cpp b/indra/newview/llpanellandmarks.cpp index ebde902e81..975219458f 100644 --- a/indra/newview/llpanellandmarks.cpp +++ b/indra/newview/llpanellandmarks.cpp @@ -327,7 +327,7 @@ void LLLandmarksPanel::initFavoritesInventoryPanel() mFavoritesInventoryPanel = getChild("favorites_list"); initLandmarksPanel(mFavoritesInventoryPanel); - + mFavoritesInventoryPanel->getFilter()->setEmptyLookupMessage("FavoritesNoMatchingItems"); initAccordion("tab_favorites", mFavoritesInventoryPanel); } diff --git a/indra/newview/skins/default/xui/en/strings.xml b/indra/newview/skins/default/xui/en/strings.xml index 3b32912fbf..3c9ceb6585 100644 --- a/indra/newview/skins/default/xui/en/strings.xml +++ b/indra/newview/skins/default/xui/en/strings.xml @@ -1805,6 +1805,7 @@ Clears (deletes) the media and all params from the given face. No matching items found in inventory. + Drag and drop a landmark here to add to your favorites. You do not have a copy of this texture in your inventory -- cgit v1.2.3