added a friend recommendation menu entry in Home drop menu, and created the dialog to create/send the recommendations

This commit is contained in:
csoler 2017-01-22 21:06:11 +01:00
parent dc43611dd4
commit 214fbc7957
6 changed files with 232 additions and 1 deletions

View file

@ -25,6 +25,7 @@
#include "gui/notifyqt.h"
#include "gui/msgs/MessageComposer.h"
#include "gui/connect/ConnectFriendWizard.h"
#include "gui/connect/FriendRecommendDialog.h"
#if QT_VERSION >= QT_VERSION_CHECK(5,0,0)
#include <QUrlQuery>
@ -60,10 +61,14 @@ HomePage::HomePage(QWidget *parent) :
QAction *SendAction = new QAction(QIcon(),tr("Send via Email"), this);
connect(SendAction, SIGNAL(triggered()), this, SLOT(runEmailClient()));
QAction *RecAction = new QAction(QIcon(),tr("Recommend friends to each others"), this);
connect(RecAction, SIGNAL(triggered()), this, SLOT(recommendFriends()));
QMenu *menu = new QMenu();
menu->addAction(CopyAction);
menu->addAction(SaveAction);
menu->addAction(SendAction);
menu->addAction(RecAction);
ui->shareButton->setMenu(menu);
@ -109,6 +114,11 @@ static void sendMail(QString sAddress, QString sSubject, QString sBody)
QDesktopServices::openUrl (url);
}
void HomePage::recommendFriends()
{
FriendRecommendDialog::showIt() ;
}
void HomePage::runEmailClient()
{
sendMail("", tr("RetroShare Invite"), ui->userCertEdit->toPlainText());