projects
/
quassel.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
oops
[quassel.git]
/
src
/
uisupport
/
nickview.cpp
diff --git
a/src/uisupport/nickview.cpp
b/src/uisupport/nickview.cpp
index
ad13a2f
..
bfdaf1e
100644
(file)
--- a/
src/uisupport/nickview.cpp
+++ b/
src/uisupport/nickview.cpp
@@
-47,10
+47,11
@@
NickView::NickView(QWidget *parent)
sortByColumn(0, Qt::AscendingOrder);
setContextMenuPolicy(Qt::CustomContextMenu);
sortByColumn(0, Qt::AscendingOrder);
setContextMenuPolicy(Qt::CustomContextMenu);
+ setSelectionMode(QAbstractItemView::ExtendedSelection);
connect(this, SIGNAL(customContextMenuRequested(const QPoint&)), SLOT(showContextMenu(const QPoint&)));
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
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;
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);
QMenu contextMenu(this);
- Client::mainUi()->actionProvider()->addActions(&contextMenu, index);
+ Client::mainUi()->actionProvider()->addActions(&contextMenu, index
List
);
contextMenu.exec(QCursor::pos());
}
contextMenu.exec(QCursor::pos());
}