From bd4ad607ba9015c97a013d734b1fa597924c0e07 Mon Sep 17 00:00:00 2001 From: Loren Shih Date: Thu, 3 Dec 2009 11:20:21 -0500 Subject: EXT-2410 : Accepting an offered notecard should open the inventorySP Preliminary checkin to improve this infrastructure. --HG-- branch : avatar-pipeline --- indra/newview/llinventorypanel.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'indra/newview/llinventorypanel.cpp') diff --git a/indra/newview/llinventorypanel.cpp b/indra/newview/llinventorypanel.cpp index 88e7196ce6..938114ade0 100644 --- a/indra/newview/llinventorypanel.cpp +++ b/indra/newview/llinventorypanel.cpp @@ -547,7 +547,7 @@ void LLInventoryPanel::buildNewViews(const LLUUID& id) cat_iter != categories->end(); ++cat_iter) { - const LLInventoryCategory* cat = (*cat_iter); + const LLViewerInventoryCategory* cat = (*cat_iter); buildNewViews(cat->getUUID()); } } @@ -558,7 +558,7 @@ void LLInventoryPanel::buildNewViews(const LLUUID& id) item_iter != items->end(); ++item_iter) { - const LLInventoryItem* item = (*item_iter); + const LLViewerInventoryItem* item = (*item_iter); buildNewViews(item->getUUID()); } } @@ -857,7 +857,7 @@ void LLInventoryPanel::dumpSelectionInformation(void* user_data) } // static -LLInventoryPanel* LLInventoryPanel::getActiveInventoryPanel() +LLInventoryPanel* LLInventoryPanel::getActiveInventoryPanel(BOOL auto_open) { LLInventoryPanel* res = NULL; @@ -879,7 +879,7 @@ LLInventoryPanel* LLInventoryPanel::getActiveInventoryPanel() } // Otherwise, open the inventorySP and use that. - if (!res) + if (!res && auto_open) { LLSD key; LLSidepanelInventory *sidepanel_inventory = -- cgit v1.2.3 From e23d51700733e98f966c540602038686cba98d4e Mon Sep 17 00:00:00 2001 From: Loren Shih Date: Thu, 3 Dec 2009 14:06:08 -0500 Subject: EXT-2410 : Accepting an offered notecard should open the inventorySP Added logic to choose the side panel if it's open, or open the side panel if no other inventory panels are open. --HG-- branch : avatar-pipeline --- indra/newview/llinventorypanel.cpp | 50 ++++++++++++++++++++++++-------------- 1 file changed, 32 insertions(+), 18 deletions(-) (limited to 'indra/newview/llinventorypanel.cpp') diff --git a/indra/newview/llinventorypanel.cpp b/indra/newview/llinventorypanel.cpp index 938114ade0..c13ae7726b 100644 --- a/indra/newview/llinventorypanel.cpp +++ b/indra/newview/llinventorypanel.cpp @@ -856,14 +856,31 @@ void LLInventoryPanel::dumpSelectionInformation(void* user_data) iv->mFolders->dumpSelectionInformation(); } +BOOL is_inventorysp_active() +{ + if (!LLSideTray::getInstance()->isPanelActive("sidepanel_inventory")) return FALSE; + LLSidepanelInventory *inventorySP = dynamic_cast(LLSideTray::getInstance()->getPanel("sidepanel_inventory")); + if (!inventorySP) return FALSE; + return inventorySP->isMainInventoryPanelActive(); +} + // static LLInventoryPanel* LLInventoryPanel::getActiveInventoryPanel(BOOL auto_open) { - LLInventoryPanel* res = NULL; - - // Iterate through the inventory floaters and return whichever is on top. + // A. If the inventory side panel is open, use that preferably. + if (is_inventorysp_active()) + { + LLSidepanelInventory *inventorySP = dynamic_cast(LLSideTray::getInstance()->getPanel("sidepanel_inventory")); + if (inventorySP) + { + return inventorySP->getActivePanel(); + } + } + + // B. Iterate through the inventory floaters and return whichever is on top. LLFloaterReg::const_instance_list_t& inst_list = LLFloaterReg::getFloaterList("inventory"); S32 z_min = S32_MAX; + LLInventoryPanel* res = NULL; for (LLFloaterReg::const_instance_list_t::const_iterator iter = inst_list.begin(); iter != inst_list.end(); ++iter) { LLFloaterInventory* iv = dynamic_cast(*iter); @@ -877,22 +894,19 @@ LLInventoryPanel* LLInventoryPanel::getActiveInventoryPanel(BOOL auto_open) } } } - - // Otherwise, open the inventorySP and use that. - if (!res && auto_open) + if (res) return res; + + // C. If no panels are open and we don't want to force open a panel, then just abort out. + if (!auto_open) return NULL; + + // D. Open the inventory side panel and use that. + LLSD key; + LLSidepanelInventory *sidepanel_inventory = + dynamic_cast(LLSideTray::getInstance()->showPanel("sidepanel_inventory", key)); + if (sidepanel_inventory) { - LLSD key; - LLSidepanelInventory *sidepanel_inventory = - dynamic_cast(LLSideTray::getInstance()->showPanel("sidepanel_inventory", key)); - if (sidepanel_inventory) - { - res = sidepanel_inventory->getActivePanel(); - if (res) - { - return res; - } - } + return sidepanel_inventory->getActivePanel(); } - return res; + return NULL; } -- cgit v1.2.3 From 0f2f846a12936991f0434d5aac50c850d76ce2a4 Mon Sep 17 00:00:00 2001 From: Loren Shih Date: Thu, 3 Dec 2009 20:50:21 -0500 Subject: EXT-3125 : INFRASTRUCTURE : Cleanup LLInventoryFilter to disambiguate various filter options EXT-3124 : Add lookup for finding all linked items to an item LLInventoryFilter cleanup, including adding ability to lookup item by UUID. --HG-- branch : avatar-pipeline --- indra/newview/llinventorypanel.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'indra/newview/llinventorypanel.cpp') diff --git a/indra/newview/llinventorypanel.cpp b/indra/newview/llinventorypanel.cpp index c13ae7726b..53b78ad438 100644 --- a/indra/newview/llinventorypanel.cpp +++ b/indra/newview/llinventorypanel.cpp @@ -207,9 +207,9 @@ LLInventoryFilter* LLInventoryPanel::getFilter() return NULL; } -void LLInventoryPanel::setFilterTypes(U64 filter_types, BOOL filter_for_categories) +void LLInventoryPanel::setFilterTypes(U64 types, LLInventoryFilter::EFilterType filter_type) { - mFolders->getFilter()->setFilterTypes(filter_types, filter_for_categories); + mFolders->getFilter()->setFilterTypes(types, filter_type); } void LLInventoryPanel::setFilterPermMask(PermissionMask filter_perm_mask) -- cgit v1.2.3 From 71cd24b4799f8bc0bed2665cca103c39fec3a965 Mon Sep 17 00:00:00 2001 From: Loren Shih Date: Thu, 3 Dec 2009 21:32:03 -0500 Subject: EXT-3124 : Add lookup for finding all linked items to an item Added ability to filter by UUID. Work in progress. --HG-- branch : avatar-pipeline --- indra/newview/llinventorypanel.cpp | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'indra/newview/llinventorypanel.cpp') diff --git a/indra/newview/llinventorypanel.cpp b/indra/newview/llinventorypanel.cpp index 53b78ad438..932c72f4cb 100644 --- a/indra/newview/llinventorypanel.cpp +++ b/indra/newview/llinventorypanel.cpp @@ -169,7 +169,7 @@ BOOL LLInventoryPanel::postBuild() { setSortOrder(gSavedSettings.getU32(DEFAULT_SORT_ORDER)); } - mFolders->setSortOrder(mFolders->getFilter()->getSortOrder()); + mFolders->setSortOrder(getFilter()->getSortOrder()); return TRUE; } @@ -209,23 +209,23 @@ LLInventoryFilter* LLInventoryPanel::getFilter() void LLInventoryPanel::setFilterTypes(U64 types, LLInventoryFilter::EFilterType filter_type) { - mFolders->getFilter()->setFilterTypes(types, filter_type); + getFilter()->setFilterTypes(types, filter_type); } void LLInventoryPanel::setFilterPermMask(PermissionMask filter_perm_mask) { - mFolders->getFilter()->setFilterPermissions(filter_perm_mask); + getFilter()->setFilterPermissions(filter_perm_mask); } void LLInventoryPanel::setFilterSubString(const std::string& string) { - mFolders->getFilter()->setFilterSubString(string); + getFilter()->setFilterSubString(string); } void LLInventoryPanel::setSortOrder(U32 order) { - mFolders->getFilter()->setSortOrder(order); - if (mFolders->getFilter()->isModified()) + getFilter()->setSortOrder(order); + if (getFilter()->isModified()) { mFolders->setSortOrder(order); // try to keep selection onscreen, even if it wasn't to start with @@ -235,22 +235,22 @@ void LLInventoryPanel::setSortOrder(U32 order) void LLInventoryPanel::setSinceLogoff(BOOL sl) { - mFolders->getFilter()->setDateRangeLastLogoff(sl); + getFilter()->setDateRangeLastLogoff(sl); } void LLInventoryPanel::setHoursAgo(U32 hours) { - mFolders->getFilter()->setHoursAgo(hours); + getFilter()->setHoursAgo(hours); } void LLInventoryPanel::setShowFolderState(LLInventoryFilter::EFolderShow show) { - mFolders->getFilter()->setShowFolderState(show); + getFilter()->setShowFolderState(show); } LLInventoryFilter::EFolderShow LLInventoryPanel::getShowFolderState() { - return mFolders->getFilter()->getShowFolderState(); + return getFilter()->getShowFolderState(); } void LLInventoryPanel::modelChanged(U32 mask) @@ -845,7 +845,7 @@ bool LLInventoryPanel::attachObject(const LLSD& userdata) BOOL LLInventoryPanel::getSinceLogoff() { - return mFolders->getFilter()->isSinceLogoff(); + return getFilter()->isSinceLogoff(); } // DEBUG ONLY -- cgit v1.2.3 From 9b89325cc9a02c3305eb32148cc8de7dccf8808b Mon Sep 17 00:00:00 2001 From: Loren Shih Date: Fri, 4 Dec 2009 11:42:17 -0500 Subject: EXT-3124 : Add lookup for finding all linked items to an item Filter now works correctly. Made some naming changes (e.g. setFilterType -> setFilterObjectType) so that what you choose to filter by is more explicit. --HG-- branch : avatar-pipeline --- indra/newview/llinventorypanel.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'indra/newview/llinventorypanel.cpp') diff --git a/indra/newview/llinventorypanel.cpp b/indra/newview/llinventorypanel.cpp index 932c72f4cb..54f528de8d 100644 --- a/indra/newview/llinventorypanel.cpp +++ b/indra/newview/llinventorypanel.cpp @@ -209,8 +209,11 @@ LLInventoryFilter* LLInventoryPanel::getFilter() void LLInventoryPanel::setFilterTypes(U64 types, LLInventoryFilter::EFilterType filter_type) { - getFilter()->setFilterTypes(types, filter_type); -} + if (filter_type == LLInventoryFilter::FILTERTYPE_OBJECT) + getFilter()->setFilterObjectTypes(types); + if (filter_type == LLInventoryFilter::FILTERTYPE_CATEGORY) + getFilter()->setFilterCategoryTypes(types); +} void LLInventoryPanel::setFilterPermMask(PermissionMask filter_perm_mask) { -- cgit v1.2.3 From 86c686e962a6fb7e282a0652eaff2b107c48a02d Mon Sep 17 00:00:00 2001 From: Sergei Litovchuk Date: Mon, 7 Dec 2009 20:31:45 +0200 Subject: Fix for major bug EXT-3135 "Crash after dragging LM from 'Inventory' accordion to fav bar". - Added method to get currently active tab in sidetray. - Disabled opening sidetray inventory panel upon receiving new inventory item or after drag-n-drop operations with landmarks in sidetray places panel. --HG-- branch : product-engine --- indra/newview/llinventorypanel.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'indra/newview/llinventorypanel.cpp') diff --git a/indra/newview/llinventorypanel.cpp b/indra/newview/llinventorypanel.cpp index baa659df7c..b89a8bfd7d 100644 --- a/indra/newview/llinventorypanel.cpp +++ b/indra/newview/llinventorypanel.cpp @@ -881,10 +881,13 @@ LLInventoryPanel* LLInventoryPanel::getActiveInventoryPanel() // Otherwise, open the inventorySP and use that. if (!res) { - LLSD key; + LLSideTray *side_tray = LLSideTray::getInstance(); LLSidepanelInventory *sidepanel_inventory = - dynamic_cast(LLSideTray::getInstance()->showPanel("sidepanel_inventory", key)); - if (sidepanel_inventory) + dynamic_cast(side_tray->getPanel("sidepanel_inventory")); + + // Use the inventory side panel only if it is already active. + // Activating it may unexpectedly switch off the currently active tab in some cases. + if (sidepanel_inventory && (LLPanel*)side_tray->getActiveTab() == (LLPanel*)sidepanel_inventory) { res = sidepanel_inventory->getActivePanel(); if (res) -- cgit v1.2.3 From 5245fb69721bf4b70de85211da6721b0e0137e07 Mon Sep 17 00:00:00 2001 From: Steve Bennetts Date: Mon, 7 Dec 2009 17:07:52 -0800 Subject: merge fixes --- indra/newview/llinventorypanel.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'indra/newview/llinventorypanel.cpp') diff --git a/indra/newview/llinventorypanel.cpp b/indra/newview/llinventorypanel.cpp index bf70bb66fa..4cbf27b725 100644 --- a/indra/newview/llinventorypanel.cpp +++ b/indra/newview/llinventorypanel.cpp @@ -903,6 +903,7 @@ LLInventoryPanel* LLInventoryPanel::getActiveInventoryPanel(BOOL auto_open) if (!auto_open) return NULL; // D. Open the inventory side panel and use that. + LLSideTray *side_tray = LLSideTray::getInstance(); LLSidepanelInventory *sidepanel_inventory = dynamic_cast(side_tray->getPanel("sidepanel_inventory")); -- cgit v1.2.3