Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CleanAfterReboot #4222

Open
wants to merge 12 commits into
base: master
Choose a base branch
from
5 changes: 4 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,11 @@ This project adheres to [Semantic Versioning](http://semver.org/).

## [1.14.8 / 5.69.8] - 2024-09-??

### Added
- added a menu action to clean boxes after the machine reboot

### Changed
- allowed users to import/export boxes with .zip files.
- allowed users to import/export boxes with .zip files

### Fixed
- fixed a cert issue
Expand Down
18 changes: 18 additions & 0 deletions SandboxiePlus/SandMan/Views/SbieView.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,7 @@ void CSbieView::CreateMenu()
m_pMenuDuplicate = m_pMenuTools->addAction(CSandMan::GetIcon("Duplicate"), tr("Duplicate Box Config"), this, SLOT(OnSandBoxAction()));
m_pMenuExport = m_pMenuTools->addAction(CSandMan::GetIcon("PackBox"), tr("Export Box"), this, SLOT(OnSandBoxAction()));
m_pMenuExport->setEnabled(CArchive::IsInit());
m_pRebootClean = m_pMenuTools->addAction(CSandMan::GetIcon("Maintenance"),tr("Clean after reboot"),this,SLOT(OnSandBoxAction()));

m_pMenuRename = m_pMenuBox->addAction(CSandMan::GetIcon("Rename"), tr("Rename Sandbox"), this, SLOT(OnSandBoxAction()));
m_pMenuMoveTo = m_pMenuBox->addMenu(CSandMan::GetIcon("Group"), tr("Move Sandbox"));
Expand Down Expand Up @@ -344,6 +345,8 @@ void CSbieView::CreateOldMenu()
m_pMenuDuplicate = m_pMenuTools->addAction(CSandMan::GetIcon("Duplicate"), tr("Duplicate Sandbox Config"), this, SLOT(OnSandBoxAction()));
m_pMenuExport = m_pMenuTools->addAction(CSandMan::GetIcon("PackBox"), tr("Export Sandbox"), this, SLOT(OnSandBoxAction()));
m_pMenuExport->setEnabled(CArchive::IsInit());
m_pRebootClean = m_pMenuTools->addAction(CSandMan::GetIcon("Maintenance"),tr("Clean after reboot"),this,SLOT(OnSandBoxAction()));


m_pMenuTools->addSeparator();
m_pMenuRefresh = m_pMenuTools->addAction(CSandMan::GetIcon("Refresh"), tr("Refresh Info"), this, SLOT(OnSandBoxAction()));
Expand Down Expand Up @@ -1386,6 +1389,21 @@ void CSbieView::OnSandBoxAction(QAction* Action, const QList<CSandBoxPtr>& SandB

Results.append(Status);
}
else if (Action == m_pRebootClean)
{
CSandBoxPtr pBox=SandBoxes.first();
auto pBoxEx = pBox.objectCast<CSandBoxPlus>();
QString fileRoot=pBoxEx->GetFileRoot();
if(QMessageBox::question(this, tr("Sandboxie-Plus"),
tr("Do you want to make the box cleaned after machine reboot?"),
Jkkoi marked this conversation as resolved.
Show resolved Hide resolved
QMessageBox::Yes, QMessageBox::No)==QMessageBox::Yes){
if(MoveFileExW(fileRoot.toStdString().c_str(),NULL,4)==0){
Jkkoi marked this conversation as resolved.
Show resolved Hide resolved
QMessageBox::warning(this, tr("Sandboxie-Plus"),
tr("The operation failed,please make sure that Sandman has admin privliage.")
, QMessageBox::Yes, 0);
}
}
}
else if (Action == m_pMenuExport)
{
CSandBoxPtr pBox = SandBoxes.first();
Expand Down
1 change: 1 addition & 0 deletions SandboxiePlus/SandMan/Views/SbieView.h
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,7 @@ private slots:
QMenu* m_pMenuTools;
QAction* m_pMenuDuplicate;
QAction* m_pMenuExport;
QAction* m_pRebootClean;
QAction* m_pMenuMoveUp;
//QAction* m_pMenuMoveBy;
QAction* m_pMenuMoveDown;
Expand Down
Loading