From 6fb3b50a29b03fb416db81a1871658219a9279b9 Mon Sep 17 00:00:00 2001 From: Mnikolenko Productengine Date: Thu, 16 Nov 2017 18:11:38 +0200 Subject: MAINT-8006 FIXED The items from 'Received items' panel are not displayed in 'Worn' tab --- indra/newview/llinventorypanel.cpp | 31 ++++--------------------------- 1 file changed, 4 insertions(+), 27 deletions(-) (limited to 'indra/newview/llinventorypanel.cpp') diff --git a/indra/newview/llinventorypanel.cpp b/indra/newview/llinventorypanel.cpp index d610b920b9..798434a257 100644 --- a/indra/newview/llinventorypanel.cpp +++ b/indra/newview/llinventorypanel.cpp @@ -1376,38 +1376,15 @@ void LLInventoryPanel::openInventoryPanelAndSetSelection(BOOL auto_open, const L if (active_panel) { LL_DEBUGS("Messaging") << "Highlighting" << obj_id << LL_ENDL; - - LLViewerInventoryItem * item = gInventory.getItem(obj_id); - LLViewerInventoryCategory * cat = gInventory.getCategory(obj_id); - - bool in_inbox = false; - - LLViewerInventoryCategory * parent_cat = NULL; - - if (item) - { - parent_cat = gInventory.getCategory(item->getParentUUID()); - } - else if (cat) - { - parent_cat = gInventory.getCategory(cat->getParentUUID()); - } - - if (parent_cat) - { - in_inbox = (LLFolderType::FT_INBOX == parent_cat->getPreferredType()); - } + + bool in_inbox = (gInventory.isObjectDescendentOf(obj_id, gInventory.findCategoryUUIDForType(LLFolderType::FT_INBOX))); if (in_inbox) { LLSidepanelInventory * sidepanel_inventory = LLFloaterSidePanelContainer::getPanel("inventory"); LLInventoryPanel * inventory_panel = NULL; - - if (in_inbox) - { - sidepanel_inventory->openInbox(); - inventory_panel = sidepanel_inventory->getInboxPanel(); - } + sidepanel_inventory->openInbox(); + inventory_panel = sidepanel_inventory->getInboxPanel(); if (inventory_panel) { -- cgit v1.3 From 667f2fedef33b6fb217939290e6b097d7447de92 Mon Sep 17 00:00:00 2001 From: Mnikolenko Productengine Date: Fri, 17 Nov 2017 17:21:25 +0200 Subject: MAINT-8013 FIXED Unnecessary tab change after using 'Show in Main panel' for items from 'Received items' panel --- indra/newview/llinventorypanel.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'indra/newview/llinventorypanel.cpp') diff --git a/indra/newview/llinventorypanel.cpp b/indra/newview/llinventorypanel.cpp index 798434a257..6e7f62d84a 100644 --- a/indra/newview/llinventorypanel.cpp +++ b/indra/newview/llinventorypanel.cpp @@ -1367,7 +1367,9 @@ LLInventoryPanel* LLInventoryPanel::getActiveInventoryPanel(BOOL auto_open) void LLInventoryPanel::openInventoryPanelAndSetSelection(BOOL auto_open, const LLUUID& obj_id, BOOL main_panel) { LLInventoryPanel *active_panel; - if (main_panel) + bool in_inbox = (gInventory.isObjectDescendentOf(obj_id, gInventory.findCategoryUUIDForType(LLFolderType::FT_INBOX))); + + if (main_panel && !in_inbox) { LLFloaterSidePanelContainer::getPanel("inventory")->selectAllItemsPanel(); } @@ -1377,8 +1379,6 @@ void LLInventoryPanel::openInventoryPanelAndSetSelection(BOOL auto_open, const L { LL_DEBUGS("Messaging") << "Highlighting" << obj_id << LL_ENDL; - bool in_inbox = (gInventory.isObjectDescendentOf(obj_id, gInventory.findCategoryUUIDForType(LLFolderType::FT_INBOX))); - if (in_inbox) { LLSidepanelInventory * sidepanel_inventory = LLFloaterSidePanelContainer::getPanel("inventory"); -- cgit v1.3 From b44e479893a1d000886a65bec5161f447e6a325a Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Mon, 4 Dec 2017 19:04:09 +0200 Subject: MAINT-7993 Fixed on uploading inventory will show up but won't display uploaded item --- indra/newview/llinventorypanel.cpp | 11 ++++++++--- indra/newview/llinventorypanel.h | 8 ++++++-- indra/newview/llmeshrepository.cpp | 16 +++++++++++----- indra/newview/llviewerassetupload.cpp | 15 ++++++++++----- 4 files changed, 35 insertions(+), 15 deletions(-) (limited to 'indra/newview/llinventorypanel.cpp') diff --git a/indra/newview/llinventorypanel.cpp b/indra/newview/llinventorypanel.cpp index 6e7f62d84a..83a8678c86 100644 --- a/indra/newview/llinventorypanel.cpp +++ b/indra/newview/llinventorypanel.cpp @@ -1364,7 +1364,7 @@ LLInventoryPanel* LLInventoryPanel::getActiveInventoryPanel(BOOL auto_open) } //static -void LLInventoryPanel::openInventoryPanelAndSetSelection(BOOL auto_open, const LLUUID& obj_id, BOOL main_panel) +void LLInventoryPanel::openInventoryPanelAndSetSelection(BOOL auto_open, const LLUUID& obj_id, BOOL main_panel, BOOL take_keyboard_focus, BOOL reset_filter) { LLInventoryPanel *active_panel; bool in_inbox = (gInventory.isObjectDescendentOf(obj_id, gInventory.findCategoryUUIDForType(LLFolderType::FT_INBOX))); @@ -1379,6 +1379,11 @@ void LLInventoryPanel::openInventoryPanelAndSetSelection(BOOL auto_open, const L { LL_DEBUGS("Messaging") << "Highlighting" << obj_id << LL_ENDL; + if (reset_filter) + { + reset_inventory_filter(); + } + if (in_inbox) { LLSidepanelInventory * sidepanel_inventory = LLFloaterSidePanelContainer::getPanel("inventory"); @@ -1388,7 +1393,7 @@ void LLInventoryPanel::openInventoryPanelAndSetSelection(BOOL auto_open, const L if (inventory_panel) { - inventory_panel->setSelection(obj_id, TAKE_FOCUS_YES); + inventory_panel->setSelection(obj_id, take_keyboard_focus); } } else @@ -1398,7 +1403,7 @@ void LLInventoryPanel::openInventoryPanelAndSetSelection(BOOL auto_open, const L { floater_inventory->setFocus(TRUE); } - active_panel->setSelection(obj_id, TAKE_FOCUS_YES); + active_panel->setSelection(obj_id, take_keyboard_focus); } } } diff --git a/indra/newview/llinventorypanel.h b/indra/newview/llinventorypanel.h index d849647bb6..ace0ea7f42 100644 --- a/indra/newview/llinventorypanel.h +++ b/indra/newview/llinventorypanel.h @@ -220,8 +220,12 @@ public: // Find whichever inventory panel is active / on top. // "Auto_open" determines if we open an inventory panel if none are open. static LLInventoryPanel *getActiveInventoryPanel(BOOL auto_open = TRUE); - - static void openInventoryPanelAndSetSelection(BOOL auto_open, const LLUUID& obj_id, BOOL main_panel = FALSE); + + static void openInventoryPanelAndSetSelection(BOOL auto_open, + const LLUUID& obj_id, + BOOL main_panel = FALSE, + BOOL take_keyboard_focus = TAKE_FOCUS_YES, + BOOL reset_filter = FALSE); void addItemID(const LLUUID& id, LLFolderViewItem* itemp); void removeItemID(const LLUUID& id); diff --git a/indra/newview/llmeshrepository.cpp b/indra/newview/llmeshrepository.cpp index 850a25107f..29a4ad001a 100644 --- a/indra/newview/llmeshrepository.cpp +++ b/indra/newview/llmeshrepository.cpp @@ -4840,26 +4840,32 @@ void on_new_single_inventory_upload_complete( gInventory.notifyObservers(); success = true; + LLFocusableElement* focus = gFocusMgr.getKeyboardFocus(); + // Show the preview panel for textures and sounds to let // user know that the image (or snapshot) arrived intact. - LLInventoryPanel* panel = LLInventoryPanel::getActiveInventoryPanel(); + LLInventoryPanel* panel = LLInventoryPanel::getActiveInventoryPanel(FALSE); if (panel) { - LLFocusableElement* focus = gFocusMgr.getKeyboardFocus(); panel->setSelection( server_response["new_inventory_item"].asUUID(), TAKE_FOCUS_NO); - - // restore keyboard focus - gFocusMgr.setKeyboardFocus(focus); } + else + { + LLInventoryPanel::openInventoryPanelAndSetSelection(TRUE, server_response["new_inventory_item"].asUUID(), TRUE, TAKE_FOCUS_NO, TRUE); + } + + // restore keyboard focus + gFocusMgr.setKeyboardFocus(focus); } else { LL_WARNS() << "Can't find a folder to put it in" << LL_ENDL; } + // Todo: This is mesh repository code, is following code really needed? // remove the "Uploading..." message LLUploadDialog::modalUploadFinished(); diff --git a/indra/newview/llviewerassetupload.cpp b/indra/newview/llviewerassetupload.cpp index 01b4fcfbe1..4f68c9a98e 100644 --- a/indra/newview/llviewerassetupload.cpp +++ b/indra/newview/llviewerassetupload.cpp @@ -760,17 +760,22 @@ void LLViewerAssetUpload::AssetInventoryUploadCoproc(LLCoreHttpUtil::HttpCorouti { success = true; + LLFocusableElement* focus = gFocusMgr.getKeyboardFocus(); + // Show the preview panel for textures and sounds to let // user know that the image (or snapshot) arrived intact. - LLInventoryPanel* panel = LLInventoryPanel::getActiveInventoryPanel(); + LLInventoryPanel* panel = LLInventoryPanel::getActiveInventoryPanel(FALSE); if (panel) { - LLFocusableElement* focus = gFocusMgr.getKeyboardFocus(); panel->setSelection(serverInventoryItem, TAKE_FOCUS_NO); - - // restore keyboard focus - gFocusMgr.setKeyboardFocus(focus); } + else + { + LLInventoryPanel::openInventoryPanelAndSetSelection(TRUE, serverInventoryItem, TRUE, TAKE_FOCUS_NO, TRUE); + } + + // restore keyboard focus + gFocusMgr.setKeyboardFocus(focus); } else { -- cgit v1.3 From 9db2de69f15723518b7129dd198332520e958b85 Mon Sep 17 00:00:00 2001 From: Mnikolenko Productengine Date: Wed, 13 Dec 2017 12:47:25 +0200 Subject: MAINT-8061 Consider including folder count along with object count --- indra/newview/llinventorybridge.cpp | 18 +++++++- indra/newview/llinventorybridge.h | 3 ++ indra/newview/llinventorypanel.cpp | 50 ++++++++++++++++++++++ indra/newview/llinventorypanel.h | 2 + indra/newview/llpanelmaininventory.cpp | 10 +++++ indra/newview/llpanelmaininventory.h | 6 ++- .../skins/default/xui/en/panel_main_inventory.xml | 9 ++-- 7 files changed, 90 insertions(+), 8 deletions(-) (limited to 'indra/newview/llinventorypanel.cpp') diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 4d1a6451e5..77c77023b1 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -2213,8 +2213,22 @@ std::string LLFolderBridge::getLabelSuffix() const { return llformat(" ( %s ) ", LLTrans::getString("LoadingData").c_str()); } - - return LLInvFVBridge::getLabelSuffix(); + std::string suffix = ""; + if(mShowDescendantsCount) + { + LLInventoryModel::cat_array_t cat_array; + LLInventoryModel::item_array_t item_array; + gInventory.collectDescendents(getUUID(), cat_array, item_array, TRUE); + S32 count = item_array.size(); + if(count > 0) + { + std::ostringstream oss; + oss << count; + suffix = " ( " + oss.str() + " Items )"; + } + } + + return LLInvFVBridge::getLabelSuffix() + suffix; } LLFontGL::StyleFlags LLFolderBridge::getLabelStyle() const diff --git a/indra/newview/llinventorybridge.h b/indra/newview/llinventorybridge.h index fd532c609c..8fa15c082b 100644 --- a/indra/newview/llinventorybridge.h +++ b/indra/newview/llinventorybridge.h @@ -293,6 +293,8 @@ public: virtual std::string getLabelSuffix() const; virtual LLFontGL::StyleFlags getLabelStyle() const; + void setShowDescendantsCount(bool show_count) {mShowDescendantsCount = show_count;} + virtual BOOL renameItem(const std::string& new_name); virtual BOOL removeItem(); @@ -373,6 +375,7 @@ protected: bool mCallingCards; bool mWearables; bool mIsLoading; + bool mShowDescendantsCount; LLTimer mTimeSinceRequestStart; std::string mMessage; LLRootHandle mHandle; diff --git a/indra/newview/llinventorypanel.cpp b/indra/newview/llinventorypanel.cpp index 83a8678c86..2762c7af82 100644 --- a/indra/newview/llinventorypanel.cpp +++ b/indra/newview/llinventorypanel.cpp @@ -1110,6 +1110,56 @@ void LLInventoryPanel::onSelectionChange(const std::deque& it fv->startRenamingSelectedItem(); } } + + std::set selected_items = mFolderRoot.get()->getSelectionList(); + LLFolderViewItem* prev_folder_item = getItemByID(mPreviousSelectedFolder); + + if (selected_items.size() == 1) + { + std::set::const_iterator iter = selected_items.begin(); + LLFolderViewItem* folder_item = (*iter); + if(folder_item && (folder_item != prev_folder_item)) + { + LLFolderViewModelItemInventory* fve_listener = static_cast(folder_item->getViewModelItem()); + if (fve_listener && (fve_listener->getInventoryType() == LLInventoryType::IT_CATEGORY)) + { + if(prev_folder_item) + { + LLFolderBridge* prev_bridge = (LLFolderBridge*)prev_folder_item->getViewModelItem(); + if(prev_bridge) + { + prev_bridge->clearDisplayName(); + prev_bridge->setShowDescendantsCount(false); + prev_folder_item->refresh(); + } + } + + LLFolderBridge* bridge = (LLFolderBridge*)folder_item->getViewModelItem(); + if(bridge) + { + bridge->clearDisplayName(); + bridge->setShowDescendantsCount(true); + folder_item->refresh(); + mPreviousSelectedFolder = bridge->getUUID(); + } + } + } + } + else + { + if(prev_folder_item) + { + LLFolderBridge* prev_bridge = (LLFolderBridge*)prev_folder_item->getViewModelItem(); + if(prev_bridge) + { + prev_bridge->clearDisplayName(); + prev_bridge->setShowDescendantsCount(false); + prev_folder_item->refresh(); + } + } + mPreviousSelectedFolder = LLUUID(); + } + } void LLInventoryPanel::doCreate(const LLSD& userdata) diff --git a/indra/newview/llinventorypanel.h b/indra/newview/llinventorypanel.h index ace0ea7f42..3829fb734d 100644 --- a/indra/newview/llinventorypanel.h +++ b/indra/newview/llinventorypanel.h @@ -258,6 +258,8 @@ protected: LLHandle mFolderRoot; LLScrollContainer* mScroller; + LLUUID mPreviousSelectedFolder; + LLFolderViewModelInventory mInventoryViewModel; LLPointer mGroupedItemBridge; Params mParams; // stored copy of parameter block diff --git a/indra/newview/llpanelmaininventory.cpp b/indra/newview/llpanelmaininventory.cpp index b004226bd5..db9d61c637 100644 --- a/indra/newview/llpanelmaininventory.cpp +++ b/indra/newview/llpanelmaininventory.cpp @@ -708,8 +708,17 @@ void LLPanelMainInventory::updateItemcountText() LLResMgr::getInstance()->getIntegerString(mItemCountString, mItemCount); } + if(mCategoryCount != gInventory.getCategoryCount()) + { + mCategoryCount = gInventory.getCategoryCount(); + mCategoryCountString = ""; + LLLocale locale(LLLocale::USER_LOCALE); + LLResMgr::getInstance()->getIntegerString(mCategoryCountString, mCategoryCount); + } + LLStringUtil::format_map_t string_args; string_args["[ITEM_COUNT]"] = mItemCountString; + string_args["[CATEGORY_COUNT]"] = mCategoryCountString; string_args["[FILTER]"] = getFilterText(); std::string text = ""; @@ -728,6 +737,7 @@ void LLPanelMainInventory::updateItemcountText() } mCounterCtrl->setValue(text); + mCounterCtrl->setToolTip(text); } void LLPanelMainInventory::onFocusReceived() diff --git a/indra/newview/llpanelmaininventory.h b/indra/newview/llpanelmaininventory.h index 2904d5de76..732a3b04e3 100644 --- a/indra/newview/llpanelmaininventory.h +++ b/indra/newview/llpanelmaininventory.h @@ -132,7 +132,7 @@ private: LLFilterEditor* mFilterEditor; LLTabContainer* mFilterTabs; - LLUICtrl* mCounterCtrl; + LLUICtrl* mCounterCtrl; LLHandle mFinderHandle; LLInventoryPanel* mActivePanel; LLInventoryPanel* mWornItemsPanel; @@ -141,7 +141,9 @@ private: std::string mFilterText; std::string mFilterSubString; S32 mItemCount; - std::string mItemCountString; + std::string mItemCountString; + S32 mCategoryCount; + std::string mCategoryCountString; LLComboBox* mSearchTypeCombo; diff --git a/indra/newview/skins/default/xui/en/panel_main_inventory.xml b/indra/newview/skins/default/xui/en/panel_main_inventory.xml index df70398599..d77fbdec0a 100644 --- a/indra/newview/skins/default/xui/en/panel_main_inventory.xml +++ b/indra/newview/skins/default/xui/en/panel_main_inventory.xml @@ -13,26 +13,27 @@ - Fetching [ITEM_COUNT] Items... [FILTER] + Fetching [ITEM_COUNT] Items and [CATEGORY_COUNT] Folders... [FILTER] - [ITEM_COUNT] Items [FILTER] + [ITEM_COUNT] Items and [CATEGORY_COUNT] Folders [FILTER] - Fetched [ITEM_COUNT] Items [FILTER] + Fetched [ITEM_COUNT] Items and [CATEGORY_COUNT] Folders [FILTER] Items: -- cgit v1.3 From de8ff2c7b397f22d1e15b21e7553a8c3e3933d45 Mon Sep 17 00:00:00 2001 From: Mnikolenko Productengine Date: Wed, 20 Dec 2017 17:01:47 +0200 Subject: MAINT-8061 update folder label when item count changes --- indra/newview/llinventorypanel.cpp | 29 +++++++++++++++++++++++++++++ indra/newview/llinventorypanel.h | 2 ++ 2 files changed, 31 insertions(+) (limited to 'indra/newview/llinventorypanel.cpp') diff --git a/indra/newview/llinventorypanel.cpp b/indra/newview/llinventorypanel.cpp index 2762c7af82..93269db380 100644 --- a/indra/newview/llinventorypanel.cpp +++ b/indra/newview/llinventorypanel.cpp @@ -563,6 +563,7 @@ void LLInventoryPanel::modelChanged(U32 mask) { setSelection(item_id, FALSE); } + updateFolderLabel(model_item->getParentUUID()); } ////////////////////////////// @@ -574,6 +575,7 @@ void LLInventoryPanel::modelChanged(U32 mask) // Don't process the item if it is the root if (old_parent) { + LLFolderViewModelItemInventory* viewmodel_folder = static_cast(old_parent->getViewModelItem()); LLFolderViewFolder* new_parent = (LLFolderViewFolder*)getItemByID(model_item->getParentUUID()); // Item has been moved. if (old_parent != new_parent) @@ -591,6 +593,7 @@ void LLInventoryPanel::modelChanged(U32 mask) setSelection(item_id, FALSE); } } + updateFolderLabel(model_item->getParentUUID()); } else { @@ -602,6 +605,10 @@ void LLInventoryPanel::modelChanged(U32 mask) // doesn't include trash). Just remove the item's UI. view_item->destroyView(); } + if(viewmodel_folder) + { + updateFolderLabel(viewmodel_folder->getUUID()); + } old_parent->getViewModelItem()->dirtyDescendantsFilter(); } } @@ -619,6 +626,11 @@ void LLInventoryPanel::modelChanged(U32 mask) if(parent) { parent->getViewModelItem()->dirtyDescendantsFilter(); + LLFolderViewModelItemInventory* viewmodel_folder = static_cast(parent->getViewModelItem()); + if(viewmodel_folder) + { + updateFolderLabel(viewmodel_folder->getUUID()); + } } } } @@ -1162,6 +1174,23 @@ void LLInventoryPanel::onSelectionChange(const std::deque& it } +void LLInventoryPanel::updateFolderLabel(const LLUUID& folder_id) +{ + if(folder_id != mPreviousSelectedFolder) return; + + LLFolderViewItem* folder_item = getItemByID(mPreviousSelectedFolder); + if(folder_item) + { + LLFolderBridge* bridge = (LLFolderBridge*)folder_item->getViewModelItem(); + if(bridge) + { + bridge->clearDisplayName(); + bridge->setShowDescendantsCount(true); + folder_item->refresh(); + } + } +} + void LLInventoryPanel::doCreate(const LLSD& userdata) { reset_inventory_filter(); diff --git a/indra/newview/llinventorypanel.h b/indra/newview/llinventorypanel.h index 3829fb734d..12001f5a2b 100644 --- a/indra/newview/llinventorypanel.h +++ b/indra/newview/llinventorypanel.h @@ -209,6 +209,8 @@ public: bool attachObject(const LLSD& userdata); static void idle(void* user_data); + void updateFolderLabel(const LLUUID& folder_id); + // DEBUG ONLY: static void dumpSelectionInformation(void* user_data); -- cgit v1.3