mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-01-23 13:51:12 -05:00
Added "Send Message" functionality to NetworkDialog, to send a distant message to a known peer.
git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@6633 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
6b768c64cf
commit
a7af0516e7
@ -33,6 +33,7 @@
|
|||||||
#include "common/vmessagebox.h"
|
#include "common/vmessagebox.h"
|
||||||
#include "common/RSTreeWidgetItem.h"
|
#include "common/RSTreeWidgetItem.h"
|
||||||
#include <gui/common/FriendSelectionDialog.h>
|
#include <gui/common/FriendSelectionDialog.h>
|
||||||
|
#include "gui/msgs/MessageComposer.h"
|
||||||
#include "NetworkDialog.h"
|
#include "NetworkDialog.h"
|
||||||
//#include "TrustView.h"
|
//#include "TrustView.h"
|
||||||
#include "NetworkView.h"
|
#include "NetworkView.h"
|
||||||
@ -45,12 +46,13 @@
|
|||||||
|
|
||||||
/* Images for context menu icons */
|
/* Images for context menu icons */
|
||||||
#define IMAGE_LOADCERT ":/images/loadcert16.png"
|
#define IMAGE_LOADCERT ":/images/loadcert16.png"
|
||||||
#define IMAGE_PEERDETAILS ":/images/peerdetails_16x16.png"
|
#define IMAGE_PEERDETAILS ":/images/info16.png"
|
||||||
#define IMAGE_AUTH ":/images/encrypted16.png"
|
#define IMAGE_AUTH ":/images/encrypted16.png"
|
||||||
#define IMAGE_CLEAN_UNUSED ":/images/deletemail24.png"
|
#define IMAGE_CLEAN_UNUSED ":/images/deletemail24.png"
|
||||||
#define IMAGE_MAKEFRIEND ":/images/user/add_user16.png"
|
#define IMAGE_MAKEFRIEND ":/images/user/add_user16.png"
|
||||||
#define IMAGE_EXPORT ":/images/exportpeers_16x16.png"
|
#define IMAGE_EXPORT ":/images/exportpeers_16x16.png"
|
||||||
#define IMAGE_COPYLINK ":/images/copyrslink.png"
|
#define IMAGE_COPYLINK ":/images/copyrslink.png"
|
||||||
|
#define IMAGE_MESSAGE ":/images/mail_new.png"
|
||||||
|
|
||||||
/* Images for Status icons */
|
/* Images for Status icons */
|
||||||
#define IMAGE_AUTHED ":/images/accepted16.png"
|
#define IMAGE_AUTHED ":/images/accepted16.png"
|
||||||
@ -199,6 +201,7 @@ void NetworkDialog::connectTreeWidgetCostumPopupMenu( QPoint /*point*/ )
|
|||||||
contextMnu->addAction(QIcon(IMAGE_EXPORT), tr("Export my certificate..."), this, SLOT(on_actionExportKey_activated()));
|
contextMnu->addAction(QIcon(IMAGE_EXPORT), tr("Export my certificate..."), this, SLOT(on_actionExportKey_activated()));
|
||||||
|
|
||||||
contextMnu->addAction(QIcon(IMAGE_PEERDETAILS), tr("Peer details..."), this, SLOT(peerdetails()));
|
contextMnu->addAction(QIcon(IMAGE_PEERDETAILS), tr("Peer details..."), this, SLOT(peerdetails()));
|
||||||
|
contextMnu->addAction(QIcon(IMAGE_MESSAGE), tr("Send Message"), this, SLOT(sendDistantMessage()));
|
||||||
contextMnu->addAction(QIcon(IMAGE_COPYLINK), tr("Copy RetroShare Link"), this, SLOT(copyLink()));
|
contextMnu->addAction(QIcon(IMAGE_COPYLINK), tr("Copy RetroShare Link"), this, SLOT(copyLink()));
|
||||||
contextMnu->addSeparator() ;
|
contextMnu->addSeparator() ;
|
||||||
contextMnu->addAction(QIcon(IMAGE_CLEAN_UNUSED), tr("Remove unused keys..."), this, SLOT(removeUnusedKeys()));
|
contextMnu->addAction(QIcon(IMAGE_CLEAN_UNUSED), tr("Remove unused keys..."), this, SLOT(removeUnusedKeys()));
|
||||||
@ -328,6 +331,31 @@ void NetworkDialog::copyLink()
|
|||||||
RSLinkClipboard::copyLinks(urls);
|
RSLinkClipboard::copyLinks(urls);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void NetworkDialog::sendDistantMessage()
|
||||||
|
{
|
||||||
|
QTreeWidgetItem *wi = getCurrentNeighbour();
|
||||||
|
if (wi == NULL) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
MessageComposer *nMsgDialog = MessageComposer::newMsg();
|
||||||
|
if (nMsgDialog == NULL) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
std::string hash ;
|
||||||
|
std::string mGpgId = wi->text(COLUMN_PEERID).toStdString() ;
|
||||||
|
|
||||||
|
if(rsMsgs->getDistantMessageHash(mGpgId,hash))
|
||||||
|
{
|
||||||
|
nMsgDialog->addRecipient(MessageComposer::TO, hash, mGpgId);
|
||||||
|
nMsgDialog->show();
|
||||||
|
nMsgDialog->activateWindow();
|
||||||
|
}
|
||||||
|
|
||||||
|
/* window will destroy itself! */
|
||||||
|
}
|
||||||
|
|
||||||
void NetworkDialog::updateDisplay()
|
void NetworkDialog::updateDisplay()
|
||||||
{
|
{
|
||||||
insertConnect() ;
|
insertConnect() ;
|
||||||
|
@ -72,6 +72,7 @@ private slots:
|
|||||||
void deleteCert() ;
|
void deleteCert() ;
|
||||||
void peerdetails();
|
void peerdetails();
|
||||||
void copyLink();
|
void copyLink();
|
||||||
|
void sendDistantMessage();
|
||||||
/** Create the context popup menu and it's submenus */
|
/** Create the context popup menu and it's submenus */
|
||||||
void connectTreeWidgetCostumPopupMenu( QPoint point );
|
void connectTreeWidgetCostumPopupMenu( QPoint point );
|
||||||
//void unvalidGPGKeyWidgetCostumPopupMenu( QPoint point );
|
//void unvalidGPGKeyWidgetCostumPopupMenu( QPoint point );
|
||||||
|
@ -10,8 +10,8 @@
|
|||||||
<height>567</height>
|
<height>567</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QVBoxLayout" name="verticalLayout">
|
<layout class="QGridLayout" name="gridLayout">
|
||||||
<item>
|
<item row="0" column="0">
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||||
<item>
|
<item>
|
||||||
<widget class="QLabel" name="titleBarLabel">
|
<widget class="QLabel" name="titleBarLabel">
|
||||||
@ -43,7 +43,7 @@
|
|||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item row="1" column="0">
|
||||||
<widget class="QSplitter" name="splitter">
|
<widget class="QSplitter" name="splitter">
|
||||||
<property name="orientation">
|
<property name="orientation">
|
||||||
<enum>Qt::Vertical</enum>
|
<enum>Qt::Vertical</enum>
|
||||||
@ -102,6 +102,11 @@
|
|||||||
<string/>
|
<string/>
|
||||||
</property>
|
</property>
|
||||||
</column>
|
</column>
|
||||||
|
<column>
|
||||||
|
<property name="text">
|
||||||
|
<string/>
|
||||||
|
</property>
|
||||||
|
</column>
|
||||||
<column>
|
<column>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Name</string>
|
<string>Name</string>
|
||||||
|
Loading…
Reference in New Issue
Block a user