Added a new checbox in the settings (NotifyPage) to enable/disable the new SecurityItem. It is enabled by default, but all existing users need to enable it.

Added new buttons to SecurityItem to add/remove the peer and view peer details.
Added new call to notifyListChange with NOTIFY_LIST_FRIENDS in AuthGPGimpl::AllowConnection.
Fixed german language.

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@4572 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
thunder2 2011-08-21 22:28:19 +00:00
parent 2e9d5663c9
commit 01fa9eec3f
17 changed files with 419 additions and 1297 deletions

View file

@ -30,6 +30,7 @@
#ifdef WINDOWS_SYS #ifdef WINDOWS_SYS
#include "retroshare/rsinit.h" #include "retroshare/rsinit.h"
#endif #endif
#include "pqi/pqinotify.h"
#include <util/rsdir.h> #include <util/rsdir.h>
#include <iostream> #include <iostream>
@ -1522,6 +1523,8 @@ bool AuthGPGimpl::AllowConnection(const std::string &gpg_id, bool accept)
IndicateConfigChanged(); IndicateConfigChanged();
rsicontrol->getNotify().notifyListChange(NOTIFY_LIST_FRIENDS, accept ? NOTIFY_TYPE_ADD : NOTIFY_TYPE_DEL);
return true; return true;
} }

View file

@ -77,8 +77,6 @@ NewsFeed::NewsFeed(QWidget *parent)
timer->start(1000); timer->start(1000);
} }
void NewsFeed::updateFeed() void NewsFeed::updateFeed()
{ {
if (!rsNotify) if (!rsNotify)
@ -86,9 +84,6 @@ void NewsFeed::updateFeed()
uint flags = Settings->getNewsFeedFlags(); uint flags = Settings->getNewsFeedFlags();
/* HACK until SECURITY is in feeds */
flags |= RS_FEED_TYPE_SECURITY;
/* check for new messages */ /* check for new messages */
RsFeedItem fi; RsFeedItem fi;
if (rsNotify->GetFeedItem(fi)) if (rsNotify->GetFeedItem(fi))
@ -238,7 +233,6 @@ void NewsFeed::addFeedItemPeerConnect(RsFeedItem &fi)
} }
void NewsFeed::addFeedItemPeerDisconnect(RsFeedItem &fi) void NewsFeed::addFeedItemPeerDisconnect(RsFeedItem &fi)
{ {
/* make new widget */ /* make new widget */
@ -255,7 +249,6 @@ void NewsFeed::addFeedItemPeerDisconnect(RsFeedItem &fi)
#endif #endif
} }
void NewsFeed::addFeedItemPeerHello(RsFeedItem &fi) void NewsFeed::addFeedItemPeerHello(RsFeedItem &fi)
{ {
/* make new widget */ /* make new widget */
@ -272,7 +265,6 @@ void NewsFeed::addFeedItemPeerHello(RsFeedItem &fi)
#endif #endif
} }
void NewsFeed::addFeedItemPeerNew(RsFeedItem &fi) void NewsFeed::addFeedItemPeerNew(RsFeedItem &fi)
{ {
/* make new widget */ /* make new widget */
@ -289,8 +281,6 @@ void NewsFeed::addFeedItemPeerNew(RsFeedItem &fi)
#endif #endif
} }
void NewsFeed::addFeedItemSecurityConnectAttempt(RsFeedItem &fi) void NewsFeed::addFeedItemSecurityConnectAttempt(RsFeedItem &fi)
{ {
/* make new widget */ /* make new widget */
@ -307,7 +297,6 @@ void NewsFeed::addFeedItemSecurityConnectAttempt(RsFeedItem &fi)
#endif #endif
} }
void NewsFeed::addFeedItemSecurityAuthDenied(RsFeedItem &fi) void NewsFeed::addFeedItemSecurityAuthDenied(RsFeedItem &fi)
{ {
/* make new widget */ /* make new widget */
@ -356,8 +345,6 @@ void NewsFeed::addFeedItemSecurityUnknownOut(RsFeedItem &fi)
#endif #endif
} }
void NewsFeed::addFeedItemChanNew(RsFeedItem &fi) void NewsFeed::addFeedItemChanNew(RsFeedItem &fi)
{ {
/* make new widget */ /* make new widget */
@ -374,7 +361,6 @@ void NewsFeed::addFeedItemChanNew(RsFeedItem &fi)
#endif #endif
} }
void NewsFeed::addFeedItemChanUpdate(RsFeedItem &fi) void NewsFeed::addFeedItemChanUpdate(RsFeedItem &fi)
{ {
/* make new widget */ /* make new widget */
@ -391,7 +377,6 @@ void NewsFeed::addFeedItemChanUpdate(RsFeedItem &fi)
#endif #endif
} }
void NewsFeed::addFeedItemChanMsg(RsFeedItem &fi) void NewsFeed::addFeedItemChanMsg(RsFeedItem &fi)
{ {
/* make new widget */ /* make new widget */
@ -408,7 +393,6 @@ void NewsFeed::addFeedItemChanMsg(RsFeedItem &fi)
#endif #endif
} }
void NewsFeed::addFeedItemForumNew(RsFeedItem &fi) void NewsFeed::addFeedItemForumNew(RsFeedItem &fi)
{ {
/* make new widget */ /* make new widget */
@ -426,7 +410,6 @@ void NewsFeed::addFeedItemForumNew(RsFeedItem &fi)
#endif #endif
} }
void NewsFeed::addFeedItemForumUpdate(RsFeedItem &fi) void NewsFeed::addFeedItemForumUpdate(RsFeedItem &fi)
{ {
/* make new widget */ /* make new widget */
@ -444,7 +427,6 @@ void NewsFeed::addFeedItemForumUpdate(RsFeedItem &fi)
#endif #endif
} }
void NewsFeed::addFeedItemForumMsg(RsFeedItem &fi) void NewsFeed::addFeedItemForumMsg(RsFeedItem &fi)
{ {
/* make new widget */ /* make new widget */
@ -501,7 +483,6 @@ void NewsFeed::addFeedItemBlogMsg(RsFeedItem &fi)
#endif #endif
} }
void NewsFeed::addFeedItemChatNew(RsFeedItem &fi) void NewsFeed::addFeedItemChatNew(RsFeedItem &fi)
{ {
#ifdef NEWS_DEBUG #ifdef NEWS_DEBUG

View file

@ -64,6 +64,7 @@ PeerItem::PeerItem(FeedHolder *parent, uint32_t feedId, std::string peerId, uint
connect( sendmsgButton, SIGNAL( clicked( ) ), this, SLOT( sendMessage() ) ); connect( sendmsgButton, SIGNAL( clicked( ) ), this, SLOT( sendMessage() ) );
connect(NotifyQt::getInstance(), SIGNAL(peerHasNewAvatar(const QString&)), this, SLOT(updateAvatar(const QString&))); connect(NotifyQt::getInstance(), SIGNAL(peerHasNewAvatar(const QString&)), this, SLOT(updateAvatar(const QString&)));
connect(NotifyQt::getInstance(), SIGNAL(friendsChanged()), this, SLOT(updateItem()));
QMenu *msgmenu = new QMenu(); QMenu *msgmenu = new QMenu();
msgmenu->addAction(actionNew_Message); msgmenu->addAction(actionNew_Message);
@ -82,16 +83,12 @@ void PeerItem::updateItemStatic()
if (!rsPeers) if (!rsPeers)
return; return;
/* fill in */ /* fill in */
#ifdef DEBUG_ITEM #ifdef DEBUG_ITEM
std::cerr << "PeerItem::updateItemStatic()"; std::cerr << "PeerItem::updateItemStatic()";
std::cerr << std::endl; std::cerr << std::endl;
#endif #endif
RsPeerDetails details;
if (rsPeers->getPeerDetails(mPeerId, details))
{
QString title; QString title;
switch(mType) switch(mType)
@ -115,11 +112,13 @@ void PeerItem::updateItemStatic()
titleLabel->setText(title); titleLabel->setText(title);
/* set textcolor for peername */ /* set textcolor for peer name */
QString nameStr("<span style=\"font-size:14pt; font-weight:500;" QString nameStr("<span style=\"font-size:14pt; font-weight:500;color:#990033;\">%1</span>");
"color:#990033;\">%1</span>");
/* set Blog name */ RsPeerDetails details;
if (rsPeers->getPeerDetails(mPeerId, details))
{
/* set peer name */
QString peername = QString::fromUtf8(details.name.c_str()); QString peername = QString::fromUtf8(details.name.c_str());
peernameLabel->setText(nameStr.arg(peername)); peernameLabel->setText(nameStr.arg(peername));
@ -145,22 +144,18 @@ void PeerItem::updateItemStatic()
lastLabel->setText(tr("Unknown Peer")); lastLabel->setText(tr("Unknown Peer"));
chatButton->setEnabled(false); chatButton->setEnabled(false);
} }
if (mIsHome) if (mIsHome)
{ {
/* disable buttons */ /* disable buttons */
clearButton->setEnabled(false); clearButton->setEnabled(false);
//gotoButton->setEnabled(false);
/* disable buttons */ /* hide buttons */
clearButton->hide(); clearButton->hide();
} }
} }
void PeerItem::updateItem() void PeerItem::updateItem()
{ {
if (!rsPeers) if (!rsPeers)
@ -172,9 +167,15 @@ void PeerItem::updateItem()
std::cerr << std::endl; std::cerr << std::endl;
#endif #endif
if(!RsAutoUpdatePage::eventsLocked()) { if(!RsAutoUpdatePage::eventsLocked()) {
/* set textcolor for peer name */
QString nameStr("<span style=\"font-size:14pt; font-weight:500;color:#990033;\">%1</span>");
RsPeerDetails details; RsPeerDetails details;
if (!rsPeers->getPeerDetails(mPeerId, details)) if (!rsPeers->getPeerDetails(mPeerId, details))
{ {
chatButton->setEnabled(false);
quickmsgButton->setEnabled(false);
return; return;
} }
@ -190,8 +191,7 @@ void PeerItem::updateItem()
} }
#endif #endif
statusLabel->setText(status); statusLabel->setText(status);
trustLabel->setText(QString::fromStdString( trustLabel->setText(QString::fromStdString(RsPeerTrustString(details.trustLvl)));
RsPeerTrustString(details.trustLvl)));
{ {
std::ostringstream out; std::ostringstream out;
@ -208,14 +208,10 @@ void PeerItem::updateItem()
chatButton->setEnabled(details.state & RS_PEER_STATE_CONNECTED); chatButton->setEnabled(details.state & RS_PEER_STATE_CONNECTED);
if (details.state & RS_PEER_STATE_FRIEND) if (details.state & RS_PEER_STATE_FRIEND)
{ {
//addButton->setEnabled(false);
//removeButton->setEnabled(true);
quickmsgButton->setEnabled(true); quickmsgButton->setEnabled(true);
} }
else else
{ {
//addButton->setEnabled(true);
//removeButton->setEnabled(false);
quickmsgButton->setEnabled(false); quickmsgButton->setEnabled(false);
} }
} }
@ -262,15 +258,6 @@ void PeerItem::removeItem()
} }
} }
void PeerItem::gotoHome()
{
#ifdef DEBUG_ITEM
std::cerr << "PeerItem::gotoHome()";
std::cerr << std::endl;
#endif
}
/*********** SPECIFIC FUNCTIOSN ***********************/ /*********** SPECIFIC FUNCTIOSN ***********************/
void PeerItem::addFriend() void PeerItem::addFriend()
@ -281,8 +268,6 @@ void PeerItem::addFriend()
#endif #endif
} }
void PeerItem::removeFriend() void PeerItem::removeFriend()
{ {
#ifdef DEBUG_ITEM #ifdef DEBUG_ITEM
@ -291,8 +276,6 @@ void PeerItem::removeFriend()
#endif #endif
} }
void PeerItem::sendMsg() void PeerItem::sendMsg()
{ {
#ifdef DEBUG_ITEM #ifdef DEBUG_ITEM
@ -300,10 +283,6 @@ void PeerItem::sendMsg()
std::cerr << std::endl; std::cerr << std::endl;
#endif #endif
if (mParent)
{
//mParent->openMsg(FEEDHOLDER_MSG_MESSAGE, mPeerId, "");
MessageComposer *nMsgDialog = MessageComposer::newMsg(); MessageComposer *nMsgDialog = MessageComposer::newMsg();
if (nMsgDialog == NULL) { if (nMsgDialog == NULL) {
return; return;
@ -314,7 +293,6 @@ void PeerItem::sendMsg()
nMsgDialog->activateWindow(); nMsgDialog->activateWindow();
/* window will destroy itself! */ /* window will destroy itself! */
}
} }
@ -342,7 +320,6 @@ void PeerItem::updateAvatar(const QString &peer_id)
rsMsgs->getAvatarData(mPeerId,data,size); rsMsgs->getAvatarData(mPeerId,data,size);
if(size != 0) if(size != 0)
{ {
// set the image // set the image
@ -350,14 +327,11 @@ void PeerItem::updateAvatar(const QString &peer_id)
pix.loadFromData(data,size,"PNG") ; pix.loadFromData(data,size,"PNG") ;
avatar_label->setPixmap(pix); avatar_label->setPixmap(pix);
delete[] data ; delete[] data ;
} }
else else
{ {
avatar_label->setPixmap(QPixmap(":/images/user/personal64.png")); avatar_label->setPixmap(QPixmap(":/images/user/personal64.png"));
} }
} }
void PeerItem::togglequickmessage() void PeerItem::togglequickmessage()
@ -370,7 +344,6 @@ void PeerItem::togglequickmessage()
{ {
messageframe->setVisible(false); messageframe->setVisible(false);
} }
} }
void PeerItem::sendMessage() void PeerItem::sendMessage()

View file

@ -48,7 +48,6 @@ public:
private slots: private slots:
/* default stuff */ /* default stuff */
void gotoHome();
void removeItem(); void removeItem();
void toggle(); void toggle();

View file

@ -421,7 +421,7 @@ border-radius: 10px}</string>
</font> </font>
</property> </property>
<property name="text"> <property name="text">
<string>Location</string> <string>Location:</string>
</property> </property>
</widget> </widget>
</item> </item>
@ -434,7 +434,7 @@ border-radius: 10px}</string>
</font> </font>
</property> </property>
<property name="text"> <property name="text">
<string>IP Address</string> <string>IP Address:</string>
</property> </property>
</widget> </widget>
</item> </item>
@ -447,7 +447,7 @@ border-radius: 10px}</string>
</font> </font>
</property> </property>
<property name="text"> <property name="text">
<string>Connection Method</string> <string>Connection Method:</string>
</property> </property>
</widget> </widget>
</item> </item>

View file

@ -21,12 +21,14 @@
#include <QDateTime> #include <QDateTime>
#include <QTimer> #include <QTimer>
#include <QMessageBox>
#include "SecurityItem.h" #include "SecurityItem.h"
#include "FeedHolder.h" #include "FeedHolder.h"
#include "../RsAutoUpdatePage.h" #include "../RsAutoUpdatePage.h"
#include "gui/msgs/MessageComposer.h" #include "gui/msgs/MessageComposer.h"
#include "gui/common/StatusDefs.h" #include "gui/common/StatusDefs.h"
#include "gui/connect/ConfCertDialog.h"
#include "gui/notifyqt.h" #include "gui/notifyqt.h"
@ -49,6 +51,12 @@ SecurityItem::SecurityItem(FeedHolder *parent, uint32_t feedId, std::string gpgI
messageframe->setVisible(false); messageframe->setVisible(false);
sendmsgButton->setEnabled(false); sendmsgButton->setEnabled(false);
quickmsgButton->setEnabled(false);
chatButton->setEnabled(false);
addFriendButton->setEnabled(false);
removeFriendButton->setEnabled(false);
removeFriendButton->hide();
peerDetailsButton->setEnabled(false);
/* general ones */ /* general ones */
connect( expandButton, SIGNAL( clicked( void ) ), this, SLOT( toggle ( void ) ) ); connect( expandButton, SIGNAL( clicked( void ) ), this, SLOT( toggle ( void ) ) );
@ -62,8 +70,12 @@ SecurityItem::SecurityItem(FeedHolder *parent, uint32_t feedId, std::string gpgI
connect( cancelButton, SIGNAL( clicked( ) ), this, SLOT( togglequickmessage() ) ); connect( cancelButton, SIGNAL( clicked( ) ), this, SLOT( togglequickmessage() ) );
connect( sendmsgButton, SIGNAL( clicked( ) ), this, SLOT( sendMessage() ) ); connect( sendmsgButton, SIGNAL( clicked( ) ), this, SLOT( sendMessage() ) );
connect(addFriendButton, SIGNAL(clicked()), this, SLOT(addFriend()));
connect(removeFriendButton, SIGNAL(clicked()), this, SLOT(removeFriend()));
connect(peerDetailsButton, SIGNAL(clicked()), this, SLOT(peerDetails()));
connect(NotifyQt::getInstance(), SIGNAL(peerHasNewAvatar(const QString&)), this, SLOT(updateAvatar(const QString&))); connect(NotifyQt::getInstance(), SIGNAL(peerHasNewAvatar(const QString&)), this, SLOT(updateAvatar(const QString&)));
connect(NotifyQt::getInstance(), SIGNAL(friendsChanged()), this, SLOT(updateItem()));
QMenu *msgmenu = new QMenu(); QMenu *msgmenu = new QMenu();
msgmenu->addAction(actionNew_Message); msgmenu->addAction(actionNew_Message);
@ -73,7 +85,7 @@ SecurityItem::SecurityItem(FeedHolder *parent, uint32_t feedId, std::string gpgI
small(); small();
updateItemStatic(); updateItemStatic();
updateItem(); updateItem();
updateAvatar(QString::fromStdString(mGpgId)); updateAvatar(QString::fromStdString(mSslId));
} }
@ -92,7 +104,6 @@ void SecurityItem::updateItemStatic()
if (!rsPeers) if (!rsPeers)
return; return;
/* fill in */ /* fill in */
#ifdef DEBUG_ITEM #ifdef DEBUG_ITEM
std::cerr << "SecurityItem::updateItemStatic()"; std::cerr << "SecurityItem::updateItemStatic()";
@ -121,63 +132,16 @@ void SecurityItem::updateItemStatic()
titleLabel->setText(title); titleLabel->setText(title);
RsPeerDetails details;
if (rsPeers->getPeerDetails(mGpgId, details))
{
/* set textcolor for peername */
QString nameStr("<span style=\"font-size:14pt; font-weight:500;"
"color:#990033;\">%1</span>");
/* set Blog name */
QString peername = QString::fromStdString(details.name);
peernameLabel->setText(nameStr.arg(peername));
QDateTime date = QDateTime::fromTime_t(details.lastConnect);
QString stime = date.toString(Qt::LocalDate);
lastLabel-> setText(stime);
/* expanded Info */
nameLabel->setText(QString::fromUtf8(details.name.c_str()));
idLabel->setText(QString::fromStdString(details.id));
locLabel->setText(QString::fromUtf8(details.location.c_str()));
}
else
{
/* it is very likely that we will end up here for some of the
* Unknown peer cases.... so allow them here
*/
QDateTime date = QDateTime::currentDateTime();
QString stime = date.toString(Qt::LocalDate);
lastLabel-> setText(stime);
nameLabel->setText(QString::fromStdString(mGpgId));
idLabel->setText(QString::fromStdString(mSslId));
statusLabel->setText(tr("Unknown Peer"));
trustLabel->setText(tr("Unknown Peer"));
locLabel->setText(tr("Unknown Peer"));
ipLabel->setText(tr("Unknown Peer"));
connLabel->setText(tr("Unknown Peer"));
chatButton->setEnabled(false);
}
if (mIsHome) if (mIsHome)
{ {
/* disable buttons */ /* disable buttons */
clearButton->setEnabled(false); clearButton->setEnabled(false);
//gotoButton->setEnabled(false);
/* disable buttons */ /* hide buttons */
clearButton->hide(); clearButton->hide();
} }
} }
void SecurityItem::updateItem() void SecurityItem::updateItem()
{ {
if (!rsPeers) if (!rsPeers)
@ -188,12 +152,57 @@ void SecurityItem::updateItem()
std::cerr << "SecurityItem::updateItem()"; std::cerr << "SecurityItem::updateItem()";
std::cerr << std::endl; std::cerr << std::endl;
#endif #endif
QDateTime currentTime = QDateTime::currentDateTime();
timeLabel->setText(currentTime.toString(Qt::LocalDate));
if(!RsAutoUpdatePage::eventsLocked()) { if(!RsAutoUpdatePage::eventsLocked()) {
/* set textcolor for peer name */
QString nameStr("<span style=\"font-size:14pt; font-weight:500;color:#990033;\">%1</span>");
RsPeerDetails details; RsPeerDetails details;
/* first try sslid */
if (!rsPeers->getPeerDetails(mSslId, details))
{
/* then gpgid */
if (!rsPeers->getPeerDetails(mGpgId, details)) if (!rsPeers->getPeerDetails(mGpgId, details))
{ {
/* it is very likely that we will end up here for some of the
* Unknown peer cases.... so allow them here
*/
/* set peer name */
peernameLabel->setText(nameStr.arg(tr("Unknown Peer")));
nameLabel->setText(QString::fromStdString(mGpgId));
idLabel->setText(QString::fromStdString(mSslId));
statusLabel->setText(tr("Unknown Peer"));
trustLabel->setText(tr("Unknown Peer"));
locLabel->setText(tr("Unknown Peer"));
ipLabel->setText(tr("Unknown Peer"));
connLabel->setText(tr("Unknown Peer"));
chatButton->setEnabled(false);
quickmsgButton->setEnabled(false);
addFriendButton->setEnabled(false);
addFriendButton->show();
removeFriendButton->setEnabled(false);
removeFriendButton->hide();
peerDetailsButton->setEnabled(false);
return; return;
} }
}
/* set peer name */
QString peername = QString::fromUtf8(details.name.c_str());
peernameLabel->setText(nameStr.arg(peername));
/* expanded Info */
nameLabel->setText(QString::fromUtf8(details.name.c_str()));
idLabel->setText(QString::fromStdString(details.id));
locLabel->setText(QString::fromUtf8(details.location.c_str()));
/* top Level info */ /* top Level info */
QString status = StatusDefs::peerStateString(details.state); QString status = StatusDefs::peerStateString(details.state);
@ -207,8 +216,7 @@ void SecurityItem::updateItem()
} }
#endif #endif
statusLabel->setText(status); statusLabel->setText(status);
trustLabel->setText(QString::fromStdString( trustLabel->setText(QString::fromStdString(RsPeerTrustString(details.trustLvl)));
RsPeerTrustString(details.trustLvl)));
{ {
std::ostringstream out; std::ostringstream out;
@ -223,16 +231,29 @@ void SecurityItem::updateItem()
/* do buttons */ /* do buttons */
chatButton->setEnabled(details.state & RS_PEER_STATE_CONNECTED); chatButton->setEnabled(details.state & RS_PEER_STATE_CONNECTED);
peerDetailsButton->setEnabled(true);
if (details.accept_connection)
{
addFriendButton->setEnabled(false);
addFriendButton->hide();
removeFriendButton->setEnabled(true);
removeFriendButton->show();
}
else
{
addFriendButton->setEnabled(true);
addFriendButton->show();
removeFriendButton->setEnabled(false);
removeFriendButton->hide();
}
if (details.state & RS_PEER_STATE_FRIEND) if (details.state & RS_PEER_STATE_FRIEND)
{ {
//addButton->setEnabled(false);
//removeButton->setEnabled(true);
quickmsgButton->setEnabled(true); quickmsgButton->setEnabled(true);
} }
else else
{ {
//addButton->setEnabled(true);
//removeButton->setEnabled(false);
quickmsgButton->setEnabled(false); quickmsgButton->setEnabled(false);
} }
} }
@ -265,7 +286,6 @@ void SecurityItem::toggle()
} }
} }
void SecurityItem::removeItem() void SecurityItem::removeItem()
{ {
#ifdef DEBUG_ITEM #ifdef DEBUG_ITEM
@ -279,15 +299,6 @@ void SecurityItem::removeItem()
} }
} }
void SecurityItem::gotoHome()
{
#ifdef DEBUG_ITEM
std::cerr << "SecurityItem::gotoHome()";
std::cerr << std::endl;
#endif
}
/*********** SPECIFIC FUNCTIOSN ***********************/ /*********** SPECIFIC FUNCTIOSN ***********************/
void SecurityItem::addFriend() void SecurityItem::addFriend()
@ -296,19 +307,44 @@ void SecurityItem::addFriend()
std::cerr << "SecurityItem::addFriend()"; std::cerr << "SecurityItem::addFriend()";
std::cerr << std::endl; std::cerr << std::endl;
#endif #endif
ConfCertDialog::showIt(mGpgId, ConfCertDialog::PageTrust);
} }
void SecurityItem::removeFriend() void SecurityItem::removeFriend()
{ {
#ifdef DEBUG_ITEM #ifdef DEBUG_ITEM
std::cerr << "SecurityItem::removeFriend()"; std::cerr << "SecurityItem::removeFriend()";
std::cerr << std::endl; std::cerr << std::endl;
#endif #endif
if ((QMessageBox::question(this, "RetroShare", tr("Do you want to remove this Friend?"), QMessageBox::Yes | QMessageBox::No, QMessageBox::Yes)) == QMessageBox::Yes)
{
rsPeers->removeFriend(mGpgId);
}
} }
void SecurityItem::peerDetails()
{
#ifdef DEBUG_ITEM
std::cerr << "SecurityItem::peerDetails()";
std::cerr << std::endl;
#endif
RsPeerDetails details;
/* first try sslid */
if (rsPeers->getPeerDetails(mSslId, details))
{
ConfCertDialog::showIt(mSslId, ConfCertDialog::PageDetails);
return;
}
/* then gpgid */
if (rsPeers->getPeerDetails(mGpgId, details))
{
ConfCertDialog::showIt(mGpgId, ConfCertDialog::PageDetails);
}
}
void SecurityItem::sendMsg() void SecurityItem::sendMsg()
{ {
@ -317,10 +353,6 @@ void SecurityItem::sendMsg()
std::cerr << std::endl; std::cerr << std::endl;
#endif #endif
if (mParent)
{
//mParent->openMsg(FEEDHOLDER_MSG_MESSAGE, mPeerId, "");
MessageComposer *nMsgDialog = MessageComposer::newMsg(); MessageComposer *nMsgDialog = MessageComposer::newMsg();
if (nMsgDialog == NULL) { if (nMsgDialog == NULL) {
return; return;
@ -331,10 +363,8 @@ void SecurityItem::sendMsg()
nMsgDialog->activateWindow(); nMsgDialog->activateWindow();
/* window will destroy itself! */ /* window will destroy itself! */
}
} }
void SecurityItem::openChat() void SecurityItem::openChat()
{ {
#ifdef DEBUG_ITEM #ifdef DEBUG_ITEM
@ -349,7 +379,7 @@ void SecurityItem::openChat()
void SecurityItem::updateAvatar(const QString &peer_id) void SecurityItem::updateAvatar(const QString &peer_id)
{ {
if (peer_id.toStdString() != mGpgId) { if (peer_id.toStdString() != mSslId) {
/* it 's not me */ /* it 's not me */
return; return;
} }
@ -357,8 +387,7 @@ void SecurityItem::updateAvatar(const QString &peer_id)
unsigned char *data = NULL; unsigned char *data = NULL;
int size = 0 ; int size = 0 ;
rsMsgs->getAvatarData(mGpgId,data,size); rsMsgs->getAvatarData(mSslId, data, size);
if(size != 0) if(size != 0)
{ {
@ -367,14 +396,11 @@ void SecurityItem::updateAvatar(const QString &peer_id)
pix.loadFromData(data,size,"PNG") ; pix.loadFromData(data,size,"PNG") ;
avatar_label->setPixmap(pix); avatar_label->setPixmap(pix);
delete[] data ; delete[] data ;
} }
else else
{ {
avatar_label->setPixmap(QPixmap(":/images/user/personal64.png")); avatar_label->setPixmap(QPixmap(":/images/user/personal64.png"));
} }
} }
void SecurityItem::togglequickmessage() void SecurityItem::togglequickmessage()
@ -387,7 +413,6 @@ void SecurityItem::togglequickmessage()
{ {
messageframe->setVisible(false); messageframe->setVisible(false);
} }
} }
void SecurityItem::sendMessage() void SecurityItem::sendMessage()

View file

@ -32,7 +32,6 @@ const uint32_t SEC_TYPE_UNKNOWN_OUT = 0x0004; /* failed outgoing with unknown
class FeedHolder; class FeedHolder;
class SecurityItem : public QWidget, private Ui::SecurityItem class SecurityItem : public QWidget, private Ui::SecurityItem
{ {
Q_OBJECT Q_OBJECT
@ -41,20 +40,19 @@ public:
/** Default Constructor */ /** Default Constructor */
SecurityItem(FeedHolder *parent, uint32_t feedId, std::string gpgId, std::string sslId, uint32_t type, bool isHome); SecurityItem(FeedHolder *parent, uint32_t feedId, std::string gpgId, std::string sslId, uint32_t type, bool isHome);
/** Default Destructor */
void updateItemStatic(); void updateItemStatic();
void small(); void small();
bool isSame(const std::string &sslId, uint32_t type); bool isSame(const std::string &sslId, uint32_t type);
private slots: private slots:
/* default stuff */ /* default stuff */
void gotoHome();
void removeItem(); void removeItem();
void toggle(); void toggle();
void addFriend(); void addFriend();
void removeFriend(); void removeFriend();
void peerDetails();
void sendMsg(); void sendMsg();
void openChat(); void openChat();
@ -66,7 +64,6 @@ private slots:
void on_quickmsgText_textChanged(); void on_quickmsgText_textChanged();
private: private:
FeedHolder *mParent; FeedHolder *mParent;
uint32_t mFeedId; uint32_t mFeedId;

View file

@ -6,13 +6,10 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>476</width> <width>675</width>
<height>382</height> <height>382</height>
</rect> </rect>
</property> </property>
<property name="windowTitle">
<string/>
</property>
<layout class="QGridLayout"> <layout class="QGridLayout">
<property name="margin"> <property name="margin">
<number>6</number> <number>6</number>
@ -149,7 +146,7 @@ border-radius: 10px}</string>
</spacer> </spacer>
</item> </item>
<item> <item>
<widget class="QLabel" name="lastLabel"> <widget class="QLabel" name="timeLabel">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred"> <sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
<horstretch>0</horstretch> <horstretch>0</horstretch>
@ -230,6 +227,57 @@ border-radius: 10px}</string>
</property> </property>
</spacer> </spacer>
</item> </item>
<item>
<widget class="QToolButton" name="peerDetailsButton">
<property name="text">
<string>Peer details</string>
</property>
<property name="icon">
<iconset resource="../images.qrc">
<normaloff>:/images/peerdetails_16x16.png</normaloff>:/images/peerdetails_16x16.png</iconset>
</property>
<property name="toolButtonStyle">
<enum>Qt::ToolButtonTextBesideIcon</enum>
</property>
<property name="autoRaise">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="removeFriendButton">
<property name="text">
<string>Deny friend</string>
</property>
<property name="icon">
<iconset resource="../images.qrc">
<normaloff>:/images/denied16.png</normaloff>:/images/denied16.png</iconset>
</property>
<property name="toolButtonStyle">
<enum>Qt::ToolButtonTextBesideIcon</enum>
</property>
<property name="autoRaise">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="addFriendButton">
<property name="text">
<string>Make friend</string>
</property>
<property name="icon">
<iconset resource="../images.qrc">
<normaloff>:/images/user/add_user16.png</normaloff>:/images/user/add_user16.png</iconset>
</property>
<property name="toolButtonStyle">
<enum>Qt::ToolButtonTextBesideIcon</enum>
</property>
<property name="autoRaise">
<bool>true</bool>
</property>
</widget>
</item>
<item> <item>
<widget class="QToolButton" name="quickmsgButton"> <widget class="QToolButton" name="quickmsgButton">
<property name="text"> <property name="text">
@ -421,7 +469,7 @@ border-radius: 10px}</string>
</font> </font>
</property> </property>
<property name="text"> <property name="text">
<string>Location</string> <string>Location:</string>
</property> </property>
</widget> </widget>
</item> </item>
@ -434,7 +482,7 @@ border-radius: 10px}</string>
</font> </font>
</property> </property>
<property name="text"> <property name="text">
<string>IP Address</string> <string>IP Address:</string>
</property> </property>
</widget> </widget>
</item> </item>
@ -447,7 +495,7 @@ border-radius: 10px}</string>
</font> </font>
</property> </property>
<property name="text"> <property name="text">
<string>Connection Method</string> <string>Connection Method:</string>
</property> </property>
</widget> </widget>
</item> </item>

View file

@ -292,9 +292,9 @@ void NotifyQt::notifyListChange(int list, int type)
{ {
case NOTIFY_LIST_NEIGHBOURS: case NOTIFY_LIST_NEIGHBOURS:
#ifdef NOTIFY_DEBUG #ifdef NOTIFY_DEBUG
std::cerr << "received neighbrs changed" << std::endl ; std::cerr << "received neighbours changed" << std::endl ;
#endif #endif
emit neighborsChanged(); emit neighboursChanged();
break; break;
case NOTIFY_LIST_FRIENDS: case NOTIFY_LIST_FRIENDS:
#ifdef NOTIFY_DEBUG #ifdef NOTIFY_DEBUG
@ -433,7 +433,7 @@ void NotifyQt::UpdateGUI()
if(!already_updated) if(!already_updated)
{ {
emit messagesChanged() ; emit messagesChanged() ;
emit neighborsChanged(); emit neighboursChanged();
emit configChanged(); emit configChanged();
already_updated = true ; already_updated = true ;

View file

@ -66,7 +66,7 @@ class NotifyQt: public QObject, public NotifyBase
void filesPostModChanged(bool) const ; void filesPostModChanged(bool) const ;
void transfersChanged() const ; void transfersChanged() const ;
void friendsChanged() const ; void friendsChanged() const ;
void neighborsChanged() const ; void neighboursChanged() const ;
void messagesChanged() const ; void messagesChanged() const ;
void messagesTagsChanged() const; void messagesTagsChanged() const;
void forumsChanged() const ; // use connect with Qt::QueuedConnection void forumsChanged() const ; // use connect with Qt::QueuedConnection

View file

@ -84,6 +84,8 @@ NotifyPage::save(QString &/*errmsg*/)
newsflags |= RS_FEED_TYPE_MSG; newsflags |= RS_FEED_TYPE_MSG;
if (ui.notify_Chat->isChecked()) if (ui.notify_Chat->isChecked())
newsflags |= RS_FEED_TYPE_CHAT; newsflags |= RS_FEED_TYPE_CHAT;
if (ui.notify_Security->isChecked())
newsflags |= RS_FEED_TYPE_SECURITY;
if (ui.chat_NewWindow->isChecked()) if (ui.chat_NewWindow->isChecked())
chatflags |= RS_CHAT_OPEN; chatflags |= RS_CHAT_OPEN;
@ -157,6 +159,7 @@ void NotifyPage::load()
ui.notify_Chat->setChecked(newsflags & RS_FEED_TYPE_CHAT); ui.notify_Chat->setChecked(newsflags & RS_FEED_TYPE_CHAT);
ui.notify_Messages->setChecked(newsflags & RS_FEED_TYPE_MSG); ui.notify_Messages->setChecked(newsflags & RS_FEED_TYPE_MSG);
ui.notify_Chat->setChecked(newsflags & RS_FEED_TYPE_CHAT); ui.notify_Chat->setChecked(newsflags & RS_FEED_TYPE_CHAT);
ui.notify_Security->setChecked(newsflags & RS_FEED_TYPE_SECURITY);
ui.chat_NewWindow->setChecked(chatflags & RS_CHAT_OPEN); ui.chat_NewWindow->setChecked(chatflags & RS_CHAT_OPEN);
ui.chat_Focus->setChecked(chatflags & RS_CHAT_FOCUS); ui.chat_Focus->setChecked(chatflags & RS_CHAT_FOCUS);

View file

@ -6,7 +6,7 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>427</width> <width>516</width>
<height>425</height> <height>425</height>
</rect> </rect>
</property> </property>
@ -558,6 +558,13 @@
</property> </property>
</widget> </widget>
</item> </item>
<item>
<widget class="QCheckBox" name="notify_Security">
<property name="text">
<string>Security</string>
</property>
</widget>
</item>
<item> <item>
<widget class="Line" name="line"> <widget class="Line" name="line">
<property name="orientation"> <property name="orientation">

View file

@ -130,7 +130,7 @@ void RshareSettings::initSettings()
uint defNewsFeed = (RS_FEED_TYPE_PEER | RS_FEED_TYPE_CHAN | uint defNewsFeed = (RS_FEED_TYPE_PEER | RS_FEED_TYPE_CHAN |
RS_FEED_TYPE_FORUM | RS_FEED_TYPE_BLOG | RS_FEED_TYPE_FORUM | RS_FEED_TYPE_BLOG |
RS_FEED_TYPE_CHAT | RS_FEED_TYPE_MSG | RS_FEED_TYPE_CHAT | RS_FEED_TYPE_MSG |
RS_FEED_TYPE_FILES); RS_FEED_TYPE_FILES | RS_FEED_TYPE_SECURITY);
setDefault(SETTING_NEWSFEED_FLAGS, defNewsFeed); setDefault(SETTING_NEWSFEED_FLAGS, defNewsFeed);
setDefault(SETTING_CHAT_FLAGS, defChat); setDefault(SETTING_CHAT_FLAGS, defChat);
@ -309,7 +309,7 @@ void RshareSettings::setNotifyFlags(uint flags)
uint RshareSettings::getTrayNotifyFlags() uint RshareSettings::getTrayNotifyFlags()
{ {
return value(SETTING_TRAYNOTIFY_FLAGS, TRAYNOTIFY_PRIVATECHAT | TRAYNOTIFY_MESSAGES | TRAYNOTIFY_CHANNELS | TRAYNOTIFY_FORUMS | TRAYNOTIFY_TRANSFERS).toUInt(); return value(SETTING_TRAYNOTIFY_FLAGS, TRAYNOTIFY_PRIVATECHAT | TRAYNOTIFY_MESSAGES | TRAYNOTIFY_CHANNELS | TRAYNOTIFY_FORUMS ).toUInt();
} }
void RshareSettings::setTrayNotifyFlags(uint flags) void RshareSettings::setTrayNotifyFlags(uint flags)

File diff suppressed because it is too large Load diff

View file

@ -276,7 +276,7 @@ int main(int argc, char *argv[])
QObject::connect(notify,SIGNAL(publicChatChanged(int)) ,w->friendsDialog ,SLOT(publicChatChanged(int) )); QObject::connect(notify,SIGNAL(publicChatChanged(int)) ,w->friendsDialog ,SLOT(publicChatChanged(int) ));
QObject::connect(notify,SIGNAL(groupsChanged(int)) ,w->friendsDialog ,SLOT(groupsChanged(int) )); QObject::connect(notify,SIGNAL(groupsChanged(int)) ,w->friendsDialog ,SLOT(groupsChanged(int) ));
QObject::connect(notify,SIGNAL(privateChatChanged(int, int)) ,w ,SLOT(privateChatChanged(int, int) )); QObject::connect(notify,SIGNAL(privateChatChanged(int, int)) ,w ,SLOT(privateChatChanged(int, int) ));
QObject::connect(notify,SIGNAL(neighborsChanged()) ,w->networkDialog ,SLOT(insertConnect() )) ; QObject::connect(notify,SIGNAL(neighboursChanged()) ,w->networkDialog ,SLOT(insertConnect() )) ;
QObject::connect(notify,SIGNAL(messagesChanged()) ,w->messagesDialog ,SLOT(insertMessages() )) ; QObject::connect(notify,SIGNAL(messagesChanged()) ,w->messagesDialog ,SLOT(insertMessages() )) ;
QObject::connect(notify,SIGNAL(messagesTagsChanged()) ,w->messagesDialog ,SLOT(messagesTagsChanged() )) ; QObject::connect(notify,SIGNAL(messagesTagsChanged()) ,w->messagesDialog ,SLOT(messagesTagsChanged() )) ;
QObject::connect(notify,SIGNAL(messagesChanged()) ,w ,SLOT(updateMessages() )) ; QObject::connect(notify,SIGNAL(messagesChanged()) ,w ,SLOT(updateMessages() )) ;