Changed the Buttons layout on ChannelsFeed

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@4793 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
defnax 2012-01-13 16:26:24 +00:00
parent fbcc3f2070
commit d09c94296a
2 changed files with 79 additions and 85 deletions

View File

@ -57,12 +57,12 @@ ChannelFeed::ChannelFeed(QWidget *parent)
/* Invoke the Qt Designer generated object setup routine */
setupUi(this);
connect(newChannelButton, SIGNAL(clicked()), this, SLOT(createChannel()));
connect(newChannelButton, SIGNAL(clicked()), this, SLOT(createChannel()));
connect(postButton, SIGNAL(clicked()), this, SLOT(createMsg()));
connect(subscribeButton, SIGNAL( clicked( void ) ), this, SLOT( subscribeChannel ( void ) ) );
connect(unsubscribeButton, SIGNAL( clicked( void ) ), this, SLOT( unsubscribeChannel ( void ) ) );
connect(setAllAsReadButton, SIGNAL(clicked()), this, SLOT(setAllAsReadClicked()));
connect(autoDownload, SIGNAL(clicked()), this, SLOT(toggleAutoDownload()));
connect(actionsetAllAsRead, SIGNAL(triggered()), this, SLOT(setAllAsReadClicked()));
connect(actionEnable_Auto_Download, SIGNAL(triggered()), this, SLOT(toggleAutoDownload()));
connect(NotifyQt::getInstance(), SIGNAL(channelMsgReadSatusChanged(QString,QString,int)), this, SLOT(channelMsgReadSatusChanged(QString,QString,int)));
@ -86,6 +86,10 @@ ChannelFeed::ChannelFeed(QWidget *parent)
popularChannels = treeWidget->addCategoryItem(tr("Popular Channels"), QIcon(), false);
otherChannels = treeWidget->addCategoryItem(tr("Other Channels"), QIcon(), false);
QMenu * channeloptsmenu = new QMenu();
channeloptsmenu->addAction(actionsetAllAsRead);
channeloptsmenu->addAction(actionEnable_Auto_Download);
channeloptions_Button->setMenu(channeloptsmenu);
//added from ahead
updateChannelList();
@ -436,8 +440,10 @@ void ChannelFeed::updateChannelMsgs()
postButton->setEnabled(false);
subscribeButton->setEnabled(false);
unsubscribeButton->setEnabled(false);
setAllAsReadButton->setEnabled(false);
autoDownload->setEnabled(false);
subscribeButton->hide();
unsubscribeButton->hide();
actionsetAllAsRead->setEnabled(false);
actionEnable_Auto_Download->setEnabled(false);
nameLabel->setText(tr("No Channel Selected"));
iconLabel->setPixmap(QPixmap(":/images/channels.png"));
iconLabel->setEnabled(false);
@ -467,25 +473,29 @@ void ChannelFeed::updateChannelMsgs()
/* do buttons */
if (ci.channelFlags & RS_DISTRIB_SUBSCRIBED) {
subscribeButton->setEnabled(false);
subscribeButton->hide();
unsubscribeButton->show();
unsubscribeButton->setEnabled(true);
setAllAsReadButton->setEnabled(true);
actionsetAllAsRead->setEnabled(true);
} else {
subscribeButton->setEnabled(true);
subscribeButton->show();
unsubscribeButton->setEnabled(false);
setAllAsReadButton->setEnabled(false);
autoDownload->setEnabled(false);
unsubscribeButton->hide();
actionsetAllAsRead->setEnabled(false);
actionEnable_Auto_Download->setEnabled(false);
}
if (ci.channelFlags & RS_DISTRIB_PUBLISH) {
postButton->setEnabled(true);
autoDownload->setEnabled(false);
actionsetAllAsRead->setEnabled(false);
} else {
postButton->setEnabled(false);
}
if(!(ci.channelFlags & RS_DISTRIB_PUBLISH) &&
(ci.channelFlags & RS_DISTRIB_SUBSCRIBED))
autoDownload->setEnabled(true);
actionsetAllAsRead->setEnabled(true);
std::list<ChannelMsgSummary> msgs;
@ -638,8 +648,8 @@ bool ChannelFeed::navigate(const std::string& channelId, const std::string& msgI
void ChannelFeed::setAutoDownloadButton(bool autoDl)
{
if (autoDl) {
autoDownload->setText(tr("Disable Auto-Download"));
actionEnable_Auto_Download->setText(tr("Disable Auto-Download"));
}else{
autoDownload->setText(tr("Enable Auto-Download"));
actionEnable_Auto_Download->setText(tr("Enable Auto-Download"));
}
}

View File

@ -405,78 +405,6 @@ border-image: url(:/images/btn_26_pressed.png) 4;
</property>
</spacer>
</item>
<item row="0" column="5">
<widget class="QToolButton" name="setAllAsReadButton">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>26</height>
</size>
</property>
<property name="styleSheet">
<string notr="true">QToolButton, QPushButton, QComboBox {
border-image: url(:/images/btn_26.png) 4;
border-width: 4;
padding: 0px 6px;
font-size: 12px;
}
QToolButton:hover, QPushButton:hover, QComboBox:hover {
border-image: url(:/images/btn_26_hover.png) 4;
}
QToolButton:disabled, QPushButton:disabled, QComboBox::disabled {
color:gray;
}
QToolButton:pressed, QPushButton:pressed{
border-image: url(:/images/btn_26_pressed.png) 4;
}</string>
</property>
<property name="text">
<string>Set all to read</string>
</property>
</widget>
</item>
<item row="0" column="6">
<widget class="QPushButton" name="autoDownload">
<property name="minimumSize">
<size>
<width>0</width>
<height>26</height>
</size>
</property>
<property name="styleSheet">
<string notr="true">QToolButton, QPushButton, QComboBox {
border-image: url(:/images/btn_26.png) 4;
border-width: 4;
padding: 0px 6px;
font-size: 12px;
}
QToolButton:hover, QPushButton:hover, QComboBox:hover {
border-image: url(:/images/btn_26_hover.png) 4;
}
QToolButton:disabled, QPushButton:disabled, QComboBox::disabled {
color:gray;
}
QToolButton:pressed, QPushButton:pressed{
border-image: url(:/images/btn_26_pressed.png) 4;
}</string>
</property>
<property name="text">
<string>Enable Auto-download</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QToolButton" name="postButton">
<property name="sizePolicy">
@ -518,6 +446,46 @@ border-image: url(:/images/btn_26_pressed.png) 4;
</property>
</widget>
</item>
<item row="0" column="5">
<widget class="QPushButton" name="channeloptions_Button">
<property name="minimumSize">
<size>
<width>0</width>
<height>26</height>
</size>
</property>
<property name="styleSheet">
<string notr="true">QToolButton, QPushButton, QComboBox {
border-image: url(:/images/btn_26.png) 4;
border-width: 4;
padding: 0px 6px;
font-size: 12px;
}
QToolButton:hover, QPushButton:hover, QComboBox:hover {
border-image: url(:/images/btn_26_hover.png) 4;
}
QToolButton:disabled, QPushButton:disabled, QComboBox::disabled {
color:gray;
}
QToolButton:pressed, QPushButton:pressed{
border-image: url(:/images/btn_26_pressed.png) 4;
}</string>
</property>
<property name="text">
<string/>
</property>
<property name="icon">
<iconset resource="images.qrc">
<normaloff>:/images/kcmsystem24.png</normaloff>:/images/kcmsystem24.png</iconset>
</property>
<property name="flat">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</item>
</layout>
@ -536,7 +504,7 @@ border-image: url(:/images/btn_26_pressed.png) 4;
<rect>
<x>0</x>
<y>0</y>
<width>486</width>
<width>392</width>
<height>333</height>
</rect>
</property>
@ -578,6 +546,22 @@ border-image: url(:/images/btn_26_pressed.png) 4;
</widget>
</item>
</layout>
<action name="actionsetAllAsRead">
<property name="text">
<string>Set all as read</string>
</property>
<property name="toolTip">
<string>Set all as read</string>
</property>
</action>
<action name="actionEnable_Auto_Download">
<property name="text">
<string>Enable Auto-Download</string>
</property>
<property name="toolTip">
<string>Enable Auto-Download</string>
</property>
</action>
</widget>
<customwidgets>
<customwidget>