268 connect(acKick, SIGNAL(triggered(bool)), this, SLOT(onKick())); |
268 connect(acKick, SIGNAL(triggered(bool)), this, SLOT(onKick())); |
269 acBan = new QAction(QAction::tr("Ban"), chatNicks); |
269 acBan = new QAction(QAction::tr("Ban"), chatNicks); |
270 acBan->setIcon(QIcon(":/res/ban.png")); |
270 acBan->setIcon(QIcon(":/res/ban.png")); |
271 acBan->setData(QVariant(true)); |
271 acBan->setData(QVariant(true)); |
272 connect(acBan, SIGNAL(triggered(bool)), this, SLOT(onBan())); |
272 connect(acBan, SIGNAL(triggered(bool)), this, SLOT(onBan())); |
|
273 acDelegate = new QAction(QAction::tr("Delegate room control"), chatNicks); |
|
274 acDelegate->setIcon(QIcon(":/res/chat/roomadmin.png")); |
|
275 acDelegate->setData(QVariant(true)); |
|
276 connect(acDelegate, SIGNAL(triggered(bool)), this, SLOT(onDelegate())); |
273 acFollow = new QAction(QAction::tr("Follow"), chatNicks); |
277 acFollow = new QAction(QAction::tr("Follow"), chatNicks); |
274 acFollow->setIcon(QIcon(":/res/follow.png")); |
278 acFollow->setIcon(QIcon(":/res/follow.png")); |
275 acFollow->setData(QVariant(false)); |
279 acFollow->setData(QVariant(false)); |
276 connect(acFollow, SIGNAL(triggered(bool)), this, SLOT(onFollow())); |
280 connect(acFollow, SIGNAL(triggered(bool)), this, SLOT(onFollow())); |
277 acIgnore = new QAction(QAction::tr("Ignore"), chatNicks); |
281 acIgnore = new QAction(QAction::tr("Ignore"), chatNicks); |
730 |
742 |
731 void HWChatWidget::adminAccess(bool b) |
743 void HWChatWidget::adminAccess(bool b) |
732 { |
744 { |
733 chatNicks->removeAction(acKick); |
745 chatNicks->removeAction(acKick); |
734 //chatNicks->removeAction(acBan); |
746 //chatNicks->removeAction(acBan); |
|
747 chatNicks->removeAction(acDelegate); |
735 |
748 |
736 m_isAdmin = b; |
749 m_isAdmin = b; |
737 |
750 |
738 if(b) |
751 if(b) |
739 { |
752 { |
740 chatNicks->insertAction(0, acKick); |
753 chatNicks->insertAction(0, acKick); |
741 //chatNicks->insertAction(0, acBan); |
754 //chatNicks->insertAction(0, acBan); |
|
755 chatNicks->insertAction(acFriend, acDelegate); |
742 } |
756 } |
743 } |
757 } |
744 |
758 |
745 void HWChatWidget::dragEnterEvent(QDragEnterEvent * event) |
759 void HWChatWidget::dragEnterEvent(QDragEnterEvent * event) |
746 { |
760 { |
929 |
943 |
930 if (m_isAdmin) |
944 if (m_isAdmin) |
931 { |
945 { |
932 acKick->setVisible(!isSelf && isOnline); |
946 acKick->setVisible(!isSelf && isOnline); |
933 acBan->setVisible(!isSelf); |
947 acBan->setVisible(!isSelf); |
|
948 acDelegate->setVisible(!isSelf && players->isFlagSet(m_userNick, PlayersListModel::InRoom)); |
934 } |
949 } |
935 |
950 |
936 m_nicksMenu->clear(); |
951 m_nicksMenu->clear(); |
937 |
952 |
938 foreach(QAction * action, chatNicks->actions()) |
953 foreach(QAction * action, chatNicks->actions()) |