Merge pull request #3948 from love-code-yeyixiao/AdminConf

Add AlertBeforeStart UI options.
This commit is contained in:
DavidXanatos 2024-05-26 09:44:05 +02:00 committed by GitHub
commit dae35e788e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 117 additions and 100 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,60 +2345,38 @@
<attribute name="title">
<string>Start Restrictions</string>
</attribute>
<widget class="QWidget" name="layoutWidget">
<property name="geometry">
<rect>
<x>9</x>
<y>9</y>
<width>751</width>
<height>493</height>
</rect>
</property>
<layout class="QGridLayout" name="gridLayout_19">
<item row="0" column="0">
<layout class="QGridLayout" name="gridLayout_16">
<item row="9" 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="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">
<property name="text">
<string>Add Program</string>
</property>
</widget>
</item>
<item row="8" column="1">
<widget class="QPushButton" name="btnDelStartProg">
<property name="text">
<string>Remove</string>
</property>
</widget>
</item>
<item row="3" column="0">
<layout class="QGridLayout" name="gridLayout_23">
<property name="verticalSpacing">
<number>0</number>
</property>
<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>
<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="2" column="0">
<widget class="QRadioButton" name="radStartSelected">
<property name="text">
@ -2413,36 +2391,74 @@
</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">
<item row="1" column="0" rowspan="2">
<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>
</layout>
<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">
<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>
<widget class="QWidget" name="tabAccess">
<attribute name="title">
<string>Resource Access</string>
@ -4951,8 +4967,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;
}

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();