Fixed minor bug EXT-2929 ([BSI] Context menu on chiclets should not have

"show session" enabled when chiclet window is visible).

--HG--
branch : product-engine
master
Andrew Dyukov 2009-12-25 22:21:58 +02:00
parent 614a214870
commit bed1ec4525
2 changed files with 23 additions and 1 deletions

View File

@ -722,8 +722,11 @@ void LLIMP2PChiclet::updateMenuItems()
if(getSessionId().isNull())
return;
LLIMFloater* open_im_floater = LLIMFloater::findInstance(getSessionId());
bool open_window_exists = open_im_floater && open_im_floater->getVisible();
mPopupMenu->getChild<LLUICtrl>("Send IM")->setEnabled(!open_window_exists);
bool is_friend = LLAvatarActions::isFriend(getOtherParticipantId());
mPopupMenu->getChild<LLUICtrl>("Add Friend")->setEnabled(!is_friend);
}
@ -1067,6 +1070,18 @@ void LLIMGroupChiclet::changed(LLGroupChange gc)
}
}
void LLIMGroupChiclet::updateMenuItems()
{
if(!mPopupMenu)
return;
if(getSessionId().isNull())
return;
LLIMFloater* open_im_floater = LLIMFloater::findInstance(getSessionId());
bool open_window_exists = open_im_floater && open_im_floater->getVisible();
mPopupMenu->getChild<LLUICtrl>("Chat")->setEnabled(!open_window_exists);
}
BOOL LLIMGroupChiclet::handleRightMouseDown(S32 x, S32 y, MASK mask)
{
if(!mPopupMenu)
@ -1076,6 +1091,7 @@ BOOL LLIMGroupChiclet::handleRightMouseDown(S32 x, S32 y, MASK mask)
if (mPopupMenu)
{
updateMenuItems();
mPopupMenu->arrangeAndClear();
LLMenuGL::showPopup(this, mPopupMenu, x, y);
}

View File

@ -521,6 +521,7 @@ protected:
/**
* Enables/disables menus based on relationship with other participant.
* Enables/disables "show session" menu item depending on visible IM floater existence.
*/
virtual void updateMenuItems();
@ -751,6 +752,11 @@ protected:
*/
virtual void onMenuItemClicked(const LLSD& user_data);
/**
* Enables/disables "show session" menu item depending on visible IM floater existence.
*/
virtual void updateMenuItems();
/**
* Displays popup menu.
*/