diff options
Diffstat (limited to 'indra/newview/llpanelgroupnotices.cpp')
-rw-r--r-- | indra/newview/llpanelgroupnotices.cpp | 34 |
1 files changed, 25 insertions, 9 deletions
diff --git a/indra/newview/llpanelgroupnotices.cpp b/indra/newview/llpanelgroupnotices.cpp index 5f913d5469..ba50081fb2 100644 --- a/indra/newview/llpanelgroupnotices.cpp +++ b/indra/newview/llpanelgroupnotices.cpp @@ -38,12 +38,12 @@ #include "llinventory.h" #include "llviewerinventory.h" +#include "llinventorydefines.h" #include "llinventoryfunctions.h" #include "llinventorymodel.h" #include "llfloaterinventory.h" #include "llagent.h" #include "llagentui.h" -#include "lltooldraganddrop.h" #include "lllineeditor.h" #include "lltexteditor.h" @@ -59,6 +59,7 @@ #include "llviewerwindow.h" #include "llviewermessage.h" #include "llnotificationsutil.h" +#include "llgiveinventory.h" static LLRegisterPanelClassWrapper<LLPanelGroupNotices> t_panel_group_notices("panel_group_notices"); @@ -161,7 +162,7 @@ BOOL LLGroupDropTarget::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, { LLViewerInventoryItem* inv_item = (LLViewerInventoryItem*)cargo_data; if(gInventory.getItem(inv_item->getUUID()) - && LLToolDragAndDrop::isInventoryGroupGiveAcceptable(inv_item)) + && LLGiveInventory::isInventoryGroupGiveAcceptable(inv_item)) { // *TODO: get multiple object transfers working *accept = ACCEPT_YES_COPY_SINGLE; @@ -329,12 +330,12 @@ void LLPanelGroupNotices::setItem(LLPointer<LLInventoryItem> inv_item) mInventoryItem = inv_item; BOOL item_is_multi = FALSE; - if ( inv_item->getFlags() & LLInventoryItem::II_FLAGS_OBJECT_HAS_MULTIPLE_ITEMS ) + if ( inv_item->getFlags() & LLInventoryItemFlags::II_FLAGS_OBJECT_HAS_MULTIPLE_ITEMS ) { item_is_multi = TRUE; }; - std::string icon_name = get_item_icon_name(inv_item->getType(), + std::string icon_name = LLInventoryIcon::getIconName(inv_item->getType(), inv_item->getInventoryType(), inv_item->getFlags(), item_is_multi ); @@ -516,6 +517,11 @@ void LLPanelGroupNotices::processNotices(LLMessageSystem* msg) mNoticesList->setEnabled(TRUE); + //save sort state and set unsorted state to prevent unnecessary + //sorting while adding notices + bool save_sort = mNoticesList->isSorted(); + mNoticesList->setNeedsSort(false); + for (;i<count;++i) { msg->getUUID("Data","NoticeID",id,i); @@ -526,6 +532,13 @@ void LLPanelGroupNotices::processNotices(LLMessageSystem* msg) mNoticesList->setEnabled(FALSE); return; } + + //with some network delays we can receive notice list more then once... + //so add only unique notices + S32 pos = mNoticesList->getItemIndex(id); + + if(pos!=-1)//if items with this ID already in the list - skip it + continue; msg->getString("Data","Subject",subj,i); msg->getString("Data","FromName",name,i); @@ -539,9 +552,9 @@ void LLPanelGroupNotices::processNotices(LLMessageSystem* msg) row["columns"][0]["column"] = "icon"; if (has_attachment) { - std::string icon_name = get_item_icon_name( + std::string icon_name = LLInventoryIcon::getIconName( (LLAssetType::EType)asset_type, - LLInventoryType::IT_NONE,FALSE, FALSE); + LLInventoryType::IT_NONE); row["columns"][0]["type"] = "icon"; row["columns"][0]["value"] = icon_name; } @@ -561,6 +574,7 @@ void LLPanelGroupNotices::processNotices(LLMessageSystem* msg) mNoticesList->addElement(row, ADD_BOTTOM); } + mNoticesList->setNeedsSort(save_sort); mNoticesList->updateSort(); } @@ -606,9 +620,8 @@ void LLPanelGroupNotices::showNotice(const std::string& subject, { mInventoryOffer = inventory_offer; - std::string icon_name = get_item_icon_name(mInventoryOffer->mType, - LLInventoryType::IT_TEXTURE, - 0, FALSE); + std::string icon_name = LLInventoryIcon::getIconName(mInventoryOffer->mType, + LLInventoryType::IT_TEXTURE); mViewInventoryIcon->setValue(icon_name); mViewInventoryIcon->setVisible(TRUE); @@ -655,6 +668,9 @@ void LLPanelGroupNotices::setGroupID(const LLUUID& id) if(mViewMessage) mViewMessage->clear(); + + if(mViewInventoryName) + mViewInventoryName->clear(); activate(); } |