setMarkerLine->setText(tr("Set Marker Line"));
setMarkerLine->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_R));
+ Action *jumpToMarkerLine = QtUi::actionCollection("Navigation")->add<Action>("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);
}
ChatLine *lastLine = view->lastVisibleChatLine();
if(lastLine) {
+ QModelIndex idx = lastLine->index();
+ MsgId msgId = idx.data(MessageModel::MsgIdRole).value<MsgId>();
+
if(!allowGoingBack) {
- QModelIndex idx = lastLine->index();
BufferId bufId = view->scene()->singleBufferId();
- MsgId msgId = idx.data(MessageModel::MsgIdRole).value<MsgId>();
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<ChatView *>(ui.stackedWidget->currentWidget());
+ if(!view)
+ return;
+
+ view->jumpToMarkerLine(requestBacklog);
+}