mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-06-20 12:24:24 -04:00
Added back the Subscribe Button to Channels
git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@6905 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
c447ab2829
commit
eab486f5db
3 changed files with 89 additions and 35 deletions
|
@ -79,6 +79,8 @@ ChannelFeed::ChannelFeed(QWidget *parent)
|
||||||
connect(treeWidget, SIGNAL(treeCustomContextMenuRequested(QPoint)), this, SLOT( channelListCustomPopupMenu( QPoint ) ) );
|
connect(treeWidget, SIGNAL(treeCustomContextMenuRequested(QPoint)), this, SLOT( channelListCustomPopupMenu( QPoint ) ) );
|
||||||
connect(treeWidget, SIGNAL(treeCurrentItemChanged(QString)), this, SLOT(selectChannel(QString)));
|
connect(treeWidget, SIGNAL(treeCurrentItemChanged(QString)), this, SLOT(selectChannel(QString)));
|
||||||
|
|
||||||
|
connect( subscribeButton , SIGNAL( clicked() ), this, SLOT( subscribeChannel() ) );
|
||||||
|
|
||||||
mChannelId.clear();
|
mChannelId.clear();
|
||||||
|
|
||||||
/* Set initial size the splitter */
|
/* Set initial size the splitter */
|
||||||
|
@ -108,6 +110,9 @@ ChannelFeed::ChannelFeed(QWidget *parent)
|
||||||
|
|
||||||
nameLabel->setMinimumWidth(20);
|
nameLabel->setMinimumWidth(20);
|
||||||
|
|
||||||
|
unsubscribechannelAct = new QAction(QIcon(":/images/cancel.png"), tr( "Unsubscribe to Channel" ), this );
|
||||||
|
connect( unsubscribechannelAct , SIGNAL( triggered() ), this, SLOT( unsubscribeChannel() ) );
|
||||||
|
|
||||||
/* load settings */
|
/* load settings */
|
||||||
processSettings(true);
|
processSettings(true);
|
||||||
|
|
||||||
|
@ -185,9 +190,6 @@ void ChannelFeed::channelListCustomPopupMenu( QPoint /*point*/ )
|
||||||
QAction *subscribechannelAct = new QAction(QIcon(":/images/edit_add24.png"), tr( "Subscribe to Channel" ), &contextMnu);
|
QAction *subscribechannelAct = new QAction(QIcon(":/images/edit_add24.png"), tr( "Subscribe to Channel" ), &contextMnu);
|
||||||
connect( subscribechannelAct , SIGNAL( triggered() ), this, SLOT( subscribeChannel() ) );
|
connect( subscribechannelAct , SIGNAL( triggered() ), this, SLOT( subscribeChannel() ) );
|
||||||
|
|
||||||
QAction *unsubscribechannelAct = new QAction(QIcon(":/images/cancel.png"), tr( "Unsubscribe to Channel" ), &contextMnu);
|
|
||||||
connect( unsubscribechannelAct , SIGNAL( triggered() ), this, SLOT( unsubscribeChannel() ) );
|
|
||||||
|
|
||||||
QAction *setallasreadchannelAct = new QAction(QIcon(":/images/message-mail-read.png"), tr( "Set all as read" ), &contextMnu);
|
QAction *setallasreadchannelAct = new QAction(QIcon(":/images/message-mail-read.png"), tr( "Set all as read" ), &contextMnu);
|
||||||
connect( setallasreadchannelAct , SIGNAL( triggered() ), this, SLOT( setAllAsReadClicked() ) );
|
connect( setallasreadchannelAct , SIGNAL( triggered() ), this, SLOT( setAllAsReadClicked() ) );
|
||||||
|
|
||||||
|
@ -590,12 +592,20 @@ void ChannelFeed::updateChannelMsgs()
|
||||||
}
|
}
|
||||||
mChanMsgItems.clear();
|
mChanMsgItems.clear();
|
||||||
|
|
||||||
|
QMenu *subscribemenu = new QMenu();
|
||||||
|
|
||||||
ChannelInfo ci;
|
ChannelInfo ci;
|
||||||
if (!rsChannels->getChannelInfo(mChannelId, ci)) {
|
if (!rsChannels->getChannelInfo(mChannelId, ci)) {
|
||||||
postButton->setEnabled(false);
|
postButton->setEnabled(false);
|
||||||
nameLabel->setText(tr("No Channel Selected"));
|
nameLabel->setText(tr("No Channel Selected"));
|
||||||
logoLabel->setPixmap(QPixmap(":/images/channels.png"));
|
logoLabel->setPixmap(QPixmap(":/images/channels.png"));
|
||||||
logoLabel->setEnabled(false);
|
logoLabel->setEnabled(false);
|
||||||
|
|
||||||
|
subscribeButton->setEnabled(false);
|
||||||
|
subscribeButton->setPopupMode(QToolButton::InstantPopup);
|
||||||
|
subscribeButton->setMenu(NULL);
|
||||||
|
subscribeButton->setIcon(QIcon(""));
|
||||||
|
subscribeButton->setText(tr("Subscribe"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -619,8 +629,25 @@ void ChannelFeed::updateChannelMsgs()
|
||||||
|
|
||||||
if (ci.channelFlags & RS_DISTRIB_SUBSCRIBED) {
|
if (ci.channelFlags & RS_DISTRIB_SUBSCRIBED) {
|
||||||
actionEnable_Auto_Download->setEnabled(true);
|
actionEnable_Auto_Download->setEnabled(true);
|
||||||
|
|
||||||
|
subscribeButton->setEnabled(true);
|
||||||
|
subscribeButton->setPopupMode(QToolButton::MenuButtonPopup);
|
||||||
|
subscribeButton->setIcon(QIcon(":/images/accepted16.png"));
|
||||||
|
subscribeButton->setText(tr("Subscribed"));
|
||||||
|
|
||||||
|
//subscribemenu->addAction(autochannelAct );
|
||||||
|
subscribemenu->addSeparator();
|
||||||
|
subscribemenu->addAction(unsubscribechannelAct);
|
||||||
|
subscribeButton->setMenu(subscribemenu);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
actionEnable_Auto_Download->setEnabled(false);
|
actionEnable_Auto_Download->setEnabled(false);
|
||||||
|
|
||||||
|
subscribeButton->setEnabled(true);
|
||||||
|
subscribeButton->setPopupMode(QToolButton::InstantPopup);
|
||||||
|
subscribeButton->setMenu(NULL);
|
||||||
|
subscribeButton->setIcon(QIcon(""));
|
||||||
|
subscribeButton->setText(tr("Subscribe"));
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef USE_THREAD
|
#ifdef USE_THREAD
|
||||||
|
|
|
@ -112,6 +112,11 @@ private:
|
||||||
QTreeWidgetItem *otherChannels;
|
QTreeWidgetItem *otherChannels;
|
||||||
|
|
||||||
ChannelFillThread *fillThread;
|
ChannelFillThread *fillThread;
|
||||||
|
|
||||||
|
/** Defines the actions for the context menu */
|
||||||
|
QAction* unsubscribechannelAct;
|
||||||
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
class ChannelFillThread : public QThread
|
class ChannelFillThread : public QThread
|
||||||
|
|
|
@ -77,8 +77,14 @@
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QToolButton" name="helpButton">
|
<widget class="QToolButton" name="helpButton">
|
||||||
<property name="focusPolicy">
|
<property name="sizePolicy">
|
||||||
<enum>Qt::NoFocus</enum>
|
<sizepolicy hsizetype="Maximum" vsizetype="Fixed">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string/>
|
||||||
</property>
|
</property>
|
||||||
<property name="icon">
|
<property name="icon">
|
||||||
<iconset resource="images.qrc">
|
<iconset resource="images.qrc">
|
||||||
|
@ -184,29 +190,6 @@
|
||||||
<property name="margin">
|
<property name="margin">
|
||||||
<number>2</number>
|
<number>2</number>
|
||||||
</property>
|
</property>
|
||||||
<item>
|
|
||||||
<widget class="QToolButton" name="postButton">
|
|
||||||
<property name="focusPolicy">
|
|
||||||
<enum>Qt::NoFocus</enum>
|
|
||||||
</property>
|
|
||||||
<property name="toolTip">
|
|
||||||
<string>Post to Channel</string>
|
|
||||||
</property>
|
|
||||||
<property name="icon">
|
|
||||||
<iconset resource="images.qrc">
|
|
||||||
<normaloff>:/images/mail_send.png</normaloff>:/images/mail_send.png</iconset>
|
|
||||||
</property>
|
|
||||||
<property name="iconSize">
|
|
||||||
<size>
|
|
||||||
<width>32</width>
|
|
||||||
<height>16</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
<property name="autoRaise">
|
|
||||||
<bool>true</bool>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
<item>
|
||||||
<spacer name="horizontalSpacer">
|
<spacer name="horizontalSpacer">
|
||||||
<property name="orientation">
|
<property name="orientation">
|
||||||
|
@ -220,6 +203,45 @@
|
||||||
</property>
|
</property>
|
||||||
</spacer>
|
</spacer>
|
||||||
</item>
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QToolButton" name="subscribeButton">
|
||||||
|
<property name="text">
|
||||||
|
<string>Subscribe</string>
|
||||||
|
</property>
|
||||||
|
<property name="toolButtonStyle">
|
||||||
|
<enum>Qt::ToolButtonTextBesideIcon</enum>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QToolButton" name="postButton">
|
||||||
|
<property name="focusPolicy">
|
||||||
|
<enum>Qt::NoFocus</enum>
|
||||||
|
</property>
|
||||||
|
<property name="toolTip">
|
||||||
|
<string>Post to Channel</string>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Post</string>
|
||||||
|
</property>
|
||||||
|
<property name="icon">
|
||||||
|
<iconset resource="images.qrc">
|
||||||
|
<normaloff>:/images/mail_send.png</normaloff>:/images/mail_send.png</iconset>
|
||||||
|
</property>
|
||||||
|
<property name="iconSize">
|
||||||
|
<size>
|
||||||
|
<width>16</width>
|
||||||
|
<height>16</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="toolButtonStyle">
|
||||||
|
<enum>Qt::ToolButtonTextBesideIcon</enum>
|
||||||
|
</property>
|
||||||
|
<property name="autoRaise">
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
@ -254,7 +276,7 @@
|
||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>513</width>
|
<width>534</width>
|
||||||
<height>16</height>
|
<height>16</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue