turned forum name label into a button to allow display of forum info

This commit is contained in:
csoler 2020-12-20 14:41:23 +01:00
parent e8d6632473
commit e417c68d41
3 changed files with 21 additions and 34 deletions

View File

@ -273,6 +273,7 @@ GxsForumThreadWidget::GxsForumThreadWidget(const RsGxsGroupId &forumId, QWidget
connect(ui->versions_CB, SIGNAL(currentIndexChanged(int)), this, SLOT(changedVersion())); connect(ui->versions_CB, SIGNAL(currentIndexChanged(int)), this, SLOT(changedVersion()));
connect(ui->threadTreeWidget, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(threadListCustomPopupMenu(QPoint))); connect(ui->threadTreeWidget, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(threadListCustomPopupMenu(QPoint)));
connect(ui->postText, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(contextMenuTextBrowser(QPoint))); connect(ui->postText, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(contextMenuTextBrowser(QPoint)));
connect(ui->forumName, SIGNAL(clicked()), this, SLOT(showForumInfo()));
ui->subscribeToolButton->hide() ; ui->subscribeToolButton->hide() ;
connect(ui->subscribeToolButton, SIGNAL(subscribe(bool)), this, SLOT(subscribeGroup(bool))); connect(ui->subscribeToolButton, SIGNAL(subscribe(bool)), this, SLOT(subscribeGroup(bool)));
@ -396,6 +397,12 @@ void GxsForumThreadWidget::handleEvent_main_thread(std::shared_ptr<const RsEvent
} }
} }
void GxsForumThreadWidget::showForumInfo()
{
mThreadId.clear();
updateForumDescription(true);
}
void GxsForumThreadWidget::blank() void GxsForumThreadWidget::blank()
{ {
ui->subscribeToolButton->hide(); ui->subscribeToolButton->hide();

View File

@ -110,6 +110,7 @@ private slots:
void threadListCustomPopupMenu(QPoint point); void threadListCustomPopupMenu(QPoint point);
void contextMenuTextBrowser(QPoint point); void contextMenuTextBrowser(QPoint point);
void headerContextMenuRequested(const QPoint& pos); void headerContextMenuRequested(const QPoint& pos);
void showForumInfo();
void changedSelection(const QModelIndex &, const QModelIndex &); void changedSelection(const QModelIndex &, const QModelIndex &);
void changedThread(QModelIndex index); void changedThread(QModelIndex index);
@ -197,7 +198,7 @@ private:
private: private:
void setForumDescriptionLoading(); void setForumDescriptionLoading();
void clearForumDescription(); void clearForumDescription();
void blankPost(); void blankPost();
RsGxsGroupId mLastForumID; RsGxsGroupId mLastForumID;
RsGxsMessageId mThreadId; RsGxsMessageId mThreadId;

View File

@ -112,30 +112,15 @@
</widget> </widget>
</item> </item>
<item> <item>
<widget class="ElidedLabel" name="forumName"> <widget class="QPushButton" name="forumName">
<property name="sizePolicy"> <property name="toolTip">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed"> <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Click here to clear current selected thread and display more information about this forum.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
<horstretch>2</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>1677215</height>
</size>
</property> </property>
<property name="text"> <property name="text">
<string notr="true">Forum name</string> <string>PushButton</string>
</property> </property>
<property name="textInteractionFlags"> <property name="flat">
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse</set> <bool>true</bool>
</property> </property>
</widget> </widget>
</item> </item>
@ -532,16 +517,16 @@
</action> </action>
</widget> </widget>
<customwidgets> <customwidgets>
<customwidget>
<class>LineEditClear</class>
<extends>QLineEdit</extends>
<header>gui/common/LineEditClear.h</header>
</customwidget>
<customwidget> <customwidget>
<class>RSTextBrowser</class> <class>RSTextBrowser</class>
<extends>QTextBrowser</extends> <extends>QTextBrowser</extends>
<header>gui/common/RSTextBrowser.h</header> <header>gui/common/RSTextBrowser.h</header>
</customwidget> </customwidget>
<customwidget>
<class>LineEditClear</class>
<extends>QLineEdit</extends>
<header>gui/common/LineEditClear.h</header>
</customwidget>
<customwidget> <customwidget>
<class>SubscribeToolButton</class> <class>SubscribeToolButton</class>
<extends>QToolButton</extends> <extends>QToolButton</extends>
@ -552,12 +537,6 @@
<extends>QLabel</extends> <extends>QLabel</extends>
<header>gui/gxs/GxsIdLabel.h</header> <header>gui/gxs/GxsIdLabel.h</header>
</customwidget> </customwidget>
<customwidget>
<class>ElidedLabel</class>
<extends>QLabel</extends>
<header location="global">gui/common/ElidedLabel.h</header>
<container>1</container>
</customwidget>
<customwidget> <customwidget>
<class>RSImageBlockWidget</class> <class>RSImageBlockWidget</class>
<extends>QWidget</extends> <extends>QWidget</extends>
@ -566,8 +545,8 @@
</customwidget> </customwidget>
</customwidgets> </customwidgets>
<resources> <resources>
<include location="../icons.qrc"/>
<include location="../images.qrc"/> <include location="../images.qrc"/>
<include location="../icons.qrc"/>
</resources> </resources>
<connections/> <connections/>
</ui> </ui>