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

@ -21,7 +21,6 @@
#include "CreateGxsForumMsg.h"
#include <QMenu>
#include <QMessageBox>
#include <QFile>
#include <QDesktopWidget>
@ -29,7 +28,6 @@
#include <QPushButton>
#include <retroshare/rsgxsforums.h>
#include <retroshare/rspeers.h>
#include "gui/settings/rsharesettings.h"
#include "gui/RetroShareLink.h"
@ -83,8 +81,6 @@ CreateGxsForumMsg::CreateGxsForumMsg(const std::string &fId, const std::string &
Settings->loadWidgetInformation(this);
connect(ui.forumMessage, SIGNAL( customContextMenuRequested(QPoint)), this, SLOT(forumMessageCostumPopupMenu(QPoint)));
connect(ui.hashBox, SIGNAL(fileHashingFinished(QList<HashedFile>)), this, SLOT(fileHashingFinished(QList<HashedFile>)));
// connect up the buttons.
@ -92,7 +88,6 @@ CreateGxsForumMsg::CreateGxsForumMsg(const std::string &fId, const std::string &
connect(ui.buttonBox, SIGNAL(rejected()), this, SLOT(close()));
connect(ui.emoticonButton, SIGNAL(clicked()), this, SLOT(smileyWidgetForums()));
connect(ui.attachFileButton, SIGNAL(clicked()), this, SLOT(addFile()));
connect(ui.pastersButton, SIGNAL(clicked()), this, SLOT(pasteLink()));
connect(ui.generateCheckBox, SIGNAL(toggled(bool)), ui.generateSpinBox, SLOT(setEnabled(bool)));
setAcceptDrops(true);
@ -115,25 +110,6 @@ CreateGxsForumMsg::~CreateGxsForumMsg()
delete(mForumQueue);
}
void CreateGxsForumMsg::forumMessageCostumPopupMenu(QPoint point)
{
QMenu *contextMnu = ui.forumMessage->createStandardContextMenu(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 my certificate link"), this, SLOT(pasteOwnCertificateLink()));
if (RSLinkClipboard::empty()) {
pasteLinkAct->setDisabled (true);
pasteLinkFullAct->setDisabled (true);
}
contextMnu->exec(QCursor::pos());
delete(contextMnu);
}
void CreateGxsForumMsg::newMsg()
{
/* clear all */
@ -409,25 +385,6 @@ void CreateGxsForumMsg::fileHashingFinished(QList<HashedFile> hashedFiles)
ui.forumMessage->setFocus( Qt::OtherFocusReason );
}
void CreateGxsForumMsg::pasteLink()
{
ui.forumMessage->insertHtml(RSLinkClipboard::toHtml()) ;
}
void CreateGxsForumMsg::pasteLinkFull()
{
ui.forumMessage->insertHtml(RSLinkClipboard::toHtmlFull()) ;
}
void CreateGxsForumMsg::pasteOwnCertificateLink()
{
RetroShareLink link ;
std::string ownId = rsPeers->getOwnId() ;
if( link.createCertificate(ownId) ) {
ui.forumMessage->insertHtml(link.toHtml() + " ");
}
}
void CreateGxsForumMsg::loadForumInfo(const uint32_t &token)
{
std::cerr << "CreateGxsForumMsg::loadForumInfo()";