This commit is contained in:
DavidXanatos 2022-05-01 10:10:47 +02:00
parent 97a8d8fffd
commit af22cf9aef
1 changed files with 20 additions and 5 deletions

View File

@ -61,13 +61,28 @@ void COptionsWindow::OnDelStartProg()
void COptionsWindow::OnStartChanged(QTreeWidgetItem* pItem, int Index) void COptionsWindow::OnStartChanged(QTreeWidgetItem* pItem, int Index)
{ {
if (pItem->checkState(0) == Qt::Checked) { QString Name = pItem->data(0, Qt::UserRole).toString();
if(DelProgramFromGroup(pItem->data(0, Qt::UserRole).toString(), "<StartRunAccessDisabled>")) QString NewName = pItem->text(0);
AddProgramToGroup(pItem->data(0, Qt::UserRole).toString(), "<StartRunAccess>"); if (Name != NewName)
{
pItem->setData(0, Qt::UserRole, NewName);
if (pItem->checkState(0) == Qt::Checked) {
if (DelProgramFromGroup(Name, "<StartRunAccess>"))
AddProgramToGroup(NewName, "<StartRunAccess>");
}
else {
if (DelProgramFromGroup(Name, "<StartRunAccessDisabled>"))
AddProgramToGroup(NewName, "<StartRunAccessDisabled>");
}
}
else if (pItem->checkState(0) == Qt::Checked) {
if(DelProgramFromGroup(Name, "<StartRunAccessDisabled>"))
AddProgramToGroup(Name, "<StartRunAccess>");
} }
else { else {
if(DelProgramFromGroup(pItem->data(0, Qt::UserRole).toString(), "<StartRunAccess>")) if(DelProgramFromGroup(Name, "<StartRunAccess>"))
AddProgramToGroup(pItem->data(0, Qt::UserRole).toString(), "<StartRunAccessDisabled>"); AddProgramToGroup(Name, "<StartRunAccessDisabled>");
} }
//m_StartChanged = true; //m_StartChanged = true;
//OnOptChanged(); //OnOptChanged();