summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview')
-rw-r--r--indra/newview/llinventorypanel.cpp93
-rw-r--r--indra/newview/llinventorypanel.h4
-rw-r--r--indra/newview/llpanelmaininventory.cpp2
-rw-r--r--indra/newview/skins/default/textures/icons/Inv_Favorite_Star_Content.pngbin0 -> 474 bytes
-rw-r--r--indra/newview/skins/default/textures/icons/Inv_Favorite_Star_Full.pngbin0 -> 582 bytes
-rw-r--r--indra/newview/skins/default/textures/textures.xml2
-rw-r--r--indra/newview/skins/default/xui/en/floater_preview_trash.xml4
-rw-r--r--indra/newview/skins/default/xui/en/widgets/folder_view_item.xml4
-rw-r--r--indra/newview/skins/default/xui/en/widgets/inbox_folder_view_folder.xml4
9 files changed, 92 insertions, 21 deletions
diff --git a/indra/newview/llinventorypanel.cpp b/indra/newview/llinventorypanel.cpp
index bdf9e87e60..f22ac6f775 100644
--- a/indra/newview/llinventorypanel.cpp
+++ b/indra/newview/llinventorypanel.cpp
@@ -947,18 +947,7 @@ void LLInventoryPanel::initializeViews(F64 max_time)
mBuildViewsEndTime = curent_time + max_time;
// init everything
- LLUUID root_id = getRootFolderID();
- if (root_id.notNull())
- {
- buildNewViews(getRootFolderID());
- }
- else
- {
- // Default case: always add "My Inventory" root first, "Library" root second
- // If we run out of time, this still should create root folders
- buildNewViews(gInventory.getRootFolderID()); // My Inventory
- buildNewViews(gInventory.getLibraryRootFolderID()); // Library
- }
+ initRootContent();
if (mBuildViewsQueue.empty())
{
@@ -991,6 +980,22 @@ void LLInventoryPanel::initializeViews(F64 max_time)
}
}
+void LLInventoryPanel::initRootContent()
+{
+ LLUUID root_id = getRootFolderID();
+ if (root_id.notNull())
+ {
+ buildNewViews(getRootFolderID());
+ }
+ else
+ {
+ // Default case: always add "My Inventory" root first, "Library" root second
+ // If we run out of time, this still should create root folders
+ buildNewViews(gInventory.getRootFolderID()); // My Inventory
+ buildNewViews(gInventory.getLibraryRootFolderID()); // Library
+ }
+}
+
LLFolderViewFolder * LLInventoryPanel::createFolderViewFolder(LLInvFVBridge * bridge, bool allow_drop)
{
@@ -1248,6 +1253,7 @@ LLFolderViewItem* LLInventoryPanel::buildViewsTree(const LLUUID& id,
{
LLViewerInventoryCategory::cat_array_t* categories;
LLViewerInventoryItem::item_array_t* items;
+ //collectInventoryDescendants(id, categories, items);
mInventory->lockDirectDescendentArrays(id, categories, items);
// Make sure panel won't lock in a loop over existing items if
@@ -1348,6 +1354,14 @@ LLFolderViewItem* LLInventoryPanel::buildViewsTree(const LLUUID& id,
return folder_view_item;
}
+
+/*void LLInventoryPanel::collectInventoryDescendants(const LLUUID& id,
+ LLViewerInventoryCategory::cat_array_t*& categories,
+ LLViewerInventoryItem::item_array_t*& items);
+{
+ mInventory->lockDirectDescendentArrays(id, categories, items);
+}*/
+
// bit of a hack to make sure the inventory is open.
void LLInventoryPanel::openStartFolderOrMyInventory()
{
@@ -2250,6 +2264,9 @@ public:
protected:
LLInventoryFavoritesItemsPanel(const Params&);
friend class LLUICtrlFactory;
+
+ void initRootContent(const LLUUID& id);
+ void initRootContent() override;
};
LLInventoryFavoritesItemsPanel::LLInventoryFavoritesItemsPanel(const Params& params)
@@ -2259,6 +2276,58 @@ LLInventoryFavoritesItemsPanel::LLInventoryFavoritesItemsPanel(const Params& par
mInvFVBridgeBuilder = &FAVORITES_BUILDER;
}
+void LLInventoryFavoritesItemsPanel::initRootContent(const LLUUID& id)
+{
+ LLViewerInventoryCategory::cat_array_t* categories;
+ LLViewerInventoryItem::item_array_t* items;
+ mInventory->lockDirectDescendentArrays(id, categories, items);
+
+ if (categories)
+ {
+ S32 count = categories->size();
+ for (S32 i = 0; i < count; ++i)
+ {
+ LLViewerInventoryCategory* cat = categories->at(i);
+ if (cat->getPreferredType() == LLFolderType::FT_TRASH)
+ {
+ continue;
+ }
+ else if (cat->getIsFavorite())
+ {
+ const LLUUID& parent_id = cat->getParentUUID();
+ LLFolderViewItem* folder_view_item = getItemByID(cat->getUUID()); // Should be NULL
+
+ buildViewsTree(cat->getUUID(), parent_id, cat, folder_view_item, mFolderRoot.get(), BUILD_TIMELIMIT);
+ }
+ else // Todo: timelimits
+ {
+ initRootContent(cat->getUUID());
+ }
+ }
+ }
+
+ if (items)
+ {
+ S32 count = items->size();
+ for (S32 i = 0; i < count; ++i)
+ {
+ LLViewerInventoryItem* item = items->at(i);
+ if (item->getIsFavorite() && typedViewsFilter(id, item))
+ {
+ const LLUUID& parent_id = item->getParentUUID();
+ LLFolderViewItem* folder_view_item = getItemByID(id); // Should be NULL
+
+ buildViewsTree(item->getUUID(), parent_id, item, folder_view_item, mFolderRoot.get(), BUILD_TIMELIMIT);
+ }
+ }
+ }
+}
+
+void LLInventoryFavoritesItemsPanel::initRootContent()
+{
+ initRootContent(gInventory.getRootFolderID()); // My Inventory
+}
+
/************************************************************************/
/* LLInventorySingleFolderPanel */
/************************************************************************/
diff --git a/indra/newview/llinventorypanel.h b/indra/newview/llinventorypanel.h
index 97300596f9..b6d21ea9a8 100644
--- a/indra/newview/llinventorypanel.h
+++ b/indra/newview/llinventorypanel.h
@@ -334,6 +334,7 @@ public:
protected:
// Builds the UI. Call this once the inventory is usable.
void initializeViews(F64 max_time);
+ virtual void initRootContent();
// Specific inventory colors
static bool sColorSetInitialized;
@@ -371,7 +372,7 @@ protected:
virtual LLFolderViewItem* createFolderViewItem(LLInvFVBridge * bridge);
boost::function<void(const std::deque<LLFolderViewItem*>& items, BOOL user_action)> mSelectionCallback;
-private:
+protected:
// buildViewsTree does not include some checks and is meant
// for recursive use, use buildNewViews() for first call
LLFolderViewItem* buildViewsTree(const LLUUID& id,
@@ -394,6 +395,7 @@ private:
EViewsInitializationState mViewsInitialized; // Whether views have been generated
F64 mBuildViewsEndTime; // Stop building views past this timestamp
std::deque<LLUUID> mBuildViewsQueue;
+ std::deque<LLUUID> mBuildRootContent;
};
diff --git a/indra/newview/llpanelmaininventory.cpp b/indra/newview/llpanelmaininventory.cpp
index b1bfd52bc6..c41fedec20 100644
--- a/indra/newview/llpanelmaininventory.cpp
+++ b/indra/newview/llpanelmaininventory.cpp
@@ -199,9 +199,7 @@ BOOL LLPanelMainInventory::postBuild()
if (favorites_panel)
{
favorites_panel->setSortOrder(gSavedSettings.getU32(LLInventoryPanel::DEFAULT_SORT_ORDER));
- favorites_panel->setShowFolderState(LLInventoryFilter::SHOW_NON_EMPTY_FOLDERS);
LLInventoryFilter& favorites_filter = favorites_panel->getFilter();
- favorites_filter.setFilterFavorites(LLInventoryFilter::FILTER_ONLY_FAVORITES);
favorites_filter.setEmptyLookupMessage("InventoryNoMatchingFavorites");
favorites_filter.markDefault();
favorites_panel->setSelectCallback(boost::bind(&LLPanelMainInventory::onSelectionChange, this, favorites_panel, _1, _2));
diff --git a/indra/newview/skins/default/textures/icons/Inv_Favorite_Star_Content.png b/indra/newview/skins/default/textures/icons/Inv_Favorite_Star_Content.png
new file mode 100644
index 0000000000..bf7ec1599a
--- /dev/null
+++ b/indra/newview/skins/default/textures/icons/Inv_Favorite_Star_Content.png
Binary files differ
diff --git a/indra/newview/skins/default/textures/icons/Inv_Favorite_Star_Full.png b/indra/newview/skins/default/textures/icons/Inv_Favorite_Star_Full.png
new file mode 100644
index 0000000000..916b57f3c5
--- /dev/null
+++ b/indra/newview/skins/default/textures/icons/Inv_Favorite_Star_Full.png
Binary files differ
diff --git a/indra/newview/skins/default/textures/textures.xml b/indra/newview/skins/default/textures/textures.xml
index c733d3feaf..7f3b9a8cee 100644
--- a/indra/newview/skins/default/textures/textures.xml
+++ b/indra/newview/skins/default/textures/textures.xml
@@ -304,6 +304,8 @@ with the same filename but different name
<texture name="Inv_CallingCard" file_name="icons/Inv_CallingCard.png" preload="false" />
<texture name="Inv_Clothing" file_name="icons/Inv_Clothing.png" preload="false" />
<texture name="Inv_Eye" file_name="icons/Inv_Eye.png" preload="false" />
+ <texture name="Inv_Favorite_Star_Content" file_name="icons/Inv_Favorite_Star_Content.png" preload="false" />
+ <texture name="Inv_Favorite_Star_Full" file_name="icons/Inv_Favorite_Star_Full.png" preload="false" />
<texture name="Inv_FolderClosed" file_name="icons/Inv_FolderClosed.png" preload="false" />
<texture name="Inv_FolderOpen" file_name="icons/Inv_FolderOpen.png" preload="false" />
<texture name="Inv_Gesture" file_name="icons/Inv_Gesture.png" preload="false" />
diff --git a/indra/newview/skins/default/xui/en/floater_preview_trash.xml b/indra/newview/skins/default/xui/en/floater_preview_trash.xml
index f62e04baf2..ebb5cd9251 100644
--- a/indra/newview/skins/default/xui/en/floater_preview_trash.xml
+++ b/indra/newview/skins/default/xui/en/floater_preview_trash.xml
@@ -29,8 +29,8 @@
bevel_style="none"
scroll.reserve_scroll_corner="false">
<folder folder_arrow_image="Folder_Arrow"
- favorite_image="Favorite_Star_Active"
- favorite_content_image="Favorite_Star_Off"
+ favorite_image="Inv_Favorite_Star_Full"
+ favorite_content_image="Inv_Favorite_Star_Content"
folder_indentation="8"
item_height="20"
item_top_pad="4"
diff --git a/indra/newview/skins/default/xui/en/widgets/folder_view_item.xml b/indra/newview/skins/default/xui/en/widgets/folder_view_item.xml
index 1bcd8886b4..50c5285e04 100644
--- a/indra/newview/skins/default/xui/en/widgets/folder_view_item.xml
+++ b/indra/newview/skins/default/xui/en/widgets/folder_view_item.xml
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<folder_view_item
folder_arrow_image="Folder_Arrow"
- favorite_image="Favorite_Star_Active"
- favorite_content_image="Favorite_Star_Off"
+ favorite_image="Inv_Favorite_Star_Full"
+ favorite_content_image="Inv_Favorite_Star_Content"
folder_indentation="8"
item_height="20"
item_top_pad="4"
diff --git a/indra/newview/skins/default/xui/en/widgets/inbox_folder_view_folder.xml b/indra/newview/skins/default/xui/en/widgets/inbox_folder_view_folder.xml
index 8f9017f9ce..865c145022 100644
--- a/indra/newview/skins/default/xui/en/widgets/inbox_folder_view_folder.xml
+++ b/indra/newview/skins/default/xui/en/widgets/inbox_folder_view_folder.xml
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<inbox_folder_view_folder
folder_arrow_image="Folder_Arrow"
- favorite_image="Favorite_Star_Active"
- favorite_content_image="Favorite_Star_Off"
+ favorite_image="Inv_Favorite_Star_Full"
+ favorite_content_image="Inv_Favorite_Star_Content"
folder_indentation="8"
item_height="20"
item_top_pad="4"