diff options
author | Mnikolenko Productengine <mnikolenko@productengine.com> | 2016-06-10 18:04:16 +0300 |
---|---|---|
committer | Mnikolenko Productengine <mnikolenko@productengine.com> | 2016-06-10 18:04:16 +0300 |
commit | 554db00bdf20692f58c3eb42b83731011e9ad119 (patch) | |
tree | 45ad0bdbb59c6a91ca8e0ea5c914589adae7b7ff /indra/newview | |
parent | 9adf2dbeb7e7dcc1d3b4188899b58c089f4d99c8 (diff) |
MAINT-6475 Add menu item for changing sort priority
Diffstat (limited to 'indra/newview')
-rw-r--r-- | indra/newview/app_settings/settings.xml | 11 | ||||
-rw-r--r-- | indra/newview/lloutfitgallery.cpp | 17 | ||||
-rw-r--r-- | indra/newview/lloutfitgallery.h | 1 | ||||
-rw-r--r-- | indra/newview/lloutfitslist.cpp | 9 | ||||
-rw-r--r-- | indra/newview/lloutfitslist.h | 1 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/menu_outfit_gear.xml | 11 |
6 files changed, 49 insertions, 1 deletions
diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index a8d42be2a1..57a71ce93d 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -14592,6 +14592,17 @@ <key>Value</key> <integer>1</integer> </map> + <key>OutfitGallerySortByName</key> + <map> + <key>Comment</key> + <string>Always sort outfits by name in Outfit Gallery</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Boolean</string> + <key>Value</key> + <integer>0</integer> + </map> <key>OutfitOperationsTimeout</key> <map> <key>Comment</key> diff --git a/indra/newview/lloutfitgallery.cpp b/indra/newview/lloutfitgallery.cpp index 224f2b7f49..055d4dbe9f 100644 --- a/indra/newview/lloutfitgallery.cpp +++ b/indra/newview/lloutfitgallery.cpp @@ -46,6 +46,7 @@ #include "lllocalbitmaps.h" #include "llnotificationsutil.h" #include "lltexturectrl.h" +#include "llviewercontrol.h" #include "llviewermenufile.h" #include "llwearableitemslist.h" @@ -147,7 +148,8 @@ void LLOutfitGallery::updateRowsIfNeeded() bool compareGalleryItem(LLOutfitGalleryItem* item1, LLOutfitGalleryItem* item2) { - if((item1->isDefaultImage() && item2->isDefaultImage()) || (!item1->isDefaultImage() && !item2->isDefaultImage())) + if(gSavedSettings.getBOOL("OutfitGallerySortByName") || + ((item1->isDefaultImage() && item2->isDefaultImage()) || (!item1->isDefaultImage() && !item2->isDefaultImage()))) { std::string name1 = item1->getItemName(); std::string name2 = item2->getItemName(); @@ -847,6 +849,8 @@ void LLOutfitGalleryGearMenu::onUpdateItemsVisibility() mMenu->setItemVisible("select_photo", have_selection); mMenu->setItemVisible("take_snapshot", have_selection); mMenu->setItemVisible("remove_photo", !hasDefaultImage()); + mMenu->setItemVisible("sepatator3", TRUE); + mMenu->setItemVisible("sort_folders_by_name", TRUE); LLOutfitListGearMenuBase::onUpdateItemsVisibility(); } @@ -891,6 +895,17 @@ void LLOutfitGalleryGearMenu::onTakeSnapshot() } } +void LLOutfitGalleryGearMenu::onChangeSortOrder() +{ + bool sort_by_name = !gSavedSettings.getBOOL("OutfitGallerySortByName"); + gSavedSettings.setBOOL("OutfitGallerySortByName", sort_by_name); + LLOutfitGallery* gallery = dynamic_cast<LLOutfitGallery*>(mOutfitList); + if (gallery) + { + gallery->reArrangeRows(); + } +} + bool LLOutfitGalleryGearMenu::hasDefaultImage() { LLOutfitGallery* gallery = dynamic_cast<LLOutfitGallery*>(mOutfitList); diff --git a/indra/newview/lloutfitgallery.h b/indra/newview/lloutfitgallery.h index 19bfc10586..f5954d9cc2 100644 --- a/indra/newview/lloutfitgallery.h +++ b/indra/newview/lloutfitgallery.h @@ -233,6 +233,7 @@ private: /*virtual*/ void onSelectPhoto(); /*virtual*/ void onTakeSnapshot(); /*virtual*/ void onRemovePhoto(); + /*virtual*/ void onChangeSortOrder(); bool hasDefaultImage(); }; diff --git a/indra/newview/lloutfitslist.cpp b/indra/newview/lloutfitslist.cpp index 2e6599090a..87c3c5042b 100644 --- a/indra/newview/lloutfitslist.cpp +++ b/indra/newview/lloutfitslist.cpp @@ -1094,6 +1094,7 @@ LLOutfitListGearMenuBase::LLOutfitListGearMenuBase(LLOutfitListBase* olist) registrar.add("Gear.SelectPhoto", boost::bind(&LLOutfitListGearMenuBase::onSelectPhoto, this)); registrar.add("Gear.TakeSnapshot", boost::bind(&LLOutfitListGearMenuBase::onTakeSnapshot, this)); registrar.add("Gear.RemovePhoto", boost::bind(&LLOutfitListGearMenuBase::onRemovePhoto, this)); + registrar.add("Gear.SortByName", boost::bind(&LLOutfitListGearMenuBase::onChangeSortOrder, this)); enable_registrar.add("Gear.OnEnable", boost::bind(&LLOutfitListGearMenuBase::onEnable, this, _2)); enable_registrar.add("Gear.OnVisible", boost::bind(&LLOutfitListGearMenuBase::onVisible, this, _2)); @@ -1246,6 +1247,12 @@ void LLOutfitListGearMenuBase::onRemovePhoto() { } + +void LLOutfitListGearMenuBase::onChangeSortOrder() +{ + +} + LLOutfitListGearMenu::LLOutfitListGearMenu(LLOutfitListBase* olist) : LLOutfitListGearMenuBase(olist) {} @@ -1262,6 +1269,8 @@ void LLOutfitListGearMenu::onUpdateItemsVisibility() mMenu->setItemVisible("select_photo", FALSE); mMenu->setItemVisible("take_snapshot", FALSE); mMenu->setItemVisible("remove_photo", FALSE); + mMenu->setItemVisible("sepatator3", FALSE); + mMenu->setItemVisible("sort_folders_by_name", FALSE); LLOutfitListGearMenuBase::onUpdateItemsVisibility(); } diff --git a/indra/newview/lloutfitslist.h b/indra/newview/lloutfitslist.h index c4dd2cd075..81be8de94f 100644 --- a/indra/newview/lloutfitslist.h +++ b/indra/newview/lloutfitslist.h @@ -167,6 +167,7 @@ protected: virtual void onSelectPhoto(); virtual void onTakeSnapshot(); virtual void onRemovePhoto(); + virtual void onChangeSortOrder(); const LLUUID& getSelectedOutfitID(); diff --git a/indra/newview/skins/default/xui/en/menu_outfit_gear.xml b/indra/newview/skins/default/xui/en/menu_outfit_gear.xml index 6b8a784560..7faa4f3d71 100644 --- a/indra/newview/skins/default/xui/en/menu_outfit_gear.xml +++ b/indra/newview/skins/default/xui/en/menu_outfit_gear.xml @@ -261,4 +261,15 @@ function="Gear.OnVisible" parameter="delete" /> </menu_item_call> + <menu_item_separator name="sepatator3" /> + <menu_item_check + label="Sort Folders Always by Name" + layout="topleft" + name="sort_folders_by_name"> + <on_click + function="Gear.SortByName" /> + <on_check + function="CheckControl" + parameter="OutfitGallerySortByName" /> + </menu_item_check> </toggleable_menu> |