STORM-737 Add "+" menu to Inventory/Recent
Review Request #65 - Created Dec. 23, 2010 and submitted
Jonathan Yap | Reviewers | ||
2.5 | viewer | ||
storm-737 | |||
None | viewer-development |
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()
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.
Posted (Dec. 24, 2010, 10:55 a.m.)
Seems plausible.
-
indra/newview/llpanelmaininventory.cpp (Diff revision 1) -
This line can now be removed at all.
-
indra/newview/llpanelmaininventory.cpp (Diff revision 1) -
redundant line
Posted (Dec. 24, 2010, 1:25 p.m.)
-
indra/newview/llpanelmaininventory.cpp (Diff revision 1) -
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");
Posted (Dec. 24, 2010, 3:30 p.m.)
-
indra/newview/llpanelmaininventory.cpp (Diff revision 1) -
I updated the code per Aleric's suggestion but the 2nd diff failed to upload. There must be some unusual hg command to generate follow-up diffs in a format RB will be happy with. You can see the change on bitbucket though.
Other reviews