mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-08-11 15:50:38 -04:00
improved network statistics for GXS net service. Added number of available messages for unsubscribed forums in GUI. Should be done as well for channels.
git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@7760 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
d4dad8328f
commit
93f77a0e2c
15 changed files with 186 additions and 113 deletions
|
@ -22,6 +22,7 @@
|
|||
#include <QMenu>
|
||||
#include <QToolButton>
|
||||
|
||||
#include "retroshare/rsgxsflags.h"
|
||||
#include "GroupTreeWidget.h"
|
||||
#include "ui_GroupTreeWidget.h"
|
||||
|
||||
|
@ -353,18 +354,22 @@ void GroupTreeWidget::fillGroupItems(QTreeWidgetItem *categoryItem, const QList<
|
|||
item->setIcon(COLUMN_NAME, itemInfo.icon);
|
||||
|
||||
/* Set popularity */
|
||||
QString tooltip = PopularityDefs::tooltip(itemInfo.popularity);
|
||||
QString tooltip = PopularityDefs::tooltip(itemInfo.popularity);
|
||||
|
||||
item->setIcon(COLUMN_POPULARITY, PopularityDefs::icon(itemInfo.popularity));
|
||||
item->setData(COLUMN_DATA, ROLE_POPULARITY, -itemInfo.popularity); // negative for correct sorting
|
||||
|
||||
/* Set tooltip */
|
||||
if (itemInfo.privatekey) {
|
||||
tooltip += "\n" + tr("Private Key Available");
|
||||
}
|
||||
}
|
||||
if(!IS_GROUP_SUBSCRIBED(itemInfo.subscribeFlags))
|
||||
tooltip += "\n" + QString::number(itemInfo.max_visible_posts) + " messages available" ;
|
||||
|
||||
item->setToolTip(COLUMN_NAME, tooltip);
|
||||
item->setToolTip(COLUMN_POPULARITY, tooltip);
|
||||
|
||||
item->setData(COLUMN_DATA, ROLE_SUBSCRIBE_FLAGS, itemInfo.subscribeFlags);
|
||||
item->setData(COLUMN_DATA, ROLE_SUBSCRIBE_FLAGS, itemInfo.subscribeFlags);
|
||||
|
||||
/* Set color */
|
||||
QBrush brush;
|
||||
|
|
|
@ -48,7 +48,8 @@ public:
|
|||
{
|
||||
popularity = 0;
|
||||
privatekey = false;
|
||||
subscribeFlags = 0;
|
||||
subscribeFlags = 0;
|
||||
max_visible_posts =0;
|
||||
}
|
||||
|
||||
public:
|
||||
|
@ -59,7 +60,8 @@ public:
|
|||
QDateTime lastpost;
|
||||
QIcon icon;
|
||||
bool privatekey;
|
||||
int subscribeFlags;
|
||||
quint32 subscribeFlags;
|
||||
quint32 max_visible_posts ;
|
||||
};
|
||||
|
||||
class GroupTreeWidget : public QWidget
|
||||
|
|
|
@ -61,7 +61,6 @@
|
|||
* these will need to be addressed in the future.
|
||||
* -> Child TS (for sorting) is not handled by GXS, this will probably have to be done in the GUI.
|
||||
* -> Need to handle IDs properly.
|
||||
* -> Popularity not handled in GXS yet.
|
||||
* -> Much more to do.
|
||||
*/
|
||||
|
||||
|
@ -655,6 +654,7 @@ void GxsGroupFrameDialog::groupInfoToGroupItemInfo(const RsGroupMetaData &groupI
|
|||
groupItemInfo.lastpost = QDateTime::fromTime_t(groupInfo.mLastPost);
|
||||
groupItemInfo.subscribeFlags = groupInfo.mSubscribeFlags;
|
||||
groupItemInfo.privatekey = IS_GROUP_PUBLISHER(groupInfo.mSubscribeFlags) ;
|
||||
groupItemInfo.max_visible_posts = groupInfo.mVisibleMsgCount ;
|
||||
|
||||
#if TOGXS
|
||||
if (groupInfo.mGroupFlags & RS_DISTRIB_AUTHEN_REQ) {
|
||||
|
@ -904,7 +904,7 @@ void GxsGroupFrameDialog::loadGroupStatistics(const uint32_t &token)
|
|||
return;
|
||||
}
|
||||
|
||||
ui->groupTreeWidget->setUnreadCount(item, mCountChildMsgs ? (stats.mNumThreadMsgsUnread + stats.mNumChildMsgsUnread) : stats.mNumThreadMsgsUnread);
|
||||
ui->groupTreeWidget->setUnreadCount(item, mCountChildMsgs ? (stats.mNumThreadMsgsUnread + stats.mNumChildMsgsUnread) : stats.mNumThreadMsgsUnread);
|
||||
}
|
||||
|
||||
/*********************** **** **** **** ***********************/
|
||||
|
|
|
@ -691,8 +691,15 @@ void GxsForumThreadWidget::insertGroupData(const RsGxsForumGroup &group)
|
|||
#endif
|
||||
|
||||
mSubscribeFlags = group.mMeta.mSubscribeFlags;
|
||||
ui->forumName->setText(QString::fromUtf8(group.mMeta.mGroupName.c_str()));
|
||||
mForumDescription = QString::fromUtf8(group.mDescription.c_str());
|
||||
ui->forumName->setText(QString::fromUtf8(group.mMeta.mGroupName.c_str()));
|
||||
|
||||
mForumDescription = QString();
|
||||
mForumDescription += QString("<b>Forum name: \t</b>")+QString::fromStdString( group.mMeta.mGroupName)+"<br/>" ;
|
||||
mForumDescription += QString("<b>Subscribers: \t</b>")+QString::number( group.mMeta.mPop)+"<br/>" ;
|
||||
mForumDescription += QString("<b>Posts: \t</b>")+QString::number(group.mMeta.mVisibleMsgCount)+"<br/>" ;
|
||||
mForumDescription += QString("<b>Description: </b>")+"<br/><br/>" ;
|
||||
|
||||
mForumDescription += QString::fromUtf8(group.mDescription.c_str());
|
||||
|
||||
ui->subscribeToolButton->setSubscribed(IS_GROUP_SUBSCRIBED(mSubscribeFlags));
|
||||
mStateHelper->setWidgetEnabled(ui->newthreadButton, (IS_GROUP_SUBSCRIBED(mSubscribeFlags)));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue