wip: setenabled crash to fix
This commit is contained in:
parent
1a4692533d
commit
f620a0575d
6 changed files with 111 additions and 17 deletions
|
|
@ -192,6 +192,10 @@ void EndpointWidget::updateMainVolume(int newValue){
|
|||
* }
|
||||
*/
|
||||
|
||||
EndpointHandler* EndpointWidget::getEndpointHandler(){
|
||||
return this->eph;
|
||||
}
|
||||
|
||||
void EndpointWidget::setIndex(uint64_t idx){
|
||||
this->idx = idx;
|
||||
}
|
||||
|
|
@ -228,8 +232,61 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent) {
|
|||
trayIcon->show();
|
||||
trayIcon->setToolTip(STRING_TITLE);
|
||||
trayIcon->setContextMenu(trayIconMenu);
|
||||
//todo: ayo...
|
||||
QString as = trayIcon->toolTip();
|
||||
connect(trayIcon, &QSystemTrayIcon::activated, this, &MainWindow::trayIconActivated);
|
||||
|
||||
|
||||
osh->setChangeFrontDefaultsFunction([this](Roles role, std::wstring endpointId) {
|
||||
|
||||
for (auto epw : this->ews) {
|
||||
if (epw->getEndpointHandler()->getId() == endpointId) {
|
||||
//not necessary to keep endpointState flags up to date right now, but updating it will allow for later config files / profiles
|
||||
epw->defaultRolesCheckBoxes.at(role)->blockSignals(true);
|
||||
epw->getEndpointHandler()->assignRoles(role);
|
||||
epw->defaultRolesCheckBoxes.at(role)->setCheckState(Qt::Checked);
|
||||
//epw->defaultRolesCheckBoxes.at(role)->setDisabled(true);
|
||||
epw->defaultRolesCheckBoxes.at(role)->blockSignals(false);
|
||||
|
||||
if (epw->getEndpointHandler()->getRoles() == Roles::ROLE_ALL) {
|
||||
epw->defaultRolesCheckBoxes.at(Roles::ROLE_ALL)->blockSignals(true);
|
||||
epw->defaultRolesCheckBoxes.at(Roles::ROLE_ALL)->setCheckState(Qt::Checked);
|
||||
//epw->defaultRolesCheckBoxes.at(Roles::ROLE_ALL)->setDisabled(true);
|
||||
epw->defaultRolesCheckBoxes.at(Roles::ROLE_ALL)->blockSignals(false);
|
||||
}
|
||||
|
||||
/*
|
||||
* switch (role) {
|
||||
* case Roles::ROLE_CONSOLE:
|
||||
* epw->getEndpointHandler()->assignRoles(role);
|
||||
* break;
|
||||
* case Roles::ROLE_MULTIMEDIA:
|
||||
* break;
|
||||
* case Roles::ROLE_COMMUNICATIONS:
|
||||
* break;
|
||||
*
|
||||
* }
|
||||
*/
|
||||
} else {
|
||||
if (epw->getEndpointHandler()->getRoles() & role) {
|
||||
epw->defaultRolesCheckBoxes.at(role)->blockSignals(true);
|
||||
epw->getEndpointHandler()->removeRoles(role);
|
||||
epw->defaultRolesCheckBoxes.at(role)->setCheckState(Qt::Unchecked);
|
||||
//epw->defaultRolesCheckBoxes.at(role)->setDisabled(false);
|
||||
epw->defaultRolesCheckBoxes.at(role)->blockSignals(false);
|
||||
|
||||
if (!epw->defaultRolesCheckBoxes.at(Roles::ROLE_ALL)->isEnabled()) {
|
||||
epw->defaultRolesCheckBoxes.at(Roles::ROLE_ALL)->blockSignals(true);
|
||||
//epw->defaultRolesCheckBoxes.at(Roles::ROLE_ALL)->setDisabled(false);
|
||||
epw->defaultRolesCheckBoxes.at(Roles::ROLE_ALL)->setCheckState(Qt::Unchecked);
|
||||
epw->defaultRolesCheckBoxes.at(Roles::ROLE_ALL)->blockSignals(false);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
void MainWindow::closeEvent(QCloseEvent *event) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue