Commit Graph

10292 Commits

Author SHA1 Message Date
ispyisail f2c0fdebba Merge pull request #1388 from bhangart/fix/part-rotation-init
Initialise the rotation of a new line and polygon in the element editor
2026-10-08 13:45:25 +13:00
ispyisail dd973fb220 Merge pull request #1379 from bhangart/feature/fr-translation-mirror
Serve the French UI from qet_fr.ts instead of the code text
2026-10-08 13:40:41 +13:00
ispyisail 05b4c8449c Merge pull request #1389 from ispyisail/fix/english-missing-strings
Fix 9 messages always shown in French; add missing English
2026-10-08 13:23:43 +13:00
ispyisail d0657f36db Fix 9 messages always shown in French; add missing English
Nine messages were never passed through tr(), so every user saw them in
French: the undo entries for grouping and ungrouping terminals, for
editing an arc (3), an ellipse, a rectangle and a PLC table in the
element editor, and the error box when integrating a title block
template fails. They are now wrapped, text unchanged.

qet_en.ts also lacked English for 63 messages added since the last
translations update (Customize dialog, mouse gestures, toolbar contents,
mirror, element scale, paste element information, paper format).
update_translations was run on qet_en.ts with lupdate's guessing
heuristics off, then the 72 new entries were translated. Most of the
diff is lupdate refreshing line numbers.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-08 12:29:08 +13:00
Beat Hangartner 0795281d79 Initialise the rotation of a new line and polygon in the element editor
PartLine and PartPolygon keep their rotation in m_rot, which nothing
sets until setRotation() is called. rotation() reads it, and
setRotation() computes the difference from it, so the first rotate of
a freshly drawn line or polygon in the element editor starts from
garbage: qRound(m_rot * 100.0) on an arbitrary value is undefined
behaviour, and the angle stored afterwards is arbitrary too.
PartRectangle and PartEllipse already start at 0.

Give m_rot a default value of 0 in both headers, as PartEllipse has.
Only the two headers change.

No file-format change, and no change for a part loaded from a file or
rotated once, since both set m_rot before reading it.

