Added clear chat history to the context menu of the message text browser.

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@5456 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
thunder2 2012-08-22 08:19:46 +00:00
parent f2072e9522
commit 28def71b4e
6 changed files with 39 additions and 5 deletions

View file

@ -89,6 +89,8 @@ ChatWidget::ChatWidget(QWidget *parent) :
connect(NotifyQt::getInstance(), SIGNAL(peerStatusChanged(const QString&, int)), this, SLOT(updateStatus(const QString&, int)));
connect(NotifyQt::getInstance(), SIGNAL(peerHasNewCustomStateString(const QString&, const QString&)), this, SLOT(updatePeersCustomStateString(const QString&, const QString&)));
connect(ui->textBrowser, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(contextMenuTextBrowser(QPoint)));
connect(ui->chattextEdit, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(contextMenu(QPoint)));
// reset text and color after removing all characters from the QTextEdit and after calling QTextEdit::clear
connect(ui->chattextEdit, SIGNAL(currentCharFormatChanged(QTextCharFormat)), this, SLOT(chatCharFormatChanged()));
@ -390,6 +392,17 @@ void ChatWidget::contextMenu(QPoint /*point*/)
delete(contextMnu);
}
void ChatWidget::contextMenuTextBrowser(QPoint)
{
QMenu *contextMnu = ui->textBrowser->createStandardContextMenu();
contextMnu->addSeparator();
contextMnu->addAction(ui->actionClearChatHistory);
contextMnu->exec(QCursor::pos());
delete(contextMnu);
}
void ChatWidget::chatCharFormatChanged()
{
if (inChatCharFormatChanged) {