Commit a91219c6 authored by Orgad Shaneh's avatar Orgad Shaneh Committed by Orgad Shaneh
Browse files

VCS: Fix context menu for custom editors



Change-Id: I44718dce73bbcd376d90fdf40f4bb5ab4c57443a
Reviewed-by: default avatarTobias Hunger <tobias.hunger@digia.com>
parent 3f1901cb
......@@ -297,14 +297,6 @@ void ChangeTextCursorHandler::fillContextMenu(QMenu *menu, EditorContentType typ
{
VcsBaseEditorWidget *widget = editorWidget();
switch (type) {
case LogOutput: { // Describe current / Annotate file of current
menu->addSeparator();
menu->addAction(createCopyRevisionAction(m_currentChange));
menu->addAction(createDescribeAction(m_currentChange));
if (widget->isFileLogAnnotateEnabled())
menu->addAction(createAnnotateAction(m_currentChange, false));
break;
}
case AnnotateOutput: { // Describe current / annotate previous
bool currentValid = widget->isValidRevision(m_currentChange);
menu->addSeparator();
......@@ -321,7 +313,12 @@ void ChangeTextCursorHandler::fillContextMenu(QMenu *menu, EditorContentType typ
}
break;
}
default:
default: // Describe current / Annotate file of current
menu->addSeparator();
menu->addAction(createCopyRevisionAction(m_currentChange));
menu->addAction(createDescribeAction(m_currentChange));
if (widget->isFileLogAnnotateEnabled())
menu->addAction(createAnnotateAction(m_currentChange, false));
break;
}
widget->addChangeActions(menu, m_currentChange);
......@@ -921,17 +918,13 @@ void VcsBaseEditorWidget::contextMenuEvent(QContextMenuEvent *e)
{
QPointer<QMenu> menu = createStandardContextMenu();
// 'click on change-interaction'
switch (d->m_parameters->type) {
case LogOutput:
case AnnotateOutput: {
if (supportChangeLinks()) {
const QTextCursor cursor = cursorForPosition(e->pos());
Internal::AbstractTextCursorHandler *handler = d->findTextCursorHandler(cursor);
if (handler != 0)
if (Internal::AbstractTextCursorHandler *handler = d->findTextCursorHandler(cursor))
handler->fillContextMenu(menu, d->m_parameters->type);
// Fall-through for log (might have diff)
if (d->m_parameters->type != LogOutput)
break;
}
switch (d->m_parameters->type) {
case LogOutput: // log might have diff
case DiffOutput: {
menu->addSeparator();
connect(menu->addAction(tr("Send to CodePaster...")), SIGNAL(triggered()),
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment