refactor: Refactors AgentRoleDialog's modes handling (#325)

* fix: Fixes `undefined-bool-conversion` compilation warning.

* refactor: Replaces `AgentRoleDialog::m_editMode` with `AgentRoleDialog::m_action`

---------

Co-authored-by: Ivan Lebedev <ilebedev@flightpath3d.com>
This commit is contained in:
lebedeviv1988
2026-03-05 09:48:01 +00:00
committed by GitHub
parent e2e13f0f38
commit b7a9787cc3
3 changed files with 32 additions and 19 deletions

View File

@ -129,7 +129,7 @@ void AgentRolesWidget::updateButtons()
void AgentRolesWidget::onAddRole()
{
AgentRoleDialog dialog(this);
AgentRoleDialog dialog{AgentRoleDialog::Action::Add, this};
if (dialog.exec() != QDialog::Accepted)
return;
@ -170,7 +170,7 @@ void AgentRolesWidget::onEditRole()
return;
}
AgentRoleDialog dialog(role, this);
AgentRoleDialog dialog{role, AgentRoleDialog::Action::Edit, this};
if (dialog.exec() != QDialog::Accepted)
return;
@ -203,7 +203,7 @@ void AgentRolesWidget::onDuplicateRole()
role.id = baseId + QString::number(counter++);
}
AgentRoleDialog dialog(role, false, this);
AgentRoleDialog dialog{role, AgentRoleDialog::Action::Duplicate, this};
if (dialog.exec() != QDialog::Accepted)
return;