Beispiel #1
0
        void on_participantsGrid_customContextMenuRequested(QPoint point)
        {
            if (participantsGrid.HoverItem != null)
            {
                var mucHandler = (MucHandler)m_Handler;

                m_SelectedParticipant = participantsGrid.HoverItem;

                var me = mucHandler.Room.Participants[mucHandler.Room.RoomAndNick];

                bool isModerator    = me.Role == RoomRole.moderator;
                bool isAdminOrOwner = me.Affiliation == RoomAffiliation.admin || me.Affiliation == RoomAffiliation.owner;

                m_ModeratorActionsMenu.Enabled    = isModerator || isAdminOrOwner;
                m_ChangeAffiliationAction.Enabled = isAdminOrOwner;

                m_ModeratorAction.Checked   = (m_SelectedParticipant.Role == RoomRole.moderator);
                m_VisitorAction.Checked     = (m_SelectedParticipant.Role == RoomRole.visitor);
                m_ParticipantAction.Checked = (m_SelectedParticipant.Role == RoomRole.participant);

                m_AddAsFriendAction.Enabled = !String.IsNullOrEmpty(participantsGrid.HoverItem.RealJID);

                m_ParticipantItemMenu.Popup(participantsGrid.MapToGlobal(point));
            }
            else
            {
                m_ParticipantsMenu.Popup(participantsGrid.MapToGlobal(point));
            }
        }
Beispiel #2
0
 void on_m_StatusLabel_linkActivated(string link)
 {
     switch (link)
     {
     case "#show-presence-menu":
         m_PresenceMenu.Popup(m_StatusLabel.MapToGlobal(m_StatusLabel.Rect.BottomLeft()));
         break;
     }
 }
Beispiel #3
0
        void on_menuButton_clicked()
        {
            var buttonPos = menuButton.MapToGlobal(new QPoint(0, menuButton.Height()));

            m_MainMenu.Popup(buttonPos);
        }