Added standard context menu to the input text in private chat, group chat and create forum message.

Added paste RetroShare link to the context menu of the text edit and file list in message composer.

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@3846 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
thunder2 2010-11-21 21:12:35 +00:00
parent 20c97680b5
commit 064b619f70
15 changed files with 260 additions and 349 deletions

View file

@ -130,8 +130,6 @@ PopupChatDialog::PopupChatDialog(const std::string &id, const QString &name, QWi
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&)));
std::cerr << "Connecting custom context menu" << std::endl;
ui.chattextEdit->setContextMenuPolicy(Qt::CustomContextMenu) ;
connect(ui.chattextEdit,SIGNAL(customContextMenuRequested(QPoint)),this,SLOT(contextMenu(QPoint)));
// Create the status bar
@ -164,9 +162,6 @@ PopupChatDialog::PopupChatDialog(const std::string &id, const QString &name, QWi
colorChanged(mCurrentColor);
fontChanged(mCurrentFont);
pasteLinkAct = new QAction(QIcon(":/images/pasterslink.png"), tr( "Paste retroshare Link" ), this );
connect( pasteLinkAct , SIGNAL( triggered() ), this, SLOT( pasteLink() ) );
updateAvatar() ;
updatePeerAvatar(id) ;
@ -432,14 +427,16 @@ void PopupChatDialog::pasteLink()
void PopupChatDialog::contextMenu( QPoint point )
{
std::cerr << "In context menu" << std::endl ;
if(RSLinkClipboard::empty())
return ;
std::cerr << "In context menu" << std::endl ;
QMenu contextMnu(this);
contextMnu.addAction( pasteLinkAct);
QMenu *contextMnu = ui.chattextEdit->createStandardContextMenu();
contextMnu.exec(QCursor::pos());
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 PopupChatDialog::resetStatusBar()