mirror of
https://github.com/RetroShare/RetroShare.git
synced 2026-09-14 11:06:01 +05:00
Added to count Wire group box
This commit is contained in:
parent
5d2024c2a1
commit
6810da41f9
@ -599,6 +599,8 @@ void WireDialog::updateGroups(const std::vector<RsWireGroup>& groups)
|
||||
ui.groupChooser->addItem(QPixmap(pixmap),QString::fromStdString(it.mMeta.mGroupName));
|
||||
}
|
||||
}
|
||||
|
||||
updateGroupCountLabels();
|
||||
}
|
||||
|
||||
|
||||
@ -1393,6 +1395,29 @@ void WireDialog::updateGroupStatisticsReal(const RsGxsGroupId &groupId)
|
||||
});
|
||||
}
|
||||
|
||||
void WireDialog::updateGroupCountLabels()
|
||||
{
|
||||
int allCount = mAllGroups.size();
|
||||
int ownCount = mOwnGroups.size();
|
||||
|
||||
// Count Subscribed and Others from mAllGroups
|
||||
int subscribedCount = 0;
|
||||
int othersCount = 0;
|
||||
for (auto const& [id, group] : mAllGroups) {
|
||||
if (group.mMeta.mSubscribeFlags & GXS_SERV::GROUP_SUBSCRIBE_SUBSCRIBED) {
|
||||
subscribedCount++;
|
||||
} else {
|
||||
othersCount++;
|
||||
}
|
||||
}
|
||||
|
||||
// Update ComboBox Text
|
||||
ui.comboBox_groupSet->setItemText(GROUP_SET_ALL, tr("All (%1)").arg(allCount));
|
||||
ui.comboBox_groupSet->setItemText(GROUP_SET_OWN, tr("Yourself (%1)").arg(ownCount));
|
||||
ui.comboBox_groupSet->setItemText(GROUP_SET_SUBSCRIBED, tr("Following (%1)").arg(subscribedCount));
|
||||
ui.comboBox_groupSet->setItemText(GROUP_SET_OTHERS, tr("Others (%1)").arg(othersCount));
|
||||
}
|
||||
|
||||
bool WireDialog::navigate(const RsGxsGroupId &groupId, const RsGxsMessageId& msgId)
|
||||
{
|
||||
if (groupId.isNull()) {
|
||||
|
||||
@ -155,6 +155,8 @@ private slots:
|
||||
void back();
|
||||
void forward();
|
||||
|
||||
void updateGroupCountLabels();
|
||||
|
||||
private:
|
||||
|
||||
bool setupPulseAddDialog();
|
||||
|
||||
Loading…
Reference in New Issue
Block a user