enabled root decoration for Channels tree and renamed some items

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@3223 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
defnax 2010-06-26 22:28:04 +00:00
parent 863a29fda1
commit c1ae6c9773

View File

@ -57,6 +57,10 @@ ChannelFeed::ChannelFeed(QWidget *parent)
/*************** Setup Left Hand Side (List of Channels) ****************/
connect(treeView, SIGNAL(clicked(const QModelIndex &)), this, SLOT(selectChannel(const QModelIndex &)));
connect(treeView, SIGNAL(activated(const QModelIndex &)), this, SLOT(toggleSelection(const QModelIndex &)));
connect(treeView, SIGNAL(customContextMenuRequested( QPoint ) ), this, SLOT( channelListCustomPopupMenu( QPoint ) ) );
mChannelId = "";
model = new QStandardItemModel(0, 3, this);
model->setHeaderData(0, Qt::Horizontal, tr("Name"), Qt::DisplayRole);
@ -67,7 +71,7 @@ ChannelFeed::ChannelFeed(QWidget *parent)
treeView->setEditTriggers(QAbstractItemView::NoEditTriggers);
treeView->setItemDelegate(new ChanGroupDelegate());
treeView->setRootIsDecorated(false);
treeView->setRootIsDecorated(true);
// hide header and id column
treeView->setHeaderHidden(true);
@ -80,42 +84,38 @@ ChannelFeed::ChannelFeed(QWidget *parent)
_header->resizeSection ( 1, 22 );
_header->resizeSection ( 2, 22 );
QStandardItem *item1 = new QStandardItem(tr("Own Channels"));
QStandardItem *item2 = new QStandardItem(tr("Subscribed Channels"));
QStandardItem *item3 = new QStandardItem(tr("Popular Channels"));
QStandardItem *item4 = new QStandardItem(tr("Other Channels"));
// set ChannelList Font
itemFont = QFont("ARIAL", 10);
itemFont.setBold(true);
model->appendRow(item1);
model->appendRow(item2);
model->appendRow(item3);
model->appendRow(item4);
QStandardItem *ownChannels = new QStandardItem(tr("Own Channels"));
ownChannels->setFont(itemFont);
ownChannels->setForeground(QBrush(QColor(79, 79, 79)));
connect(treeView, SIGNAL(clicked(const QModelIndex &)), this, SLOT(selectChannel(const QModelIndex &)));
connect(treeView, SIGNAL(activated(const QModelIndex &)), this, SLOT(toggleSelection(const QModelIndex &)));
connect(treeView, SIGNAL(customContextMenuRequested( QPoint ) ), this, SLOT( channelListCustomPopupMenu( QPoint ) ) );
QStandardItem *subcribedChannels = new QStandardItem(tr("Subscribed Channels"));
subcribedChannels->setFont(itemFont);
subcribedChannels->setForeground(QBrush(QColor(79, 79, 79)));
QStandardItem *popularChannels = new QStandardItem(tr("Popular Channels"));
popularChannels->setFont(itemFont);
popularChannels->setForeground(QBrush(QColor(79, 79, 79)));
QStandardItem *otherChannels = new QStandardItem(tr("Other Channels"));
otherChannels->setFont(itemFont);
otherChannels->setForeground(QBrush(QColor(79, 79, 79)));
model->appendRow(ownChannels);
model->appendRow(subcribedChannels);
model->appendRow(popularChannels);
model->appendRow(otherChannels);
//added from ahead
updateChannelList();
mChannelFont = QFont("MS SANS SERIF", 22);
nameLabel->setFont(mChannelFont);
nameLabel->setMinimumWidth(20);
// set ChannelList Font
itemFont = QFont("ARIAL", 10);
itemFont.setBold(true);
item1->setFont(itemFont);
item2->setFont(itemFont);
item3->setFont(itemFont);
item4->setFont(itemFont);
// set ChannelList Foreground Color
item1->setForeground(QBrush(QColor(79, 79, 79)));
item2->setForeground(QBrush(QColor(79, 79, 79)));
item3->setForeground(QBrush(QColor(79, 79, 79)));
item4->setForeground(QBrush(QColor(79, 79, 79)));
// Setup Channel Menu:
QMenu *channelmenu = new QMenu();
channelmenu->addAction(actionCreate_Channel);
@ -159,7 +159,8 @@ void ChannelFeed::channelListCustomPopupMenu( QPoint point )
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)){
if((ci.channelFlags & RS_DISTRIB_PUBLISH) && (ci.channelFlags & RS_DISTRIB_ADMIN))
{
contextMnu.addAction( postchannelAct );
contextMnu.addSeparator();
contextMnu.addAction( channeldetailsAct );
@ -175,7 +176,6 @@ void ChannelFeed::channelListCustomPopupMenu( QPoint point )
}
else if (ci.channelFlags & RS_DISTRIB_SUBSCRIBED)
{
contextMnu.addAction( unsubscribechannelAct );
contextMnu.addSeparator();
contextMnu.addAction( channeldetailsAct );
@ -183,7 +183,6 @@ void ChannelFeed::channelListCustomPopupMenu( QPoint point )
}
else
{
contextMnu.addAction( subscribechannelAct );
contextMnu.addSeparator();
contextMnu.addAction( channeldetailsAct );