show checkbox next to current profile

This commit is contained in:
mappu 2018-10-02 19:53:04 +13:00
parent c25705c50f
commit 257d26248d

View File

@ -108,7 +108,16 @@ void TrayIcon::onGotPulseCardInfo(const pa_card_info& cardInfo, int eol)
cardMenu->setIcon(QIcon::fromTheme(iconName));
for (size_t i = 0; i < cardInfo.n_profiles; ++i) {
bool isActiveProfile = (!strcmp(cardInfo.active_profile->name, cardInfo.profiles[i].name));
auto profileAction = new QAction(cardInfo.profiles[i].description, cardMenu);
profileAction->setCheckable(true);
if (isActiveProfile) {
profileAction->setChecked(true);
}
profileAction->setData(cardInfo.profiles[i].name);
cardMenu->addAction(profileAction);
}