mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-01-16 09:57:19 -05:00
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:
parent
d28ffb9c0d
commit
32ac7efb42
@ -357,6 +357,17 @@ void ChatWidget::pasteLink()
|
|||||||
ui->chattextEdit->insertHtml(RSLinkClipboard::toHtml());
|
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*/)
|
void ChatWidget::contextMenu(QPoint /*point*/)
|
||||||
{
|
{
|
||||||
std::cerr << "In context menu" << std::endl;
|
std::cerr << "In context menu" << std::endl;
|
||||||
@ -366,6 +377,7 @@ void ChatWidget::contextMenu(QPoint /*point*/)
|
|||||||
contextMnu->addSeparator();
|
contextMnu->addSeparator();
|
||||||
QAction *action = contextMnu->addAction(QIcon(":/images/pasterslink.png"), tr("Paste RetroShare Link"), this, SLOT(pasteLink()));
|
QAction *action = contextMnu->addAction(QIcon(":/images/pasterslink.png"), tr("Paste RetroShare Link"), this, SLOT(pasteLink()));
|
||||||
action->setDisabled(RSLinkClipboard::empty());
|
action->setDisabled(RSLinkClipboard::empty());
|
||||||
|
contextMnu->addAction(QIcon(":/images/pasterslink.png"), tr("Paste own certificate link"), this, SLOT(pasteOwnCertificateLink()));
|
||||||
|
|
||||||
contextMnu->exec(QCursor::pos());
|
contextMnu->exec(QCursor::pos());
|
||||||
delete(contextMnu);
|
delete(contextMnu);
|
||||||
|
@ -97,6 +97,7 @@ protected:
|
|||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void pasteLink();
|
void pasteLink();
|
||||||
|
void pasteOwnCertificateLink();
|
||||||
void contextMenu(QPoint);
|
void contextMenu(QPoint);
|
||||||
void chatCharFormatChanged();
|
void chatCharFormatChanged();
|
||||||
|
|
||||||
|
@ -29,6 +29,7 @@
|
|||||||
#include <QPushButton>
|
#include <QPushButton>
|
||||||
|
|
||||||
#include <retroshare/rsforums.h>
|
#include <retroshare/rsforums.h>
|
||||||
|
#include <retroshare/rspeers.h>
|
||||||
|
|
||||||
#include "gui/settings/rsharesettings.h"
|
#include "gui/settings/rsharesettings.h"
|
||||||
#include "gui/RetroShareLink.h"
|
#include "gui/RetroShareLink.h"
|
||||||
@ -75,6 +76,7 @@ void CreateForumMsg::forumMessageCostumPopupMenu( QPoint /*point*/ )
|
|||||||
contextMnu->addSeparator();
|
contextMnu->addSeparator();
|
||||||
QAction *pasteLinkAct = contextMnu->addAction(QIcon(":/images/pasterslink.png"), tr("Paste RetroShare Link"), this, SLOT(pasteLink()));
|
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()));
|
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()) {
|
if (RSLinkClipboard::empty()) {
|
||||||
pasteLinkAct->setDisabled (true);
|
pasteLinkAct->setDisabled (true);
|
||||||
@ -245,3 +247,12 @@ void CreateForumMsg::pasteLinkFull()
|
|||||||
{
|
{
|
||||||
ui.forumMessage->insertHtml(RSLinkClipboard::toHtmlFull()) ;
|
ui.forumMessage->insertHtml(RSLinkClipboard::toHtmlFull()) ;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CreateForumMsg::pasteOwnCertificateLink()
|
||||||
|
{
|
||||||
|
RetroShareLink link ;
|
||||||
|
std::string ownId = rsPeers->getOwnId() ;
|
||||||
|
if( link.createCertificate(ownId) ) {
|
||||||
|
ui.forumMessage->insertHtml(link.toHtml() + " ");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@ -44,6 +44,7 @@ private slots:
|
|||||||
void cancelMsg();
|
void cancelMsg();
|
||||||
void pasteLink();
|
void pasteLink();
|
||||||
void pasteLinkFull();
|
void pasteLinkFull();
|
||||||
|
void pasteOwnCertificateLink();
|
||||||
|
|
||||||
void smileyWidgetForums();
|
void smileyWidgetForums();
|
||||||
void addSmileys();
|
void addSmileys();
|
||||||
|
Loading…
Reference in New Issue
Block a user