added sharekey feature to channel dialog

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@3166 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
chrisparker126 2010-06-19 16:38:13 +00:00
parent ddb1094f68
commit 43e756148a
2 changed files with 17 additions and 1 deletions

View File

@ -33,6 +33,7 @@
#include "gui/channels/ChannelDetails.h" #include "gui/channels/ChannelDetails.h"
#include "gui/channels/CreateChannelMsg.h" #include "gui/channels/CreateChannelMsg.h"
#include "gui/channels/EditChanDetails.h" #include "gui/channels/EditChanDetails.h"
#include "gui/channels/ShareKey.h"
#include "gui/ChanGroupDelegate.h" #include "gui/ChanGroupDelegate.h"
@ -155,17 +156,22 @@ void ChannelFeed::channelListCustomPopupMenu( QPoint point )
editChannelDetailAct = new QAction(QIcon(":/images/settings16.png"), tr("Edit Channel Details"), this); editChannelDetailAct = new QAction(QIcon(":/images/settings16.png"), tr("Edit Channel Details"), this);
connect( editChannelDetailAct, SIGNAL( triggered() ), this, SLOT( editChannelDetail() ) ); connect( editChannelDetailAct, SIGNAL( triggered() ), this, SLOT( editChannelDetail() ) );
if(ci.channelFlags & (RS_DISTRIB_PUBLISH | RS_DISTRIB_ADMIN)){ shareKeyAct = new QAction(QIcon(":/images/gpgp_key_generate.png"), tr("Share Key"), this);
connect( shareKeyAct, SIGNAL( triggered() ), this, SLOT( shareKey() ) );
if((ci.channelFlags & RS_DISTRIB_PUBLISH) && (ci.channelFlags & RS_DISTRIB_ADMIN)){
contextMnu.addAction( postchannelAct ); contextMnu.addAction( postchannelAct );
contextMnu.addSeparator(); contextMnu.addSeparator();
contextMnu.addAction( channeldetailsAct ); contextMnu.addAction( channeldetailsAct );
contextMnu.addAction( editChannelDetailAct); contextMnu.addAction( editChannelDetailAct);
contextMnu.addAction( shareKeyAct );
} }
else if (ci.channelFlags & RS_DISTRIB_PUBLISH) else if (ci.channelFlags & RS_DISTRIB_PUBLISH)
{ {
contextMnu.addAction( postchannelAct ); contextMnu.addAction( postchannelAct );
contextMnu.addSeparator(); contextMnu.addSeparator();
contextMnu.addAction( channeldetailsAct ); contextMnu.addAction( channeldetailsAct );
contextMnu.addAction( shareKeyAct );
} }
else if (ci.channelFlags & RS_DISTRIB_SUBSCRIBED) else if (ci.channelFlags & RS_DISTRIB_SUBSCRIBED)
{ {
@ -233,6 +239,14 @@ void ChannelFeed::editChannelDetail(){
return; return;
} }
void ChannelFeed::shareKey()
{
ShareKey shareUi(this, 0, mChannelId);
shareUi.exec();
return;
}
void ChannelFeed::createMsg() void ChannelFeed::createMsg()
{ {
if (mChannelId == "") if (mChannelId == "")

View File

@ -73,6 +73,7 @@ private slots:
void showChannelDetails(); void showChannelDetails();
void restoreChannelKeys(); void restoreChannelKeys();
void editChannelDetail(); void editChannelDetail();
void shareKey();
private: private:
@ -102,6 +103,7 @@ private:
QAction* channeldetailsAct; QAction* channeldetailsAct;
QAction* restoreKeysAct; QAction* restoreKeysAct;
QAction* editChannelDetailAct; QAction* editChannelDetailAct;
QAction* shareKeyAct;
}; };