Update again

This commit is contained in:
love-code-yeyixiao 2024-03-02 10:15:19 +08:00
commit 741b320733
3 changed files with 30 additions and 0 deletions

View File

@ -233,7 +233,11 @@
<item>
<widget class="QCheckBox" name="chkCheckDelete">
<property name="text">
<<<<<<< HEAD
<string>Don't check sandboxes' auto-delete status when Sandman starts.</string>
=======
<string>Check sandboxes' auto-delete status when Sandman starts</string>
>>>>>>> cbb2b8660f0ba5f1e56841d78292bf64f7931de4
</property>
</widget>
</item>

View File

@ -281,6 +281,28 @@ CSandMan::CSandMan(QWidget *parent)
connect(theAPI, SIGNAL(ConfigReloaded()), this, SLOT(OnIniReloaded()));
connect(qApp, &QGuiApplication::commitDataRequest, this, &CSandMan::commitData);
if (theConf->GetBool("Options/CheckAutoDelete", false)) {
for (auto& box : theAPI->GetAllBoxes().toStdMap()) {
CSandBoxPtr pBox = box.second;
if (box.second->GetActiveProcessCount() == 0) {
if (!pBox->GetBool("NeverDelete", false))
{
if (pBox->GetBool("AutoDelete", false))
{
bool DeleteSnapshots = false;
// if this box auto deletes first show the recovry dialog with the option to abort deletion
//if (!theGUI->OpenRecovery(pBox, DeleteSnapshots, true)) // unless no files are found than continue silently
// return;
if (theConf->GetBool("Options/AutoBoxOpsNotify", false))
OnLogMessage(tr("Auto deleting content of %1").arg(pBox->GetName()), true);
DeleteBoxContent(pBox, eAuto, DeleteSnapshots);
}
}
}
}
}
/*if (theConf->GetBool("Options/CheckAutoDelete", false)) {
for (auto& box : theAPI->GetAllBoxes().toStdMap()) {

View File

@ -1561,7 +1561,11 @@ void CSettingsWindow::SaveSettings()
theConf->SetValue("Options/EnableSuspendKey", ui.chkSuspend->isChecked());
theConf->SetValue("Options/SuspendKeySequence", ui.keySuspend->keySequence().toString());
<<<<<<< HEAD
theConf->SetValue("Options/CleanUpOnStart", !ui.chkCheckDelete->isChecked());
=======
theConf->SetValue("Options/CheckAutoDelete", ui.chkCheckDelete->isChecked());
>>>>>>> cbb2b8660f0ba5f1e56841d78292bf64f7931de4
theConf->SetValue("Options/WatchBoxSize", ui.chkMonitorSize->isChecked());