X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fqtui%2Fchatscene.cpp;h=60f3f1bb6cca414821fc867c7cfb916eabd1ecfe;hp=ae63e550fdc0f1527f02a1aef82338052ae31597;hb=8af8cee61754657c07a6240c3a8761afc86929b2;hpb=a19d4cb095e9711028c70f651012bb558e17a6c2 diff --git a/src/qtui/chatscene.cpp b/src/qtui/chatscene.cpp index ae63e550..60f3f1bb 100644 --- a/src/qtui/chatscene.cpp +++ b/src/qtui/chatscene.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 * @@ -48,7 +48,7 @@ ChatScene::ChatScene(QAbstractItemModel *model, const QString &idString, qreal w _chatView(parent), _idString(idString), _model(model), - _singleBufferScene(false), + _singleBufferId(BufferId()), _sceneRect(0, 0, width, 0), _firstLineRow(-1), _viewportHeight(0), @@ -61,8 +61,8 @@ ChatScene::ChatScene(QAbstractItemModel *model, const QString &idString, qreal w _leftButtonPressed(false) { MessageFilter *filter = qobject_cast(model); - if(filter) { - _singleBufferScene = filter->isSingleBufferFilter(); + if(filter && filter->isSingleBufferFilter()) { + _singleBufferId = filter->singleBufferId(); } ChatViewSettings defaultSettings; @@ -587,6 +587,9 @@ void ChatScene::contextMenuEvent(QGraphicsSceneContextMenuEvent *event) { ChatItem *item = chatItemAt(pos); if(item) item->addActionsToMenu(&menu, item->mapFromScene(pos)); + else + // no item -> default scene actions + Client::mainUi()->actionProvider()->addActions(&menu, filter(), BufferId()); menu.exec(event->screenPos()); @@ -650,7 +653,7 @@ void ChatScene::mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event) { } void ChatScene::mouseReleaseEvent(QGraphicsSceneMouseEvent *event) { - if(!event->buttons() & Qt::LeftButton) { + if(event->button() == Qt::LeftButton && _leftButtonPressed) { _leftButtonPressed = false; if(_clickMode != NoClick) { if(_clickMode == SingleClick)