# Conflicts:
#	indra/llui/lllayoutstack.cpp
#	indra/newview/llinventorypanel.cpp
#	indra/newview/llpanelmaininventory.cpp
#	indra/newview/llpanelwearing.h
#	indra/newview/llviewermessage.cpp
master
Ansariel 2023-05-17 20:35:53 +02:00
commit 63df00d4e5
26 changed files with 323 additions and 71 deletions

View File

@ -260,13 +260,13 @@ public:
virtual void updateMenu();
void finishRenamingItem( void );
void updateRenamerPosition();
// Note: We may eventually have to move that method up the hierarchy to LLFolderViewItem.
LLHandle<LLFolderView> getHandle() const { return getDerivedHandle<LLFolderView>(); }
private:
void updateMenuOptions(LLMenuGL* menu);
void updateRenamerPosition();
protected:
LLScrollContainer* mScrollContainer; // NULL if this is not a child of a scroll container.

View File

@ -1884,6 +1884,11 @@ BOOL LLFolderViewFolder::isRemovable()
return TRUE;
}
void LLFolderViewFolder::destroyRoot()
{
delete this;
}
// this is an internal method used for adding items to folders.
void LLFolderViewFolder::addItem(LLFolderViewItem* item)
{

View File

@ -409,6 +409,7 @@ public:
// destroys this folder, and all children
virtual void destroyView();
void destroyRoot();
// whether known children are fully loaded (arrange sets to true)
virtual bool isFolderComplete() { return mIsFolderComplete; }

View File

@ -322,6 +322,17 @@ void LLLayoutStack::draw()
}
}
void LLLayoutStack::deleteAllChildren()
{
mPanels.clear();
LLView::deleteAllChildren();
// Not really needed since nothing is left to
// display, but for the sake of consistency
updateFractionalSizes();
mNeedsLayout = true;
}
void LLLayoutStack::removeChild(LLView* view)
{
LLLayoutPanel* embedded_panelp = findEmbeddedPanel(dynamic_cast<LLPanel*>(view));
@ -329,21 +340,20 @@ void LLLayoutStack::removeChild(LLView* view)
if (embedded_panelp)
{
mPanels.erase(std::find(mPanels.begin(), mPanels.end(), embedded_panelp));
// delete embedded_panelp; // <FS:Zi> Fix crash when removing layout panels from a stack
LLView::removeChild(view);
updateFractionalSizes();
mNeedsLayout = true;
}
LLView::removeChild(view);
// <FS:Zi> Fix crash when removing layout panels from a stack
if (embedded_panelp)
{
// only delete the panel after it was removed from LLView to prevent
// LLView::removeChild() to run into an already deleted pointer
// <FS:Zi> Fix crash when removing layout panels from a stack
// <FS:Ansariel> LL replaced "delete embedded_panelp;" with "LLView::removeChild(view);". AFAIK
// removeChild does not call delete, so we might exhibit a memory leak. Thus
// we leave this in place.
delete embedded_panelp;
// </FS:Zi>
}
// </FS:Zi>
else
{
LLView::removeChild(view);
}
}
BOOL LLLayoutStack::postBuild()

View File

@ -74,6 +74,7 @@ public:
virtual ~LLLayoutStack();
/*virtual*/ void draw();
/*virtual*/ void deleteAllChildren();
/*virtual*/ void removeChild(LLView*);
/*virtual*/ BOOL postBuild();
/*virtual*/ bool addChild(LLView* child, S32 tab_group = 0);

View File

@ -1914,6 +1914,13 @@ bool LLMenuGL::addContextChild(LLView* view, S32 tab_group)
return false;
}
void LLMenuGL::deleteAllChildren()
{
mItems.clear();
LLUICtrl::deleteAllChildren();
}
void LLMenuGL::removeChild( LLView* ctrl)
{
// previously a dynamic_cast with if statement to check validity

View File

@ -450,6 +450,7 @@ public:
/*virtual*/ void drawBackground(LLMenuItemGL* itemp, F32 alpha);
/*virtual*/ void setVisible(BOOL visible);
/*virtual*/ bool addChild(LLView* view, S32 tab_group = 0);
/*virtual*/ void deleteAllChildren();
/*virtual*/ void removeChild( LLView* ctrl);
/*virtual*/ BOOL postBuild();

View File

@ -361,7 +361,13 @@ bool LLView::addChild(LLView* child, S32 tab_group)
}
child->mParentView = this;
updateBoundingRect();
if (getVisible() && child->getVisible())
{
// if child isn't visible it won't affect bounding rect
// if current view is not visible it will be recalculated
// on visibility change
updateBoundingRect();
}
mLastTabGroup = tab_group;
return true;
}
@ -626,9 +632,12 @@ void LLView::deleteAllChildren()
while (!mChildList.empty())
{
LLView* viewp = mChildList.front();
delete viewp; // will remove the child from mChildList
LLView* viewp = mChildList.front();
viewp->mParentView = NULL;
delete viewp;
mChildList.pop_front();
}
updateBoundingRect();
}
void LLView::setAllChildrenEnabled(BOOL b)

