X-Git-Url: https://git.quassel-irc.org/?a=blobdiff_plain;f=src%2Fuisupport%2Fnickview.cpp;h=d785f921e1120527413da8318d82ce8c09183b0e;hb=e32fd68ac69cada52a65598d4781f1cc735145fc;hp=ad13a2fb90cd7cee62fb2f0ae87e7a52883dd23f;hpb=f1823aad7ce73a2dd17807ed4dfde552be7ae769;p=quassel.git diff --git a/src/uisupport/nickview.cpp b/src/uisupport/nickview.cpp index ad13a2fb..d785f921 100644 --- a/src/uisupport/nickview.cpp +++ b/src/uisupport/nickview.cpp @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2005-08 by the Quassel Project * + * Copyright (C) 2005-09 by the Quassel Project * * devel@quassel-irc.org * * * * This program is free software; you can redistribute it and/or modify * @@ -47,10 +47,11 @@ NickView::NickView(QWidget *parent) sortByColumn(0, Qt::AscendingOrder); setContextMenuPolicy(Qt::CustomContextMenu); + setSelectionMode(QAbstractItemView::ExtendedSelection); connect(this, SIGNAL(customContextMenuRequested(const QPoint&)), SLOT(showContextMenu(const QPoint&))); -#if defined Q_WS_QWS or defined Q_WS_X11 +#if defined Q_WS_QWS || defined Q_WS_X11 connect(this, SIGNAL(doubleClicked(QModelIndex)), SLOT(startQuery(QModelIndex))); #else // afaik this is better on Mac and Windows @@ -89,8 +90,13 @@ void NickView::showContextMenu(const QPoint & pos ) { if(index.data(NetworkModel::ItemTypeRole) != NetworkModel::IrcUserItemType) return; + QModelIndexList indexList = selectedIndexes(); + // make sure the item we clicked on is first + indexList.removeAll(index); + indexList.prepend(index); + QMenu contextMenu(this); - Client::mainUi()->actionProvider()->addActions(&contextMenu, index); + Client::mainUi()->actionProvider()->addActions(&contextMenu, indexList); contextMenu.exec(QCursor::pos()); }