--- a/QTfrontend/ui/widget/chatwidget.cpp Sun Oct 02 17:39:42 2016 +0200
+++ b/QTfrontend/ui/widget/chatwidget.cpp Sun Oct 02 18:29:55 2016 +0200
@@ -270,6 +270,10 @@
acBan->setIcon(QIcon(":/res/ban.png"));
acBan->setData(QVariant(true));
connect(acBan, SIGNAL(triggered(bool)), this, SLOT(onBan()));
+ acDelegate = new QAction(QAction::tr("Delegate room control"), chatNicks);
+ acDelegate->setIcon(QIcon(":/res/chat/roomadmin.png"));
+ acDelegate->setData(QVariant(true));
+ connect(acDelegate, SIGNAL(triggered(bool)), this, SLOT(onDelegate()));
acFollow = new QAction(QAction::tr("Follow"), chatNicks);
acFollow->setIcon(QIcon(":/res/follow.png"));
acFollow->setData(QVariant(false));
@@ -624,6 +628,14 @@
emit ban(mil[0].data().toString());
}
+void HWChatWidget::onDelegate()
+{
+ QModelIndexList mil = chatNicks->selectionModel()->selectedRows();
+
+ if(mil.size())
+ emit delegate(mil[0].data().toString());
+}
+
void HWChatWidget::onInfo()
{
QModelIndexList mil = chatNicks->selectionModel()->selectedRows();
@@ -732,6 +744,7 @@
{
chatNicks->removeAction(acKick);
//chatNicks->removeAction(acBan);
+ chatNicks->removeAction(acDelegate);
m_isAdmin = b;
@@ -739,6 +752,7 @@
{
chatNicks->insertAction(0, acKick);
//chatNicks->insertAction(0, acBan);
+ chatNicks->insertAction(acFriend, acDelegate);
}
}
@@ -931,6 +945,7 @@
{
acKick->setVisible(!isSelf && isOnline);
acBan->setVisible(!isSelf);
+ acDelegate->setVisible(!isSelf && players->isFlagSet(m_userNick, PlayersListModel::InRoom));
}
m_nicksMenu->clear();