View File

@ -5135,10 +5135,14 @@ void callAfterCOFFetch(nullary_func_t cb)
{
LLUUID cat_id = LLAppearanceMgr::instance().getCOF();
LLViewerInventoryCategory* cat = gInventory.getCategory(cat_id);
if (cat->getVersion() == LLViewerInventoryCategory::VERSION_UNKNOWN && AISAPI::isAvailable())
if (cat->getVersion() == LLViewerInventoryCategory::VERSION_UNKNOWN)
{
// Assume that we have no relevant cache. Fetch cof, and items cof's links point to.
AISAPI::FetchCOF([cb](const LLUUID& id)
if (AISAPI::isAvailable())
{
// Mark cof (update timer) so that background fetch won't request it
cat->setFetching(LLViewerInventoryCategory::FETCH_RECURSIVE);
// Assume that we have no relevant cache. Fetch cof, and items cof's links point to.
AISAPI::FetchCOF([cb](const LLUUID& id)
{
cb();
LLUUID cat_id = LLAppearanceMgr::instance().getCOF();
@ -5148,8 +5152,14 @@ void callAfterCOFFetch(nullary_func_t cb)
cat->setFetching(LLViewerInventoryCategory::FETCH_NONE);
}
});
// Mark it so that background fetch won't request it if it didn't already
cat->setFetching(LLViewerInventoryCategory::FETCH_RECURSIVE);
}
else
{
LL_WARNS() << "AIS API v3 not available, can't use AISAPI::FetchCOF" << LL_ENDL;
// startup should have marked folder as fetching, remove that
cat->setFetching(LLViewerInventoryCategory::FETCH_NONE);
callAfterCategoryFetch(cat_id, cb);
}
}
else
{

View File

@ -336,6 +336,7 @@ void LLFloaterChangeItemThumbnail::refreshFromObject(LLInventoryObject* obj)
LLViewerInventoryItem* item = dynamic_cast<LLViewerInventoryItem*>(obj);
if (item)
{
setTitle(getString("title_item_thumbnail"));
// This floater probably shouldn't be possible to open
// for imcomplete items
llassert(item->isFinished());
@ -349,6 +350,7 @@ void LLFloaterChangeItemThumbnail::refreshFromObject(LLInventoryObject* obj)
if (cat)
{
setTitle(getString("title_folder_thumbnail"));
icon_img = LLUI::getUIImage(LLViewerFolderType::lookupIconName(cat->getPreferredType(), true));
if (thumbnail_id.isNull() && (cat->getPreferredType() == LLFolderType::FT_OUTFIT))

View File

@ -103,7 +103,17 @@ LLFloater* LLFloaterSidePanelContainer::getTopmostInventoryFloater()
S32 z_min = S32_MAX;
LLFloaterReg::const_instance_list_t& inst_list = LLFloaterReg::getFloaterList("inventory");
for (LLFloaterReg::const_instance_list_t::const_iterator iter = inst_list.begin(); iter != inst_list.end(); ++iter)
// <FS:Ansariel> Fix for sharing inventory when multiple inventory floaters are open:
// For the secondary floaters, we have registered those as
// "secondary_inventory" in LLFloaterReg, so we have to add those
// instances to the instance list!
//for (LLFloaterReg::const_instance_list_t::const_iterator iter = inst_list.begin(); iter != inst_list.end(); ++iter)
LLFloaterReg::const_instance_list_t& inst_list_secondary = LLFloaterReg::getFloaterList("secondary_inventory");
LLFloaterReg::instance_list_t combined_list;
combined_list.insert(combined_list.end(), inst_list.begin(), inst_list.end());
combined_list.insert(combined_list.end(), inst_list_secondary.begin(), inst_list_secondary.end());
for (LLFloaterReg::instance_list_t::const_iterator iter = combined_list.begin(); iter != combined_list.end(); ++iter)
// </FS:Ansariel>
{
LLFloater* inventory_floater = (*iter);

View File

@ -47,6 +47,7 @@ public:
/*virtual*/ void onOpen(const LLSD& notification_id);
/*virtual*/ BOOL handleToolTip(S32 x, S32 y, MASK mask);
/*virtual*/ void deleteAllChildren();
/*virtual*/ void removeChild(LLView* child);
private:
void onToastDestroy(LLToast * toast);
@ -122,6 +123,12 @@ BOOL LLInspectToast::handleToolTip(S32 x, S32 y, MASK mask)
return LLFloater::handleToolTip(x, y, mask);
}
void LLInspectToast::deleteAllChildren()
{
mPanel = NULL;
LLInspect::deleteAllChildren();
}
// virtual
void LLInspectToast::removeChild(LLView* child)
{

View File

@ -45,6 +45,7 @@
#include "llfriendcard.h"
#include "llgesturemgr.h"
#include "llmarketplacefunctions.h"
#include "lloutfitobserver.h"
#include "lltrans.h"
#include "llviewerassettype.h"
#include "llviewermessage.h"
@ -244,8 +245,7 @@ void LLInventoryGallery::updateRootFolder()
}
}
const LLUUID cof = gInventory.findCategoryUUIDForType(LLFolderType::FT_CURRENT_OUTFIT);
mCategoriesObserver->addCategory(cof, boost::bind(&LLInventoryGallery::onCOFChanged, this));
LLOutfitObserver::instance().addCOFChangedCallback(boost::bind(&LLInventoryGallery::onCOFChanged, this));
if (!mGalleryCreated)
{
@ -882,6 +882,11 @@ void LLInventoryGallery::scrollToShowItem(const LLUUID& item_id)
}
}
LLInventoryGalleryItem* LLInventoryGallery::getSelectedItem()
{
return mItemMap[mSelectedItemID];
}
void LLInventoryGallery::updateMessageVisibility()
{
@ -1051,6 +1056,14 @@ void LLInventoryGallery::deselectItem(const LLUUID& category_id)
}
}
void LLInventoryGallery::clearSelection()
{
if(mSelectedItemID != LLUUID::null)
{
changeItemSelection(LLUUID::null);
}
}
void LLInventoryGallery::signalSelectionItemID(const LLUUID& category_id)
{
mSelectionChangeSignal(category_id);

View File

@ -116,6 +116,7 @@ public:
void computeDifference(const LLInventoryModel::cat_array_t vcats, const LLInventoryModel::item_array_t vitems, uuid_vec_t& vadded, uuid_vec_t& vremoved);
void deselectItem(const LLUUID& category_id);
void clearSelection();
void changeItemSelection(const LLUUID& item_id, bool scroll_to_selection = false);
void scrollToShowItem(const LLUUID& item_id);
void signalSelectionItemID(const LLUUID& category_id);
@ -129,6 +130,7 @@ public:
bool hasVisibleItems();
void handleModifiedFilter();
LLScrollContainer* getScrollableContainer() { return mScrollPanel; }
LLInventoryGalleryItem* getSelectedItem();
protected:

View File

@ -921,8 +921,17 @@ void LLInventoryModel::ensureCategoryForTypeExists(LLFolderType::EType preferred
LLStringUtil::null,
[preferred_type](const LLUUID &new_cat_id)
{
LL_DEBUGS("Inventory") << "Created category: " << new_cat_id
<< " for type: " << preferred_type << LL_ENDL;
if (new_cat_id.isNull())
{
LL_WARNS("Inventory")
<< "Failed to create folder of type " << preferred_type
<< LL_ENDL;
}
else
{
LL_DEBUGS("Inventory") << "Created category: " << new_cat_id
<< " for type: " << preferred_type << LL_ENDL;
}
}
);
}
@ -965,7 +974,10 @@ const LLUUID LLInventoryModel::findCategoryUUIDForTypeInRoot(
}
}
if(rv.isNull() && root_id.notNull() && preferred_type != LLFolderType::FT_MARKETPLACE_LISTINGS)
if(rv.isNull()
&& root_id.notNull()
&& preferred_type != LLFolderType::FT_MARKETPLACE_LISTINGS
&& preferred_type != LLFolderType::FT_OUTBOX)
{
// if it does not exists, it should either be added
// to createCommonSystemCategories or server should

View File

@ -169,7 +169,8 @@ LLInventoryPanel::LLInventoryPanel(const LLInventoryPanel::Params& p) :
mInvFVBridgeBuilder(NULL),
mInventoryViewModel(p.name),
mGroupedItemBridge(new LLFolderViewGroupedItemBridge),
mFocusSelection(false)
mFocusSelection(false),
mBuildChildrenViews(true)
{
mInvFVBridgeBuilder = &INVENTORY_BRIDGE_BUILDER;
@ -1106,8 +1107,11 @@ LLFolderViewItem* LLInventoryPanel::buildViewsTree(const LLUUID& id,
LLInventoryObject const* objectp,
LLFolderViewItem *folder_view_item,
LLFolderViewFolder *parent_folder,
const EBuildModes &mode)
const EBuildModes &mode,
S32 depth)
{
depth++;
// Force the creation of an extra root level folder item if required by the inventory panel (default is "false")
bool allow_drop = true;
bool create_root = false;
@ -1207,7 +1211,8 @@ LLFolderViewItem* LLInventoryPanel::buildViewsTree(const LLUUID& id,
}
}
bool create_children = folder_view_item && objectp->getType() == LLAssetType::AT_CATEGORY;
bool create_children = folder_view_item && objectp->getType() == LLAssetType::AT_CATEGORY
&& (mBuildChildrenViews || depth == 0);
if (create_children)
{
@ -1227,7 +1232,10 @@ LLFolderViewItem* LLInventoryPanel::buildViewsTree(const LLUUID& id,
{
create_children = false;
// run it again for the sake of creating children
mBuildViewsQueue.push_back(id);
if (mBuildChildrenViews || depth == 0)
{
mBuildViewsQueue.push_back(id);
}
}
else
{
@ -1240,7 +1248,10 @@ LLFolderViewItem* LLInventoryPanel::buildViewsTree(const LLUUID& id,
{
create_children = false;
// run it to create children, current caller is only interested in current view
mBuildViewsQueue.push_back(id);
if (mBuildChildrenViews || depth == 0)
{
mBuildViewsQueue.push_back(id);
}
break;
}
case BUILD_ONE_FOLDER:
@ -1288,11 +1299,11 @@ LLFolderViewItem* LLInventoryPanel::buildViewsTree(const LLUUID& id,
// each time, especially since content is growing, we can just
// iter over copy of mItemMap in some way
LLFolderViewItem* view_itemp = getItemByID(cat->getUUID());
buildViewsTree(cat->getUUID(), id, cat, view_itemp, parentp, (mode == BUILD_ONE_FOLDER ? BUILD_NO_CHILDREN : mode));
buildViewsTree(cat->getUUID(), id, cat, view_itemp, parentp, (mode == BUILD_ONE_FOLDER ? BUILD_NO_CHILDREN : mode), depth);
}
else
{
buildViewsTree(cat->getUUID(), id, cat, NULL, parentp, (mode == BUILD_ONE_FOLDER ? BUILD_NO_CHILDREN : mode));
buildViewsTree(cat->getUUID(), id, cat, NULL, parentp, (mode == BUILD_ONE_FOLDER ? BUILD_NO_CHILDREN : mode), depth);
}
}
}
@ -1312,7 +1323,7 @@ LLFolderViewItem* LLInventoryPanel::buildViewsTree(const LLUUID& id,
// each time, especially since content is growing, we can just
// iter over copy of mItemMap in some way
LLFolderViewItem* view_itemp = getItemByID(item->getUUID());
buildViewsTree(item->getUUID(), id, item, view_itemp, parentp, mode);
buildViewsTree(item->getUUID(), id, item, view_itemp, parentp, mode, depth);
}
}
}
@ -2008,7 +2019,7 @@ LLInventoryPanel* LLInventoryPanel::getActiveInventoryPanel(BOOL auto_open)
}
//static
void LLInventoryPanel::openInventoryPanelAndSetSelection(BOOL auto_open, const LLUUID& obj_id, BOOL main_panel, BOOL take_keyboard_focus, BOOL reset_filter)
void LLInventoryPanel::openInventoryPanelAndSetSelection(BOOL auto_open, const LLUUID& obj_id, BOOL use_main_panel, BOOL take_keyboard_focus, BOOL reset_filter)
{
// <FS:Ansariel> Use correct inventory floater
//LLSidepanelInventory* sidepanel_inventory = LLFloaterSidePanelContainer::getPanel<LLSidepanelInventory>("inventory");
@ -2019,7 +2030,7 @@ void LLInventoryPanel::openInventoryPanelAndSetSelection(BOOL auto_open, const L
bool show_inbox = gSavedSettings.getBOOL("FSShowInboxFolder"); // <FS:Ansariel> Optional hiding of Received Items folder aka Inbox
// <FS:Ansariel> FIRE-22167: Make "Show in Main View" work properly
//if (!in_inbox && (main_panel || !sidepanel_inventory->getMainInventoryPanel()->isRecentItemsPanelSelected())) //if (main_panel && !in_inbox)
//if (!in_inbox && (use_main_panel || !sidepanel_inventory->getMainInventoryPanel()->isRecentItemsPanelSelected())) //if (main_panel && !in_inbox)
//{
// sidepanel_inventory->selectAllItemsPanel();
//}
@ -2038,6 +2049,27 @@ void LLInventoryPanel::openInventoryPanelAndSetSelection(BOOL auto_open, const L
}
}
// <FS:Ansariel> Use correct inventory floater
//LLPanelMainInventory* main_inventory = sidepanel_inventory->getMainInventoryPanel();
//if (main_inventory && main_inventory->isSingleFolderMode()
// && use_main_panel)
//{
// main_inventory->toggleViewMode();
//}
if (!inventory_floater)
{
inventory_floater = LLFloaterReg::showInstance("inventory");
}
if (use_main_panel && inventory_floater)
{
LLSidepanelInventory* inventory_panel = inventory_floater->findChild<LLSidepanelInventory>("main_panel");
LLPanelMainInventory* main_inventory = inventory_panel->getMainInventoryPanel();
if (main_inventory && main_inventory->isSingleFolderMode())
{
main_inventory->toggleViewMode();
}
}
// </FS:Ansariel>
LLInventoryPanel *active_panel = LLInventoryPanel::getActiveInventoryPanel(auto_open);
@ -2069,7 +2101,7 @@ void LLInventoryPanel::openInventoryPanelAndSetSelection(BOOL auto_open, const L
{
// <FS:Ansariel> FIRE-22167: Make "Show in Main View" work properly
//LLFloater* floater_inventory = LLFloaterReg::getInstance("inventory");
if (main_panel)
if (use_main_panel)
{
active_panel->getParentByType<LLTabContainer>()->selectFirstTab();
active_panel = getActiveInventoryPanel(FALSE);
@ -2329,6 +2361,7 @@ static LLDefaultChildRegistry::Register<LLInventorySingleFolderPanel> t_single_f
LLInventorySingleFolderPanel::LLInventorySingleFolderPanel(const Params& params)
: LLInventoryPanel(params)
{
mBuildChildrenViews = false;
getFilter().setSingleFolderMode(true);
getFilter().setEmptyLookupMessage("InventorySingleFolderNoMatches");
getFilter().setDefaultEmptyLookupMessage("InventorySingleFolderEmpty");
@ -2429,8 +2462,8 @@ void LLInventorySingleFolderPanel::updateSingleFolderRoot()
LLUUID root_id = mFolderID;
if (mFolderRoot.get())
{
removeItemID(getRootFolderID());
mFolderRoot.get()->destroyView();
mItemMap.clear();
mFolderRoot.get()->destroyRoot();
}
mCommitCallbackRegistrar.pushScope();

View File

@ -262,7 +262,7 @@ public:
static void openInventoryPanelAndSetSelection(BOOL auto_open,
const LLUUID& obj_id,
BOOL main_panel = FALSE,
BOOL use_main_panel = FALSE,
BOOL take_keyboard_focus = TAKE_FOCUS_YES,
BOOL reset_filter = FALSE);
static void setSFViewAndOpenFolder(const LLInventoryPanel* panel, const LLUUID& folder_id);
@ -321,6 +321,8 @@ protected:
*/
const LLInventoryFolderViewModelBuilder* mInvFVBridgeBuilder;
bool mBuildChildrenViews;
//--------------------------------------------------------------------
// Sorting
@ -389,7 +391,8 @@ private:
LLInventoryObject const* objectp,
LLFolderViewItem *target_view,
LLFolderViewFolder *parent_folder_view,
const EBuildModes &mode);
const EBuildModes &mode,
S32 depth = -1);
typedef enum e_views_initialization_state
{

View File

@ -130,9 +130,8 @@ void LLOutfitsList::onOpen(const LLSD& info)
{
if (!mIsInitialized)
{
const LLUUID cof = gInventory.findCategoryUUIDForType(LLFolderType::FT_CURRENT_OUTFIT);
// Start observing changes in Current Outfit category.
mCategoriesObserver->addCategory(cof, boost::bind(&LLOutfitsList::onCOFChanged, this));
LLOutfitObserver::instance().addCOFChangedCallback(boost::bind(&LLOutfitsList::onCOFChanged, this));
}
LLOutfitListBase::onOpen(info);

View File

@ -137,6 +137,8 @@ LLPanelMainInventory::LLPanelMainInventory(const LLPanel::Params& p)
mCombinationShapeDirty(true),
mListViewRootUpdatedConnection(),
mGalleryRootUpdatedConnection(),
mDelayedCombGalleryScroll(false),
mDelayedCombInvPanelScroll(false),
mViewMenuButton(nullptr), // <FS:Ansariel> Keep better inventory layout
mSearchTypeCombo(NULL) // <FS:Ansariel> Properly initialize this
{
@ -381,7 +383,7 @@ BOOL LLPanelMainInventory::postBuild()
LLInventoryFilter& comb_inv_filter = mCombinationInventoryPanel->getFilter();
comb_inv_filter.setFilterThumbnails(LLInventoryFilter::FILTER_EXCLUDE_THUMBNAILS);
comb_inv_filter.markDefault();
mCombinationInventoryPanel->setSelectCallback(boost::bind(&LLPanelMainInventory::onSelectionChange, this, mCombinationInventoryPanel, _1, _2));
mCombinationInventoryPanel->setSelectCallback(boost::bind(&LLPanelMainInventory::onCombinationInventorySelectionChanged, this, _1, _2));
mCombinationInventoryPanel->setRootChangedCallback(boost::bind(&LLPanelMainInventory::onCombinationRootChanged, this, false));
mCombinationGalleryPanel = getChild<LLInventoryGallery>("comb_gallery_view_inv");
@ -389,6 +391,7 @@ BOOL LLPanelMainInventory::postBuild()
comb_gallery_filter.setFilterThumbnails(LLInventoryFilter::FILTER_ONLY_THUMBNAILS);
comb_gallery_filter.markDefault();
mCombinationGalleryPanel->setRootChangedCallback(boost::bind(&LLPanelMainInventory::onCombinationRootChanged, this, true));
mCombinationGalleryPanel->setSelectionChangeCallback(boost::bind(&LLPanelMainInventory::onCombinationGallerySelectionChanged, this, _1));
mCombinationScroller = getChild<LLView>("combination_scroller");
@ -601,7 +604,7 @@ void LLPanelMainInventory::newFolderWindow(LLUUID folder_id, LLUUID item_to_sele
main_inventory->setFocus(true);
if(item_to_select.notNull())
{
sidepanel_inventory->getActivePanel()->setSelection(item_to_select, TAKE_FOCUS_YES);
main_inventory->setGallerySelection(item_to_select);
}
return;
}
@ -626,7 +629,7 @@ void LLPanelMainInventory::newFolderWindow(LLUUID folder_id, LLUUID item_to_sele
main_inventory->setSingleFolderViewRoot(folder_id);
if(item_to_select.notNull())
{
sidepanel_inventory->getActivePanel()->setSelection(item_to_select, TAKE_FOCUS_YES);
main_inventory->setGallerySelection(item_to_select, true);
}
}
}
@ -1268,6 +1271,7 @@ void LLPanelMainInventory::changed(U32 mask)
|| (mask & LLInventoryObserver::STRUCTURE)
|| (mask & LLInventoryObserver::REMOVE)
|| (mask & LLInventoryObserver::ADD)
|| (mask & LLInventoryObserver::INTERNAL) // Thumbnail
|| (mask & LLInventoryObserver::LABEL))
{
// todo: can be limited to just observed folder
@ -1288,6 +1292,7 @@ void LLPanelMainInventory::reshape(S32 width, S32 height, BOOL called_from_paren
{
mCombinationShapeDirty = true;
LLPanel::reshape(width, height, called_from_parent);
updateCombinationVisibility();
}
// virtual
@ -1320,9 +1325,9 @@ void LLPanelMainInventory::draw()
mResortActivePanel = false;
}
updateCombinationVisibility();
LLPanel::draw();
updateItemcountText();
updateCombinationVisibility();
}
void LLPanelMainInventory::updateItemcountText()
@ -1974,7 +1979,6 @@ void LLPanelMainInventory::onAddButtonClick()
if (menu)
{
disableAddIfNeeded();
menu->getChild<LLMenuItemGL>("New Folder")->setEnabled(!isRecentItemsPanelSelected());
setUploadCostIfNeeded();
@ -2942,7 +2946,7 @@ void LLPanelMainInventory::disableAddIfNeeded()
{
bool enable = !mSingleFolderMode || is_add_allowed(getCurrentSFVRoot());
menu->getChild<LLMenuItemGL>("New Folder")->setEnabled(enable);
menu->getChild<LLMenuItemGL>("New Folder")->setEnabled(enable && !isRecentItemsPanelSelected());
menu->getChild<LLMenuItemGL>("New Script")->setEnabled(enable);
menu->getChild<LLMenuItemGL>("New Note")->setEnabled(enable);
menu->getChild<LLMenuItemGL>("New Gesture")->setEnabled(enable);
@ -2997,6 +3001,24 @@ void LLPanelMainInventory::onCombinationRootChanged(bool gallery_clicked)
mCombinationInventoryPanel->reshape(1, 1);
}
void LLPanelMainInventory::onCombinationGallerySelectionChanged(const LLUUID& category_id)
{
if(category_id != LLUUID::null)
{
mCombinationInventoryPanel->unSelectAll();
}
}
void LLPanelMainInventory::onCombinationInventorySelectionChanged(const std::deque<LLFolderViewItem*>& items, BOOL user_action)
{
onSelectionChange(mCombinationInventoryPanel, items, user_action);
if(!items.empty())
{
mCombinationGalleryPanel->clearSelection();
}
}
void LLPanelMainInventory::updateCombinationVisibility()
{
if(mSingleFolderMode
@ -3048,6 +3070,21 @@ void LLPanelMainInventory::updateCombinationVisibility()
mCombinationScroller->reshape(desired_width, inv_rect.getHeight() + galery_rect.getHeight(), true);
mCombinationGalleryPanel->setShape(galery_rect, false);
mCombinationInventoryPanel->setShape(inv_rect, false);
if(mDelayedCombGalleryScroll)
{
scrollToGallerySelection();
}
else if(mDelayedCombInvPanelScroll)
{
scrollToInvPanelSelection();
}
LLFolderView* root_folder = mCombinationInventoryPanel->getRootFolder();
if (root_folder)
{
root_folder->updateRenamerPosition();
}
}
}
@ -3181,7 +3218,7 @@ LLInventoryFilter& LLPanelMainInventory::getCurrentFilter()
}
}
void LLPanelMainInventory::setGallerySelection(const LLUUID& item_id)
void LLPanelMainInventory::setGallerySelection(const LLUUID& item_id, bool new_window)
{
if(mSingleFolderMode && isGalleryViewMode())
{
@ -3191,13 +3228,60 @@ void LLPanelMainInventory::setGallerySelection(const LLUUID& item_id)
{
if(mCombinationGalleryPanel->getFilter().checkAgainstFilterThumbnails(item_id))
{
mCombinationGalleryPanel->changeItemSelection(item_id, true);
mCombinationGalleryPanel->changeItemSelection(item_id, false);
if(new_window)
{
mDelayedCombGalleryScroll = new_window;
}
else
{
scrollToGallerySelection();
}
}
else
{
mCombinationInventoryPanel->setSelection(item_id, false);
mCombinationInventoryPanel->setSelection(item_id, true);
if(new_window)
{
mDelayedCombInvPanelScroll = new_window;
}
else
{
scrollToInvPanelSelection();
}
}
}
else if (mSingleFolderMode && isListViewMode())
{
mSingleFolderPanelInventory->setSelection(item_id, true);
}
}
void LLPanelMainInventory::scrollToGallerySelection()
{
LLInventoryGalleryItem* item = mCombinationGalleryPanel->getSelectedItem();
LLScrollContainer* scroll_panel = getChild<LLScrollContainer>("combination_view_inventory");
if(item)
{
LLRect item_rect;
item->localRectToOtherView(item->getLocalRect(), &item_rect, mCombinationScroller);
scroll_panel->scrollToShowRect(item_rect);
}
}
void LLPanelMainInventory::scrollToInvPanelSelection()
{
LLFolderViewItem* item = mCombinationInventoryPanel->getRootFolder()->getCurSelectedItem();
LLScrollContainer* scroll_panel = getChild<LLScrollContainer>("combination_view_inventory");
if(item)
{
LLRect item_rect;
item->localRectToOtherView(item->getLocalRect(), &item_rect, mCombinationScroller);
scroll_panel->scrollToShowRect(item_rect);
}
}
// List Commands //
////////////////////////////////////////////////////////////////////////////////

View File

@ -127,10 +127,13 @@ public:
void onBackFolderClicked();
void onForwardFolderClicked();
void setSingleFolderViewRoot(const LLUUID& folder_id, bool clear_nav_history = true);
void setGallerySelection(const LLUUID& item_id);
void setGallerySelection(const LLUUID& item_id, bool new_window = false);
LLUUID getSingleFolderViewRoot();
bool isSingleFolderMode() { return mSingleFolderMode; }
void scrollToGallerySelection();
void scrollToInvPanelSelection();
void setViewMode(EViewModeType mode);
bool isListViewMode() { return (mViewMode == MODE_LIST); }
bool isGalleryViewMode() { return (mViewMode == MODE_GALLERY); }
@ -274,6 +277,8 @@ protected:
void updateNavButtons();
void onCombinationRootChanged(bool gallery_clicked);
void onCombinationGallerySelectionChanged(const LLUUID& category_id);
void onCombinationInventorySelectionChanged(const std::deque<LLFolderViewItem*>& items, BOOL user_action);
/**
* Set upload cost in "Upload" sub menu.
*/
@ -298,6 +303,8 @@ private:
bool mForceShowInvLayout;
bool mCombinationShapeDirty;
bool mDelayedCombGalleryScroll;
bool mDelayedCombInvPanelScroll;
// List Commands //
////////////////////////////////////////////////////////////////////////////////
};

View File

@ -40,6 +40,7 @@
#include "llinventorymodel.h"
#include "llinventoryobserver.h"
#include "llmenubutton.h"
#include "lloutfitobserver.h"
#include "llscrolllistctrl.h"
#include "llviewermenu.h"
#include "llviewerregion.h"
@ -253,8 +254,6 @@ LLPanelWearing::LLPanelWearing()
, mIsInitialized(false)
, mAttachmentsChangedConnection()
{
mCategoriesObserver = new LLInventoryCategoriesObserver();
mGearMenu = new LLWearingGearMenu(this);
mContextMenu = new LLWearingContextMenu();
mAttachmentsMenu = new LLTempAttachmentsContextMenu(this);
@ -266,12 +265,6 @@ LLPanelWearing::~LLPanelWearing()
delete mContextMenu;
delete mAttachmentsMenu;
if (gInventory.containsObserver(mCategoriesObserver))
{
gInventory.removeObserver(mCategoriesObserver);
}
delete mCategoriesObserver;
if (mAttachmentsChangedConnection.connected())
{
mAttachmentsChangedConnection.disconnect();
@ -321,10 +314,8 @@ void LLPanelWearing::onOpen(const LLSD& /*info*/)
if (!category)
return;
gInventory.addObserver(mCategoriesObserver);
// Start observing changes in Current Outfit category.
mCategoriesObserver->addCategory(cof, boost::bind(&LLWearableItemsList::updateList, mCOFItemsList, cof));
LLOutfitObserver::instance().addCOFChangedCallback(boost::bind(&LLWearableItemsList::updateList, mCOFItemsList, cof));
// Fetch Current Outfit contents and refresh the list to display
// initially fetched items. If not all items are fetched now

View File

@ -97,7 +97,6 @@ private:
// <FS:Ansariel> FIRE-22484: Double-click wear in outfits list
void onDoubleClick();
LLInventoryCategoriesObserver* mCategoriesObserver;
LLWearableItemsList* mCOFItemsList;
LLScrollListCtrl* mTempItemsList;
LLWearingGearMenu* mGearMenu;

View File

@ -2648,9 +2648,21 @@ bool idle_startup()
LLNotificationsUtil::add("InventoryUnusable");
}
LLInventoryModelBackgroundFetch::instance().start();
gInventory.createCommonSystemCategories();
LLInventoryModelBackgroundFetch::instance().start();
LLUUID cof_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_CURRENT_OUTFIT);
LLViewerInventoryCategory* cof = gInventory.getCategory(cof_id);
if (cof
&& cof->getVersion() == LLViewerInventoryCategory::VERSION_UNKNOWN)
{
// Special case, dupplicate request prevention.
// Cof folder will be requested via FetchCOF
// in appearance manager, prevent recursive fetch
cof->setFetching(LLViewerInventoryCategory::FETCH_RECURSIVE);
}
// It's debatable whether this flag is a good idea - sets all
// bits, and in general it isn't true that inventory
// initialization generates all types of changes. Maybe add an

View File

@ -1781,7 +1781,7 @@ EAcceptance LLToolDragAndDrop::dad3dRezAttachmentFromInv(
}
const LLUUID &outbox_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_OUTBOX);
if(gInventory.isObjectDescendentOf(item->getUUID(), outbox_id))
if(outbox_id.notNull() && gInventory.isObjectDescendentOf(item->getUUID(), outbox_id))
{
// Legacy
return ACCEPT_NO;
@ -2255,7 +2255,7 @@ EAcceptance LLToolDragAndDrop::dad3dWearCategory(
}
const LLUUID &outbox_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_OUTBOX);
if(gInventory.isObjectDescendentOf(category->getUUID(), outbox_id))
if(outbox_id.notNull() && gInventory.isObjectDescendentOf(category->getUUID(), outbox_id))
{
// Legacy
return ACCEPT_NO;

View File

@ -79,6 +79,7 @@
#include "llnotifications.h"
#include "llnotificationsutil.h"
#include "llpanelgrouplandmoney.h"
#include "llpanelmaininventory.h"
#include "llrecentpeople.h"
#include "llscriptfloater.h"
#include "llscriptruntimeperms.h"
@ -1699,15 +1700,40 @@ void open_inventory_offer(const uuid_vec_t& objects, const std::string& from_nam
}
////////////////////////////////////////////////////////////////////////////////
static LLUICachedControl<bool> find_original_new_floater("FindOriginalOpenWindow", false);
//show in a new single-folder window
if(find_original_new_floater && !from_name.empty())
{
const LLInventoryObject *obj = gInventory.getObject(obj_id);
if (obj && obj->getParentUUID().notNull())
{
if (obj->getActualType() == LLAssetType::AT_CATEGORY)
{
LLPanelMainInventory::newFolderWindow(obj_id);
}
else
{
LLPanelMainInventory::newFolderWindow(obj->getParentUUID(), obj_id);
}
}
}
else
{
// Highlight item
// <FS:Ansariel> Only show if either ShowInInventory is true OR it is an inventory
// offer from an agent and the asset is not previewable
const BOOL auto_open = gSavedSettings.getBOOL("ShowInInventory") || (from_agent_manual && !check_asset_previewable(asset_type));
//gSavedSettings.getBOOL("ShowInInventory") && // don't open if showininventory is false
//!from_name.empty(); // don't open if it's not from anyone.
// <FS:Ansariel> Don't mess with open inventory panels when ShowInInventory is FALSE
if (auto_open)
LLInventoryPanel::openInventoryPanelAndSetSelection(auto_open, obj_id);
// <FS:Ansariel> Use correct inventory floater
//if (auto_open)
//{
// LLFloaterReg::showInstance("inventory");
//}
// </FS:Ansariel>
if (auto_open) // <FS:Ansariel> Don't mess with open inventory panels when ShowInInventory is FALSE
LLInventoryPanel::openInventoryPanelAndSetSelection(auto_open, obj_id, true);
}
}
}

View File

@ -8,6 +8,14 @@
title="Change Item Image"
width="319">
<floater.string
name="title_item_thumbnail">
Change Item Image
</floater.string>
<floater.string
name="title_folder_thumbnail">
Change Folder Image
</floater.string>
<floater.string
name="tooltip_upload_local">
Upload from computer