Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidXanatos committed Mar 24, 2024
1 parent 7a04435 commit 34dd1e6
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ This project adheres to [Semantic Versioning](http://semver.org/).
- added "LingerExemptWnds=n" to make the lingering process monitor mechanism no longer exempt lingering processes with windows from termination
- Added option 'SharedTemplate' to Box Wizard [#3737](https://github.com/sandboxie-plus/Sandboxie/pull/3737) (thanks offhub)
- Added an option to force the protection of an encrypted sandbox to be enabled. [#3736](https://github.com/sandboxie-plus/Sandboxie/pull/3736) (thanks Yeyixiao)
- Added a menu and button/icon to suspend all processes [#3741] (https://github.com/sandboxie-plus/Sandboxie/issues/3741)

### Changed
- option "LingerLeniency=n" now also disabled the 5 sec grace period for freshly started lingerers [#1892](https://github.com/sandboxie-plus/Sandboxie/issues/1892)
Expand Down
Binary file added SandboxiePlus/SandMan/Resources/Actions/Pause.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions SandboxiePlus/SandMan/Resources/SandMan.qrc
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,7 @@
<file>SideLogoDM.png</file>
<file>Actions/TaskBar.png</file>
<file>Actions/Desktop.png</file>
<file>Actions/Pause.png</file>
</qresource>
<qresource prefix="/Boxes">
<file alias="Busy">Boxes/BusyOverlay.png</file>
Expand Down
13 changes: 13 additions & 0 deletions SandboxiePlus/SandMan/SandMan.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -510,6 +510,7 @@ void CSandMan::CreateMenus(bool bAdvanced)
m_pImportBox->setEnabled(CArchive::IsInit());
m_pMenuFile->addSeparator();
m_pRunBoxed = m_pMenuFile->addAction(CSandMan::GetIcon("Run"), tr("Run Sandboxed"), this, SLOT(OnSandBoxAction()));
m_pPauseAll = m_pMenuFile->addAction(CSandMan::GetIcon("Pause"), tr("Suspend All Processes"), this, SLOT(OnPauseAll()));
m_pEmptyAll = m_pMenuFile->addAction(CSandMan::GetIcon("EmptyAll"), tr("Terminate All Processes"), this, SLOT(OnEmptyAll()));
m_pLockAll = m_pMenuFile->addAction(CSandMan::GetIcon("LockClosed"), tr("Lock All Encrypted Boxes"), this, SLOT(OnLockAll()));
m_pMenuFile->addSeparator();
Expand Down Expand Up @@ -653,6 +654,7 @@ void CSandMan::CreateOldMenus()

m_pMenuFile = m_pMenuBar->addMenu(tr("&File"));
m_pRunBoxed = m_pMenuFile->addAction(CSandMan::GetIcon("Run"), tr("Run Sandboxed"), this, SLOT(OnSandBoxAction()));
m_pPauseAll = m_pMenuFile->addAction(CSandMan::GetIcon("Pause"), tr("Suspend All Processes"), this, SLOT(OnPauseAll()));
m_pEmptyAll = m_pMenuFile->addAction(CSandMan::GetIcon("EmptyAll"), tr("Terminate All Processes"), this, SLOT(OnEmptyAll()));
m_pLockAll = m_pMenuFile->addAction(CSandMan::GetIcon("LockClosed"), tr("Lock All Encrypted Boxes"), this, SLOT(OnLockAll()));
m_pDisableForce = m_pMenuFile->addAction(CSandMan::GetIcon("PauseForce"), tr("Pause Forcing Programs"), this, SLOT(OnDisableForce()));
Expand Down Expand Up @@ -830,6 +832,7 @@ QList<ToolBarAction> CSandMan::GetAvailableToolBarActions()
ToolBarAction{ "", nullptr }, // separator
ToolBarAction{ "RunBoxed", m_pRunBoxed },
ToolBarAction{ "IsBoxed", m_pWndFinder },
ToolBarAction{ "SuspendAll", m_pPauseAll },
ToolBarAction{ "TerminateAll", m_pEmptyAll },
ToolBarAction{ "LockAll", m_pLockAll },
ToolBarAction{ "", nullptr }, // separator
Expand Down Expand Up @@ -2577,6 +2580,7 @@ void CSandMan::UpdateState()
m_pNewBox->setEnabled(isConnected);
m_pNewGroup->setEnabled(isConnected);
m_pImportBox->setEnabled(isConnected);
m_pPauseAll->setEnabled(isConnected);
m_pEmptyAll->setEnabled(isConnected);
m_pLockAll->setEnabled(isConnected);
m_pDisableForce->setEnabled(isConnected);
Expand Down Expand Up @@ -3184,6 +3188,15 @@ void CSandMan::OnEmptyAll()
theAPI->TerminateAll();
}

void CSandMan::OnPauseAll()
{
for (auto pBox: theAPI->GetAllBoxes()) {
pBox->SetSuspendedAll(TRUE);
for (auto pProcess : pBox->GetProcessList())
pProcess->TestSuspended();
}
}

void CSandMan::OnLockAll()
{
if (theConf->GetInt("Options/WarnLockAll", -1) == -1)
Expand Down
2 changes: 2 additions & 0 deletions SandboxiePlus/SandMan/SandMan.h
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,7 @@ private slots:

void OnSandBoxAction();
void OnSettingsAction();
void OnPauseAll();
void OnEmptyAll();
void OnLockAll();
void OnWndFinder();
Expand Down Expand Up @@ -373,6 +374,7 @@ private slots:
QAction* m_pNewBox;
QAction* m_pNewGroup;
QAction* m_pImportBox;
QAction* m_pPauseAll;
QAction* m_pEmptyAll;
QAction* m_pLockAll;
QAction* m_pWndFinder;
Expand Down

0 comments on commit 34dd1e6

Please # to comment.