X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fqtui%2Fbufferwidget.cpp;h=7b4e9545dcc772fef0474260694dbac0c43a8c79;hp=ab068997538ce38671aa7b38d164058a1e981092;hb=83efa7dcd9771008e7600b4c35db0dde6e0bc995;hpb=9da8a8a14a39bffe74403001978a13cc8b130138 diff --git a/src/qtui/bufferwidget.cpp b/src/qtui/bufferwidget.cpp index ab068997..7b4e9545 100644 --- a/src/qtui/bufferwidget.cpp +++ b/src/qtui/bufferwidget.cpp @@ -94,6 +94,10 @@ BufferWidget::BufferWidget(QWidget *parent) setMarkerLine->setText(tr("Set Marker Line")); setMarkerLine->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_R)); + Action *jumpToMarkerLine = QtUi::actionCollection("Navigation")->add("JumpToMarkerLine", this, SLOT(jumpToMarkerLine())); + jumpToMarkerLine->setText(tr("Go to Marker Line")); + jumpToMarkerLine->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_K)); + ChatViewSettings s; s.initAndNotify("AutoMarkerLine", this, SLOT(setAutoMarkerLine(QVariant)), true); } @@ -238,14 +242,24 @@ void BufferWidget::setMarkerLine(ChatView *view, bool allowGoingBack) { ChatLine *lastLine = view->lastVisibleChatLine(); if(lastLine) { + QModelIndex idx = lastLine->index(); + MsgId msgId = idx.data(MessageModel::MsgIdRole).value(); + if(!allowGoingBack) { - QModelIndex idx = lastLine->index(); BufferId bufId = view->scene()->singleBufferId(); - MsgId msgId = idx.data(MessageModel::MsgIdRole).value(); MsgId oldMsgId = Client::markerLine(bufId); if(oldMsgId.isValid() && msgId <= oldMsgId) return; } - view->setMarkedLine(lastLine); + view->setMarkerLine(msgId); } } + +void BufferWidget::jumpToMarkerLine(ChatView *view, bool requestBacklog) { + if(!view) + view = qobject_cast(ui.stackedWidget->currentWidget()); + if(!view) + return; + + view->jumpToMarkerLine(requestBacklog); +}