MAINT-3510 (Incorrect context menu entry in Places floater)

MaximB ProductEngine 2014-01-14 10:00:30 +02:00
parent c934710f76
commit 4d81b1d967
5 changed files with 21 additions and 1 deletions

View File

@ -236,7 +236,7 @@ public:
virtual S32 notify(const LLSD& info) ;
bool useLabelSuffix() { return mUseLabelSuffix; }
void updateMenu();
virtual void updateMenu();
private:
void updateMenuOptions(LLMenuGL* menu);

View File

@ -716,6 +716,11 @@ void LLLandmarksPanel::updateListCommands()
mListCommands->getChildView(TRASH_BUTTON_NAME)->setEnabled(trash_enabled);
}
void LLLandmarksPanel::updateMenuVisibility(LLUICtrl* menu)
{
onMenuVisibilityChange(menu, LLSD().with("visibility", true));
}
void LLLandmarksPanel::onActionsButtonClick()
{
LLToggleableMenu* menu = mGearFolderMenu;

View File

@ -80,6 +80,8 @@ public:
LLPlacesInventoryPanel* getLibraryInventoryPanel() { return mLibraryInventoryPanel; }
void updateMenuVisibility(LLUICtrl* menu);
protected:
/**
* @return true - if current selected panel is not null and selected item is a landmark

View File

@ -31,6 +31,7 @@
#include "llplacesinventorypanel.h"
#include "llpanellandmarks.h"
#include "llmenugl.h"
LLPlacesFolderView::LLPlacesFolderView(const LLFolderView::Params& p)
: LLFolderView(p)
@ -67,6 +68,16 @@ BOOL LLPlacesFolderView::handleRightMouseDown(S32 x, S32 y, MASK mask)
return LLFolderView::handleRightMouseDown(x, y, mask);
}
void LLPlacesFolderView::updateMenu()
{
LLFolderView::updateMenu();
LLMenuGL* menu = (LLMenuGL*)mPopupMenuHandle.get();
if (menu && menu->getVisible())
{
mParentLandmarksPanel->updateMenuVisibility(menu);
}
}
void LLPlacesFolderView::setupMenuHandle(LLInventoryType::EType asset_type, LLHandle<LLView> menu_handle)
{
mMenuHandlesByInventoryType[asset_type] = menu_handle;

View File

@ -51,6 +51,8 @@ public:
*/
/*virtual*/ BOOL handleRightMouseDown( S32 x, S32 y, MASK mask );
/*virtual*/ void updateMenu();
void setupMenuHandle(LLInventoryType::EType asset_type, LLHandle<LLView> menu_handle);
void setParentLandmarksPanel(LLLandmarksPanel* panel)