The connection attempt to all ssl id's of one gpg id can be started from the context menu in PeersDialog and MessengerWindow.

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@3401 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
thunder2 2010-08-28 19:50:38 +00:00
parent a0e426a527
commit 66f3c7fee8
4 changed files with 56 additions and 34 deletions

View File

@ -22,6 +22,8 @@
#include <QFile>
#include <QFileInfo>
#include <QWidgetAction>
#include <QTimer>
#include <QFileDialog>
#include "common/vmessagebox.h"
#include <retroshare/rsiface.h>
@ -52,6 +54,7 @@
#include <iostream>
#include <sstream>
#include <algorithm>
#include <set>
/* Images for context menu icons */
#define IMAGE_REMOVEFRIEND ":/images/removefriend16.png"
@ -378,10 +381,8 @@ void MessengerWindow::messengertreeWidgetCostumPopupMenu( QPoint point )
//contextMnu.addAction( profileviewAct);
if (c->type() == 0) {
contextMnu.addAction( recommendfriendAct);
} else {
//this is a SSL key
contextMnu.addAction( connectfriendAct);
}
contextMnu.addAction( connectfriendAct);
contextMnu.addAction(pastePersonAct);
contextMnu.addAction( removefriendAct);
//contextMnu.addAction( exportfriendAct);
@ -688,7 +689,6 @@ void MessengerWindow::insertPeers()
}
break;
}
}
}
}
@ -866,23 +866,35 @@ void MessengerWindow::removefriend()
void MessengerWindow::connectfriend()
{
QTreeWidgetItem *c = getCurrentPeer();
QTreeWidgetItem *c = getCurrentPeer();
#ifdef PEERS_DEBUG
std::cerr << "PeersDialog::connectfriend()" << std::endl;
std::cerr << "PeersDialog::connectfriend()" << std::endl;
#endif
if (!c)
{
if (!c)
{
#ifdef PEERS_DEBUG
std::cerr << "PeersDialog::connectfriend() Noone Selected -- sorry" << std::endl;
std::cerr << "PeersDialog::connectfriend() Noone Selected -- sorry" << std::endl;
#endif
return;
}
return;
}
if (rsPeers)
{
rsPeers->connectAttempt(getPeersRsCertId(c));
c -> setIcon(COLUMN_NAME,(QIcon(IMAGE_CONNECT2)));
}
if (rsPeers)
{
if (c->type() == 0) {
int childCount = c->childCount();
for (int childIndex = 0; childIndex < childCount; childIndex++) {
QTreeWidgetItem *item = c->child(childIndex);
if (item->type() == 1) {
rsPeers->connectAttempt(getPeersRsCertId(item));
item->setIcon(COLUMN_NAME,(QIcon(IMAGE_CONNECT2)));
}
}
} else {
//this is a SSL key
rsPeers->connectAttempt(getPeersRsCertId(c));
c->setIcon(COLUMN_NAME,(QIcon(IMAGE_CONNECT2)));
}
}
}
/* GUI stuff -> don't do anything directly with Control */

View File

@ -28,6 +28,7 @@
#include <QColorDialog>
#include <QFontDialog>
#include <QDropEvent>
#include <QFileDialog>
#include "common/vmessagebox.h"
#include <gui/mainpagestack.h>
@ -421,10 +422,8 @@ void PeersDialog::peertreeWidgetCostumPopupMenu( QPoint point )
//contextMnu.addAction( profileviewAct);
if (c->type() == 0) {
contextMnu.addAction( recommendfriendAct);
} else {
//this is a SSL key
contextMnu.addAction( connectfriendAct);
}
contextMnu.addAction( connectfriendAct);
contextMnu.addAction(pastePersonAct);
contextMnu.addAction( removefriendAct);
//contextMnu.addAction( exportfriendAct);
@ -928,23 +927,35 @@ void PeersDialog::removefriend()
void PeersDialog::connectfriend()
{
QTreeWidgetItem *c = getCurrentPeer();
QTreeWidgetItem *c = getCurrentPeer();
#ifdef PEERS_DEBUG
std::cerr << "PeersDialog::connectfriend()" << std::endl;
std::cerr << "PeersDialog::connectfriend()" << std::endl;
#endif
if (!c)
{
if (!c)
{
#ifdef PEERS_DEBUG
std::cerr << "PeersDialog::connectfriend() Noone Selected -- sorry" << std::endl;
std::cerr << "PeersDialog::connectfriend() Noone Selected -- sorry" << std::endl;
#endif
return;
}
return;
}
if (rsPeers)
{
rsPeers->connectAttempt(getPeerRsCertId(c));
c -> setIcon(COLUMN_NAME,(QIcon(IMAGE_CONNECT2)));
}
if (rsPeers)
{
if (c->type() == 0) {
int childCount = c->childCount();
for (int childIndex = 0; childIndex < childCount; childIndex++) {
QTreeWidgetItem *item = c->child(childIndex);
if (item->type() == 1) {
rsPeers->connectAttempt(getPeerRsCertId(item));
item->setIcon(COLUMN_NAME,(QIcon(IMAGE_CONNECT2)));
}
}
} else {
//this is a SSL key
rsPeers->connectAttempt(getPeerRsCertId(c));
c->setIcon(COLUMN_NAME,(QIcon(IMAGE_CONNECT2)));
}
}
}
/* GUI stuff -> don't do anything directly with Control */

View File

@ -22,9 +22,6 @@
#ifndef _PEERSDIALOG_H
#define _PEERSDIALOG_H
#include <QFileDialog>
#include "chat/PopupChatDialog.h"
#include "chat/HandleRichText.h"
#include "RsAutoUpdatePage.h"
@ -49,6 +46,7 @@ class QAction;
class QTextEdit;
class QTextCharFormat;
class ChatDialog;
class AttachFileItem;
class PeersDialog : public RsAutoUpdatePage
{

View File

@ -28,6 +28,7 @@
#include "gui/TransfersDialog.h"
#include "gui/MessagesDialog.h"
#include "gui/SharedFilesDialog.h"
#include "gui/chat/PopupChatDialog.h"
#include "gui/MessengerWindow.h"
#include "gui/NetworkDialog.h"
#include "gui/StartDialog.h"