Added a custom context menu for pasting RS-links to the base class MimeTextEdit and removed the custom context menu from derived classes.

Updated english translation.

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@6977 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
thunder2 2013-12-30 19:12:16 +00:00
parent dddc4356f1
commit abd6b46ca0
17 changed files with 206 additions and 374 deletions

View file

@ -162,7 +162,6 @@ MessageComposer::MessageComposer(QWidget *parent, Qt::WindowFlags flags)
connect(ui.msgText, SIGNAL(currentCharFormatChanged(const QTextCharFormat &)), this, SLOT(currentCharFormatChanged(const QTextCharFormat &)));
connect(ui.msgText, SIGNAL(cursorPositionChanged()), this, SLOT(cursorPositionChanged()));
connect(ui.msgText,SIGNAL(customContextMenuRequested(QPoint)),this,SLOT(contextMenu(QPoint)));
connect(ui.msgText->document(), SIGNAL(modificationChanged(bool)), actionSave, SLOT(setEnabled(bool)));
connect(ui.msgText->document(), SIGNAL(modificationChanged(bool)), this, SLOT(setWindowModified(bool)));
@ -565,23 +564,6 @@ void MessageComposer::closeEvent (QCloseEvent * event)
}
}
void MessageComposer::contextMenu(QPoint point)
{
QMenu *contextMnu = ui.msgText->createStandardContextMenu(point);
contextMnu->addSeparator();
QAction *action = contextMnu->addAction(QIcon(":/images/pasterslink.png"), tr("Paste RetroShare Link"), this, SLOT(pasteLink()));
action->setDisabled(RSLinkClipboard::empty());
contextMnu->exec(QCursor::pos());
delete(contextMnu);
}
void MessageComposer::pasteLink()
{
ui.msgText->insertHtml(RSLinkClipboard::toHtml()) ;
}
void MessageComposer::contextMenuFileList(QPoint)
{
QMenu contextMnu(this);