summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
authorSergei Litovchuk <slitovchuk@productengine.com>2010-06-04 21:52:38 +0300
committerSergei Litovchuk <slitovchuk@productengine.com>2010-06-04 21:52:38 +0300
commitd1751df1cc5d9bf853f29555de94faec1912e19f (patch)
treea710f8b9b4b24a9b327afb371fe7703219670b15 /indra/newview
parent65f8d1822d058aee1902238e298f760368b724f6 (diff)
EXT-7610 FIXED Added sorting outfit tabs by name (case insensitive).
Reviewed by Neal Orman at https://codereview.productengine.com/secondlife/r/523/. --HG-- branch : product-engine
Diffstat (limited to 'indra/newview')
-rw-r--r--indra/newview/lloutfitslist.cpp17
-rw-r--r--indra/newview/lloutfitslist.h18
2 files changed, 33 insertions, 2 deletions
diff --git a/indra/newview/lloutfitslist.cpp b/indra/newview/lloutfitslist.cpp
index a4ae957c76..e20b2e26be 100644
--- a/indra/newview/lloutfitslist.cpp
+++ b/indra/newview/lloutfitslist.cpp
@@ -53,6 +53,20 @@
static bool is_tab_header_clicked(LLAccordionCtrlTab* tab, S32 y);
+static const LLOutfitTabNameComparator OUTFIT_TAB_NAME_COMPARATOR;
+
+/*virtual*/
+bool LLOutfitTabNameComparator::compare(const LLAccordionCtrlTab* tab1, const LLAccordionCtrlTab* tab2) const
+{
+ std::string name1 = tab1->getTitle();
+ std::string name2 = tab2->getTitle();
+
+ LLStringUtil::toUpper(name1);
+ LLStringUtil::toUpper(name2);
+
+ return name1 < name2;
+}
+
//////////////////////////////////////////////////////////////////////////
class OutfitContextMenu : public LLListContextMenu
@@ -158,6 +172,7 @@ LLOutfitsList::~LLOutfitsList()
BOOL LLOutfitsList::postBuild()
{
mAccordion = getChild<LLAccordionCtrl>("outfits_accordion");
+ mAccordion->setComparator(&OUTFIT_TAB_NAME_COMPARATOR);
return TRUE;
}
@@ -328,7 +343,7 @@ void LLOutfitsList::refreshList(const LLUUID& category_id)
updateOutfitTab(*items_iter);
}
- mAccordion->arrange();
+ mAccordion->sort();
}
void LLOutfitsList::onSelectionChange(LLUICtrl* ctrl)
diff --git a/indra/newview/lloutfitslist.h b/indra/newview/lloutfitslist.h
index 44f6ec908b..bb516446d2 100644
--- a/indra/newview/lloutfitslist.h
+++ b/indra/newview/lloutfitslist.h
@@ -32,18 +32,34 @@
#ifndef LL_LLOUTFITSLIST_H
#define LL_LLOUTFITSLIST_H
+#include "llaccordionctrl.h"
#include "llpanel.h"
// newview
#include "llinventorymodel.h"
#include "llinventoryobserver.h"
-class LLAccordionCtrl;
class LLAccordionCtrlTab;
class LLWearableItemsList;
class LLListContextMenu;
/**
+ * @class LLOutfitTabNameComparator
+ *
+ * Comparator of outfit tabs.
+ */
+class LLOutfitTabNameComparator : public LLAccordionCtrl::LLTabComparator
+{
+ LOG_CLASS(LLOutfitTabNameComparator);
+
+public:
+ LLOutfitTabNameComparator() {};
+ virtual ~LLOutfitTabNameComparator() {};
+
+ /*virtual*/ bool compare(const LLAccordionCtrlTab* tab1, const LLAccordionCtrlTab* tab2) const;
+};
+
+/**
* @class LLOutfitsList
*
* A list of agents's outfits from "My Outfits" inventory category