commit
819ba064c3
|
@ -176,6 +176,7 @@ SB_STATUS CNewBoxWizard::TryToCreateBox()
|
||||||
if(field("imagesProtection").toBool())
|
if(field("imagesProtection").toBool())
|
||||||
pBox->SetBool("ProtectHostImages", true);
|
pBox->SetBool("ProtectHostImages", true);
|
||||||
|
|
||||||
|
// SharedTemplate
|
||||||
QString templateName = "SharedTemplate";
|
QString templateName = "SharedTemplate";
|
||||||
QString templateFullName = QString("Template_Local_%1").arg(templateName);
|
QString templateFullName = QString("Template_Local_%1").arg(templateName);
|
||||||
QString templateSettings = theAPI->SbieIniGetEx(templateFullName, "");
|
QString templateSettings = theAPI->SbieIniGetEx(templateFullName, "");
|
||||||
|
@ -192,14 +193,31 @@ SB_STATUS CNewBoxWizard::TryToCreateBox()
|
||||||
}
|
}
|
||||||
else if (field("sharedTemplate").toInt() == 2) { // append to config
|
else if (field("sharedTemplate").toInt() == 2) { // append to config
|
||||||
QStringList templateSettingsLines = templateSettings.split("\r\n", Qt::SkipEmptyParts);
|
QStringList templateSettingsLines = templateSettings.split("\r\n", Qt::SkipEmptyParts);
|
||||||
|
|
||||||
for (const QString& tLine : templateSettingsLines) {
|
for (const QString& tLine : templateSettingsLines) {
|
||||||
if (!tLine.startsWith("Enabled=") && !tLine.startsWith("ConfigLevel=") && !tLine.startsWith("Tmpl.") && !tLine.startsWith("#")) { // skip lines
|
if (tLine.startsWith("Enabled=") ||
|
||||||
|
tLine.startsWith("ConfigLevel=") ||
|
||||||
|
tLine.startsWith("Tmpl.") ||
|
||||||
|
tLine.startsWith("#")) {
|
||||||
|
continue; // Skip lines that start with these prefixes
|
||||||
|
}
|
||||||
|
|
||||||
QStringList tParts = tLine.split('=');
|
QStringList tParts = tLine.split('=');
|
||||||
if (tParts.size() == 2) {
|
if (tParts.size() != 2) {
|
||||||
|
continue; // Skip lines that don't have exactly one '=' character
|
||||||
|
}
|
||||||
|
|
||||||
QString tKey = tParts[0].trimmed();
|
QString tKey = tParts[0].trimmed();
|
||||||
QString tValue = tParts[1].trimmed();
|
QString tValue = tParts[1].trimmed();
|
||||||
pBox->AppendText(tKey, tValue);
|
|
||||||
|
if (tLine.endsWith("=y") ||
|
||||||
|
tLine.endsWith("=Y") ||
|
||||||
|
tLine.endsWith("=n") ||
|
||||||
|
tLine.endsWith("=N")) {
|
||||||
|
pBox->SetText(tKey, tValue);
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
pBox->AppendText(tKey, tValue);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue