From a32e93fed93e5c4ba9b9c46496ba62433618fcfa Mon Sep 17 00:00:00 2001 From: Alexander von Renteln Date: Mon, 28 Jan 2008 17:26:51 +0000 Subject: [PATCH] bufferview: corrected small error (userInput no longer static) nickview: added more items to the user context menu --- src/uisupport/bufferview.cpp | 2 +- src/uisupport/nickview.cpp | 32 +++++++++++++++++++++++++++----- 2 files changed, 28 insertions(+), 6 deletions(-) diff --git a/src/uisupport/bufferview.cpp b/src/uisupport/bufferview.cpp index db28ae42..3b9f6578 100644 --- a/src/uisupport/bufferview.cpp +++ b/src/uisupport/bufferview.cpp @@ -90,7 +90,7 @@ void BufferView::joinChannel(const QModelIndex &index) { BufferInfo bufferInfo = index.data(NetworkModel::BufferInfoRole).value(); - Client::userInput(bufferInfo, QString("/JOIN %1").arg(bufferInfo.buffer())); + Client::instance()->userInput(bufferInfo, QString("/JOIN %1").arg(bufferInfo.buffer())); // Client::fakeInput(index.data(NetworkModel::BufferIdRole).value(), QString("/JOIN %1").arg(index.sibling(index.row(), 0).data().toString())); } diff --git a/src/uisupport/nickview.cpp b/src/uisupport/nickview.cpp index 0c4e853b..0c93dbf8 100644 --- a/src/uisupport/nickview.cpp +++ b/src/uisupport/nickview.cpp @@ -73,13 +73,35 @@ void NickView::showContextMenu(const QPoint & pos ) { BufferInfo bufferInfo = index.data(NetworkModel::BufferInfoRole).value(); QMenu nickContextMenu(this); - nickContextMenu.addAction(tr("context menu for %1").arg(username)); - nickContextMenu.addSeparator(); QAction *whoisAction = nickContextMenu.addAction(tr("WHOIS")); + QAction *versionAction = nickContextMenu.addAction(tr("VERSION")); + QAction *pingAction = nickContextMenu.addAction(tr("PING")); + nickContextMenu.addSeparator(); + + QMenu *modeMenu = nickContextMenu.addMenu(tr("modi")); + QAction *opAction = modeMenu->addAction(tr("OP %1").arg(username)); + QAction *deOpAction = modeMenu->addAction(tr("de-OP %1").arg(username)); + QAction *voiceAction = modeMenu->addAction(tr("VOICE %1").arg(username)); + QAction *deVoiceAction = modeMenu->addAction(tr("de-VOICE %1").arg(username)); + nickContextMenu.addSeparator(); + + QMenu *kickBanMenu = nickContextMenu.addMenu(tr("kick / ban")); + QAction *kickAction = kickBanMenu->addAction(tr("KICK %1").arg(username)); + QAction *kickBanAction = kickBanMenu->addAction(tr("KICK+BAN %1").arg(username)); + nickContextMenu.addSeparator(); + QAction *result = nickContextMenu.exec(QCursor::pos()); - if (result == whoisAction ) { - Client::userInput(bufferInfo, "/WHOIS "+username); - } + if (result == whoisAction) { Client::instance()->userInput(bufferInfo, "/WHOIS "+username); } + if (result == versionAction) { Client::instance()->userInput(bufferInfo, "/CTCP "+username+" VERSION"); } + if (result == pingAction) { Client::instance()->userInput(bufferInfo, "/CTCP "+username+" PING"); } + + if (result == opAction) { Client::instance()->userInput(bufferInfo, "/OP "+username); } + if (result == deOpAction) { Client::instance()->userInput(bufferInfo, "/DEOP "+username); } + if (result == voiceAction) { Client::instance()->userInput(bufferInfo, "/VOICE "+username); } + if (result == deVoiceAction) { Client::instance()->userInput(bufferInfo, "/DEVOICE "+username); } + + if (result == kickAction) { Client::instance()->userInput(bufferInfo, "/KICK "+username); } + if (result == kickBanAction) { Client::instance()->userInput(bufferInfo, "/KICKBAN "+username); } } -- 2.20.1