-added remove Friend feature

-added Add Friend feature

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@251 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
defnax 2007-11-17 01:35:52 +00:00
parent 23d1894b2b
commit 92d5c61c8c
2 changed files with 64 additions and 16 deletions

View File

@ -33,6 +33,8 @@
#include "util/PixmapMerging.h"
#include "LogoBar.h"
#include "util/Widget.h"
#include "gui/connect/InviteDialog.h"
#include "gui/connect/AddFriendDialog.h"
#include <iostream>
#include <sstream>
@ -70,7 +72,9 @@ MessengerWindow::MessengerWindow(QWidget * parent)
connect( ui.messengertreeWidget, SIGNAL( customContextMenuRequested( QPoint ) ), this, SLOT( messengertreeWidgetCostumPopupMenu( QPoint ) ) );
connect( ui.avatarButton, SIGNAL(clicked()), SLOT(changeAvatarClicked()));
connect( ui.avatarButton, SIGNAL(clicked()), SLOT(changeAvatarClicked()));
connect( ui.addIMAccountButton, SIGNAL(clicked( bool ) ), this , SLOT( addFriend2() ) );
/* to hide the header */
ui.messengertreeWidget->header()->hide();
@ -126,25 +130,26 @@ void MessengerWindow::messengertreeWidgetCostumPopupMenu( QPoint point )
exportfriendAct = new QAction(QIcon(IMAGE_EXPIORTFRIEND), tr( "Export Friend" ), this );
connect( exportfriendAct , SIGNAL( triggered() ), this, SLOT( exportfriend2() ) );
removefriendAct = new QAction(QIcon(IMAGE_REMOVEFRIEND), tr( "Remove Friend" ), this );
connect( removefriendAct , SIGNAL( triggered() ), this, SLOT( removefriend2() ) );
*
*
*
*
*********/
removefriend2Act = new QAction(QIcon(IMAGE_REMOVEFRIEND), tr( "Remove Friend" ), this );
connect( removefriend2Act , SIGNAL( triggered() ), this, SLOT( removefriend2() ) );
contextMnu.clear();
contextMnu.addAction( chatAct);
contextMnu.addAction( sendMessageAct);
contextMnu.addSeparator();
contextMnu.addAction( connectfriendAct);
contextMnu.addAction( removefriend2Act);
/**** Do we want these options here???
*
*
contextMnu.addAction( configurefriendAct);
contextMnu.addAction( exportfriendAct);
contextMnu.addAction( removefriendAct);
contextMnu.addAction( exportfriendAct);
*
*
****/
@ -263,11 +268,6 @@ void MessengerWindow::exportfriend2()
}
void MessengerWindow::removefriend2()
{
}
void MessengerWindow::allowfriend2()
{
@ -431,6 +431,19 @@ QTreeWidgetItem *MessengerWindow::getCurrentPeer(bool &isOnline)
return item;
}
void MessengerWindow::removefriend2()
{
bool isOnline;
QTreeWidgetItem *c = getCurrentPeer(isOnline);
std::cerr << "MessengerWindow::removefriend2()" << std::endl;
if (!c)
{
std::cerr << "MessengerWindow::removefriend2() Noone Selected -- sorry" << std::endl;
return;
}
rsicontrol->FriendRemove(getMessengerPeerRsCertId(c));
}
void MessengerWindow::changeAvatarClicked()
{
@ -438,6 +451,34 @@ void MessengerWindow::changeAvatarClicked()
}
/** Add a Friend ShortCut */
void MessengerWindow::addFriend2()
{
/* call load Certificate */
#if 0
std::string id;
if (connectionsDialog)
{
id = connectionsDialog->loadneighbour();
}
/* call make Friend */
if (id != "")
{
connectionsDialog->showpeerdetails(id);
}
virtual int NeighLoadPEMString(std::string pem, std::string &id) = 0;
#else
static AddFriendDialog *addDialog2 =
new AddFriendDialog(networkDialog2, this);
std::string invite = "";
addDialog2->setInfo(invite);
addDialog2->show();
#endif
}
void MessengerWindow::updateAvatar()
{
std::string backgroundPixmapFilename = ":/images/retrosharelogo1.png";

View File

@ -24,7 +24,9 @@
#include <QFileDialog>
#include "mainpage.h"
#include "ui_MessengerWindow.h"
#include "ui_MessengerWindow.h"
#include "NetworkDialog.h"
class LogoBar;
class ChatDialog;
@ -40,6 +42,9 @@ public:
void insertPeers();
void setChatDialog(ChatDialog *cd);
NetworkDialog *networkDialog2;
public slots:
@ -66,7 +71,9 @@ private slots:
void sendMessage();
void configurefriend2();
void configurefriend2();
void addFriend2();
/** RsServer Friend Calls */
void allowfriend2();
@ -96,7 +103,7 @@ private:
QAction* connectfriendAct;
QAction* configurefriendAct;
QAction* exportfriendAct;
QAction* removefriendAct;
QAction* removefriend2Act;
QTreeView *messengertreeWidget;