mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-12-28 00:49:28 -05:00
Added Send Invite Button to People Dialog.
This commit is contained in:
parent
e3f496f3d9
commit
12c919491c
@ -32,6 +32,7 @@
|
|||||||
#include "gui/chat/ChatDialog.h"
|
#include "gui/chat/ChatDialog.h"
|
||||||
#include "gui/settings/rsharesettings.h"
|
#include "gui/settings/rsharesettings.h"
|
||||||
#include "gui/msgs/MessageComposer.h"
|
#include "gui/msgs/MessageComposer.h"
|
||||||
|
#include "gui/RetroShareLink.h"
|
||||||
#include "util/QtVersion.h"
|
#include "util/QtVersion.h"
|
||||||
|
|
||||||
#include <retroshare/rspeers.h>
|
#include <retroshare/rspeers.h>
|
||||||
@ -142,7 +143,7 @@ IdDialog::IdDialog(QWidget *parent) :
|
|||||||
connect(ui->filterLineEdit, SIGNAL(textChanged(QString)), this, SLOT(filterChanged(QString)));
|
connect(ui->filterLineEdit, SIGNAL(textChanged(QString)), this, SLOT(filterChanged(QString)));
|
||||||
connect(ui->ownOpinion_CB, SIGNAL(currentIndexChanged(int)), this, SLOT(modifyReputation()));
|
connect(ui->ownOpinion_CB, SIGNAL(currentIndexChanged(int)), this, SLOT(modifyReputation()));
|
||||||
|
|
||||||
connect(ui->messageButton, SIGNAL(clicked()), this, SLOT(sendMsg()));
|
connect(ui->inviteButton, SIGNAL(clicked()), this, SLOT(sendInvite()));
|
||||||
|
|
||||||
ui->avlabel->setPixmap(QPixmap(":/images/user/friends64.png"));
|
ui->avlabel->setPixmap(QPixmap(":/images/user/friends64.png"));
|
||||||
ui->headerTextLabel->setText(tr("People"));
|
ui->headerTextLabel->setText(tr("People"));
|
||||||
@ -665,7 +666,7 @@ void IdDialog::insertIdDetails(uint32_t token)
|
|||||||
ui->editIdentity->setEnabled(true);
|
ui->editIdentity->setEnabled(true);
|
||||||
ui->removeIdentity->setEnabled(true);
|
ui->removeIdentity->setEnabled(true);
|
||||||
ui->chatIdentity->setEnabled(false);
|
ui->chatIdentity->setEnabled(false);
|
||||||
ui->messageButton->setEnabled(false);
|
ui->inviteButton->setEnabled(false);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -674,7 +675,7 @@ void IdDialog::insertIdDetails(uint32_t token)
|
|||||||
ui->editIdentity->setEnabled(false);
|
ui->editIdentity->setEnabled(false);
|
||||||
ui->removeIdentity->setEnabled(false);
|
ui->removeIdentity->setEnabled(false);
|
||||||
ui->chatIdentity->setEnabled(true);
|
ui->chatIdentity->setEnabled(true);
|
||||||
ui->messageButton->setEnabled(true);
|
ui->inviteButton->setEnabled(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* now fill in the reputation information */
|
/* now fill in the reputation information */
|
||||||
@ -1064,6 +1065,42 @@ void IdDialog::sendMsg()
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QString IdDialog::inviteMessage()
|
||||||
|
{
|
||||||
|
return tr("Hi,<br>I want to be friends with you on RetroShare.<br>");
|
||||||
|
}
|
||||||
|
|
||||||
|
void IdDialog::sendInvite()
|
||||||
|
{
|
||||||
|
QTreeWidgetItem *item = ui->idTreeWidget->currentItem();
|
||||||
|
if (!item)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
/* create a message */
|
||||||
|
MessageComposer *composer = MessageComposer::newMsg();
|
||||||
|
|
||||||
|
composer->setTitleText(tr("You have a friend invite"));
|
||||||
|
|
||||||
|
RsPeerId ownId = rsPeers->getOwnId();
|
||||||
|
RetroShareLink link;
|
||||||
|
link.createCertificate(ownId);
|
||||||
|
|
||||||
|
std::string keyId = item->text(RSID_COL_KEYID).toStdString();
|
||||||
|
|
||||||
|
QString sMsgText = inviteMessage();
|
||||||
|
sMsgText += "<br><br>";
|
||||||
|
sMsgText += tr("Respond now:") + "<br>";
|
||||||
|
sMsgText += link.toHtml() + "<br>";
|
||||||
|
sMsgText += "<br>";
|
||||||
|
sMsgText += tr("Thanks, <br>") + QString::fromUtf8(rsPeers->getGPGName(rsPeers->getGPGOwnId()).c_str());
|
||||||
|
composer->setMsgText(sMsgText);
|
||||||
|
composer->addRecipient(MessageComposer::TO, RsGxsId(keyId));
|
||||||
|
|
||||||
|
composer->show();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
void IdDialog::banPerson()
|
void IdDialog::banPerson()
|
||||||
{
|
{
|
||||||
QTreeWidgetItem *item = ui->idTreeWidget->currentItem();
|
QTreeWidgetItem *item = ui->idTreeWidget->currentItem();
|
||||||
|
@ -79,6 +79,9 @@ private slots:
|
|||||||
|
|
||||||
void banPerson();
|
void banPerson();
|
||||||
void unbanPerson();
|
void unbanPerson();
|
||||||
|
|
||||||
|
static QString inviteMessage();
|
||||||
|
void sendInvite();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void processSettings(bool load);
|
void processSettings(bool load);
|
||||||
|
@ -305,41 +305,6 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="0" column="3" rowspan="2">
|
|
||||||
<widget class="QToolButton" name="messageButton">
|
|
||||||
<property name="minimumSize">
|
|
||||||
<size>
|
|
||||||
<width>48</width>
|
|
||||||
<height>48</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
<property name="maximumSize">
|
|
||||||
<size>
|
|
||||||
<width>48</width>
|
|
||||||
<height>48</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
<property name="toolTip">
|
|
||||||
<string>Send message</string>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string/>
|
|
||||||
</property>
|
|
||||||
<property name="icon">
|
|
||||||
<iconset resource="../images.qrc">
|
|
||||||
<normaloff>:/images/mail-message-new.png</normaloff>:/images/mail-message-new.png</iconset>
|
|
||||||
</property>
|
|
||||||
<property name="iconSize">
|
|
||||||
<size>
|
|
||||||
<width>48</width>
|
|
||||||
<height>48</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
<property name="autoRaise">
|
|
||||||
<bool>true</bool>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
@ -495,6 +460,13 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QPushButton" name="inviteButton">
|
||||||
|
<property name="text">
|
||||||
|
<string>Send Invite</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<spacer name="verticalSpacer_3">
|
<spacer name="verticalSpacer_3">
|
||||||
<property name="orientation">
|
<property name="orientation">
|
||||||
|
Loading…
Reference in New Issue
Block a user