CHUI-659 : Fixed : Reimplemented open selection on hitting return the right way
parent
0e7e877379
commit
4ef1181cdc
|
|
@ -275,17 +275,6 @@ BOOL LLFolderView::canFocusChildren() const
|
|||
void LLFolderView::addFolder( LLFolderViewFolder* folder)
|
||||
{
|
||||
LLFolderViewFolder::addFolder(folder);
|
||||
|
||||
// TODO RN: enforce sort order of My Inventory followed by Library
|
||||
//mFolders.remove(folder);
|
||||
//if (((LLFolderViewModelItemInventory*)folder->getViewModelItem())->getUUID() == gInventory.getLibraryRootFolderID())
|
||||
//{
|
||||
// mFolders.push_back(folder);
|
||||
//}
|
||||
//else
|
||||
//{
|
||||
// mFolders.insert(mFolders.begin(), folder);
|
||||
//}
|
||||
}
|
||||
|
||||
void LLFolderView::closeAllFolders()
|
||||
|
|
@ -793,76 +782,6 @@ void LLFolderView::removeSelectedItems()
|
|||
}
|
||||
}
|
||||
|
||||
// TODO RN: abstract
|
||||
// open the selected item.
|
||||
void LLFolderView::openSelectedItems( void )
|
||||
{
|
||||
//TODO RN: get working again
|
||||
//if(getVisible() && getEnabled())
|
||||
//{
|
||||
// if (mSelectedItems.size() == 1)
|
||||
// {
|
||||
// mSelectedItems.front()->openItem();
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// LLMultiPreview* multi_previewp = new LLMultiPreview();
|
||||
// LLMultiProperties* multi_propertiesp = new LLMultiProperties();
|
||||
|
||||
// selected_items_t::iterator item_it;
|
||||
// for (item_it = mSelectedItems.begin(); item_it != mSelectedItems.end(); ++item_it)
|
||||
// {
|
||||
// // IT_{OBJECT,ATTACHMENT} creates LLProperties
|
||||
// // floaters; others create LLPreviews. Put
|
||||
// // each one in the right type of container.
|
||||
// LLFolderViewModelItemInventory* listener = static_cast<LLFolderViewModelItemInventory*>((*item_it)->getViewModelItem());
|
||||
// bool is_prop = listener && (listener->getInventoryType() == LLInventoryType::IT_OBJECT || listener->getInventoryType() == LLInventoryType::IT_ATTACHMENT);
|
||||
// if (is_prop)
|
||||
// LLFloater::setFloaterHost(multi_propertiesp);
|
||||
// else
|
||||
// LLFloater::setFloaterHost(multi_previewp);
|
||||
// listener->openItem();
|
||||
// }
|
||||
|
||||
// LLFloater::setFloaterHost(NULL);
|
||||
// // *NOTE: LLMulti* will safely auto-delete when open'd
|
||||
// // without any children.
|
||||
// multi_previewp->openFloater(LLSD());
|
||||
// multi_propertiesp->openFloater(LLSD());
|
||||
// }
|
||||
//}
|
||||
}
|
||||
|
||||
void LLFolderView::propertiesSelectedItems( void )
|
||||
{
|
||||
//TODO RN: get working again
|
||||
//if(getVisible() && getEnabled())
|
||||
//{
|
||||
// if (mSelectedItems.size() == 1)
|
||||
// {
|
||||
// LLFolderViewItem* folder_item = mSelectedItems.front();
|
||||
// if(!folder_item) return;
|
||||
// folder_item->getViewModelItem()->showProperties();
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// LLMultiProperties* multi_propertiesp = new LLMultiProperties();
|
||||
|
||||
// LLFloater::setFloaterHost(multi_propertiesp);
|
||||
|
||||
// selected_items_t::iterator item_it;
|
||||
// for (item_it = mSelectedItems.begin(); item_it != mSelectedItems.end(); ++item_it)
|
||||
// {
|
||||
// (*item_it)->getViewModelItem()->showProperties();
|
||||
// }
|
||||
|
||||
// LLFloater::setFloaterHost(NULL);
|
||||
// multi_propertiesp->openFloater(LLSD());
|
||||
// }
|
||||
//}
|
||||
}
|
||||
|
||||
|
||||
void LLFolderView::autoOpenItem( LLFolderViewFolder* item )
|
||||
{
|
||||
if ((mAutoOpenItems.check() == item) ||
|
||||
|
|
@ -1151,11 +1070,6 @@ BOOL LLFolderView::handleKeyHere( KEY key, MASK mask )
|
|||
mSearchString.clear();
|
||||
handled = TRUE;
|
||||
}
|
||||
else
|
||||
{
|
||||
LLFolderView::openSelectedItems();
|
||||
handled = TRUE;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
|
|
|
|||
|
|
@ -163,10 +163,6 @@ public:
|
|||
// Deletion functionality
|
||||
void removeSelectedItems();
|
||||
|
||||
// Open the selected item
|
||||
void openSelectedItems( void );
|
||||
void propertiesSelectedItems( void );
|
||||
|
||||
void autoOpenItem(LLFolderViewFolder* item);
|
||||
void closeAutoOpenedFolders();
|
||||
BOOL autoOpenTest(LLFolderViewFolder* item);
|
||||
|
|
|
|||
|
|
@ -127,7 +127,7 @@ public:
|
|||
virtual bool startDrag(std::vector<LLFolderViewModelItem*>& items) = 0;
|
||||
};
|
||||
|
||||
// This is am abstract base class that users of the folderview classes
|
||||
// This is an abstract base class that users of the folderview classes
|
||||
// would use to bridge the folder view with the underlying data
|
||||
class LLFolderViewModelItem : public LLRefCount
|
||||
{
|
||||
|
|
|
|||
|
|
@ -684,8 +684,9 @@ void LLInventoryPanel::initializeViews()
|
|||
}
|
||||
else
|
||||
{
|
||||
buildNewViews(gInventory.getRootFolderID());
|
||||
buildNewViews(gInventory.getLibraryRootFolderID());
|
||||
// Default case: always add "My Inventory" first, "Library" second
|
||||
buildNewViews(gInventory.getRootFolderID()); // My Inventory
|
||||
buildNewViews(gInventory.getLibraryRootFolderID()); // Library
|
||||
}
|
||||
|
||||
gIdleCallbacks.addFunction(idle, this);
|
||||
|
|
@ -1354,6 +1355,21 @@ void LLInventoryPanel::doToSelected(const LLSD& userdata)
|
|||
return;
|
||||
}
|
||||
|
||||
BOOL LLInventoryPanel::handleKeyHere( KEY key, MASK mask )
|
||||
{
|
||||
BOOL handled = FALSE;
|
||||
switch (key)
|
||||
{
|
||||
case KEY_RETURN:
|
||||
// Open selected items if enter key hit on the inventory panel
|
||||
if (mask == MASK_NONE)
|
||||
{
|
||||
LLInventoryAction::doToSelected(mInventory, mFolderRoot, "open");
|
||||
handled = TRUE;
|
||||
}
|
||||
}
|
||||
return handled;
|
||||
}
|
||||
|
||||
/************************************************************************/
|
||||
/* Recent Inventory Panel related class */
|
||||
|
|
|
|||
|
|
@ -143,6 +143,7 @@ public:
|
|||
|
||||
// LLView methods
|
||||
void draw();
|
||||
/*virtual*/ BOOL handleKeyHere( KEY key, MASK mask );
|
||||
BOOL handleHover(S32 x, S32 y, MASK mask);
|
||||
BOOL handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop,
|
||||
EDragAndDropType cargo_type,
|
||||
|
|
|
|||
Loading…
Reference in New Issue