Skip to content

Commit

Permalink
Update NewBoxWizard.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
offhub committed Mar 25, 2024
1 parent 0e35e8f commit 9ca6e95
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions SandboxiePlus/SandMan/Wizards/NewBoxWizard.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -177,13 +177,14 @@ SB_STATUS CNewBoxWizard::TryToCreateBox()
pBox->SetBool("ProtectHostImages", true);

QString templateName = "SharedTemplate";
QString templateTitle = tr("Shared Template");
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 (templateSettings.isNull()) {
QString templateBase = QString("Tmpl.Title=%1\r\nTmpl.Class=Local\r\nTmpl.Comment=%2\r\n").arg(templateName, templateComment);
QString templateBase = QString("Tmpl.Title=%1\r\nTmpl.Class=Local\r\nTmpl.Comment=%2\r\n").arg(templateTitle, templateComment);
theAPI->SbieIniSet(templateFullName, "", templateBase);
}
QString insertValue = templateFullName.replace("Template_", "");
Expand Down Expand Up @@ -692,10 +693,11 @@ CAdvancedPage::CAdvancedPage(QWidget *parent)
layout->addWidget(pImageProtection, row++, 1, 1, 3);
registerField("imagesProtection", pImageProtection);

QString templateTitle = tr("Shared Template");
QCheckBox* pSharedTemplate = new QCheckBox(tr("Use a shared local template"));
pSharedTemplate->setToolTip(tr("This setting adds a local template to the sandbox configuration so that the settings in that template are shared between sandboxes. However, some settings added to the template may not be reflected in the user interface."
"\nTo change the template's settings, simply locate and edit the 'SharedTemplate' template in the App Templates list under Sandbox Options."
"\nTo disable this template for a sandbox, simply uncheck it in the template list."));
"\nTo change the template's settings, simply locate and edit the '%1' template in the 'App Templates' list under 'Sandbox Options'."
"\nTo disable this template for a sandbox, simply uncheck it in the template list.").arg(templateTitle));
pSharedTemplate->setChecked(theConf->GetBool("BoxDefaults/SharedTemplate", false));
layout->addWidget(pSharedTemplate, row++, 1, 1, 3);
registerField("sharedTemplate", pSharedTemplate);
Expand Down

0 comments on commit 9ca6e95

Please sign in to comment.