This commit is contained in:
DavidXanatos 2022-10-26 10:37:30 +02:00
parent 206447a60b
commit 69bc841c4b
5 changed files with 36 additions and 54 deletions

View File

@ -20,6 +20,8 @@ This project adheres to [Semantic Versioning](http://semver.org/).
- fixed issue with boxed object directory initialization [#2342](https://github.com/sandboxie-plus/Sandboxie/issues/2342)
- Sandboxie no longer leaves behind permanent directory objects
- FIXED SECURITY ISSUE ID-21 AlpcConnectPortEx was not filtered by the driver [#2396](https://github.com/sandboxie-plus/Sandboxie/issues/2396)
- fixed issues with program controll options [#2395](https://github.com/sandboxie-plus/Sandboxie/issues/2395)
## [1.5.0 / 5.60.0] - 2022-10-19

View File

@ -158,53 +158,6 @@ void COptionsWindow::OnAddGroup()
OnOptChanged();
}
void COptionsWindow::AddProgToGroup(QTreeWidget* pTree, const QString& Groupe, bool disabled)
{
QString Value = SelectProgram();
if (Value.isEmpty())
return;
QTreeWidgetItem* pItem = new QTreeWidgetItem();
pItem->setCheckState(0, disabled ? Qt::Unchecked : Qt::Checked);
SetProgramItem(Value, pItem, 0);
pItem->setFlags(pItem->flags() | Qt::ItemIsEditable);
pTree->addTopLevelItem(pItem);
AddProgramToGroup(Value, Groupe);
}
void COptionsWindow::DelProgFromGroup(QTreeWidget* pTree, const QString& Groupe)
{
QTreeWidgetItem* pItem = pTree->currentItem();
if (!pItem)
return;
QString Value = pItem->data(0, Qt::UserRole).toString();
delete pItem;
for (int i = 0; i < ui.treeGroups->topLevelItemCount(); i++)
{
QTreeWidgetItem* pGroupItem = ui.treeGroups->topLevelItem(i);
if (pGroupItem->data(0, Qt::UserRole).toString().compare(Groupe, Qt::CaseInsensitive) == 0)
{
for (int j = 0; j < pGroupItem->childCount(); j++)
{
QTreeWidgetItem* pProgItem = pGroupItem->child(j);
if (pProgItem->data(0, Qt::UserRole).toString().compare(Value, Qt::CaseInsensitive) == 0)
{
delete pProgItem;
m_GroupsChanged = true;
OnOptChanged();
break;
}
}
break;
}
}
}
void COptionsWindow::AddProgramToGroup(const QString& Program, const QString& Group)
{
QTreeWidgetItem* pItem = FindGroupByName(Group, true);

View File

@ -46,15 +46,35 @@ void COptionsWindow::OnRestrictStart()
void COptionsWindow::OnAddStartProg()
{
AddProgToGroup(ui.treeStart, "<StartRunAccess>");
QString Value = SelectProgram();
if (Value.isEmpty())
return;
QTreeWidgetItem* pItem = new QTreeWidgetItem();
pItem->setCheckState(0, Qt::Checked);
SetProgramItem(Value, pItem, 0);
pItem->setFlags(pItem->flags() | Qt::ItemIsEditable);
ui.treeStart->addTopLevelItem(pItem);
AddProgramToGroup(Value, "<StartRunAccess>");
//m_StartChanged = true;
//OnOptChanged();
}
void COptionsWindow::OnDelStartProg()
{
DelProgFromGroup(ui.treeStart, "<StartRunAccess>");
DelProgFromGroup(ui.treeStart, "<StartRunAccessDisabled>");
QTreeWidgetItem* pItem = ui.treeStart->currentItem();
if (!pItem)
return;
QString Value = pItem->data(0, Qt::UserRole).toString();
delete pItem;
DelProgramFromGroup(Value, "<StartRunAccess>");
DelProgramFromGroup(Value, "<StartRunAccessDisabled>");
//m_StartChanged = true;
//OnOptChanged();
}

View File

@ -58,6 +58,15 @@ public:
}*/
pBox->setProperty("value", text);
});
connect(pBox->lineEdit(), &QLineEdit::returnPressed, [pBox](){
/*if (pBox->currentIndex() != -1) {
int pos = pBox->lineEdit()->cursorPosition();
pBox->setCurrentIndex(-1);
pBox->setCurrentText(text);
pBox->lineEdit()->setCursorPosition(pos);
}*/
pBox->setProperty("value", pBox->lineEdit()->text());
});
connect(pBox, qOverload<int>(&QComboBox::currentIndexChanged), [pBox](int index){
if (index != -1)
@ -391,7 +400,7 @@ COptionsWindow::COptionsWindow(const QSharedPointer<CSbieIni>& pBox, const QStri
connect(ui.chkShowForceTmpl, SIGNAL(clicked(bool)), this, SLOT(OnShowForceTmpl()));
//ui.treeForced->setEditTriggers(QAbstractItemView::DoubleClicked);
ui.treeForced->setItemDelegateForColumn(0, new NoEditDelegate(this));
ui.treeForced->setItemDelegateForColumn(1, new ProgramsDelegate(this, ui.treeForced, 0, this));
ui.treeForced->setItemDelegateForColumn(1, new ProgramsDelegate(this, ui.treeForced, -1, this));
connect(ui.treeForced, SIGNAL(itemChanged(QTreeWidgetItem *, int)), this, SLOT(OnForcedChanged(QTreeWidgetItem *, int)));
connect(ui.btnBreakoutProg, SIGNAL(clicked(bool)), this, SLOT(OnBreakoutProg()));
@ -404,7 +413,7 @@ COptionsWindow::COptionsWindow(const QSharedPointer<CSbieIni>& pBox, const QStri
connect(ui.chkShowBreakoutTmpl, SIGNAL(clicked(bool)), this, SLOT(OnShowBreakoutTmpl()));
//ui.treeBreakout->setEditTriggers(QAbstractItemView::DoubleClicked);
ui.treeBreakout->setItemDelegateForColumn(0, new NoEditDelegate(this));
ui.treeBreakout->setItemDelegateForColumn(1, new ProgramsDelegate(this, ui.treeBreakout, 0, this));
ui.treeBreakout->setItemDelegateForColumn(1, new ProgramsDelegate(this, ui.treeBreakout, -1, this));
connect(ui.treeBreakout, SIGNAL(itemChanged(QTreeWidgetItem *, int)), this, SLOT(OnForcedChanged(QTreeWidgetItem *, int)));
//

View File

@ -312,8 +312,6 @@ protected:
QTreeWidgetItem* GetAccessEntry(EAccessType Type, const QString& Program, EAccessMode Mode, const QString& Path);
void SetAccessEntry(EAccessType Type, const QString& Program, EAccessMode Mode, const QString& Path);
void DelAccessEntry(EAccessType Type, const QString& Program, EAccessMode Mode, const QString& Path);
void AddProgToGroup(QTreeWidget* pTree, const QString& Groupe, bool disabled = false);
void DelProgFromGroup(QTreeWidget* pTree, const QString& Groupe);
void LoadConfig();
void SaveConfig();