Skip to content

Commit

Permalink
Merge pull request #3751 from offhub/add007-2
Browse files Browse the repository at this point in the history
Update NewBoxWizard.cpp
  • Loading branch information
DavidXanatos committed Mar 25, 2024
2 parents a354f3f + 0e35e8f commit 300bdfe
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions SandboxiePlus/SandMan/Wizards/NewBoxWizard.cpp
Expand Up @@ -176,16 +176,18 @@ SB_STATUS CNewBoxWizard::TryToCreateBox()
if(field("imagesProtection").toBool())
pBox->SetBool("ProtectHostImages", true);

QString stName = "SharedTemplate";
QString stNameCheck = theAPI->SbieIniGetEx("Template_Local_" + stName, "Tmpl.Title");
QString stComment = tr("Add your settings after this line.");
QString templateName = "SharedTemplate";
QString templateFullName = QString("Template_Local_%1").arg(templateName);
QString templateSettings = theAPI->SbieIniGetEx(templateFullName, "");
QString templateComment = tr("Add your settings after this line.");

if (field("sharedTemplate").toBool()) {
if (stNameCheck.isNull()) {
QString stTemplate = QString("Template_Local_%1").arg(stName);
QString stSettings = QString("Tmpl.Title=%1\nTmpl.Class=Local\nTmpl.Comment=%2").arg(stName,stComment);
theAPI->SbieIniSet(stTemplate, "", stSettings);
if (templateSettings.isNull()) {
QString templateBase = QString("Tmpl.Title=%1\r\nTmpl.Class=Local\r\nTmpl.Comment=%2\r\n").arg(templateName, templateComment);
theAPI->SbieIniSet(templateFullName, "", templateBase);
}
pBox->InsertText("Template", "Local_" + stName);
QString insertValue = templateFullName.replace("Template_", "");
pBox->InsertText("Template", insertValue);
}

if (!Password.isEmpty())
Expand Down

0 comments on commit 300bdfe

Please sign in to comment.