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

View file

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

View file

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

View file

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