From faf262e2a97fe0d4ae63949381af62012606e9ef Mon Sep 17 00:00:00 2001 From: Vadim Savchuk Date: Thu, 15 Jul 2010 18:22:34 +0300 Subject: EXT-8373 FIXED Fixed translation of attachment points in "Attach..." / "Attach To..." menus (AE and inventory). There is an on_enable callback set for the menu items. It tries adding a suffix like "(obj_name)" if there is already an attachment on the attachment point. No matter whether the suffix has been actually added, the callback resets the menu item label to its parameter (cbparams["label"]). The problem was that we passed the original English attachment point name to the callback, that set it as the menu item name, thus screwing up translation. The fix is to pass translated attachment point name to the on_enable callback. Reviewed by Mike Antipov at https://codereview.productengine.com/secondlife/r/768/ --HG-- branch : product-engine --- indra/newview/llinventorybridge.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview/llinventorybridge.cpp') diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 7ec6440dc3..578c68410b 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -4134,7 +4134,7 @@ void LLObjectBridge::buildContextMenu(LLMenuGL& menu, U32 flags) } LLSD cbparams; cbparams["index"] = curiter->first; - cbparams["label"] = attachment->getName(); + cbparams["label"] = p.name; p.on_click.function_name = "Inventory.AttachObject"; p.on_click.parameter = LLSD(attachment->getName()); p.on_enable.function_name = "Attachment.Label"; -- 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/llinventorybridge.cpp | 31 +++++++++++++++++++++---------- 1 file changed, 21 insertions(+), 10 deletions(-) (limited to 'indra/newview/llinventorybridge.cpp') diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 578c68410b..4ac9edecbe 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -1444,7 +1444,7 @@ bool LLItemBridge::isRemoveAction(std::string action) const // | LLFolderBridge | // +=================================================+ -LLFolderBridge* LLFolderBridge::sSelf=NULL; +LLHandle LLFolderBridge::sSelf; // Can be moved to another folder BOOL LLFolderBridge::isItemMovable() const @@ -2388,8 +2388,11 @@ void LLFolderBridge::pasteLinkFromClipboard() void LLFolderBridge::staticFolderOptionsMenu() { - if (!sSelf) return; - sSelf->folderOptionsMenu(); + LLFolderBridge* selfp = sSelf.get(); + if (selfp) + { + selfp->folderOptionsMenu(); + } } void LLFolderBridge::folderOptionsMenu() @@ -2466,11 +2469,15 @@ void LLFolderBridge::folderOptionsMenu() } mItems.push_back(std::string("Outfit Separator")); } - hide_context_entries(*mMenu, mItems, disabled_items, TRUE); + LLMenuGL* menup = dynamic_cast(mMenu.get()); + if (menup) + { + hide_context_entries(*menup, mItems, disabled_items, TRUE); - // Reposition the menu, in case we're adding items to an existing menu. - mMenu->needsArrange(); - mMenu->arrangeAndClear(); + // Reposition the menu, in case we're adding items to an existing menu. + menup->needsArrange(); + menup->arrangeAndClear(); + } } BOOL LLFolderBridge::checkFolderForContentsOfType(LLInventoryModel* model, LLInventoryCollectFunctor& is_type) @@ -2512,6 +2519,10 @@ void LLFolderBridge::buildContextMenu(LLMenuGL& menu, U32 flags) mDisabledItems.push_back(std::string("New Body Parts")); } + // clear out old menu and folder pointers + mMenu.markDead(); + sSelf.markDead(); + if(trash_id == mUUID) { // This is the trash. @@ -2587,9 +2598,8 @@ void LLFolderBridge::buildContextMenu(LLMenuGL& menu, U32 flags) { mWearables=TRUE; } - - mMenu = &menu; - sSelf = this; + mMenu = menu.getHandle(); + sSelf = getHandle(); } // Preemptively disable system folder removal if more than one item selected. @@ -2619,6 +2629,7 @@ void LLFolderBridge::buildContextMenu(LLMenuGL& menu, U32 flags) { folders.push_back(category->getUUID()); } + LLRightClickInventoryFetchDescendentsObserver* fetch = new LLRightClickInventoryFetchDescendentsObserver(folders, FALSE); fetch->startFetch(); inc_busy_count(); -- cgit v1.2.3 From 2961992a7e135ca68e5d78b245ea9a43b4284e56 Mon Sep 17 00:00:00 2001 From: Loren Shih Date: Tue, 20 Jul 2010 12:50:13 -0400 Subject: EXT-8448 FIXED [crashhunters] Crash in LLFolderBridge::folderOptionsMenu(), and Trash folder options incorrect Minor fix to previous checkin for this crash. This fixes the UI issue where you're seeing the context options for the previous folder you clicked when you click on trash/library. --- indra/newview/llinventorybridge.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'indra/newview/llinventorybridge.cpp') diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 4ac9edecbe..0b1408616e 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -2598,8 +2598,6 @@ void LLFolderBridge::buildContextMenu(LLMenuGL& menu, U32 flags) { mWearables=TRUE; } - mMenu = menu.getHandle(); - sSelf = getHandle(); } // Preemptively disable system folder removal if more than one item selected. @@ -2630,6 +2628,8 @@ void LLFolderBridge::buildContextMenu(LLMenuGL& menu, U32 flags) folders.push_back(category->getUUID()); } + mMenu = menu.getHandle(); + sSelf = getHandle(); LLRightClickInventoryFetchDescendentsObserver* fetch = new LLRightClickInventoryFetchDescendentsObserver(folders, FALSE); fetch->startFetch(); inc_busy_count(); -- 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/llinventorybridge.cpp | 6 ------ 1 file changed, 6 deletions(-) (limited to 'indra/newview/llinventorybridge.cpp') diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 0b1408616e..f2a91defef 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -2612,12 +2612,6 @@ void LLFolderBridge::buildContextMenu(LLMenuGL& menu, U32 flags) mDisabledItems.push_back(std::string("Share")); } - if (mItems.empty()) - { - mItems.push_back(std::string("--no options--")); - mDisabledItems.push_back(std::string("--no options--")); - } - hide_context_entries(menu, mItems, mDisabledItems); // Add menu items that are dependent on the contents of the folder. -- cgit v1.2.3 From 34ab18d0c2f7de57e42ded0c3d94ee0fec17da28 Mon Sep 17 00:00:00 2001 From: Loren Shih Date: Mon, 26 Jul 2010 18:14:32 -0400 Subject: EXT-8918 FIXED Incorrect right-click options for library items Library items have "Share" disabled. --- indra/newview/llinventorybridge.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'indra/newview/llinventorybridge.cpp') diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index f2a91defef..38f3521b2d 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -952,6 +952,8 @@ void LLInvFVBridge::purgeItem(LLInventoryModel *model, const LLUUID &uuid) BOOL LLInvFVBridge::canShare() const { + if (!isAgentInventory()) return FALSE; + const LLInventoryModel* model = getInventoryModel(); if (!model) return FALSE; @@ -963,9 +965,10 @@ BOOL LLInvFVBridge::canShare() const return (BOOL)LLGiveInventory::isInventoryGiveAcceptable(item); } - // All categories can be given. - const LLViewerInventoryCategory* cat = model->getCategory(mUUID); - return (cat != NULL); + // Categories can be given. + if (model->getCategory(mUUID)) return TRUE; + + return FALSE; } // +=================================================+ -- cgit v1.2.3