From 1d6ebfbb573bca573c60d666d12a401c1f21d37d Mon Sep 17 00:00:00 2001 From: Loren Shih Date: Thu, 13 May 2010 16:53:29 -0400 Subject: EXT-4088 : FIXED : INFRASTRUCTURE : Change LLFolderView::getSelectionList to return a selection Function signature change to return a selection instead of taking one as an argument. --- indra/newview/llfolderview.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'indra/newview/llfolderview.cpp') diff --git a/indra/newview/llfolderview.cpp b/indra/newview/llfolderview.cpp index eba4cdfa31..2ae11aa2b5 100644 --- a/indra/newview/llfolderview.cpp +++ b/indra/newview/llfolderview.cpp @@ -846,16 +846,16 @@ void LLFolderView::clearSelection() mSelectThisID.setNull(); } -BOOL LLFolderView::getSelectionList(std::set &selection) const +std::set LLFolderView::getSelectionList() const { + std::set selection; for (selected_items_t::const_iterator item_it = mSelectedItems.begin(); item_it != mSelectedItems.end(); ++item_it) { selection.insert((*item_it)->getListener()->getUUID()); } - - return (selection.size() != 0); + return selection; } BOOL LLFolderView::startDrag(LLToolDragAndDrop::ESource source) @@ -2070,8 +2070,7 @@ bool LLFolderView::doToSelected(LLInventoryModel* model, const LLSD& userdata) } - std::set selected_items; - getSelectionList(selected_items); + std::set selected_items = getSelectionList(); LLMultiPreview* multi_previewp = NULL; LLMultiProperties* multi_propertiesp = NULL; -- cgit v1.2.3 From 8f7d277e9a79e7bf882f55813179fc3c6489be0e Mon Sep 17 00:00:00 2001 From: Yuri Chebotarev Date: Mon, 17 May 2010 09:20:57 +0300 Subject: EXT-6941 FIX setup global EditMenu handle setup global EditMenu handle when pressing mouse on FolderView. --HG-- branch : product-engine --- indra/newview/llfolderview.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'indra/newview/llfolderview.cpp') diff --git a/indra/newview/llfolderview.cpp b/indra/newview/llfolderview.cpp index 2ae11aa2b5..a87f7288fa 100644 --- a/indra/newview/llfolderview.cpp +++ b/indra/newview/llfolderview.cpp @@ -1744,6 +1744,8 @@ BOOL LLFolderView::handleMouseDown( S32 x, S32 y, MASK mask ) mParentPanel->setFocus(TRUE); + LLEditMenuHandler::gEditMenuHandler = this; + return LLView::handleMouseDown( x, y, mask ); } -- cgit v1.2.3 From 0a6e0deb3245775a284fad78aa4007be8d09074b Mon Sep 17 00:00:00 2001 From: Mike Antipov Date: Thu, 10 Jun 2010 15:11:41 +0300 Subject: EXT-7564 FIXED Added "wrap" attribute for status message in an inventory folder view. EXT-7047 PARTIAL FIXED truncation of status message is fixed. Updated arranging in folder view to take into account required height for status message. --HG-- branch : product-engine --- indra/newview/llfolderview.cpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'indra/newview/llfolderview.cpp') diff --git a/indra/newview/llfolderview.cpp b/indra/newview/llfolderview.cpp index a87f7288fa..676c50014f 100644 --- a/indra/newview/llfolderview.cpp +++ b/indra/newview/llfolderview.cpp @@ -246,6 +246,7 @@ LLFolderView::LLFolderView(const Params& p) text_p.font(font); text_p.visible(false); text_p.allow_html(true); + text_p.wrap(true); // allow multiline text. See EXT-7564, EXT-7047 mStatusTextBox = LLUICtrlFactory::create (text_p); mStatusTextBox->setFollowsLeft(); mStatusTextBox->setFollowsTop(); @@ -953,6 +954,23 @@ void LLFolderView::draw() } mStatusTextBox->setValue(mStatusText); mStatusTextBox->setVisible( TRUE ); + + // firstly reshape message textbox with current size. This is necessary to + // LLTextBox::getTextPixelHeight works properly + const LLRect local_rect = getLocalRect(); + mStatusTextBox->setShape(local_rect); + + // get preferable text height... + S32 pixel_height = mStatusTextBox->getTextPixelHeight(); + bool height_changed = local_rect.getHeight() != pixel_height; + if (height_changed) + { + // ... if it does not match current height, lets rearrange current view. + // This will indirectly call ::arrange and reshape of the status textbox. + // We should call this method to also notify parent about required rect. + // See EXT-7564, EXT-7047. + arrangeFromRoot(); + } } -- cgit v1.2.3 From 591aa0d5be809a8ce0ba314493a9c3a8dfee8b9b Mon Sep 17 00:00:00 2001 From: Yuri Chebotarev Date: Thu, 10 Jun 2010 17:12:43 +0300 Subject: EXT-7741 FIX add iterator increment to prevent infinite loop revieded by Mike Antipov https://codereview.productengine.com/secondlife/r/552/ --HG-- branch : product-engine --- indra/newview/llfolderview.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'indra/newview/llfolderview.cpp') diff --git a/indra/newview/llfolderview.cpp b/indra/newview/llfolderview.cpp index a87f7288fa..184ffdb274 100644 --- a/indra/newview/llfolderview.cpp +++ b/indra/newview/llfolderview.cpp @@ -2310,7 +2310,7 @@ void LLFolderView::updateRenamerPosition() bool LLFolderView::selectFirstItem() { for (folders_t::iterator iter = mFolders.begin(); - iter != mFolders.end();) + iter != mFolders.end();++iter) { LLFolderViewFolder* folder = (*iter ); if (folder->getVisible()) @@ -2347,7 +2347,7 @@ bool LLFolderView::selectLastItem() } } for (folders_t::reverse_iterator iter = mFolders.rbegin(); - iter != mFolders.rend();) + iter != mFolders.rend();++iter) { LLFolderViewFolder* folder = (*iter); if (folder->getVisible()) -- cgit v1.2.3 From 56d9e64b6da662ef8729ab203bab6142309a79f0 Mon Sep 17 00:00:00 2001 From: Mike Antipov Date: Fri, 11 Jun 2010 10:26:53 +0300 Subject: EXT-7047 FIXED Overridden tab container's max tab width. Added paddings to status message text in inventory folder view. Also fixed crash in LLPanelPlaceProfile if login after places Panel is opened and hidden in UI Preview Tool: * added removing of an idle function when instance is destroyed. Message text has been wrapped into several lines in EXT-7564 (1869e99b5ce2) Reviewed by Vadim Savchuk at https://codereview.productengine.com/secondlife/r/558/ --HG-- branch : product-engine --- indra/newview/llfolderview.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'indra/newview/llfolderview.cpp') diff --git a/indra/newview/llfolderview.cpp b/indra/newview/llfolderview.cpp index 010033fcd3..74034cfbf7 100644 --- a/indra/newview/llfolderview.cpp +++ b/indra/newview/llfolderview.cpp @@ -88,6 +88,10 @@ const S32 MIN_ITEM_WIDTH_VISIBLE = LLFolderViewItem::ICON_WIDTH + /*first few characters*/ 40; const S32 MINIMUM_RENAMER_WIDTH = 80; +// *TODO: move in params in xml if necessary. Requires modification of LLFolderView & LLInventoryPanel Params. +const S32 STATUS_TEXT_HPAD = 6; +const S32 STATUS_TEXT_VPAD = 8; + enum { SIGNAL_NO_KEYBOARD_FOCUS = 1, SIGNAL_KEYBOARD_FOCUS = 2 @@ -247,6 +251,9 @@ LLFolderView::LLFolderView(const Params& p) text_p.visible(false); text_p.allow_html(true); text_p.wrap(true); // allow multiline text. See EXT-7564, EXT-7047 + // set text padding the same as in People panel. EXT-7047, EXT-4837 + text_p.h_pad(STATUS_TEXT_HPAD); + text_p.v_pad(STATUS_TEXT_VPAD); mStatusTextBox = LLUICtrlFactory::create (text_p); mStatusTextBox->setFollowsLeft(); mStatusTextBox->setFollowsTop(); -- cgit v1.2.3 From 7127fa493c98ae922f09c966a91e0d9d3679f60b Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Thu, 10 Jun 2010 17:07:45 -0700 Subject: EXT-7750 - Wearing list does not need to be bold or show link or worn --- indra/newview/llfolderview.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'indra/newview/llfolderview.cpp') diff --git a/indra/newview/llfolderview.cpp b/indra/newview/llfolderview.cpp index a87f7288fa..5682e691cd 100644 --- a/indra/newview/llfolderview.cpp +++ b/indra/newview/llfolderview.cpp @@ -181,6 +181,7 @@ LLFolderView::LLFolderView(const Params& p) mRenameItem( NULL ), mNeedsScroll( FALSE ), mEnableScroll( true ), + mUseLabelSuffix(p.use_label_suffix), mPinningSelectedItem(FALSE), mNeedsAutoSelect( FALSE ), mAutoSelectOverride(FALSE), -- cgit v1.2.3 From 3ce3df564351ad7b6fb0acd4e0252b5f89f2a47e Mon Sep 17 00:00:00 2001 From: Loren Shih Date: Mon, 28 Jun 2010 12:25:33 -0400 Subject: EXT-8033 FIXED Selecting multiple inventory items can give incorrect right-click context menus EXT-8093 FIXED No "open" or "properties" items for gestures Re-added open/properties to gestures Fixed right-click inventory selection so that it does something logical & consistent for multiple items. Had to add a "getLastVisible" to LLView to support this. --- indra/newview/llfolderview.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'indra/newview/llfolderview.cpp') diff --git a/indra/newview/llfolderview.cpp b/indra/newview/llfolderview.cpp index f241d18a21..87c5a830e9 100644 --- a/indra/newview/llfolderview.cpp +++ b/indra/newview/llfolderview.cpp @@ -1868,7 +1868,8 @@ BOOL LLFolderView::handleRightMouseDown( S32 x, S32 y, MASK mask ) LLView::child_list_t::const_iterator menu_itor; for (menu_itor = list->begin(); menu_itor != list->end(); ++menu_itor) { - (*menu_itor)->setVisible(TRUE); + (*menu_itor)->setVisible(FALSE); + (*menu_itor)->pushVisible(TRUE); (*menu_itor)->setEnabled(TRUE); } -- cgit v1.2.3 From 2c722547ea57c1510a82200242a3ccff2e505d17 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Thu, 15 Jul 2010 10:20:06 -0700 Subject: changed allow_html to parse_urls to be clearer about its meaning allow_html still supported as alternate --- indra/newview/llfolderview.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview/llfolderview.cpp') diff --git a/indra/newview/llfolderview.cpp b/indra/newview/llfolderview.cpp index 87c5a830e9..8708ebebb0 100644 --- a/indra/newview/llfolderview.cpp +++ b/indra/newview/llfolderview.cpp @@ -250,7 +250,7 @@ LLFolderView::LLFolderView(const Params& p) text_p.name(std::string(p.name)); text_p.font(font); text_p.visible(false); - text_p.allow_html(true); + text_p.parse_urls(true); text_p.wrap(true); // allow multiline text. See EXT-7564, EXT-7047 // set text padding the same as in People panel. EXT-7047, EXT-4837 text_p.h_pad(STATUS_TEXT_HPAD); -- cgit v1.2.3 From 39ae8785b459255f5fcc432cb2b5d5bed3ab2ba9 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Mon, 19 Jul 2010 15:15:04 -0700 Subject: EXT-8448 FIX [crashhunters] Crash in LLFolderBridge::folderOptionsMenu() reviewed by Callum --- indra/newview/llfolderview.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview/llfolderview.cpp') diff --git a/indra/newview/llfolderview.cpp b/indra/newview/llfolderview.cpp index 87c5a830e9..14d3bda8e9 100644 --- a/indra/newview/llfolderview.cpp +++ b/indra/newview/llfolderview.cpp @@ -1195,7 +1195,7 @@ void LLFolderView::propertiesSelectedItems( void ) void LLFolderView::changeType(LLInventoryModel *model, LLFolderType::EType new_folder_type) { - LLFolderBridge *folder_bridge = LLFolderBridge::sSelf; + LLFolderBridge *folder_bridge = LLFolderBridge::sSelf.get(); if (!folder_bridge) return; LLViewerInventoryCategory *cat = folder_bridge->getCategory(); -- cgit v1.2.3 From 4a361046f32a685408ddbc1e4a3138946c448ff1 Mon Sep 17 00:00:00 2001 From: Loren Shih Date: Mon, 26 Jul 2010 17:53:48 -0400 Subject: EXT-8229 FIXED Add "--no options--" automatically instead of special casing for it in right-click menus Changed logic so that the menu is post-processed and, at that time, nooptions is added if the menu is seen to be empty. --- indra/newview/llfolderview.cpp | 44 ++++++++++++++++++++++++++++++++++++++---- 1 file changed, 40 insertions(+), 4 deletions(-) (limited to 'indra/newview/llfolderview.cpp') diff --git a/indra/newview/llfolderview.cpp b/indra/newview/llfolderview.cpp index 14d3bda8e9..5aa504eb35 100644 --- a/indra/newview/llfolderview.cpp +++ b/indra/newview/llfolderview.cpp @@ -1874,13 +1874,18 @@ BOOL LLFolderView::handleRightMouseDown( S32 x, S32 y, MASK mask ) } // Successively filter out invalid options - selected_items_t::iterator item_itor; + U32 flags = FIRST_SELECTED_ITEM; - for (item_itor = mSelectedItems.begin(); item_itor != mSelectedItems.end(); ++item_itor) + for (selected_items_t::iterator item_itor = mSelectedItems.begin(); + item_itor != mSelectedItems.end(); + ++item_itor) { - (*item_itor)->buildContextMenu(*menu, flags); + LLFolderViewItem* selected_item = (*item_itor); + selected_item->buildContextMenu(*menu, flags); flags = 0x0; } + + addNoOptions(menu); menu->updateParent(LLMenuGL::sMenuContainer); LLMenuGL::showPopup(this, menu, x, y); @@ -1889,7 +1894,7 @@ BOOL LLFolderView::handleRightMouseDown( S32 x, S32 y, MASK mask ) } else { - if(menu && menu->getVisible()) + if (menu && menu->getVisible()) { menu->setVisible(FALSE); } @@ -1898,6 +1903,37 @@ BOOL LLFolderView::handleRightMouseDown( S32 x, S32 y, MASK mask ) return handled; } +// Add "--no options--" if the menu is completely blank. +BOOL LLFolderView::addNoOptions(LLMenuGL* menu) const +{ + const std::string nooptions_str = "--no options--"; + LLView *nooptions_item = NULL; + + const LLView::child_list_t *list = menu->getChildList(); + for (LLView::child_list_t::const_iterator itor = list->begin(); + itor != list->end(); + ++itor) + { + LLView *menu_item = (*itor); + if (menu_item->getVisible()) + { + return FALSE; + } + std::string name = menu_item->getName(); + if (menu_item->getName() == nooptions_str) + { + nooptions_item = menu_item; + } + } + if (nooptions_item) + { + nooptions_item->setVisible(TRUE); + nooptions_item->setEnabled(FALSE); + return TRUE; + } + return FALSE; +} + BOOL LLFolderView::handleHover( S32 x, S32 y, MASK mask ) { return LLView::handleHover( x, y, mask ); -- cgit v1.2.3 From 9c2694c682edcd1a25b25fe513a416daa8062830 Mon Sep 17 00:00:00 2001 From: Sergei Litovchuk Date: Wed, 4 Aug 2010 19:34:55 +0300 Subject: Backed out changeset: b81927151a18. Fix of EXT-3981 reverted to fix EXT-4379. --HG-- branch : product-engine --- indra/newview/llfolderview.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'indra/newview/llfolderview.cpp') diff --git a/indra/newview/llfolderview.cpp b/indra/newview/llfolderview.cpp index d3d52e20f7..be15ab7b98 100644 --- a/indra/newview/llfolderview.cpp +++ b/indra/newview/llfolderview.cpp @@ -184,7 +184,6 @@ LLFolderView::LLFolderView(const Params& p) mSourceID(p.task_id), mRenameItem( NULL ), mNeedsScroll( FALSE ), - mEnableScroll( true ), mUseLabelSuffix(p.use_label_suffix), mPinningSelectedItem(FALSE), mNeedsAutoSelect( FALSE ), @@ -1980,7 +1979,7 @@ void LLFolderView::deleteAllChildren() void LLFolderView::scrollToShowSelection() { - if (mEnableScroll && mSelectedItems.size()) + if (mSelectedItems.size()) { mNeedsScroll = TRUE; } -- cgit v1.2.3 From da1398f26fde69b3bf84aa453809c2517057d769 Mon Sep 17 00:00:00 2001 From: Sergei Litovchuk Date: Fri, 6 Aug 2010 22:34:10 +0300 Subject: EXT-3981 FIXED Disabled folder view automatic scrolling while background fetch is in progress. Reviewed by Loren Shih at https://codereview.productengine.com/secondlife/r/835/. --HG-- branch : product-engine --- indra/newview/llfolderview.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'indra/newview/llfolderview.cpp') diff --git a/indra/newview/llfolderview.cpp b/indra/newview/llfolderview.cpp index be15ab7b98..49d80a0249 100644 --- a/indra/newview/llfolderview.cpp +++ b/indra/newview/llfolderview.cpp @@ -561,7 +561,9 @@ void LLFolderView::addToSelectionList(LLFolderViewItem* item) void LLFolderView::removeFromSelectionList(LLFolderViewItem* item) { - if (mSelectedItems.size()) + // If items are filtered while background fetch is in progress + // scrollbar resets to the first filtered item. See EXT-3981. + if (!LLInventoryModelBackgroundFetch::instance().backgroundFetchActive() && mSelectedItems.size()) { mSelectedItems.back()->setIsCurSelection(FALSE); } -- cgit v1.2.3 From 11517b83205c0b9029f2151d57a7917b4b4e7063 Mon Sep 17 00:00:00 2001 From: Sergei Litovchuk Date: Tue, 10 Aug 2010 17:39:03 +0300 Subject: Backed out changeset: e1e225cd1deb --HG-- branch : product-engine --- indra/newview/llfolderview.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'indra/newview/llfolderview.cpp') diff --git a/indra/newview/llfolderview.cpp b/indra/newview/llfolderview.cpp index 49d80a0249..be15ab7b98 100644 --- a/indra/newview/llfolderview.cpp +++ b/indra/newview/llfolderview.cpp @@ -561,9 +561,7 @@ void LLFolderView::addToSelectionList(LLFolderViewItem* item) void LLFolderView::removeFromSelectionList(LLFolderViewItem* item) { - // If items are filtered while background fetch is in progress - // scrollbar resets to the first filtered item. See EXT-3981. - if (!LLInventoryModelBackgroundFetch::instance().backgroundFetchActive() && mSelectedItems.size()) + if (mSelectedItems.size()) { mSelectedItems.back()->setIsCurSelection(FALSE); } -- cgit v1.2.3 From f88890afe5fa45e25f196a2546620102935887aa Mon Sep 17 00:00:00 2001 From: Sergei Litovchuk Date: Tue, 10 Aug 2010 18:21:12 +0300 Subject: EXT-3981 FIXED changeset e1e225cd1deb. Disabled folder view automatic scrolling while background fetch is in progress. Reviewed by Loren Shih at https://codereview.productengine.com/secondlife/r/835/. --HG-- branch : product-engine --- indra/newview/llfolderview.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'indra/newview/llfolderview.cpp') diff --git a/indra/newview/llfolderview.cpp b/indra/newview/llfolderview.cpp index be15ab7b98..e8891d1cc5 100644 --- a/indra/newview/llfolderview.cpp +++ b/indra/newview/llfolderview.cpp @@ -1979,7 +1979,9 @@ void LLFolderView::deleteAllChildren() void LLFolderView::scrollToShowSelection() { - if (mSelectedItems.size()) + // If items are filtered while background fetch is in progress + // scrollbar resets to the first filtered item. See EXT-3981. + if (!LLInventoryModelBackgroundFetch::instance().backgroundFetchActive() && mSelectedItems.size()) { mNeedsScroll = TRUE; } -- cgit v1.2.3 From 79be630d0830a50c7c40bf8a787ccbeced82caf4 Mon Sep 17 00:00:00 2001 From: Andrew Dyukov Date: Tue, 10 Aug 2010 19:16:18 +0300 Subject: EXT-8255 FIXED Added confirmation dialog when removing items. Reviewed by Vadim Savchuk at https://codereview.productengine.com/secondlife/r/849/ --HG-- branch : product-engine --- indra/newview/llfolderview.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'indra/newview/llfolderview.cpp') diff --git a/indra/newview/llfolderview.cpp b/indra/newview/llfolderview.cpp index e8891d1cc5..ab36a76153 100644 --- a/indra/newview/llfolderview.cpp +++ b/indra/newview/llfolderview.cpp @@ -62,6 +62,7 @@ #include "llviewerwindow.h" #include "llvoavatar.h" #include "llfloaterproperties.h" +#include "llnotificationsutil.h" // Linden library includes #include "lldbstrings.h" @@ -1024,6 +1025,17 @@ void LLFolderView::closeRenamer( void ) void LLFolderView::removeSelectedItems( void ) { + if (mSelectedItems.empty()) return; + LLSD args; + args["QUESTION"] = LLTrans::getString(mSelectedItems.size() > 1 ? "DeleteItems" : "DeleteItem"); + LLNotificationsUtil::add("DeleteItems", args, LLSD(), boost::bind(&LLFolderView::onItemsRemovalConfirmation, this, _1, _2)); +} + +void LLFolderView::onItemsRemovalConfirmation(const LLSD& notification, const LLSD& response) +{ + S32 option = LLNotificationsUtil::getSelectedOption(notification, response); + if (option != 0) return; // canceled + if(getVisible() && getEnabled()) { // just in case we're removing the renaming item. -- cgit v1.2.3 From 44adcdecd0abb1726d6ae778e6e37b4da431e55a Mon Sep 17 00:00:00 2001 From: Vadim Savchuk Date: Thu, 12 Aug 2010 16:16:57 +0300 Subject: EXT-8473 FIXED Fixed renaming inventory items without hitting Enter. Problem: The bug was caused by the fix of EXT-6682 that prematurely forgets the item being renamed (by resetting mRenameItem) whenever the renamer input field loses focus. That's why we couldn't actually finish renaming item. Fix: The code is quite messy, but I'll try to explain. There are three cases when we should hide the renamer: 1) ESC key is hit (just hide). 2) ENTER key is hit (rename, then hide). 3) renamer loses focus (rename, then hide). In the first two cases we manually remove the renamer from the popups list -- by calling gViewerWindow->removePopup(mRenamer). In the third case that's done automatically. So, in all cases the onRenamerLost() pop-up is called that hides the renamer and only *then* resets mRenameItem. Not only this approach fixes the bug -- I hope it's a bit more straightforward too. Reviewed by Seraph at https://codereview.productengine.com/secondlife/r/854/ --HG-- branch : product-engine --- indra/newview/llfolderview.cpp | 48 ++++++++++++++++++------------------------ 1 file changed, 20 insertions(+), 28 deletions(-) (limited to 'indra/newview/llfolderview.cpp') diff --git a/indra/newview/llfolderview.cpp b/indra/newview/llfolderview.cpp index 5aa504eb35..81f00af948 100644 --- a/indra/newview/llfolderview.cpp +++ b/indra/newview/llfolderview.cpp @@ -104,7 +104,6 @@ void copy_selected_item(void* user_data); void open_selected_items(void* user_data); void properties_selected_items(void* user_data); void paste_items(void* user_data); -void renamer_focus_lost( LLFocusableElement* handler, void* user_data ); //--------------------------------------------------------------------------- @@ -275,6 +274,8 @@ LLFolderView::LLFolderView(const Params& p) // Destroys the object LLFolderView::~LLFolderView( void ) { + closeRenamer(); + // The release focus call can potentially call the // scrollcontainer, which can potentially be called with a partly // destroyed scollcontainer. Just null it out here, and no worries @@ -290,8 +291,6 @@ LLFolderView::~LLFolderView( void ) LLView::deleteViewByHandle(mPopupMenuHandle); - gViewerWindow->removePopup(mRenamer); - mAutoOpenItems.removeAllNodes(); clearSelection(); mItems.clear(); @@ -998,12 +997,7 @@ void LLFolderView::finishRenamingItem( void ) mRenameItem->rename( mRenamer->getText() ); } - gViewerWindow->removePopup(mRenamer); - - if( mRenameItem ) - { - setSelectionFromRoot( mRenameItem, TRUE ); - } + closeRenamer(); // List is re-sorted alphabeticly, so scroll to make sure the selected item is visible. scrollToShowSelection(); @@ -1011,15 +1005,10 @@ void LLFolderView::finishRenamingItem( void ) void LLFolderView::closeRenamer( void ) { - // will commit current name (which could be same as original name) - mRenamer->setFocus( FALSE ); - mRenamer->setVisible( FALSE ); - gViewerWindow->removePopup(mRenamer); - - if( mRenameItem ) + if (mRenamer && mRenamer->getVisible()) { - setSelectionFromRoot( mRenameItem, TRUE ); - mRenameItem = NULL; + // Triggers onRenamerLost() that actually closes the renamer. + gViewerWindow->removePopup(mRenamer); } } @@ -1444,8 +1433,7 @@ void LLFolderView::startRenamingSelectedItem( void ) mRenamer->setVisible( TRUE ); // set focus will fail unless item is visible mRenamer->setFocus( TRUE ); - mRenamer->setTopLostCallback(boost::bind(&LLFolderView::onRenamerLost, this, _1)); - mRenamer->setFocusLostCallback(boost::bind(&LLFolderView::onRenamerLost, this, _1)); + mRenamer->setTopLostCallback(boost::bind(&LLFolderView::onRenamerLost, this)); gViewerWindow->addPopup(mRenamer); } } @@ -1966,10 +1954,7 @@ BOOL LLFolderView::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, void LLFolderView::deleteAllChildren() { - if(mRenamer == gFocusMgr.getTopCtrl()) - { - gViewerWindow->removePopup(mRenamer); - } + closeRenamer(); LLView::deleteViewByHandle(mPopupMenuHandle); mPopupMenuHandle = LLHandle(); mRenamer = NULL; @@ -2452,13 +2437,20 @@ S32 LLFolderView::notify(const LLSD& info) /// Local function definitions ///---------------------------------------------------------------------------- -void LLFolderView::onRenamerLost( LLFocusableElement* renamer) +void LLFolderView::onRenamerLost() { - mRenameItem = NULL; - LLUICtrl* uictrl = dynamic_cast(renamer); - if (uictrl) + if (mRenamer && mRenamer->getVisible()) { - uictrl->setVisible(FALSE); + mRenamer->setVisible(FALSE); + + // will commit current name (which could be same as original name) + mRenamer->setFocus(FALSE); + } + + if( mRenameItem ) + { + setSelectionFromRoot( mRenameItem, TRUE ); + mRenameItem = NULL; } } -- cgit v1.2.3 From 06b0d72efa96b6a0ed665f7cd46f358c48929e7b Mon Sep 17 00:00:00 2001 From: Oz Linden Date: Fri, 13 Aug 2010 07:24:57 -0400 Subject: Change license from GPL to LGPL (version 2.1) --- indra/newview/llfolderview.cpp | 36 +++++++++++++++--------------------- 1 file changed, 15 insertions(+), 21 deletions(-) (limited to 'indra/newview/llfolderview.cpp') diff --git a/indra/newview/llfolderview.cpp b/indra/newview/llfolderview.cpp index 5aa504eb35..d71e288ffe 100644 --- a/indra/newview/llfolderview.cpp +++ b/indra/newview/llfolderview.cpp @@ -2,31 +2,25 @@ * @file llfolderview.cpp * @brief Implementation of the folder view collection of classes. * - * $LicenseInfo:firstyear=2001&license=viewergpl$ - * - * Copyright (c) 2001-2009, Linden Research, Inc. - * + * $LicenseInfo:firstyear=2001&license=viewerlgpl$ * Second Life Viewer Source Code - * The source code in this file ("Source Code") is provided by Linden Lab - * to you under the terms of the GNU General Public License, version 2.0 - * ("GPL"), unless you have obtained a separate licensing agreement - * ("Other License"), formally executed by you and Linden Lab. Terms of - * the GPL can be found in doc/GPL-license.txt in this distribution, or - * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 + * Copyright (C) 2010, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. * - * There are special exceptions to the terms and conditions of the GPL as - * it is applied to this Source Code. View the full text of the exception - * in the file doc/FLOSS-exception.txt in this software distribution, or - * online at - * http://secondlifegrid.net/programs/open_source/licensing/flossexception + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. * - * By copying, modifying or distributing this software, you acknowledge - * that you have read and understood your obligations described above, - * and agree to abide by those obligations. + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * - * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO - * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, - * COMPLETENESS OR PERFORMANCE. + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA * $/LicenseInfo$ */ -- cgit v1.2.3 From 98cc2365034a93c69704daa69efb389799cc9627 Mon Sep 17 00:00:00 2001 From: Tofu Linden Date: Tue, 24 Aug 2010 18:44:39 +0100 Subject: Backed out changeset a62bf7c0af21 Backing out this merge that I pushed (prematurely) to the wrong place. --- indra/newview/llfolderview.cpp | 67 +++++++++++++++++++----------------------- 1 file changed, 31 insertions(+), 36 deletions(-) (limited to 'indra/newview/llfolderview.cpp') diff --git a/indra/newview/llfolderview.cpp b/indra/newview/llfolderview.cpp index 5d8e3f9ab9..d71e288ffe 100644 --- a/indra/newview/llfolderview.cpp +++ b/indra/newview/llfolderview.cpp @@ -56,7 +56,6 @@ #include "llviewerwindow.h" #include "llvoavatar.h" #include "llfloaterproperties.h" -#include "llnotificationsutil.h" // Linden library includes #include "lldbstrings.h" @@ -99,6 +98,7 @@ void copy_selected_item(void* user_data); void open_selected_items(void* user_data); void properties_selected_items(void* user_data); void paste_items(void* user_data); +void renamer_focus_lost( LLFocusableElement* handler, void* user_data ); //--------------------------------------------------------------------------- @@ -178,6 +178,7 @@ LLFolderView::LLFolderView(const Params& p) mSourceID(p.task_id), mRenameItem( NULL ), mNeedsScroll( FALSE ), + mEnableScroll( true ), mUseLabelSuffix(p.use_label_suffix), mPinningSelectedItem(FALSE), mNeedsAutoSelect( FALSE ), @@ -243,7 +244,7 @@ LLFolderView::LLFolderView(const Params& p) text_p.name(std::string(p.name)); text_p.font(font); text_p.visible(false); - text_p.parse_urls(true); + text_p.allow_html(true); text_p.wrap(true); // allow multiline text. See EXT-7564, EXT-7047 // set text padding the same as in People panel. EXT-7047, EXT-4837 text_p.h_pad(STATUS_TEXT_HPAD); @@ -268,8 +269,6 @@ LLFolderView::LLFolderView(const Params& p) // Destroys the object LLFolderView::~LLFolderView( void ) { - closeRenamer(); - // The release focus call can potentially call the // scrollcontainer, which can potentially be called with a partly // destroyed scollcontainer. Just null it out here, and no worries @@ -285,6 +284,8 @@ LLFolderView::~LLFolderView( void ) LLView::deleteViewByHandle(mPopupMenuHandle); + gViewerWindow->removePopup(mRenamer); + mAutoOpenItems.removeAllNodes(); clearSelection(); mItems.clear(); @@ -991,7 +992,12 @@ void LLFolderView::finishRenamingItem( void ) mRenameItem->rename( mRenamer->getText() ); } - closeRenamer(); + gViewerWindow->removePopup(mRenamer); + + if( mRenameItem ) + { + setSelectionFromRoot( mRenameItem, TRUE ); + } // List is re-sorted alphabeticly, so scroll to make sure the selected item is visible. scrollToShowSelection(); @@ -999,26 +1005,20 @@ void LLFolderView::finishRenamingItem( void ) void LLFolderView::closeRenamer( void ) { - if (mRenamer && mRenamer->getVisible()) + // will commit current name (which could be same as original name) + mRenamer->setFocus( FALSE ); + mRenamer->setVisible( FALSE ); + gViewerWindow->removePopup(mRenamer); + + if( mRenameItem ) { - // Triggers onRenamerLost() that actually closes the renamer. - gViewerWindow->removePopup(mRenamer); + setSelectionFromRoot( mRenameItem, TRUE ); + mRenameItem = NULL; } } void LLFolderView::removeSelectedItems( void ) { - if (mSelectedItems.empty()) return; - LLSD args; - args["QUESTION"] = LLTrans::getString(mSelectedItems.size() > 1 ? "DeleteItems" : "DeleteItem"); - LLNotificationsUtil::add("DeleteItems", args, LLSD(), boost::bind(&LLFolderView::onItemsRemovalConfirmation, this, _1, _2)); -} - -void LLFolderView::onItemsRemovalConfirmation(const LLSD& notification, const LLSD& response) -{ - S32 option = LLNotificationsUtil::getSelectedOption(notification, response); - if (option != 0) return; // canceled - if(getVisible() && getEnabled()) { // just in case we're removing the renaming item. @@ -1438,7 +1438,8 @@ void LLFolderView::startRenamingSelectedItem( void ) mRenamer->setVisible( TRUE ); // set focus will fail unless item is visible mRenamer->setFocus( TRUE ); - mRenamer->setTopLostCallback(boost::bind(&LLFolderView::onRenamerLost, this)); + mRenamer->setTopLostCallback(boost::bind(&LLFolderView::onRenamerLost, this, _1)); + mRenamer->setFocusLostCallback(boost::bind(&LLFolderView::onRenamerLost, this, _1)); gViewerWindow->addPopup(mRenamer); } } @@ -1959,7 +1960,10 @@ BOOL LLFolderView::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, void LLFolderView::deleteAllChildren() { - closeRenamer(); + if(mRenamer == gFocusMgr.getTopCtrl()) + { + gViewerWindow->removePopup(mRenamer); + } LLView::deleteViewByHandle(mPopupMenuHandle); mPopupMenuHandle = LLHandle(); mRenamer = NULL; @@ -1970,9 +1974,7 @@ void LLFolderView::deleteAllChildren() void LLFolderView::scrollToShowSelection() { - // If items are filtered while background fetch is in progress - // scrollbar resets to the first filtered item. See EXT-3981. - if (!LLInventoryModelBackgroundFetch::instance().backgroundFetchActive() && mSelectedItems.size()) + if (mEnableScroll && mSelectedItems.size()) { mNeedsScroll = TRUE; } @@ -2444,20 +2446,13 @@ S32 LLFolderView::notify(const LLSD& info) /// Local function definitions ///---------------------------------------------------------------------------- -void LLFolderView::onRenamerLost() +void LLFolderView::onRenamerLost( LLFocusableElement* renamer) { - if (mRenamer && mRenamer->getVisible()) - { - mRenamer->setVisible(FALSE); - - // will commit current name (which could be same as original name) - mRenamer->setFocus(FALSE); - } - - if( mRenameItem ) + mRenameItem = NULL; + LLUICtrl* uictrl = dynamic_cast(renamer); + if (uictrl) { - setSelectionFromRoot( mRenameItem, TRUE ); - mRenameItem = NULL; + uictrl->setVisible(FALSE); } } -- cgit v1.2.3