Tests: none of their own; an uninitialised read is what a sanitizer
finds, and this one is the same kind as the BorderTitleBlock and
ConductorProfile fixes (#1358, #1359). ctest on macOS, and all
example projects through --resave and --export-svg, unchanged.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Signed-off-by: Beat Hangartner <beat@hangartners.ch>
2026-10-07 23:38:34 +02:00
ispyisail ef795a21e5 Merge pull request #1330 from saschbe/fix/attached-text-formatting
Fix plain-text paste styling in attached element texts
2026-10-08 08:24:23 +13:00
ispyisail a92edc3b63 Merge pull request #1378 from ispyisail/feature/symbol-scale
Add Scale element to the element editor, keeping terminals on the grid
2026-10-08 08:23:04 +13:00
Beat Hangartner 8fa73f72a2 Refresh qet_fr.ts and mirror the strings added since 4 October
lupdate over sources/ adds the 164 strings merged after the last
translations update (da39ec1c8) and revives 3 entries it had wrongly
marked vanished (the issue #1366 describes for English); the mirror
script then fills the new ones. qet_fr.qm: 3792 finished, 0 unfinished,
0 null records.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-10-07 20:51:45 +02:00
Beat Hangartner f32d9365e5 Finish unfinished French entries that equal their source
After a lupdate refresh, the same-text heuristic fills a new string with
the translation of an existing identical one and marks it unfinished.
In the source-language file that guess is the source text itself, which
is exactly what a mirror run writes, but the script left it alone as
"work in progress": 39 such entries stayed unfinished in qet_fr.ts after
refreshing it on 2026-10-07.

The script now finishes an unfinished translation (or plural with all
forms) that is identical to its source. Unfinished translations with
other text stay untouched. Two fixture messages and a test cover it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-07 20:51:30 +02:00
Beat Hangartner 287689d185 Serve the French UI from qet_fr.ts instead of the code text
The strings in the code are French and serve as both translation key
and displayed text. lang/qet_fr.ts was almost empty: 3425 messages and
22 plural messages had no translation, so lrelease compiled them as
null-string records (3469 in qet_fr.qm) and the French UI showed the
code text through QTranslator's null fallback. Correcting French
wording therefore meant changing the key, which orphans the translation
of that string in all 33 other language files; the "Élement" typo fix
needed a key rename in 34 files for one accent.

This copies every empty French entry's source text into its own
translation, so qet_fr.qm is complete (514 KB, 0 null records, like
the other languages) and French wording can be corrected in the .ts
alone. Translations that already had text (113 French renderings of
English-written sources, 16 identical, 54 plurals) are untouched, as
are the 10 vanished entries. The file is byte-identical outside the
rewritten <translation> elements.

misc/i18n/mirror_source_language.py does the copy and is meant to run
after update_translations; --check exits 1 when a run is needed.
Forgetting it breaks nothing: an empty entry still falls back to the
code text. INSTALL.md section 10 explains the rule and that
-removeidentical must never be added to lrelease. Tests:
misc/i18n/test_mirror_source_language.py with a before/after fixture
pair covering every message class.

No visible change in the application.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-10-07 20:51:30 +02:00
ispyisail 35162b6731 Add "Scale element..." to the element editor, keeping terminals on the grid
Edit > Scale element... scales the whole element about its hotspot by a
factor picked from x0.5, x1.5, x2, x2.5, x3, x4. Only the factors that
leave every terminal on the 10 px folio grid are offered, so wires to a
scaled element stay straight. An element whose terminals are off the grid
today is offered only the factors that bring them on to it; if none does,
the dialog says so and OK is disabled.

Drawn parts are scaled with their existing handleUserTransformation(), as
the resize handles do. Texts, dynamic text fields and terminals are set
directly so that font sizes (whole points, 4 pt minimum), terminal name
offsets and line end sizes scale too, which the resize handles do not do.
One undo step restores the element.

Unlike "Import an element to resize", this needs no external program and
works on the element being edited.

Grew out of issue #1338.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-08 07:12:48 +13:00
saschbe ca6b79ab79 Use Qt's platform redo shortcut in plain-paste regression 2026-10-07 20:09:32 +02:00
ispyisail 06083c455d Merge pull request #1376 from ispyisail/feature/1375-paste-element-info
Linux build and tests / Build and test (Qt 6, Debug) (push) Failing after 19m47s
Add Paste element information: copy one symbol's details onto others
2026-10-08 06:32:46 +13:00
ispyisail f2513f4f9b Add "Paste element information" to copy one symbol's details onto others
Issue #1375: replacing a symbol meant retyping its label, manufacturer,
part number and the rest by hand. Copy the old symbol (Ctrl+C), select
the new one(s), then Edit > Paste element information, also in the
right-click menu of a selection.

Every field filled in on the copied symbol overwrites the same field on
each selected symbol; fields it leaves empty are left alone, since empty
fields are not written to the clipboard. The label and its formula move
together, so a target whose label comes from a formula takes the copied
label rather than rebuilding its own. A numbering-scheme id is kept only
if the scheme exists in the target project. Plain slaves and folio
reports are skipped: they take their information from what they are
linked to, as in the properties dialog. One undo step.

Enabled only when the clipboard holds exactly one symbol. The clipboard
is parsed once when it changes, not on every selection change.

No default shortcut: Ctrl+Shift+V, suggested in the issue, is already
"Paste at origin". It can be assigned in the shortcut settings.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-08 05:37:22 +13:00
ispyisail 47ecd06d1c Merge pull request #1371 from bhangart/fix/element-typo
Fix the spelling of "Élément" in the element description
2026-10-08 05:15:15 +13:00
ispyisail 51c9035611 Merge pull request #1367 from bhangart/fix/image-pivot-flag-undo
Undo restores whether a picture's pivot was placed by hand
2026-10-08 05:14:47 +13:00
saschbe 43c17b41cb Use field styling for plain clipboard paste in attached user texts 2026-10-07 17:44:28 +02:00
Laurent Trinques 4146936fb6 Merge pull request #1374 from arummler/master-remove-pri-file
Cleanup: remove old *.pri files
2026-10-07 16:43:38 +02:00
Laurent Trinques b9507a09fe CI: try to fix windows-build 2026-10-07 16:25:23 +02:00
Laurent Trinques 3dab9256c0 CI: try to fix windows-build 2026-10-07 15:55:39 +02:00
Laurent Trinques 44abc241c2 Merge pull request #1369 from bhangart/feature/script-imagecrop-map
Return qet.imageCrop() as {x, y, width, height}
2026-10-07 13:15:48 +02:00
Laurent Trinques 03f2911295 Merge pull request #1373 from bhangart/fix/lang-pl-missing
Add the missing Polish translations
2026-10-07 13:15:10 +02:00
Laurent Trinques d9225bb89d Merge pull request #1372 from bhangart/fix/lang-de-missing
Add the missing German translations
2026-10-07 13:14:56 +02:00
Andre Rummler 329e8f51d0 Cleanup: remova old *.pri files which were part of qmake and are no longer used for anything after switch to cmake. 2026-10-07 10:55:50 +02:00
Beat Hangartner 36bfc6f969 Return qet.imageCrop() as {x, y, width, height}
The crop rectangle came back as the string "x,y,width,height", which a
script had to split and parse. elementGeometry() returns a map; the
crop now does the same, and an empty map for no such image.

Suggested in the review of #1310.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-10-07 10:55:02 +02:00
Beat Hangartner afa35e094d Undo restores whether a picture's pivot was placed by hand
A picture remembers whether its pivot was placed by hand: a hand-placed
pivot is saved and kept through a resize, a default one is not saved
and recentres after a resize. Two actions changed that flag outside
their undo step:

- applyCrop() marked the pivot as default after moving it to the centre
  of the kept region. After Ctrl+Z the pivot was back where the user
  had put it, but marked as default, so the next save dropped it.
- dragging the pivot handle marked it as hand-placed. After Ctrl+Z the
  pivot was back at the centre but still marked as hand-placed, so a
  later resize left it at the handle's anchor corner.

pivotIsCustom becomes a property, and both actions put it into their
undo command next to rawPivot. tst_imagecropundo checks that a project
saved after undoing a crop keeps its hand-placed pivot.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-10-07 10:54:53 +02:00
ispyisail 140f9f6e39 Merge pull request #1355 from ispyisail/feat/upright-symbol-texts
Linux build and tests / Build and test (Qt 6, Debug) (push) Failing after 1m54s
Add an option to keep texts of turned symbols horizontal
2026-10-07 21:39:49 +13:00
ispyisail fd0df50c17 Merge pull request #1354 from ispyisail/feat/1335-flip-elements
Add horizontal and vertical mirror for symbols on a folio (#1335)
2026-10-07 21:30:18 +13:00
Beat Hangartner 6c9f1b40ab Fix the spelling of "Élément" in the element description
The "general" tab of the element properties starts its description with
tr("Élement\n"), missing the second accent. The French UI shows the typo,
and the misspelt string is the translation key in all 34 lang/qet_*.ts
files (and from there was copied into 11 phrase books).

This fixes the source string to "Élément\n" and renames the key in the
34 .ts files so every existing translation stays attached. Without the
.ts change, the next lupdate run would mark the old entry vanished and
add an empty "Élément" entry: lupdate's similar-text heuristic does not
carry the translation over (checked with Qt 6.11 lupdate on copies of
qet_de/pl/en/fr.ts). With the change, lupdate reports the entry as
already existing and keeps the translation. qet_fr.ts also gets the
corrected spelling as its translation.

No behaviour change besides the one character in the label. The phrase
books keep their copy of the typo for now; they are cleaned up with the
other phrase-book corrections.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-10-07 10:25:32 +02:00
Beat Hangartner dad46cd75f Use "element główny" for the master element in the new Polish strings
Four strings added on this branch rendered "maître" as "nadrzędny",
following the rest of the file. A Polish reviewer confirmed that the
phrase book's "Element główny" is the right term and "nadrzędny" is
wrong for a master element. The 14 older entries that use "nadrzędny"
are left for a separate change, so this PR does not rewrite existing
translations.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-07 10:25:32 +02:00
Beat Hangartner e4bdb296ae Refresh qet_de.ts and translate the strings added since 4 October
Upstream added 154 source strings after the last translations update
(da39ec1c8), among them the Toolbars, Shortcuts, Gestures and 3D mouse
pages, DXF block export, the image dark-theme option, text width and
cross-reference stacking. That update had also marked 38 entries vanished
whose strings are still in the code (table properties, text field
properties, database model widget), so lrelease left them out and the
German UI showed French there (the same issue #1366 fixes for English).

lupdate over sources/ revives the 38 with their existing translations and
adds the new strings; the 116 that had no translation are translated with
the terms the file already uses. lupdate's same-text suggestions were
reviewed rather than accepted (e.g. "Grille des textes" had been offered
as "Textübersicht"). Most of the diff is lupdate moving line numbers.

Checked with lrelease (3782 translations, no warning) and the placeholder
check for every changed entry.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-07 10:25:32 +02:00
Beat Hangartner df32e9088f Refresh qet_pl.ts and translate the strings added since 4 October
Upstream added 154 source strings after the last translations update
(da39ec1c8), among them the Toolbars, Shortcuts, Gestures and 3D mouse
pages, DXF block export, the image dark-theme option, text width and
cross-reference stacking. That update had also marked 38 entries vanished
whose strings are still in the code (table properties, text field
properties, database model widget), so lrelease left them out and the
Polish UI showed French there (the same issue #1366 fixes for English).

lupdate over sources/ revives the 38 with their existing translations and
adds the new strings; the 116 that had no translation are translated with
the terms the file already uses. lupdate's same-text suggestions were
reviewed rather than accepted; the 20 offered for Polish were kept
after review. Most of the diff is lupdate moving line numbers.

Checked with lrelease (3782 translations, no warning) and the placeholder
check for every changed entry.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-07 10:25:32 +02:00
Beat Hangartner 5f0b918c3e Add the missing German translations
qet_de.ts had 407 strings with no German translation (plus 7 plural
entries with only the singular filled), almost all from features merged
in the last two months: auto-numbering pages, script manager, AI
assistant dialog, live server, material list, prefix configuration,
element info widget, fillet/arc tools, alignment and grouping. A German
user saw the French source text in those places.

This fills every empty translation and the missing plural forms, using
the terms the file already uses (Bauteil, Seite, Leiter, Anschluss,
Nummerierung, Schnellzugriffsleiste). Two existing entries were wrong
and are corrected: "Exécuter un script" was translated as "v", and the
spin-box suffix " pas de grille" (grid steps) as " kein Raster".

No source code or file-format change. Checked with lrelease (3630
translations, no warning) and a script that compares source and
translation placeholders (%1, %n) for every changed entry.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-10-07 10:25:32 +02:00
Beat Hangartner af10f50153 Add the missing Polish translations
qet_pl.ts had 675 strings with no Polish translation (plus 4 plural
entries with missing forms), almost all from features merged in the last
two months: auto-numbering pages, script manager, AI assistant dialog,
live server, material list, prefix configuration, shortcut bar, element
picker, conductor and background colour buttons, fillet/arc tools,
alignment and grouping. A Polish user saw the French source text in
those places.

This fills every empty translation and the missing plural forms, using
the terms the file already uses (element, arkusz, przewód, zacisk,
numeracja, pasek skrótów). Three existing entries are corrected: the
plural of "%n action(s)" contained the placeholder "niepewne"
(uncertain) and an empty third form, the PDF page count had only its
first form, and "Borne" was translated as "Terminal" twice while the
rest of the file uses "Zacisk".

No source code or file-format change. Checked with lrelease (3630
translations, no warning) and a script that compares source and
translation placeholders (%1, %n) for every changed entry.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-10-07 10:25:32 +02:00
ispyisail aac004bcdd Merge pull request #1368 from bhangart/refactor/image-pixmap-from-source
Compute a picture's displayed pixmap from its source
2026-10-07 21:24:39 +13:00
ispyisail c8944e23b2 Merge pull request #1370 from ispyisail/fix/qt-colour-dialog
Fix saved custom colours being pushed out on Linux
2026-10-07 21:23:10 +13:00
ispyisail 5d2eddfdd1 Merge pull request #1358 from bhangart/fix/bordertitleblock-uninit-members
Initialise the BorderTitleBlock members its constructor compares
2026-10-07 21:18:30 +13:00
ispyisail 3662032289 Merge feat/1335-flip-elements into feat/upright-symbol-texts
Brings in master's DXF blocks (#1339) through #1354. The upright texts
now live in drawSymbol() too, and a turned symbol whose texts stay
horizontal is drawn in full like a mirrored one: an INSERT would turn
its texts.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-07 21:17:38 +13:00
ispyisail d508e0adb2 Merge pull request #1359 from bhangart/fix/conductorprofile-uninit-orientation
Initialise the orientations of a default-constructed ConductorProfile
2026-10-07 21:14:36 +13:00
ispyisail f94ad83c46 Merge pull request #1366 from ispyisail/translation/english-update
Update the English translation (qet_en.ts)
2026-10-07 21:12:46 +13:00
ispyisail a55c1312de Merge pull request #1357 from ispyisail/fix/aligned-text-lines-auto-width
Fix line alignment of multi-line symbol texts with Auto width (#1348)
2026-10-07 21:12:20 +13:00
ispyisail 14a31e895e Merge master into feat/1335-flip-elements
Conflicts with the DXF blocks export (#1350) and the picture factory
leak fix. The mirror now lives in drawSymbol(); a mirrored symbol is
drawn in full rather than as an INSERT of its block, since a negative
INSERT scale would mirror its texts too.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-07 21:11:00 +13:00
ispyisail b1f1f77a53 Merge pull request #1365 from ispyisail/feature/customise-dialog
Add a Customise window for toolbars, shortcuts and gestures
2026-10-07 20:57:15 +13:00
ispyisail bae96b4ae7 Merge pull request #1364 from ispyisail/feature/customise-gesture-list
Add a mouse gesture page: own commands, 4 or 8 directions
2026-10-07 20:56:50 +13:00
ispyisail a43ce3baa5 Merge pull request #1362 from ispyisail/feature/folio-paper-size
Add paper sizes A0–A5 to the folio dimensions
2026-10-07 20:54:31 +13:00
ispyisail 72b215bb23 Always use Qt's own colour dialog
On GTK desktops (Mint, XFCE, GNOME) Qt hands QColorDialog to GTK's
chooser. Its "Custom" row is a recent-colours list kept by GTK: every
colour picked is pushed in on the left and the oldest drops out, so a
user's saved wire colours are lost (forum topic 3190). It also ignores
the custom colours QET saves (#918) and has no swatch grid for the
double-click to accept (#1172).

Pass DontUseNativeDialog at every colour dialog, so all platforms get
the dialog Windows already shows: 16 custom slots that change only on
"Add to Custom Colors", saved across restarts.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-07 20:53:11 +13:00
ispyisail a3c178e4ce Update the English translation (qet_en.ts)
lupdate over sources/ finds 98 new source texts. 41 are new and are
translated here: the Toolbars settings page, the new Shortcuts page
controls (category filter, search by key, Menu column, copy list), the
Edit > Selection submenu, DXF block export options, cross-reference
stacking, picture dark-theme adaptation and text width.

The other 57 were already translated but marked vanished by the
4 October translations update (da39ec1c8), so lrelease left them out
and these screens showed French in the English interface: the 3D mouse
settings page, the table properties editor and the text field
properties. They come back with their existing English.

lrelease: 3737 finished, 0 unfinished.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-07 20:08:38 +13:00
ispyisail 0fef6b19ce Add a Customise window: toolbars, shortcut bar, keyboard, gestures
Configuration > Personnaliser... (also at the bottom of a toolbar's
right-click menu) opens one window with a tab for each page that sets
how the user works: Barres d'outils, Contenu des barres, Barre de
raccourcis, Raccourcis and Gestes de la souris, like SolidWorks'
Tools > Customize. The tabs are the same pages the configuration
dialog shows, which keeps them. OK applies every tab, Cancel none.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-07 19:31:42 +13:00
ispyisail b6bbcfdd7a Merge branch 'feature/customise-gesture-list' into feature/customise-dialog
# Conflicts:
#	tests/qttest/CMakeLists.txt
2026-10-07 18:41:40 +13:00
ispyisail 46e041fe01 Mouse gestures: own command list, 4 or 8 directions
The right-drag ring showed the shortcut bar's commands for the selection.
A new Preferences page, "Gestes de la souris", lets the user pick the
ring's commands per selection context, one per direction, and choose 4 or
8 directions. Commands are dropped from the list onto a slot of a ring
editor, or placed with a button; Delete empties a slot.

A context the user never edits keeps following the shortcut bar, and 8
directions stays the default, so nothing changes for anyone who does not
open the page. A picked list is positional: a direction left empty, or
holding a command this build lacks, stays empty instead of shifting the
others. Stored like ShortcutBarSettings: diagrameditor/gestures/<context>
id lists in QSettings, defaults not stored.

tst_gesturesettings covers the defaults, positional lists, the 4/8
setting, the overlay's sectors and empty slots, and the page.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-07 18:38:25 +13:00