added paste own certificate to chat/forum context menu (patch from AC)

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@5125 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
csoler 2012-04-27 12:04:40 +00:00
parent d28ffb9c0d
commit 32ac7efb42
4 changed files with 25 additions and 0 deletions

View File

@ -357,6 +357,17 @@ void ChatWidget::pasteLink()
ui->chattextEdit->insertHtml(RSLinkClipboard::toHtml());
}
void ChatWidget::pasteOwnCertificateLink()
{
std::cerr << "In paste own certificate link" << std::endl;
RetroShareLink link ;
std::string ownId = rsPeers->getOwnId() ;
if( link.createCertificate(ownId) ) {
ui->chattextEdit->insertHtml(link.toHtml() + " ");
}
}
void ChatWidget::contextMenu(QPoint /*point*/)
{
std::cerr << "In context menu" << std::endl;
@ -366,6 +377,7 @@ void ChatWidget::contextMenu(QPoint /*point*/)
contextMnu->addSeparator();
QAction *action = contextMnu->addAction(QIcon(":/images/pasterslink.png"), tr("Paste RetroShare Link"), this, SLOT(pasteLink()));
action->setDisabled(RSLinkClipboard::empty());
contextMnu->addAction(QIcon(":/images/pasterslink.png"), tr("Paste own certificate link"), this, SLOT(pasteOwnCertificateLink()));
contextMnu->exec(QCursor::pos());
delete(contextMnu);

View File

@ -97,6 +97,7 @@ protected:
private slots:
void pasteLink();
void pasteOwnCertificateLink();
void contextMenu(QPoint);
void chatCharFormatChanged();

View File

@ -29,6 +29,7 @@
#include <QPushButton>
#include <retroshare/rsforums.h>
#include <retroshare/rspeers.h>
#include "gui/settings/rsharesettings.h"
#include "gui/RetroShareLink.h"
@ -75,6 +76,7 @@ void CreateForumMsg::forumMessageCostumPopupMenu( QPoint /*point*/ )
contextMnu->addSeparator();
QAction *pasteLinkAct = contextMnu->addAction(QIcon(":/images/pasterslink.png"), tr("Paste RetroShare Link"), this, SLOT(pasteLink()));
QAction *pasteLinkFullAct = contextMnu->addAction(QIcon(":/images/pasterslink.png"), tr("Paste full RetroShare Link"), this, SLOT(pasteLinkFull()));
contextMnu->addAction(QIcon(":/images/pasterslink.png"), tr("Paste own certificate link"), this, SLOT(pasteOwnCertificateLink()));
if (RSLinkClipboard::empty()) {
pasteLinkAct->setDisabled (true);
@ -245,3 +247,12 @@ void CreateForumMsg::pasteLinkFull()
{
ui.forumMessage->insertHtml(RSLinkClipboard::toHtmlFull()) ;
}
void CreateForumMsg::pasteOwnCertificateLink()
{
RetroShareLink link ;
std::string ownId = rsPeers->getOwnId() ;
if( link.createCertificate(ownId) ) {
ui.forumMessage->insertHtml(link.toHtml() + " ");
}
}

View File

@ -44,6 +44,7 @@ private slots:
void cancelMsg();
void pasteLink();
void pasteLinkFull();
void pasteOwnCertificateLink();
void smileyWidgetForums();
void addSmileys();