Element editor Save As: label the field as a file name, not element name (#469)

The Save As 'location' dialog used a QFileNameEdit (accepts only
[0-9a-z_-.]) but labelled it 'New element name', which is confusing —
QET also has a separate, translatable display name shown in the
collection. Users reasonably tried to type a display name (spaces,
capitals) and it was rejected.

Rename the placeholder to 'Element file name' and add a tooltip noting
the accepted characters and that the display name is edited separately
in the element properties. Updates the English translation; other
languages fall back until re-translated.

Fixes #469.
This commit is contained in:
Shane Ringrose
2026-06-12 05:34:20 +12:00
parent e7787daa2c
commit 86b5d7ac95
2 changed files with 23 additions and 4 deletions
+12 -3
View File
@@ -1833,9 +1833,18 @@ Note: these options DO NOT allow or block auto numberings, only their update pol
<translation>Name of the new template</translation> <translation>Name of the new template</translation>
</message> </message>
<message> <message>
<location filename="../sources/elementdialog.cpp" line="127"/> <location filename="../sources/elementdialog.cpp" line="130"/>
<source>Nom du nouvel élément</source> <source>Nom de fichier de l'élément</source>
<translation>New element name</translation> <comment>placeholder: the element's file name, not its display name</comment>
<translation>Element file name</translation>
</message>
<message>
<location filename="../sources/elementdialog.cpp" line="134"/>
<source>Nom de fichier de l'élément : chiffres, minuscules, « - », « _ » et « . » uniquement.
Le nom affiché de l'élément se modifie séparément dans les propriétés de l'élément.</source>
<comment>tooltip for the element file-name field</comment>
<translation>The element's file name: digits, lowercase letters, '-', '_' and '.' only.
The element's display name is edited separately in the element properties.</translation>
</message> </message>
<message> <message>
<location filename="../sources/elementdialog.cpp" line="238"/> <location filename="../sources/elementdialog.cpp" line="238"/>
+11 -1
View File
@@ -124,7 +124,17 @@ void ElementDialog::setUpWidget()
} else if (m_mode == SaveTemplate) { } else if (m_mode == SaveTemplate) {
m_text_field->setPlaceholderText(tr("Nom du nouveau template")); m_text_field->setPlaceholderText(tr("Nom du nouveau template"));
} else { } else {
m_text_field->setPlaceholderText(tr("Nom du nouvel élément")); // This is the element's file name, not its display name: the field
// only accepts file-name characters (QFileNameEdit). The visible
// element name is edited separately in the element properties.
m_text_field->setPlaceholderText(
tr("Nom de fichier de l'élément",
"placeholder: the element's file name, not its display name"));
m_text_field->setToolTip(
tr("Nom de fichier de l'élément : chiffres, minuscules, « - », "
"« _ » et « . » uniquement.\nLe nom affiché de l'élément se "
"modifie séparément dans les propriétés de l'élément.",
"tooltip for the element file-name field"));
} }
layout->addWidget(m_text_field); layout->addWidget(m_text_field);