X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fuisupport%2Fnetworkmodelactionprovider.cpp;h=31117f4eff54e8d4c86110c45ad4b54d206b9ffc;hp=44dd460bd00617b836e46a227f242e491a2875bc;hb=6eebebc97f84a94f732b05a793ea8e4c000643ab;hpb=63e8840632d2eee3ad1632d1f7d7af3bcdad1503 diff --git a/src/uisupport/networkmodelactionprovider.cpp b/src/uisupport/networkmodelactionprovider.cpp index 44dd460b..31117f4e 100644 --- a/src/uisupport/networkmodelactionprovider.cpp +++ b/src/uisupport/networkmodelactionprovider.cpp @@ -67,9 +67,9 @@ NetworkModelActionProvider::NetworkModelActionProvider(QObject *parent) registerAction(NickDeop, tr("Take Operator Status")); registerAction(NickVoice, tr("Give Voice")); registerAction(NickDevoice, tr("Take Voice")); - registerAction(NickKick, tr("Kick")); - registerAction(NickBan, tr("Ban")); - registerAction(NickKickBan, tr("Kickban")); + registerAction(NickKick, tr("Kick From Channel")); + registerAction(NickBan, tr("Ban From Channel")); + registerAction(NickKickBan, tr("Kick && Ban")); registerAction(HideBufferTemporarily, tr("Hide Buffer(s) Temporarily")); registerAction(HideBufferPermanently, tr("Hide Buffer(s) Permanently")); @@ -105,7 +105,11 @@ NetworkModelActionProvider::NetworkModelActionProvider(QObject *parent) nickModeMenu->addAction(action(NickDeop)); nickModeMenu->addAction(action(NickVoice)); nickModeMenu->addAction(action(NickDevoice)); - _nickModeMenuAction = new Action(tr("Modes"), 0); + nickModeMenu->addSeparator(); + nickModeMenu->addAction(action(NickKick)); + nickModeMenu->addAction(action(NickBan)); + nickModeMenu->addAction(action(NickKickBan)); + _nickModeMenuAction = new Action(tr("Actions"), 0); _nickModeMenuAction->setMenu(nickModeMenu); } @@ -203,13 +207,18 @@ void NetworkModelActionProvider::addActions(QMenu *menu, // ChatView actions if(_contextItem.isEmpty()) { // a) query buffer: handle like ircuser - // b) general chatview: only react if _contextItem is set (i.e. we right-clicked on something) + // b) general chatview: handle like channel iff it displays a single buffer // NOTE stuff breaks probably with merged buffers, need to rework a lot around here then - // for now, use the item type of a random buffer... assuming we never mix channel and query buffers - //if(!_messageFilter->containedBuffers.count()) - // return; - //BufferId randomBuf = _messageFilter->containedBuffers.values().at(0); + if(_messageFilter->containedBuffers().count() == 1) { + // we can handle this like a single bufferItem + QModelIndex index = Client::networkModel()->bufferIndex(_messageFilter->containedBuffers().values().at(0)); + _indexList = QList() << index; + addBufferItemActions(menu, index); + return; + } else { + // TODO: actions for merged buffers... _indexList contains the index of the message we clicked on + } } } } @@ -502,6 +511,8 @@ void NetworkModelActionProvider::handleHideAction(ActionType type, QAction *acti } void NetworkModelActionProvider::handleGeneralAction(ActionType type, QAction *action) { + Q_UNUSED(action) + if(!_indexList.count()) return; NetworkId networkId = _indexList.at(0).data(NetworkModel::NetworkIdRole).value();