Give new projects the terminal labelling of the settings

The labelling of the terminals is a setting of the project, so that the
same file draws the same way on every machine which opens it. A new
project has to start with something, though, and that is now a default
of the application: Configure QElectroTech > New project, on the sheet
tab, the same group box with the same two choices the project
properties use -- what it saves is only what a new project starts with.

Off unless the settings say otherwise, so a new project draws the whole
label in one field, as it always did, and a project saved after that
keeps its own choice (readTerminalLabelSplitXml()).

The settings key starts with "diagrameditor/default", the prefix of the
new-project part of a configuration profile, so the choice travels with
the other defaults of a new project.

The project gets the setting in its own properties and nowhere else: the
page of the new sheets does not offer it, and the tests say so.
This commit is contained in:
Kellermorph
2026-10-23 14:50:58 +02:00
parent 6a6e558194
commit 8b59bcb992
4 changed files with 148 additions and 0 deletions
+6
View File
@@ -96,6 +96,12 @@ m_project_properties_handler{this}
//Read auto break conductor default from global settings
setAutoBreakConductor(settings.value(QStringLiteral("diagrameditor/auto_break_conductor"), false).toBool());
//A new project draws its terminals the way the settings chose it
//for new projects (Configure QElectroTech > New project), off when
//they say nothing: the drawing is then the one it always was. Every
//project saved after that keeps its own choice (readTerminalLabelSplitXml())
setTerminalLabelSplit(settings.value(QStringLiteral("diagrameditor/defaultterminallabelling"), false).toBool());
int size = settings.beginReadArray(QStringLiteral("diagrameditor/defaultguides"));
for (int i = 0; i < size; ++i) {
settings.setArrayIndex(i);