This commit is contained in:
love-code-yeyixiao 2024-03-17 19:10:29 +08:00
parent 345c29efe8
commit 4f5477628d
3 changed files with 45 additions and 70 deletions

View File

@ -2161,6 +2161,33 @@ Unlike the preview channel, it does not include untested, potentially breaking,
<string>Sandboxie.ini Presets</string>
</attribute>
<layout class="QGridLayout" name="gridLayout_19">
<item row="7" column="0">
<spacer name="verticalSpacer_7">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>211</height>
</size>
</property>
</spacer>
</item>
<item row="6" column="2">
<widget class="QCheckBox" name="chkClearPass">
<property name="text">
<string>Clear password when main window becomes hidden</string>
</property>
</widget>
</item>
<item row="5" column="2" colspan="2">
<widget class="QCheckBox" name="chkAdminOnlyFP">
<property name="text">
<string>Only Administrator user accounts can use Pause Forcing Programs command</string>
</property>
</widget>
</item>
<item row="0" column="2">
<widget class="QCheckBox" name="chkWatchConfig">
<property name="text">
@ -2168,34 +2195,6 @@ Unlike the preview channel, it does not include untested, potentially breaking,
</property>
</widget>
</item>
<item row="1" column="0" colspan="2">
<widget class="QLabel" name="lblProtection">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
<kerning>true</kerning>
</font>
</property>
<property name="text">
<string>Config protection</string>
</property>
</widget>
</item>
<item row="2" column="2">
<widget class="QCheckBox" name="chkAdminOnly">
<property name="text">
<string>Only Administrator user accounts can make changes</string>
</property>
</widget>
</item>
<item row="3" column="2">
<widget class="QCheckBox" name="chkPassRequired">
<property name="text">
<string>Password must be entered in order to make changes</string>
</property>
</widget>
</item>
<item row="3" column="3" rowspan="2">
<widget class="QPushButton" name="btnSetPassword">
<property name="text">
@ -2216,40 +2215,34 @@ Unlike the preview channel, it does not include untested, potentially breaking,
</property>
</spacer>
</item>
<item row="5" column="2" colspan="2">
<widget class="QCheckBox" name="chkAdminOnlyFP">
<item row="2" column="2">
<widget class="QCheckBox" name="chkAdminOnly">
<property name="text">
<string>Only Administrator user accounts can use Pause Forcing Programs command</string>
<string>Only Administrator user accounts can make changes</string>
</property>
</widget>
</item>
<item row="6" column="2">
<widget class="QCheckBox" name="chkClearPass">
<item row="1" column="0" colspan="2">
<widget class="QLabel" name="lblProtection">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
<kerning>true</kerning>
</font>
</property>
<property name="text">
<string>Clear password when main window becomes hidden</string>
<string>Config protection</string>
</property>
</widget>
</item>
<item row="7" column="2">
<widget class="QCheckBox" name="chkLockTrayMenu">
<item row="3" column="2">
<widget class="QCheckBox" name="chkPassRequired">
<property name="text">
<string>Protect The Sandman tray menu.</string>
<string>Password must be entered in order to make changes</string>
</property>
</widget>
</item>
<item row="8" column="0">
<spacer name="verticalSpacer_7">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>211</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</widget>

View File

@ -542,22 +542,6 @@ void CSandMan::OnBoxMenu(const QPoint& point)
QTreeWidgetItem* pItem = m_pTrayBoxes->currentItem();
if (!pItem)
return;
if (theAPI->IsConnected()) {
if (theConf->GetBool("LockTrayMenu", false) && theAPI->IsConfigLocked()) {
QString Value = QInputDialog::getText(this, "Sandboxie-Plus", tr("Please enter the configuration password."), QLineEdit::Password);
if (Value.isEmpty()) {
QMessageBox::warning(this, "Sandboxie-Plus", tr("Login Failed"));
return;
}
SB_STATUS Status = theAPI->UnlockConfig(Value);
if (!Status.IsError()) {
QMessageBox::warning(this, "Sandboxie-Plus", tr("Login Failed: %1").arg(FormatError(Status)));
return;
}
}
}
CTrayBoxesItemDelegate::m_Hold = true;
m_pBoxView->PopUpMenu(pItem->data(0, Qt::UserRole).toString());
CTrayBoxesItemDelegate::m_Hold = false;

View File

@ -429,7 +429,7 @@ CSettingsWindow::CSettingsWindow(QWidget* parent)
connect(ui.btnSetPassword, SIGNAL(clicked(bool)), this, SLOT(OnSetPassword()));
connect(ui.chkAdminOnlyFP, SIGNAL(stateChanged(int)), this, SLOT(OnProtectionChange()));
connect(ui.chkClearPass, SIGNAL(stateChanged(int)), this, SLOT(OnProtectionChange()));
connect(ui.chkLockTrayMenu, SIGNAL(stateChanged(int)), this, SLOT(OnProtectionChange()));
m_ProtectionChanged = false;
//
@ -1001,7 +1001,6 @@ void CSettingsWindow::LoadSettings()
ui.chkPassRequired->setChecked(!theAPI->GetGlobalSettings()->GetText("EditPassword", "").isEmpty());
ui.chkAdminOnlyFP->setChecked(theAPI->GetGlobalSettings()->GetBool("ForceDisableAdminOnly", false));
ui.chkClearPass->setChecked(theAPI->GetGlobalSettings()->GetBool("ForgetPassword", false));
ui.chkLockTrayMenu->setChecked(theAPI->GetGlobalSettings()->GetBool("LockTrayMenu", false));
m_HoldChange = true;
OnProtectionChange();
m_HoldChange = false;
@ -1056,7 +1055,6 @@ void CSettingsWindow::LoadSettings()
ui.chkPassRequired->setEnabled(false);
ui.chkAdminOnlyFP->setEnabled(false);
ui.chkClearPass->setEnabled(false);
ui.chkLockTrayMenu->setEnabled(false);
ui.btnSetPassword->setEnabled(false);
ui.treeWarnProgs->setEnabled(false);
ui.btnAddWarnProg->setEnabled(false);
@ -1666,7 +1664,7 @@ void CSettingsWindow::SaveSettings()
WriteAdvancedCheck(ui.chkAdminOnlyFP, "ForceDisableAdminOnly", "y", "");
WriteAdvancedCheck(ui.chkClearPass, "ForgetPassword", "y", "");
WriteAdvancedCheck(ui.chkLockTrayMenu, "LockTrayMenu", "y", "");
}
if (m_WarnProgsChanged)