Added to count Wire group box

This commit is contained in:
defnax 2026-04-03 16:00:10 +02:00
parent 5d2024c2a1
commit 6810da41f9
2 changed files with 27 additions and 0 deletions

View File

@ -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()) {

View File

@ -155,6 +155,8 @@ private slots:
void back();
void forward();
void updateGroupCountLabels();
private:
bool setupPulseAddDialog();