mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-10-01 02:35:48 -04:00
reworked context channel menu to allow unsubscribing from own channels. Removed some irrelevant items. Added warning when publish rights can/cannot be restored. It would be nice to only show the restore publish right entry when the Grp is available. Might be too costly though.
git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@5538 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
bb784ce325
commit
29b5983e71
@ -180,37 +180,28 @@ void ChannelFeed::channelListCustomPopupMenu( QPoint /*point*/ )
|
||||
QAction *shareKeyAct = new QAction(QIcon(":/images/gpgp_key_generate.png"), tr("Share Channel"), &contextMnu);
|
||||
connect( shareKeyAct, SIGNAL( triggered() ), this, SLOT( shareKey() ) );
|
||||
|
||||
if ((ci.channelFlags & RS_DISTRIB_PUBLISH) && (ci.channelFlags & RS_DISTRIB_ADMIN)) {
|
||||
contextMnu.addAction( postchannelAct );
|
||||
contextMnu.addSeparator();
|
||||
if((ci.channelFlags & RS_DISTRIB_ADMIN) && (ci.channelFlags & RS_DISTRIB_SUBSCRIBED))
|
||||
contextMnu.addAction( editChannelDetailAct);
|
||||
contextMnu.addAction( shareKeyAct );
|
||||
else
|
||||
contextMnu.addAction( channeldetailsAct );
|
||||
}
|
||||
else if ((ci.channelFlags & RS_DISTRIB_PUBLISH) && (ci.channelFlags & RS_DISTRIB_SUBSCRIBED)) {
|
||||
|
||||
if((ci.channelFlags & RS_DISTRIB_PUBLISH) && (ci.channelFlags & RS_DISTRIB_SUBSCRIBED))
|
||||
{
|
||||
contextMnu.addAction( postchannelAct );
|
||||
contextMnu.addSeparator();
|
||||
contextMnu.addAction( channeldetailsAct );
|
||||
contextMnu.addAction( shareKeyAct );
|
||||
contextMnu.addAction( restoreKeysAct );
|
||||
contextMnu.addSeparator();
|
||||
contextMnu.addAction( autochannelAct );
|
||||
contextMnu.addAction( setallasreadchannelAct );
|
||||
} else if (ci.channelFlags & RS_DISTRIB_SUBSCRIBED) {
|
||||
contextMnu.addAction( unsubscribechannelAct );
|
||||
contextMnu.addSeparator();
|
||||
contextMnu.addAction( channeldetailsAct );
|
||||
contextMnu.addAction( restoreKeysAct );
|
||||
contextMnu.addSeparator();
|
||||
contextMnu.addAction( autochannelAct );
|
||||
contextMnu.addAction( setallasreadchannelAct );
|
||||
} else {
|
||||
contextMnu.addAction( subscribechannelAct );
|
||||
contextMnu.addSeparator();
|
||||
contextMnu.addAction( channeldetailsAct );
|
||||
contextMnu.addAction( restoreKeysAct );
|
||||
}
|
||||
|
||||
if(ci.channelFlags & RS_DISTRIB_SUBSCRIBED)
|
||||
{
|
||||
contextMnu.addAction( unsubscribechannelAct );
|
||||
contextMnu.addAction( restoreKeysAct );
|
||||
contextMnu.addSeparator();
|
||||
contextMnu.addAction( autochannelAct );
|
||||
contextMnu.addAction( setallasreadchannelAct );
|
||||
}
|
||||
else
|
||||
contextMnu.addAction( subscribechannelAct );
|
||||
|
||||
contextMnu.addSeparator();
|
||||
QAction *action = contextMnu.addAction(QIcon(":/images/copyrslink.png"), tr("Copy RetroShare Link"), this, SLOT(copyChannelLink()));
|
||||
action->setEnabled(!mChannelId.empty());
|
||||
@ -285,7 +276,10 @@ void ChannelFeed::createMsg()
|
||||
|
||||
void ChannelFeed::restoreChannelKeys()
|
||||
{
|
||||
rsChannels->channelRestoreKeys(mChannelId);
|
||||
if(rsChannels->channelRestoreKeys(mChannelId))
|
||||
QMessageBox::information(NULL,tr("Publish rights restored."),tr("Publish rights have been restored for this channel.")) ;
|
||||
else
|
||||
QMessageBox::warning(NULL,tr("Publish not restored."),tr("Publish rights can't be restored for this channel.<br/>You're not the creator of this channel.")) ;
|
||||
}
|
||||
|
||||
void ChannelFeed::selectChannel(const QString &id)
|
||||
|
Loading…
Reference in New Issue
Block a user