Add AlertBeforeStart UI options.

This commit is contained in:
love-code-yeyixiao 2024-05-26 13:44:21 +08:00
parent 6c00c512d3
commit 498b02b80a
3 changed files with 90 additions and 83 deletions

View File

@ -6,7 +6,7 @@
<rect>
<x>0</x>
<y>0</y>
<width>720</width>
<width>787</width>
<height>588</height>
</rect>
</property>
@ -45,7 +45,7 @@
<enum>QTabWidget::North</enum>
</property>
<property name="currentIndex">
<number>0</number>
<number>5</number>
</property>
<widget class="QWidget" name="tabGeneral">
<attribute name="title">
@ -2345,102 +2345,108 @@
<attribute name="title">
<string>Start Restrictions</string>
</attribute>
<layout class="QGridLayout" name="gridLayout_19">
<layout class="QGridLayout" name="gridLayout_16">
<item row="0" column="0">
<layout class="QGridLayout" name="gridLayout_16">
<item row="9" column="0">
<widget class="QCheckBox" name="chkStartBlockMsg">
<layout class="QGridLayout" name="gridLayout_23">
<property name="verticalSpacing">
<number>0</number>
</property>
<item row="2" column="0">
<widget class="QRadioButton" name="radStartSelected">
<property name="text">
<string>Issue message 1308 when a program fails to start</string>
<string>Allow only selected programs to start in this sandbox. *</string>
</property>
</widget>
</item>
<item row="5" column="0" rowspan="4">
<widget class="QTreeWidget" name="treeStart">
<property name="sortingEnabled">
<bool>true</bool>
</property>
<column>
<property name="text">
<string>Name</string>
</property>
</column>
</widget>
</item>
<item row="6" column="1">
<spacer name="verticalSpacer_8">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
<item row="5" column="1">
<widget class="QPushButton" name="btnAddStartProg">
<item row="1" column="0">
<widget class="QRadioButton" name="radStartExcept">
<property name="text">
<string>Add Program</string>
<string>Prevent selected programs from starting in this sandbox.</string>
</property>
</widget>
</item>
<item row="8" column="1">
<widget class="QPushButton" name="btnDelStartProg">
<item row="0" column="0">
<widget class="QRadioButton" name="radStartAll">
<property name="text">
<string>Remove</string>
<string>Allow all programs to start in this sandbox.</string>
</property>
</widget>
</item>
<item row="3" column="0">
<layout class="QGridLayout" name="gridLayout_23">
<property name="verticalSpacing">
<number>0</number>
</property>
<item row="2" column="0">
<widget class="QRadioButton" name="radStartSelected">
<property name="text">
<string>Allow only selected programs to start in this sandbox. *</string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QRadioButton" name="radStartExcept">
<property name="text">
<string>Prevent selected programs from starting in this sandbox.</string>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QRadioButton" name="radStartAll">
<property name="text">
<string>Allow all programs to start in this sandbox.</string>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="label_4">
<property name="text">
<string>* Note: Programs installed to this sandbox won't be able to start at all.</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</item>
<item row="7" column="1">
<widget class="QCheckBox" name="chkShowStartTmpl">
<widget class="QLabel" name="label_4">
<property name="text">
<string>Show Templates</string>
<string>* Note: Programs installed to this sandbox won't be able to start at all.</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</item>
<item row="1" column="0" rowspan="4">
<widget class="QTreeWidget" name="treeStart">
<property name="sortingEnabled">
<bool>true</bool>
</property>
<column>
<property name="text">
<string>Name</string>
</property>
</column>
</widget>
</item>
<item row="1" column="1">
<widget class="QPushButton" name="btnAddStartProg">
<property name="text">
<string>Add Program</string>
</property>
</widget>
</item>
<item row="2" column="1">
<spacer name="verticalSpacer_8">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>299</height>
</size>
</property>
</spacer>
</item>
<item row="3" column="1">
<widget class="QCheckBox" name="chkShowStartTmpl">
<property name="text">
<string>Show Templates</string>
</property>
</widget>
</item>
<item row="4" column="1">
<widget class="QPushButton" name="btnDelStartProg">
<property name="text">
<string>Remove</string>
</property>
</widget>
</item>
<item row="5" column="0">
<widget class="QCheckBox" name="chkStartBlockMsg">
<property name="text">
<string>Issue message 1308 when a program fails to start</string>
</property>
</widget>
</item>
<item row="6" column="0" colspan="2">
<widget class="QCheckBox" name="chkAlertBeforeStart">
<property name="toolTip">
<string>This can be used to prevent a host malicious program from breaking through by launching a pre-designed malicious program into an unlocked encrypted sandbox.</string>
</property>
<property name="text">
<string>A pop-up warning before launching a process into the sandbox from an external source.</string>
</property>
</widget>
</item>
</layout>
</widget>
<widget class="QWidget" name="tabAccess">
@ -4951,8 +4957,8 @@ instead of &quot;*&quot;.</string>
<rect>
<x>0</x>
<y>0</y>
<width>98</width>
<height>28</height>
<width>75</width>
<height>16</height>
</rect>
</property>
<layout class="QGridLayout" name="dbgLayout">

View File

@ -12,14 +12,14 @@ void COptionsWindow::LoadStart()
{
ui.chkStartBlockMsg->setEnabled(!ui.radStartAll->isChecked());
ui.chkStartBlockMsg->setChecked(m_pBox->GetBool("NotifyStartRunAccessDenied", true));
ui.chkAlertBeforeStart->setChecked(m_pBox->GetBool("AlertBeforeStart", false));
m_StartChanged = false;
}
void COptionsWindow::SaveStart()
{
WriteAdvancedCheck(ui.chkStartBlockMsg, "NotifyStartRunAccessDenied", "", "n");
WriteAdvancedCheck(ui.chkAlertBeforeStart, "AlertBeforeStart", "y", "");
m_StartChanged = false;
}
@ -106,4 +106,4 @@ void COptionsWindow::OnStartChanged(QTreeWidgetItem* pItem, int Index)
}
//m_StartChanged = true;
//OnOptChanged();
}
}

View File

@ -515,6 +515,7 @@ COptionsWindow::COptionsWindow(const QSharedPointer<CSbieIni>& pBox, const QStri
connect(ui.chkStartBlockMsg, SIGNAL(clicked(bool)), this, SLOT(OnStartChanged()));
ui.treeStart->setItemDelegateForColumn(0, new ProgramsDelegate(this, ui.treeStart, -1, this));
connect(ui.treeStart, SIGNAL(itemChanged(QTreeWidgetItem *, int)), this, SLOT(OnStartChanged(QTreeWidgetItem *, int)));
connect(ui.chkAlertBeforeStart, SIGNAL(clicked(bool)), this, SLOT(OnStartChanged()));
//
CreateNetwork();