From 2aa9ecb60235c96a42f3719fab9dbc6ea1bf50db Mon Sep 17 00:00:00 2001 From: Loren Shih Date: Mon, 8 Mar 2010 17:38:50 -0500 Subject: EXT-5867 : Crash when clicking and dragging root folder of object contents into build floater Simple fix to use dynamic cast - the previous unsafe static cast was treating folders as if they were items and then querying permissions, which don't exist for folders. This code actually existed back in 1.23 but by some stroke of luck worked. --- indra/newview/llpanelobjectinventory.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'indra/newview/llpanelobjectinventory.cpp') diff --git a/indra/newview/llpanelobjectinventory.cpp b/indra/newview/llpanelobjectinventory.cpp index 5ddbdf7f01..6fcba80845 100644 --- a/indra/newview/llpanelobjectinventory.cpp +++ b/indra/newview/llpanelobjectinventory.cpp @@ -770,8 +770,8 @@ BOOL LLTaskCategoryBridge::startDrag(EDragAndDropType* type, LLUUID* id) const LLViewerObject* object = gObjectList.findObject(mPanel->getTaskUUID()); if(object) { - LLInventoryItem* inv = NULL; - if((inv = (LLInventoryItem*)object->getInventoryObject(mUUID))) + const LLInventoryItem *inv = dynamic_cast(object->getInventoryObject(mUUID)); + if (inv) { const LLPermissions& perm = inv->getPermissions(); bool can_copy = gAgent.allowOperation(PERM_COPY, perm, -- cgit v1.3 From 4d412d38ce63cc040f25b883bfc3e358a8c1bb7c Mon Sep 17 00:00:00 2001 From: Richard Nelson Date: Tue, 9 Mar 2010 16:16:07 -0800 Subject: EXT-6030 - [ Assert Failure] Assert in LLFolderViewFolder when select inventory folder after moving item between folders reviewed by Leyla --- indra/newview/llfolderview.cpp | 9 ++-- indra/newview/llfolderviewitem.cpp | 82 -------------------------------- indra/newview/llfolderviewitem.h | 10 +--- indra/newview/llpanelobjectinventory.cpp | 2 +- 4 files changed, 9 insertions(+), 94 deletions(-) (limited to 'indra/newview/llpanelobjectinventory.cpp') diff --git a/indra/newview/llfolderview.cpp b/indra/newview/llfolderview.cpp index cc807c2370..23062bafec 100644 --- a/indra/newview/llfolderview.cpp +++ b/indra/newview/llfolderview.cpp @@ -837,11 +837,14 @@ void LLFolderView::sanitizeSelection() void LLFolderView::clearSelection() { - if (mSelectedItems.size() > 0) + for (selected_items_t::const_iterator item_it = mSelectedItems.begin(); + item_it != mSelectedItems.end(); + ++item_it) { - recursiveDeselect(FALSE); - mSelectedItems.clear(); + (*item_it)->setUnselected(); } + + mSelectedItems.clear(); mSelectThisID.setNull(); } diff --git a/indra/newview/llfolderviewitem.cpp b/indra/newview/llfolderviewitem.cpp index 76607e4874..d3e3d2b57b 100644 --- a/indra/newview/llfolderviewitem.cpp +++ b/indra/newview/llfolderviewitem.cpp @@ -121,7 +121,6 @@ LLFolderViewItem::LLFolderViewItem(const LLFolderViewItem::Params& p) mHasVisibleChildren(FALSE), mIndentation(0), mItemHeight(p.item_height), - mNumDescendantsSelected(0), mPassedFilter(FALSE), mLastFilterGeneration(-1), mStringMatchOffset(std::string::npos), @@ -497,22 +496,6 @@ BOOL LLFolderViewItem::changeSelection(LLFolderViewItem* selection, BOOL selecte return FALSE; } -void LLFolderViewItem::recursiveDeselect(BOOL deselect_self) -{ - if (mIsSelected && deselect_self) - { - mIsSelected = FALSE; - - // update ancestors' count of selected descendents - LLFolderViewFolder* parent_folder = getParentFolder(); - while(parent_folder) - { - parent_folder->mNumDescendantsSelected--; - parent_folder = parent_folder->getParentFolder(); - } - } -} - BOOL LLFolderViewItem::isMovable() { @@ -1459,7 +1442,6 @@ BOOL LLFolderViewFolder::setSelection(LLFolderViewItem* selection, BOOL openitem { rv = TRUE; child_selected = TRUE; - mNumDescendantsSelected++; } } for (items_t::iterator iter = mItems.begin(); @@ -1470,7 +1452,6 @@ BOOL LLFolderViewFolder::setSelection(LLFolderViewItem* selection, BOOL openitem { rv = TRUE; child_selected = TRUE; - mNumDescendantsSelected++; } } if(openitem && child_selected) @@ -1503,14 +1484,6 @@ BOOL LLFolderViewFolder::changeSelection(LLFolderViewItem* selection, folders_t::iterator fit = iter++; if((*fit)->changeSelection(selection, selected)) { - if (selected) - { - mNumDescendantsSelected++; - } - else - { - mNumDescendantsSelected--; - } rv = TRUE; } } @@ -1520,14 +1493,6 @@ BOOL LLFolderViewFolder::changeSelection(LLFolderViewItem* selection, items_t::iterator iit = iter++; if((*iit)->changeSelection(selection, selected)) { - if (selected) - { - mNumDescendantsSelected++; - } - else - { - mNumDescendantsSelected--; - } rv = TRUE; } } @@ -1544,7 +1509,6 @@ S32 LLFolderViewFolder::extendSelection(LLFolderViewItem* selection, LLFolderVie { folders_t::iterator fit = iter++; num_selected += (*fit)->extendSelection(selection, last_selected, selected_items); - mNumDescendantsSelected += num_selected; } // handle selection of our immediate children... @@ -1637,7 +1601,6 @@ S32 LLFolderViewFolder::extendSelection(LLFolderViewItem* selection, LLFolderVie if (item->changeSelection(item, TRUE)) { selected_items.put(item); - mNumDescendantsSelected++; num_selected++; } } @@ -1648,7 +1611,6 @@ S32 LLFolderViewFolder::extendSelection(LLFolderViewItem* selection, LLFolderVie if (selection->changeSelection(selection, TRUE)) { selected_items.put(selection); - mNumDescendantsSelected++; num_selected++; } } @@ -1656,47 +1618,6 @@ S32 LLFolderViewFolder::extendSelection(LLFolderViewItem* selection, LLFolderVie return num_selected; } -void LLFolderViewFolder::recursiveDeselect(BOOL deselect_self) -{ - // make sure we don't have negative values - llassert(mNumDescendantsSelected >= 0); - - if (mIsSelected && deselect_self) - { - mIsSelected = FALSE; - - // update ancestors' count of selected descendents - LLFolderViewFolder* parent_folder = getParentFolder(); - while(parent_folder) - { - parent_folder->mNumDescendantsSelected--; - parent_folder = parent_folder->getParentFolder(); - } - } - - if (0 == mNumDescendantsSelected) - { - return; - } - - for (items_t::iterator iter = mItems.begin(); - iter != mItems.end();) - { - items_t::iterator iit = iter++; - LLFolderViewItem* item = (*iit); - item->recursiveDeselect(TRUE); - } - - for (folders_t::iterator iter = mFolders.begin(); - iter != mFolders.end();) - { - folders_t::iterator fit = iter++; - LLFolderViewFolder* folder = (*fit); - folder->recursiveDeselect(TRUE); - } - -} - void LLFolderViewFolder::destroyView() { for (items_t::iterator iter = mItems.begin(); @@ -1730,8 +1651,6 @@ BOOL LLFolderViewFolder::removeItem(LLFolderViewItem* item) { if(item->remove()) { - //RN: this seem unneccessary as remove() moves to trash - //removeView(item); return TRUE; } return FALSE; @@ -1746,7 +1665,6 @@ void LLFolderViewFolder::removeView(LLFolderViewItem* item) return; } // deselect without traversing hierarchy - item->recursiveDeselect(TRUE); getRoot()->removeFromSelectionList(item); extractItem(item); delete item; diff --git a/indra/newview/llfolderviewitem.h b/indra/newview/llfolderviewitem.h index be8e73a5a9..655ad89e99 100644 --- a/indra/newview/llfolderviewitem.h +++ b/indra/newview/llfolderviewitem.h @@ -150,7 +150,6 @@ protected: BOOL mHasVisibleChildren; S32 mIndentation; S32 mItemHeight; - S32 mNumDescendantsSelected; BOOL mPassedFilter; S32 mLastFilterGeneration; std::string::size_type mStringMatchOffset; @@ -231,9 +230,6 @@ public: // this method is used to group select items virtual S32 extendSelection(LLFolderViewItem* selection, LLFolderViewItem* last_selected, LLDynamicArray& items){ return FALSE; } - // this method is used to group select items - virtual void recursiveDeselect(BOOL deselect_self); - // gets multiple-element selection virtual BOOL getSelectionList(std::set &selection) const {return TRUE;} @@ -246,10 +242,10 @@ public: // destroys this item recursively virtual void destroyView(); - S32 getNumSelectedDescendants() { return mNumDescendantsSelected; } - BOOL isSelected() { return mIsSelected; } + void setUnselected() { mIsSelected = FALSE; } + void setIsCurSelection(BOOL select) { mIsCurSelection = select; } BOOL getIsCurSelection() { return mIsCurSelection; } @@ -441,8 +437,6 @@ public: // this method is used to group select items virtual S32 extendSelection(LLFolderViewItem* selection, LLFolderViewItem* last_selected, LLDynamicArray& items); - virtual void recursiveDeselect(BOOL deselect_self); - // Returns true is this object and all of its children can be removed. virtual BOOL isRemovable(); diff --git a/indra/newview/llpanelobjectinventory.cpp b/indra/newview/llpanelobjectinventory.cpp index 6fcba80845..dedd1afcde 100644 --- a/indra/newview/llpanelobjectinventory.cpp +++ b/indra/newview/llpanelobjectinventory.cpp @@ -1642,7 +1642,7 @@ void LLPanelObjectInventory::updateInventory() // We're still interested in this task's inventory. std::set selected_items; BOOL inventory_has_focus = FALSE; - if (mHaveInventory && mFolders->getNumSelectedDescendants()) + if (mHaveInventory) { mFolders->getSelectionList(selected_items); inventory_has_focus = gFocusMgr.childHasKeyboardFocus(mFolders); -- cgit v1.3 From bda0e60f98cc7e07fe50bff6a4842c2791ec3ef7 Mon Sep 17 00:00:00 2001 From: Yuri Chebotarev Date: Tue, 16 Mar 2010 15:31:30 +0200 Subject: fix for normal EXT-6354 [HARD CODED] - Inventory, Filter-popup: Title isnґt localized reviwed https://codereview.productengine.com/secondlife/r/35/ MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --HG-- branch : product-engine --- indra/newview/llfolderview.cpp | 2 +- indra/newview/llfolderview.h | 5 +++-- indra/newview/llinventorypanel.cpp | 1 + indra/newview/llpanelobjectinventory.cpp | 1 + indra/newview/llplacesinventorypanel.cpp | 1 + 5 files changed, 7 insertions(+), 3 deletions(-) (limited to 'indra/newview/llpanelobjectinventory.cpp') diff --git a/indra/newview/llfolderview.cpp b/indra/newview/llfolderview.cpp index 0de41ee591..f74d912842 100644 --- a/indra/newview/llfolderview.cpp +++ b/indra/newview/llfolderview.cpp @@ -186,7 +186,7 @@ LLFolderView::LLFolderView(const Params& p) mNeedsAutoRename(FALSE), mDebugFilters(FALSE), mSortOrder(LLInventoryFilter::SO_FOLDERS_BY_NAME), // This gets overridden by a pref immediately - mFilter( new LLInventoryFilter(p.name) ), + mFilter( new LLInventoryFilter(p.title) ), mShowSelectionContext(FALSE), mShowSingleSelection(FALSE), mArrangeGeneration(0), diff --git a/indra/newview/llfolderview.h b/indra/newview/llfolderview.h index 38255b3cea..42390dfd17 100644 --- a/indra/newview/llfolderview.h +++ b/indra/newview/llfolderview.h @@ -93,8 +93,9 @@ class LLFolderView : public LLFolderViewFolder, public LLEditMenuHandler public: struct Params : public LLInitParam::Block { - Mandatory parent_panel; - Optional task_id; + Mandatory parent_panel; + Optional task_id; + Optional title; }; LLFolderView(const Params&); virtual ~LLFolderView( void ); diff --git a/indra/newview/llinventorypanel.cpp b/indra/newview/llinventorypanel.cpp index 8097985ade..ec83a1fd6d 100644 --- a/indra/newview/llinventorypanel.cpp +++ b/indra/newview/llinventorypanel.cpp @@ -118,6 +118,7 @@ BOOL LLInventoryPanel::postBuild() 0); LLFolderView::Params p; p.name = getName(); + p.title = getLabel(); p.rect = folder_rect; p.parent_panel = this; p.tool_tip = p.name; diff --git a/indra/newview/llpanelobjectinventory.cpp b/indra/newview/llpanelobjectinventory.cpp index dedd1afcde..c14812ca17 100644 --- a/indra/newview/llpanelobjectinventory.cpp +++ b/indra/newview/llpanelobjectinventory.cpp @@ -1575,6 +1575,7 @@ void LLPanelObjectInventory::reset() LLRect dummy_rect(0, 1, 1, 0); LLFolderView::Params p; p.name = "task inventory"; + p.title = "task inventory"; p.task_id = getTaskUUID(); p.parent_panel = this; p.tool_tip= p.name; diff --git a/indra/newview/llplacesinventorypanel.cpp b/indra/newview/llplacesinventorypanel.cpp index f1e450a083..ed0fb54051 100644 --- a/indra/newview/llplacesinventorypanel.cpp +++ b/indra/newview/llplacesinventorypanel.cpp @@ -92,6 +92,7 @@ BOOL LLPlacesInventoryPanel::postBuild() 0); LLPlacesFolderView::Params p; p.name = getName(); + p.title = getLabel(); p.rect = folder_rect; p.parent_panel = this; mFolders = (LLFolderView*)LLUICtrlFactory::create(p); -- cgit v1.3 From b3f305ae9464201445328f9e6c980357aba21ef7 Mon Sep 17 00:00:00 2001 From: Andrew Dyukov Date: Tue, 16 Mar 2010 18:29:56 +0200 Subject: Implemented normal task EXT-5982([HARD CODED] on L$ kaufen window (Buy L$)). - Moved hardcoded strings in LLFloaterBuyCurrency::buyCurrency() calls to strings.xml Reviewed by Vadim Savchuk at https://codereview.productengine.com/secondlife/r/33/ --HG-- branch : product-engine --- indra/newview/llassetuploadresponders.cpp | 3 ++- indra/newview/llpanelobjectinventory.cpp | 2 +- indra/newview/llpanelplaceprofile.cpp | 2 +- indra/newview/llviewermenu.cpp | 3 ++- indra/newview/llviewermenufile.cpp | 2 +- indra/newview/llviewermessage.cpp | 2 +- indra/newview/skins/default/xui/en/strings.xml | 7 +++++++ 7 files changed, 15 insertions(+), 6 deletions(-) (limited to 'indra/newview/llpanelobjectinventory.cpp') diff --git a/indra/newview/llassetuploadresponders.cpp b/indra/newview/llassetuploadresponders.cpp index a2322e28b4..80cf8f1d61 100644 --- a/indra/newview/llassetuploadresponders.cpp +++ b/indra/newview/llassetuploadresponders.cpp @@ -55,6 +55,7 @@ #include "llviewermenufile.h" #include "llviewerwindow.h" #include "lltexlayer.h" +#include "lltrans.h" // library includes #include "lldir.h" @@ -181,7 +182,7 @@ void LLAssetUploadResponder::uploadFailure(const LLSD& content) // deal with L$ errors if (reason == "insufficient funds") { - LLFloaterBuyCurrency::buyCurrency("Uploading costs", LLGlobalEconomy::Singleton::getInstance()->getPriceUpload()); + LLFloaterBuyCurrency::buyCurrency(LLTrans::getString("uploading_costs"), LLGlobalEconomy::Singleton::getInstance()->getPriceUpload()); } else { diff --git a/indra/newview/llpanelobjectinventory.cpp b/indra/newview/llpanelobjectinventory.cpp index c14812ca17..9e92ee337f 100644 --- a/indra/newview/llpanelobjectinventory.cpp +++ b/indra/newview/llpanelobjectinventory.cpp @@ -609,7 +609,7 @@ void LLTaskInvFVBridge::performAction(LLFolderView* folder, LLInventoryModel* mo { if (price > 0 && price > gStatusBar->getBalance()) { - LLFloaterBuyCurrency::buyCurrency("This costs", price); + LLFloaterBuyCurrency::buyCurrency(LLTrans::getString("this_costs"), price); } else { diff --git a/indra/newview/llpanelplaceprofile.cpp b/indra/newview/llpanelplaceprofile.cpp index 9e5f9da0ea..cdd79b1559 100644 --- a/indra/newview/llpanelplaceprofile.cpp +++ b/indra/newview/llpanelplaceprofile.cpp @@ -569,7 +569,7 @@ void LLPanelPlaceProfile::onForSaleBannerClick() { if(parcel->getSalePrice() - gStatusBar->getBalance() > 0) { - LLFloaterBuyCurrency::buyCurrency("Buying selected land ", parcel->getSalePrice()); + LLFloaterBuyCurrency::buyCurrency(LLTrans::getString("buying_selected_land"), parcel->getSalePrice()); } else { diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index bc3b8ac9d6..1d58daba2c 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -103,6 +103,7 @@ #include "llfloatercamera.h" #include "lluilistener.h" #include "llappearancemgr.h" +#include "lltrans.h" using namespace LLVOAvatarDefines; @@ -3272,7 +3273,7 @@ void handle_buy_object(LLSaleInfo sale_info) if (price > 0 && price > gStatusBar->getBalance()) { - LLFloaterBuyCurrency::buyCurrency("This object costs", price); + LLFloaterBuyCurrency::buyCurrency(LLTrans::getString("this_object_costs"), price); return; } diff --git a/indra/newview/llviewermenufile.cpp b/indra/newview/llviewermenufile.cpp index 84b270f8cc..00762894cd 100644 --- a/indra/newview/llviewermenufile.cpp +++ b/indra/newview/llviewermenufile.cpp @@ -1001,7 +1001,7 @@ void upload_new_resource(const LLTransactionID &tid, LLAssetType::EType asset_ty if (balance < expected_upload_cost) { // insufficient funds, bail on this upload - LLFloaterBuyCurrency::buyCurrency("Uploading costs", expected_upload_cost); + LLFloaterBuyCurrency::buyCurrency(LLTrans::getString("uploading_costs"), expected_upload_cost); return; } } diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index 2b4f33b8ed..eed3f25231 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -272,7 +272,7 @@ void give_money(const LLUUID& uuid, LLViewerRegion* region, S32 amount, BOOL is_ } else { - LLFloaterBuyCurrency::buyCurrency("Giving", amount); + LLFloaterBuyCurrency::buyCurrency(LLTrans::getString("giving"), amount); } } diff --git a/indra/newview/skins/default/xui/en/strings.xml b/indra/newview/skins/default/xui/en/strings.xml index 431ecda5f1..111daec242 100644 --- a/indra/newview/skins/default/xui/en/strings.xml +++ b/indra/newview/skins/default/xui/en/strings.xml @@ -3029,7 +3029,14 @@ If you continue to receive this message, contact the [SUPPORT_SITE]. [SOURCES] have said something new " + [NAME] paid you L$[AMOUNT] + Giving + Uploading costs + This costs + Buying selected land + This object costs" + Everyone Officers Owners -- cgit v1.3 From 24d95dc0ba3a1fc642484192d79d92bcaa6dfdd9 Mon Sep 17 00:00:00 2001 From: Mike Antipov Date: Wed, 17 Mar 2010 10:57:45 +0200 Subject: Fixed normal task EXT-6021 [HARD CODED] Bubble shown when you mouseover on script within Contents is in EN (task inventory) * Added new string name="PanelContentsTooltip into strings.xml * Set this tooltip to LLFolderView inside the Build Tool Note: Fix for localization of default "New Script" name will be fixed in the EXT-5839. Reviewed by Richard Nelson at https://codereview.productengine.com/secondlife/r/43/ --HG-- branch : product-engine --- indra/newview/llpanelobjectinventory.cpp | 2 +- indra/newview/skins/default/xui/en/strings.xml | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) (limited to 'indra/newview/llpanelobjectinventory.cpp') diff --git a/indra/newview/llpanelobjectinventory.cpp b/indra/newview/llpanelobjectinventory.cpp index 9e92ee337f..7505581904 100644 --- a/indra/newview/llpanelobjectinventory.cpp +++ b/indra/newview/llpanelobjectinventory.cpp @@ -1578,7 +1578,7 @@ void LLPanelObjectInventory::reset() p.title = "task inventory"; p.task_id = getTaskUUID(); p.parent_panel = this; - p.tool_tip= p.name; + p.tool_tip= LLTrans::getString("PanelContentsTooltip"); mFolders = LLUICtrlFactory::create(p); // this ensures that we never say "searching..." or "no items found" mFolders->getFilter()->setShowFolderState(LLInventoryFilter::SHOW_ALL_FOLDERS); diff --git a/indra/newview/skins/default/xui/en/strings.xml b/indra/newview/skins/default/xui/en/strings.xml index 111daec242..707a830622 100644 --- a/indra/newview/skins/default/xui/en/strings.xml +++ b/indra/newview/skins/default/xui/en/strings.xml @@ -2121,6 +2121,7 @@ Clears (deletes) the media and all params from the given face. New Script + Content of object The Resident you messaged is in 'busy mode' which means they have requested not to be disturbed. Your message will still be shown in their IM panel for later viewing. -- cgit v1.3 From 00c4dabc2ba4052f66654c871f82f90e21500d9d Mon Sep 17 00:00:00 2001 From: Dmitry Zaporozhan Date: Thu, 18 Mar 2010 17:32:44 +0200 Subject: Fixed major bug EXT-2707 - Coalesced objects do not show the proper icon in inventory. Added new icon for multi-objects. New icon is used in inventory, object inventory and buy floater. New icon can not be used in Group Notices because server does not send enough info in GroupNoticesListReply. --HG-- branch : product-engine --- indra/newview/llfloaterbuy.cpp | 3 ++- indra/newview/llinventorybridge.cpp | 7 +++++-- indra/newview/llpanelobjectinventory.cpp | 16 ++++++++++++---- indra/newview/llviewertexteditor.cpp | 5 ++++- .../skins/default/textures/icons/Inv_Object_Multi.png | Bin 0 -> 774 bytes indra/newview/skins/default/textures/textures.xml | 1 + 6 files changed, 24 insertions(+), 8 deletions(-) create mode 100644 indra/newview/skins/default/textures/icons/Inv_Object_Multi.png (limited to 'indra/newview/llpanelobjectinventory.cpp') diff --git a/indra/newview/llfloaterbuy.cpp b/indra/newview/llfloaterbuy.cpp index fba557c656..589f570d96 100644 --- a/indra/newview/llfloaterbuy.cpp +++ b/indra/newview/llfloaterbuy.cpp @@ -246,7 +246,8 @@ void LLFloaterBuy::inventoryChanged(LLViewerObject* obj, // Compute icon for this item BOOL item_is_multi = FALSE; - if ( inv_item->getFlags() & LLInventoryItem::II_FLAGS_LANDMARK_VISITED ) + if ( inv_item->getFlags() & LLInventoryItem::II_FLAGS_LANDMARK_VISITED + || inv_item->getFlags() & LLInventoryItem::II_FLAGS_OBJECT_HAS_MULTIPLE_ITEMS) { item_is_multi = TRUE; } diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 1f918c72ea..6fedd9ac4d 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -103,7 +103,7 @@ std::string ICON_NAME[ICON_NAME_COUNT] = "Inv_Script", "Inv_Clothing", "Inv_Object", - "Inv_Object", + "Inv_Object_Multi", "Inv_Notecard", "Inv_Skin", "Inv_Snapshot", @@ -5358,7 +5358,10 @@ LLUIImagePtr LLLinkItemBridge::getIcon() const { if (LLViewerInventoryItem *item = getItem()) { - return get_item_icon(item->getActualType(), item->getInventoryType(), 0, FALSE); + U32 attachment_point = (item->getFlags() & 0xff); // low byte of inventory flags + bool is_multi = LLInventoryItem::II_FLAGS_OBJECT_HAS_MULTIPLE_ITEMS & item->getFlags(); + + return get_item_icon(item->getActualType(), item->getInventoryType(), attachment_point, is_multi); } return get_item_icon(LLAssetType::AT_LINK, LLInventoryType::IT_NONE, 0, FALSE); } diff --git a/indra/newview/llpanelobjectinventory.cpp b/indra/newview/llpanelobjectinventory.cpp index 7505581904..69b8571bfb 100644 --- a/indra/newview/llpanelobjectinventory.cpp +++ b/indra/newview/llpanelobjectinventory.cpp @@ -1188,7 +1188,8 @@ public: LLTaskObjectBridge( LLPanelObjectInventory* panel, const LLUUID& uuid, - const std::string& name); + const std::string& name, + U32 flags = 0); virtual LLUIImagePtr getIcon() const; }; @@ -1196,8 +1197,9 @@ public: LLTaskObjectBridge::LLTaskObjectBridge( LLPanelObjectInventory* panel, const LLUUID& uuid, - const std::string& name) : - LLTaskInvFVBridge(panel, uuid, name) + const std::string& name, + U32 flags) : + LLTaskInvFVBridge(panel, uuid, name, flags) { } @@ -1442,9 +1444,15 @@ LLTaskInvFVBridge* LLTaskInvFVBridge::createObjectBridge(LLPanelObjectInventory* // object->getName()); break; case LLAssetType::AT_OBJECT: + { + item = dynamic_cast(object); + U32 flags = ( NULL == item ? 0 : item->getFlags() ); + new_bridge = new LLTaskObjectBridge(panel, object->getUUID(), - object->getName()); + object->getName(), + flags); + } break; case LLAssetType::AT_NOTECARD: new_bridge = new LLTaskNotecardBridge(panel, diff --git a/indra/newview/llviewertexteditor.cpp b/indra/newview/llviewertexteditor.cpp index ea8af223c3..c9b3886fef 100644 --- a/indra/newview/llviewertexteditor.cpp +++ b/indra/newview/llviewertexteditor.cpp @@ -524,7 +524,10 @@ LLUIImagePtr LLEmbeddedItems::getItemImage(llwchar ext_char) const break; case LLAssetType::AT_SOUND: img_name = "Inv_Sound"; break; case LLAssetType::AT_CLOTHING: img_name = "Inv_Clothing"; break; - case LLAssetType::AT_OBJECT: img_name = "Inv_Object"; break; + case LLAssetType::AT_OBJECT: + img_name = LLInventoryItem::II_FLAGS_OBJECT_HAS_MULTIPLE_ITEMS & item->getFlags() ? + "Inv_Object_Multi" : "Inv_Object"; + break; case LLAssetType::AT_CALLINGCARD: img_name = "Inv_CallingCard"; break; case LLAssetType::AT_LANDMARK: img_name = "Inv_Landmark"; break; case LLAssetType::AT_NOTECARD: img_name = "Inv_Notecard"; break; diff --git a/indra/newview/skins/default/textures/icons/Inv_Object_Multi.png b/indra/newview/skins/default/textures/icons/Inv_Object_Multi.png new file mode 100644 index 0000000000..11f4871ad8 Binary files /dev/null and b/indra/newview/skins/default/textures/icons/Inv_Object_Multi.png differ diff --git a/indra/newview/skins/default/textures/textures.xml b/indra/newview/skins/default/textures/textures.xml index b1594816b2..a3e5361e76 100644 --- a/indra/newview/skins/default/textures/textures.xml +++ b/indra/newview/skins/default/textures/textures.xml @@ -247,6 +247,7 @@ with the same filename but different name + -- cgit v1.3 From c74f87015118a6da7036623d026fc512f46af9d5 Mon Sep 17 00:00:00 2001 From: Sergei Litovchuk Date: Thu, 18 Mar 2010 19:42:38 +0200 Subject: (EXT-5982) [FRAGMENTATION] L$ kaufen window (Buy L$) - Moved hardcoded strings in LLFloaterBuyCurrency::buyCurrency() calls to strings.xml Reviewed by Vadim Savchuk https://codereview.productengine.com/secondlife/r/56/ --HG-- branch : product-engine --- indra/newview/llassetuploadresponders.cpp | 5 ++++- indra/newview/llfloaterbuycurrency.cpp | 3 +-- indra/newview/llpanelobjectinventory.cpp | 4 +++- indra/newview/llpanelplaceprofile.cpp | 8 ++++++-- indra/newview/llviewermenu.cpp | 8 ++++++-- indra/newview/llviewermenufile.cpp | 12 +++++++----- indra/newview/llviewermessage.cpp | 4 +++- indra/newview/skins/default/xui/en/floater_buy_currency.xml | 2 +- indra/newview/skins/default/xui/en/strings.xml | 13 +++++++------ 9 files changed, 38 insertions(+), 21 deletions(-) (limited to 'indra/newview/llpanelobjectinventory.cpp') diff --git a/indra/newview/llassetuploadresponders.cpp b/indra/newview/llassetuploadresponders.cpp index 80cf8f1d61..8441796219 100644 --- a/indra/newview/llassetuploadresponders.cpp +++ b/indra/newview/llassetuploadresponders.cpp @@ -182,7 +182,10 @@ void LLAssetUploadResponder::uploadFailure(const LLSD& content) // deal with L$ errors if (reason == "insufficient funds") { - LLFloaterBuyCurrency::buyCurrency(LLTrans::getString("uploading_costs"), LLGlobalEconomy::Singleton::getInstance()->getPriceUpload()); + S32 price = LLGlobalEconomy::Singleton::getInstance()->getPriceUpload(); + LLStringUtil::format_map_t args; + args["AMOUNT"] = llformat("%d", price); + LLFloaterBuyCurrency::buyCurrency(LLTrans::getString("uploading_costs", args), price); } else { diff --git a/indra/newview/llfloaterbuycurrency.cpp b/indra/newview/llfloaterbuycurrency.cpp index 1642e6725e..7fddd1fc5f 100644 --- a/indra/newview/llfloaterbuycurrency.cpp +++ b/indra/newview/llfloaterbuycurrency.cpp @@ -234,8 +234,7 @@ void LLFloaterBuyCurrencyUI::updateUI() if (mHasTarget) { childSetVisible("buy_action", true); - childSetTextArg("buy_action", "[NAME]", mTargetName); - childSetTextArg("buy_action", "[PRICE]", llformat("%d",mTargetPrice)); + childSetTextArg("buy_action", "[ACTION]", mTargetName); } } diff --git a/indra/newview/llpanelobjectinventory.cpp b/indra/newview/llpanelobjectinventory.cpp index 69b8571bfb..c43cbf5819 100644 --- a/indra/newview/llpanelobjectinventory.cpp +++ b/indra/newview/llpanelobjectinventory.cpp @@ -609,7 +609,9 @@ void LLTaskInvFVBridge::performAction(LLFolderView* folder, LLInventoryModel* mo { if (price > 0 && price > gStatusBar->getBalance()) { - LLFloaterBuyCurrency::buyCurrency(LLTrans::getString("this_costs"), price); + LLStringUtil::format_map_t args; + args["AMOUNT"] = llformat("%d", price); + LLFloaterBuyCurrency::buyCurrency(LLTrans::getString("this_costs", args), price); } else { diff --git a/indra/newview/llpanelplaceprofile.cpp b/indra/newview/llpanelplaceprofile.cpp index cdd79b1559..1a1650c38b 100644 --- a/indra/newview/llpanelplaceprofile.cpp +++ b/indra/newview/llpanelplaceprofile.cpp @@ -567,9 +567,13 @@ void LLPanelPlaceProfile::onForSaleBannerClick() if(parcel->getLocalID() == mSelectedParcelID && mLastSelectedRegionID ==selected_region->getRegionID()) { - if(parcel->getSalePrice() - gStatusBar->getBalance() > 0) + S32 price = parcel->getSalePrice(); + + if(price - gStatusBar->getBalance() > 0) { - LLFloaterBuyCurrency::buyCurrency(LLTrans::getString("buying_selected_land"), parcel->getSalePrice()); + LLStringUtil::format_map_t args; + args["AMOUNT"] = llformat("%d", price); + LLFloaterBuyCurrency::buyCurrency(LLTrans::getString("buying_selected_land", args), price); } else { diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index 5c40d02f8d..dc8185c770 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -3274,7 +3274,9 @@ void handle_buy_object(LLSaleInfo sale_info) if (price > 0 && price > gStatusBar->getBalance()) { - LLFloaterBuyCurrency::buyCurrency(LLTrans::getString("this_object_costs"), price); + LLStringUtil::format_map_t args; + args["AMOUNT"] = llformat("%d", price); + LLFloaterBuyCurrency::buyCurrency(LLTrans::getString("this_object_costs", args), price); return; } @@ -4404,8 +4406,10 @@ void handle_buy_or_take() } else { + LLStringUtil::format_map_t args; + args["AMOUNT"] = llformat("%d", total_price); LLFloaterBuyCurrency::buyCurrency( - "Buying this costs", total_price); + LLTrans::getString("BuyingCosts", args), total_price); } } else diff --git a/indra/newview/llviewermenufile.cpp b/indra/newview/llviewermenufile.cpp index 00762894cd..dfde9a9d1d 100644 --- a/indra/newview/llviewermenufile.cpp +++ b/indra/newview/llviewermenufile.cpp @@ -811,10 +811,10 @@ void upload_done_callback(const LLUUID& uuid, void* user_data, S32 result, LLExt if(!(can_afford_transaction(expected_upload_cost))) { - LLFloaterBuyCurrency::buyCurrency( - llformat(LLTrans::getString("UploadingCosts").c_str(), - data->mAssetInfo.getName().c_str()), - expected_upload_cost); + LLStringUtil::format_map_t args; + args["NAME"] = data->mAssetInfo.getName(); + args["AMOUNT"] = llformat("%d", expected_upload_cost); + LLFloaterBuyCurrency::buyCurrency(LLTrans::getString("UploadingCosts", args), expected_upload_cost); is_balance_sufficient = FALSE; } else if(region) @@ -1001,7 +1001,9 @@ void upload_new_resource(const LLTransactionID &tid, LLAssetType::EType asset_ty if (balance < expected_upload_cost) { // insufficient funds, bail on this upload - LLFloaterBuyCurrency::buyCurrency(LLTrans::getString("uploading_costs"), expected_upload_cost); + LLStringUtil::format_map_t args; + args["AMOUNT"] = llformat("%d", expected_upload_cost); + LLFloaterBuyCurrency::buyCurrency(LLTrans::getString("uploading_costs", args), expected_upload_cost); return; } } diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index bd0012057c..210557f68f 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -272,7 +272,9 @@ void give_money(const LLUUID& uuid, LLViewerRegion* region, S32 amount, BOOL is_ } else { - LLFloaterBuyCurrency::buyCurrency(LLTrans::getString("giving"), amount); + LLStringUtil::format_map_t args; + args["AMOUNT"] = llformat("%d", amount); + LLFloaterBuyCurrency::buyCurrency(LLTrans::getString("giving", args), amount); } } diff --git a/indra/newview/skins/default/xui/en/floater_buy_currency.xml b/indra/newview/skins/default/xui/en/floater_buy_currency.xml index 961bd6b5e4..e02d32596a 100644 --- a/indra/newview/skins/default/xui/en/floater_buy_currency.xml +++ b/indra/newview/skins/default/xui/en/floater_buy_currency.xml @@ -182,7 +182,7 @@ width="180" layout="topleft" name="buy_action"> - [NAME] L$ [PRICE] + [ACTION] Acquired Items Cancel - Uploading %s costs + Uploading [NAME] costs L$ [AMOUNT] + Buying this costs L$ [AMOUNT] Unknown file extension .%s Expected .wav, .tga, .bmp, .jpg, .jpeg, or .bvh @@ -3060,11 +3061,11 @@ If you continue to receive this message, contact the [SUPPORT_SITE]. to join a group to upload - Giving - Uploading costs - This costs - Buying selected land - This object costs" + Giving L$ [AMOUNT] + Uploading costs L$ [AMOUNT] + This costs L$ [AMOUNT] + Buying selected land L$ [AMOUNT] + This object costs L$ [AMOUNT] Everyone Officers -- cgit v1.3