[opensource-dev] Review Request: STORM-737 Add "+" menu to Inventory/Recent
Aleric Inglewood
Aleric.Inglewood at gmail.com
Fri Dec 24 13:25:16 PST 2010
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://codereview.secondlife.com/r/65/#review88
-----------------------------------------------------------
indra/newview/llpanelmaininventory.cpp
<http://codereview.secondlife.com/r/65/#comment62>
While you're removing that empty line anyway, I thought I'd help you to not learn the bad coding habbits of whoever wrote the original code ;).
operator== returns a bool, might as well do the conversions one step later (if at all) and use a bool here.
Using 'bool' always has the preference (BOOL is ugly window-ism).
Certainly in this case since !recent_active converts it to a bool again! (bool --> BOOL -> bool -> BOOL now).
Secondly, when testing if a variable is equal to a literal/constant, I think that's better readable to put the variable up front, thus: mActivePanel()->getName() == "Recent Items".
Finally, although you may choose to leave it like it is, be aware that the extra 'variable' recent_active here was only added as pseudo 'comment' and to because the monitor of the original coder wasn't wide enough. If you have a normal 22" inch like all devs, you might also consider the more professional looking:
// "New Folder" is broken for the Recent Items tab. Do not enable it for that case.
mMenuAdd->getChild<LLMenuItemGL>("New Folder")->setEnabled(mActivePanel->getName() != "Recent Items");
- Aleric
On 2010-12-23 13:25:31, Jonathan Yap wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://codereview.secondlife.com/r/65/
> -----------------------------------------------------------
>
> (Updated 2010-12-23 13:25:31)
>
>
> Review request for Viewer.
>
>
> Summary
> -------
>
> This change enables the "+" menu in Inventory/Recent
> It grays out "New Folder" in this menu
> It enables identical menu entries when you right click on an inventory item.
>
> Question:
> Is graying out "New Folder" best done where I am doing it now -- in
> llpanelmaininventory.cpp / LLPanelMainInventory::onAddButtonClick()
>
>
> This addresses bug storm-737.
> http://jira.secondlife.com/browse/storm-737
>
>
> Diffs
> -----
>
> doc/contributions.txt e843e274fa58
> indra/newview/llinventorybridge.cpp e843e274fa58
> indra/newview/llpanelmaininventory.cpp e843e274fa58
>
> Diff: http://codereview.secondlife.com/r/65/diff
>
>
> Testing
> -------
>
> I opened up Inventory/My Inventory and used all the "New xxx" options for both right clicking on an inventory item and also from the "+" menu.
>
> I then changed to the Recent tab and performed the same steps.
>
> New items were created as expected, except "New Folder" was not an option via either method when the Recent tab was active.
>
>
> Thanks,
>
> Jonathan
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.secondlife.com/pipermail/opensource-dev/attachments/20101224/9b635442/attachment.htm
More information about the opensource-dev
mailing list