From 16aba205b13782d4b921d5e7e4865262ac601244 Mon Sep 17 00:00:00 2001 From: love-code-yeyixiao <188240888@qq.com> Date: Sun, 17 Mar 2024 17:32:43 +0800 Subject: [PATCH] Add UI. --- SandboxiePlus/SandMan/Forms/OptionsWindow.ui | 6 +- SandboxiePlus/SandMan/Forms/SettingsWindow.ui | 169 ++++++++++-------- .../SandMan/Windows/SettingsWindow.cpp | 4 + 3 files changed, 100 insertions(+), 79 deletions(-) diff --git a/SandboxiePlus/SandMan/Forms/OptionsWindow.ui b/SandboxiePlus/SandMan/Forms/OptionsWindow.ui index 63360739..63d0a3d5 100644 --- a/SandboxiePlus/SandMan/Forms/OptionsWindow.ui +++ b/SandboxiePlus/SandMan/Forms/OptionsWindow.ui @@ -411,7 +411,7 @@ - Lock the encrypted sandbox when all processes in the sandbox terminate. + Force lock the encrypted sandbox when all processes in the sandbox terminate. @@ -4525,8 +4525,8 @@ instead of "*". 0 0 - 75 - 16 + 98 + 28 diff --git a/SandboxiePlus/SandMan/Forms/SettingsWindow.ui b/SandboxiePlus/SandMan/Forms/SettingsWindow.ui index 00d4c17c..7460ecc5 100644 --- a/SandboxiePlus/SandMan/Forms/SettingsWindow.ui +++ b/SandboxiePlus/SandMan/Forms/SettingsWindow.ui @@ -48,7 +48,7 @@ QTabWidget::North - 0 + 5 @@ -449,7 +449,7 @@ - 0 + 1 @@ -1689,6 +1689,7 @@ + 75 true true @@ -1940,7 +1941,7 @@ Unlike the preview channel, it does not include untested, potentially breaking, - 0 + 1 @@ -2159,79 +2160,95 @@ Unlike the preview channel, it does not include untested, potentially breaking, Sandboxie.ini Presets - - - - - - - Change Password - - - - - - - Password must be entered in order to make changes - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - - 75 - true - true - - - - Config protection - - - - - - - Only Administrator user accounts can make changes - - - - - - - Watch Sandboxie.ini for changes - - - - - - - Only Administrator user accounts can use Pause Forcing Programs command - - - - - - - Clear password when main window becomes hidden - - - - + + + + + Watch Sandboxie.ini for changes + + + + + + + + 75 + true + true + + + + Config protection + + + + + + + Only Administrator user accounts can make changes + + + + + + + Password must be entered in order to make changes + + + + + + + Change Password + + + + + + + Qt::Horizontal + + + + 140 + 20 + + + + + + + + Only Administrator user accounts can use Pause Forcing Programs command + + + + + + + Clear password when main window becomes hidden + + + + + + + Protect The Sandman tray menu. + + + + + + + Qt::Vertical + + + + 20 + 211 + + + diff --git a/SandboxiePlus/SandMan/Windows/SettingsWindow.cpp b/SandboxiePlus/SandMan/Windows/SettingsWindow.cpp index de81c9d6..e71f10d4 100644 --- a/SandboxiePlus/SandMan/Windows/SettingsWindow.cpp +++ b/SandboxiePlus/SandMan/Windows/SettingsWindow.cpp @@ -429,6 +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; // @@ -1000,6 +1001,7 @@ 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; @@ -1054,6 +1056,7 @@ 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); @@ -1663,6 +1666,7 @@ void CSettingsWindow::SaveSettings() WriteAdvancedCheck(ui.chkAdminOnlyFP, "ForceDisableAdminOnly", "y", ""); WriteAdvancedCheck(ui.chkClearPass, "ForgetPassword", "y", ""); + WriteAdvancedCheck(ui.chkLockTrayMenu, "LockTrayMenu", "y", ""); } if (m_WarnProgsChanged)