diff options
author | andreykproductengine <akleshchev@productengine.com> | 2015-08-04 16:45:49 +0300 |
---|---|---|
committer | andreykproductengine <akleshchev@productengine.com> | 2015-08-04 16:45:49 +0300 |
commit | f94a19e09ebcf51e3e6cd3437fe364b60755406f (patch) | |
tree | fa4f585008c6f5aa7850b2f5128a681b0065fcdc /indra/llui | |
parent | d04a3b6d4e67dafa0b6dd8e88b752c5a929de5b0 (diff) | |
parent | 310ec101dfd2c69ecc1a51d0a3a8ea12d5fdaf7a (diff) |
Merge downstream code and become version 3.8.3
Diffstat (limited to 'indra/llui')
-rwxr-xr-x | indra/llui/llcommandmanager.cpp | 19 | ||||
-rwxr-xr-x | indra/llui/llcommandmanager.h | 1 | ||||
-rwxr-xr-x | indra/llui/llfolderview.cpp | 3 | ||||
-rw-r--r-- | indra/llui/llfolderviewitem.cpp | 29 | ||||
-rwxr-xr-x | indra/llui/llfolderviewitem.h | 6 | ||||
-rwxr-xr-x | indra/llui/llfolderviewmodel.h | 4 |
6 files changed, 48 insertions, 14 deletions
diff --git a/indra/llui/llcommandmanager.cpp b/indra/llui/llcommandmanager.cpp index 74ef8dd0c3..3e159365e5 100755 --- a/indra/llui/llcommandmanager.cpp +++ b/indra/llui/llcommandmanager.cpp @@ -131,6 +131,25 @@ LLCommand * LLCommandManager::getCommand(const LLCommandId& commandId) return command_match; } +LLCommand * LLCommandManager::getCommand(const std::string& name) +{ + LLCommand * command_match = NULL; + + CommandVector::const_iterator it = mCommands.begin(); + + while (it != mCommands.end()) + { + if ((*it)->name() == name) + { + command_match = *it; + break; + } + it++; + } + + return command_match; +} + void LLCommandManager::addCommand(LLCommand * command) { LLCommandId command_id = command->id(); diff --git a/indra/llui/llcommandmanager.h b/indra/llui/llcommandmanager.h index ff5a8a3257..f2f2145953 100755 --- a/indra/llui/llcommandmanager.h +++ b/indra/llui/llcommandmanager.h @@ -190,6 +190,7 @@ public: U32 commandCount() const; LLCommand * getCommand(U32 commandIndex); LLCommand * getCommand(const LLCommandId& commandId); + LLCommand * getCommand(const std::string& name); static bool load(); diff --git a/indra/llui/llfolderview.cpp b/indra/llui/llfolderview.cpp index 4c05d001a0..3282c5f726 100755 --- a/indra/llui/llfolderview.cpp +++ b/indra/llui/llfolderview.cpp @@ -730,7 +730,7 @@ void LLFolderView::removeSelectedItems() // structures. std::vector<LLFolderViewItem*> items; S32 count = mSelectedItems.size(); - if(count == 0) return; + if(count <= 0) return; LLFolderViewItem* item = NULL; selected_items_t::iterator item_it; for (item_it = mSelectedItems.begin(); item_it != mSelectedItems.end(); ++item_it) @@ -947,7 +947,6 @@ void LLFolderView::cut() if (listener) { listener->cutToClipboard(); - listener->removeItem(); } } diff --git a/indra/llui/llfolderviewitem.cpp b/indra/llui/llfolderviewitem.cpp index f16cd8e124..3def0386e1 100644 --- a/indra/llui/llfolderviewitem.cpp +++ b/indra/llui/llfolderviewitem.cpp @@ -104,7 +104,8 @@ LLFolderViewItem::Params::Params() item_height("item_height"), item_top_pad("item_top_pad"), creation_date(), - allow_open("allow_open", true), + allow_wear("allow_wear", true), + allow_drop("allow_drop", true), font_color("font_color"), font_highlight_color("font_highlight_color"), left_pad("left_pad", 0), @@ -138,7 +139,8 @@ LLFolderViewItem::LLFolderViewItem(const LLFolderViewItem::Params& p) mRoot(p.root), mViewModelItem(p.listener), mIsMouseOverTitle(false), - mAllowOpen(p.allow_open), + mAllowWear(p.allow_wear), + mAllowDrop(p.allow_drop), mFontColor(p.font_color), mFontHighlightColor(p.font_highlight_color), mLeftPad(p.left_pad), @@ -472,7 +474,7 @@ void LLFolderViewItem::buildContextMenu(LLMenuGL& menu, U32 flags) void LLFolderViewItem::openItem( void ) { - if (mAllowOpen) + if (mAllowWear || !getViewModelItem()->isItemWearable()) { getViewModelItem()->openItem(); } @@ -1346,7 +1348,7 @@ void LLFolderViewFolder::gatherChildRangeExclusive(LLFolderViewItem* start, LLFo { return; } - if (selecting) + if (selecting && (*it)->getVisible()) { items.push_back(*it); } @@ -1365,7 +1367,7 @@ void LLFolderViewFolder::gatherChildRangeExclusive(LLFolderViewItem* start, LLFo return; } - if (selecting) + if (selecting && (*it)->getVisible()) { items.push_back(*it); } @@ -1387,7 +1389,7 @@ void LLFolderViewFolder::gatherChildRangeExclusive(LLFolderViewItem* start, LLFo return; } - if (selecting) + if (selecting && (*it)->getVisible()) { items.push_back(*it); } @@ -1406,7 +1408,7 @@ void LLFolderViewFolder::gatherChildRangeExclusive(LLFolderViewItem* start, LLFo return; } - if (selecting) + if (selecting && (*it)->getVisible()) { items.push_back(*it); } @@ -1509,12 +1511,14 @@ void LLFolderViewFolder::destroyView() while (!mItems.empty()) { LLFolderViewItem *itemp = mItems.back(); + mItems.pop_back(); itemp->destroyView(); // LLFolderViewItem::destroyView() removes entry from mItems } while (!mFolders.empty()) { LLFolderViewFolder *folderp = mFolders.back(); + mFolders.pop_back(); folderp->destroyView(); // LLFolderVievFolder::destroyView() removes entry from mFolders } @@ -1814,9 +1818,16 @@ BOOL LLFolderViewFolder::handleDragAndDropToThisFolder(MASK mask, EAcceptance* accept, std::string& tooltip_msg) { + if (!mAllowDrop) + { + *accept = ACCEPT_NO; + tooltip_msg = LLTrans::getString("TooltipOutboxCannotDropOnRoot"); + return TRUE; + } + BOOL accepted = getViewModelItem()->dragOrDrop(mask,drop,cargo_type,cargo_data, tooltip_msg); - - if (accepted) + + if (accepted) { mDragAndDropTarget = TRUE; *accept = ACCEPT_YES_MULTI; diff --git a/indra/llui/llfolderviewitem.h b/indra/llui/llfolderviewitem.h index f77d676f46..0322c8836d 100755 --- a/indra/llui/llfolderviewitem.h +++ b/indra/llui/llfolderviewitem.h @@ -59,7 +59,8 @@ public: item_top_pad; Optional<time_t> creation_date; - Optional<bool> allow_open; + Optional<bool> allow_wear; + Optional<bool> allow_drop; Optional<LLUIColor> font_color; Optional<LLUIColor> font_highlight_color; @@ -118,7 +119,8 @@ protected: mIsCurSelection, mDragAndDropTarget, mIsMouseOverTitle, - mAllowOpen, + mAllowWear, + mAllowDrop, mSelectPending; LLUIColor mFontColor; diff --git a/indra/llui/llfolderviewmodel.h b/indra/llui/llfolderviewmodel.h index 8e780c6752..a395af537a 100755 --- a/indra/llui/llfolderviewmodel.h +++ b/indra/llui/llfolderviewmodel.h @@ -157,6 +157,8 @@ public: virtual void openItem( void ) = 0; virtual void closeItem( void ) = 0; virtual void selectItem(void) = 0; + + virtual BOOL isItemWearable() const { return FALSE; } virtual BOOL isItemRenameable() const = 0; virtual BOOL renameItem(const std::string& new_name) = 0; @@ -170,7 +172,7 @@ public: virtual BOOL isItemCopyable() const = 0; virtual BOOL copyToClipboard() const = 0; - virtual BOOL cutToClipboard() const = 0; + virtual BOOL cutToClipboard() = 0; virtual BOOL isClipboardPasteable() const = 0; virtual void pasteFromClipboard() = 0; |