Commit Graph

10132 Commits

Author SHA1 Message Date
ispyisail ad20eb94ba Live mode: open a saved project, switch between open projects
open_project opens a .qet and makes it current, as File > Open does but
with no file dialog and no error windows: a missing, unreadable or
foreign file is refused in the answer. A project already open is only
made current. switch_project makes another open project current, by its
index or its file. status now lists every open project (index, title,
file, folios, unsaved changes, current), so the assistant sees what it
can switch to. MCP: qet_live_open_project, qet_live_switch_project; both
paths go through the workspace policy.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-05 19:00:13 +13:00
ispyisail 42b1e43e4a Live mode: create a new project (new_project, qet_live_new_project)
An assistant in live mode could only work on the project already open.
new_project makes one as File > New does -- this installation's
new-folio defaults, optional title and number of folios -- and makes it
the current project, so the next request works on it. An optional
absolute path saves it at once, never over an existing file: QElectroTech
refuses, and the MCP server refuses before asking (a new never-overwrite
class in its path policy, so an "overwrite" flag cannot get round it).

Pages and links across pages already worked through scripts
(qet.addFolio, setFolioTitle, linkElements across folios); the tool's
description now says so.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-05 18:48:38 +13:00
Laurent Trinques ecf995174e Merge pull request #1309 from plc-user/master
Linux build and tests / Build and test (Qt 6, Debug) (push) Failing after 1m54s
FIX copyright-date in cmake-files
2026-10-04 21:26:39 +02:00
plc-user b8be28782f FIX copyright-date in cmake-files 2026-10-04 20:59:17 +02:00
Laurent Trinques 1882486785 Merge pull request #1308 from jp2images/svg-icons-d
Sort the icon folders by source and redraw the convert-shape icons (#1269)
2026-10-04 20:02:44 +02:00
Jeff Patterson 1dc9c5cc3d Served the app icon from the icon theme in the new element wizard
The qet theme now lists Nuri's app icon PNGs under the name
qelectrotech, and the wizard loads its logo by that name instead of
the 256 px file path. The files stay in ico/breeze-icons/, where the
packaging scripts install them from.

Part of #1269.
2026-10-04 10:16:34 -05:00
Jeff Patterson f46c63bd42 Redrew Andre's three convert-shape icons for the light and dark themes
ellipse-to-bezier, rect-to-bezier and rect-to-polyline are now drawn
pixel by pixel at 16 and 22 px, with the 1 px lines and hollow handles
of the line tool, and follow the theme's text color. The polyline is
simpler: at menu size the three-segment line with a handle on every
corner was too much detail to read, so it is now two segments rising
to a peak with a handle at each foot. Andre agreed to the redraw under
GPL-2.0-or-later.

Part of #1269.
2026-10-04 10:16:29 -05:00
Laurent Trinques 534d3b4a49 Merge pull request #1277 from saschbe/docs/improve-testing-guide
Linux build and tests / Build and test (Qt 6, Debug) (push) Failing after 2m5s
docs: improve testing and build instructions
2026-10-04 16:17:56 +02:00
Jeff Patterson 20ee3383d3 Sorted the icon folders by source and added ico/README.md
Each folder now holds icons from one source: qet/ for QET's own SVGs,
breeze/ for KDE Breeze (with breeze/added/), flags/, colors/, and
themes/ for script output (with themes/generated/). The unused
128x128/terminalstrip.svg is removed. The generator, qrc files,
qeticons.cpp and ico/copyright follow the new paths. ico/README.md
lists each folder's source, script and license.

Part of #1269.
2026-10-04 07:28:56 -05:00
Laurent Trinques dafd8e8024 Update translations files 2026-10-04 12:55:47 +02:00
Laurent Trinques da39ec1c86 Update translations files 2026-10-04 12:42:50 +02:00
Laurent Trinques 49b145bd4f Merge pull request #1307 from arummler/fix-qtests
Fix qtest regarding hash stability
2026-10-04 11:53:43 +02:00
Laurent Trinques 1c09c4e391 Merge pull request #1282 from arummler/formula-improvements
Auto numeration: a lot of changes for elements, condutors, sheets
2026-10-04 11:52:56 +02:00
Andre Rummler 86be2b303e Fix qtest regarding hash stability as requested in PR #1282. 2026-10-04 10:28:15 +02:00
Laurent Trinques bbb8e5d2e2 Tested in list display on a real project: neighbouring references on the same row were raised alternately (980 / 927 / 980...) although nothing visibly overlapped.
Linux build and tests / Build and test (Qt 6, Debug) (push) Failing after 1m52s
Cause: in list mode `drawAsContacts()` adds a margin (`adjust(-30, -4, 4, 4)`) to `boundingRect()`, and the horizontal test in `stackAtBottom()` uses that rect. Two lists overlapping only inside the empty margin (1.4 units in my log) count as overlapping. `gap` only changes how far the raised ones move, not which ones.

Fix: test the content only in list mode (`rect.adjust(30, 0, -4, 0)`), with the two margins as constants shared with `drawAsContacts()`.

Result: all references stay at the bottom (980 -> 980), none raised by mistake, also when moving an element sideways.

Checked: [to complete: same-column coils in list mode still stack, cross mode unchanged]
2026-10-04 09:32:12 +02:00
Laurent Trinques ac2f360910 Merge pull request #1302 from ispyisail/fix/1252-parttext-align-while-typing
Fix #1252: aligned static text drifts while typing in the element editor
2026-10-04 07:38:51 +02:00
Laurent Trinques 7bd9979777 Merge pull request #1303 from ispyisail/fix/text-group-dangling-xref-connection
Fix a crash in Project properties after a text group is deleted
2026-10-04 07:37:27 +02:00
Laurent Trinques faa0ca92a5 Merge pull request #1301 from ispyisail/fix/zoom-content-hidden-items
Fix #1281: Zoom to content includes hidden wire texts
2026-10-04 07:35:52 +02:00
Laurent Trinques 8a275be6da Merge pull request #1299 from ispyisail/fix/1280-junction-dot-potential
Fix #1280: missing junction dot where wires share a line
2026-10-04 07:34:46 +02:00
ispyisail e055438f30 Fix a crash when cross-reference settings change after a text group is deleted
A text group kept at the bottom of the page, on a master element,
connects to its project's XRefPropertiesChanged with a lambda that has
no context object. The connection belongs to the project, so it
outlives the group: once the group is deleted (paste a coil, undo,
then make any other edit), changing a cross-reference setting in the
project properties calls QTimer::singleShot() on the freed group and
QElectroTech crashes.

Pass the group as the context of that connection and of the
linkedElementChanged one beside it, so Qt removes both when the group
goes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-04 14:59:10 +13:00
ispyisail 9d7fac1f53 Element editor: keep a static text's alignment while typing (#1252)
startEdition() records the bounding rect, but the aligned point was only
restored in endEdition(), so a right/centre/bottom-aligned text grew from
its old left/top edge while being typed into and jumped into place when
the edition ended. Re-anchor after every content change during inline
edition.

endEdition() now always clears previous_text, which marks an edition in
progress. It used to stay set after an edition that left the text
unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-04 12:06:55 +13:00
Andre Rummler 8eb2024bb1 Fix jump to element search. 2026-10-04 01:04:44 +02:00
ispyisail cbacd2bb62 Merge pull request #1283 from jp2images/svg-icons-c
Linux build and tests / Build and test (Qt 6, Debug) (push) Failing after 1m39s
Finish the SVG icons and fix the icon licenses in ico/copyright (#1063, #1269)
2026-10-04 11:45:07 +13:00
ispyisail 2ff0f0d860 Merge pull request #1300 from arummler/fix-qobject
Fix missing Q_OBJECT
2026-10-04 11:44:13 +13:00
ispyisail 6f5db879c1 Zoom to content: count only visible items
itemsBoundingRect() also counts hidden items. The text of a single-line
wire, and the wire texts hidden by "one text per potential", are never
positioned again and can sit far outside the drawing, so Zoom to content
zoomed out to include them. On photovoltaique.qet 14 such texts reach
x = -729 and the zoom covered 2421x924 instead of 1135x648.

Add Diagram::visibleItemsBoundingRect() and use it for Zoom to content,
the scene rect and the borderless export. Zoom to content now goes through
zoomToRect(), which re-centres after the scroll bars appear; before, the
view could stay scrolled to the top-left with part of the content cut off.

Fixes #1281

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-04 11:23:26 +13:00
Andre Rummler 30281032e4 Fix missing Q_OBJECT. Required to pull declaration into the header. 2026-10-04 00:11:38 +02:00
ispyisail bec0f1c7b4 Fix #1280: junction dot missing where a wire's corner meets a wire it is not wired to
A conductor draws a junction dot at each of its bends that lies on
another conductor. It only looked at the conductors on its own two
terminals, so a bend lying on a conductor of the same potential that
shares no terminal with it got no dot. Dragging the horizontal parts of
a chain of conductors onto one line, as in the report, does exactly that.

Look at every conductor of the potential on the folio instead
(relatedPotentialConductors(false)). The folio scene uses NoIndex, so a
scene lookup at each bend scans every item and made export of the
366-conductor Polonez example 60% slower; walking the potential costs
nothing measurable there (2.08 s vs 2.11 s) or on a 153-conductor
potential (0.97 s both).

The test for one other conductor moves into bendMakesJunction(). It
also stops a point being appended once per matching segment: master drew
the dot above K2 in the fixture ten times.

Across the 23 examples (133 folios) exported to SVG, 6 dots are added,
all at T-joints that had none, and none removed.

tst_junctiondots exports fixtures/junction_dot_shared_potential.qet and
checks for both dots; it fails on master with the dot above K3 missing.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-04 10:57:27 +13:00
ispyisail 69aed0cf84 Merge pull request #1287 from ispyisail/fix/xref-bottom-stack
Fix cross-references printing over each other at the folio bottom (#1178)
2026-10-04 10:55:24 +13:00
ispyisail 05de3b754c Merge pull request #1286 from ispyisail/fix/pdf-document-id-from-content
Fix repeatable PDF changing when a project is regenerated (#1178)
2026-10-04 10:54:52 +13:00
ispyisail 519f61e2cf Merge pull request #1285 from ispyisail/fix/element-search-ranking
Fix symbol search offering coils for "NC contact" (#1178)
2026-10-04 10:54:38 +13:00
ispyisail 30d29b933a Stack cross-references snapped to the bottom of a folio instead of overlapping (#1178)
With "snap to bottom", each master's cross was centred under it at the
bottom of the folio on its own, so two coils in one column drew their
crosses on the same spot and the references printed over each other.

The crosses of a folio are now placed together: when two would overlap,
the one of the higher element goes above the other, so a column of
coils gets its crosses in the same order. Crosses that do not overlap
stay where they were. Moving an element sideways now re-places them
too, since it can move a cross into or out of another's column.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-04 08:54:13 +13:00
ispyisail ef96b7d948 Give a repeatable PDF the same document id however the project was made (#1178)
With SOURCE_DATE_EPOCH set, the document id came from the project's uuid
and a hash of the .qet file. A project generated again from the same
data has new uuids, so its PDF differed in the id alone (XMP DocumentID
and trailer /ID, 120 bytes) although every page was the same.

Qt now writes a fixed placeholder id, and once the file is written the
placeholder is replaced with an id derived from the bytes of the PDF:
the same pages give the same id. Same length, so no offset changes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-04 08:54:13 +13:00
plc-user 7e8510cea7 Merge pull request #1284 from ispyisail/translate/en-wires-per-terminal
Update the English translation (qet_en.ts)

Thank you ispyisail!
2026-10-03 21:51:40 +02:00
ispyisail a13cab0945 English: translate the 48 new entries in qet_en.ts
lupdate (run on qet_en.ts only) found strings added since the last
update that the English interface showed in French:

- wires per terminal (#1272, #1273): the rules in Settings > General
  and Project properties, the experimental-feature warning, and the
  tooltip on a terminal that refuses a conductor (both plural forms);
- Display > Show (#1268): the item kinds and the "%n kinds of items
  hidden" status message;
- the 3D mouse settings page.

Terms follow the existing English: conductor (conducteur), terminal
(borne), sheet (folio), sheet reference (renvoi de folio). The menu
"Affichage" is "Display", so its "Afficher" submenu is "Show" rather
than lupdate's guess "Display". lrelease reports 3573 finished,
0 unfinished. Other languages are untouched.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-04 08:36:32 +13:00
ispyisail c49561a76c qet-mcp: better symbol search for NO/NC and schematic symbols (#1178)
qet_element_search matched every word as a substring of the names and
the path, so "NC contact" offered a remanence coil ("nc" in "remanence",
"contact" in its folder) and an outlet before any auxiliary contact,
"normally closed contact" found nothing, and "emergency stop" ranked a
maker's part and two assembly-plan drawings above the push button.

- A word of one or two letters must now be a whole word. Longer words,
  and short ones with a digit, still match inside a word, so German
  compounds ("schutz", "klemme") and "3p" find what they found before;
  on 37 sample queries no result is lost.
- NO, N/O, "normally open", "normalement ouvert" are one word, and NC,
  N/C, NF, "normally closed", "normalement fermé" another.
- Symbols under *_graphics, *_manufacturers_articles and
  *_miscellaneous_unsorted come after every other match.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-04 08:34:29 +13:00
plc-user f09be8007f Add German part to "CREDIT" 2026-10-03 21:27:33 +02:00
Jeff Patterson 4fe31dfefa Gave the circle, ellipse and arc icons the line tool's handles, and kept crop a dashed box at 16 px
Circle and ellipse had a blue square handle and the arc none; all three
now have hollow 3 px handles and 1 px lines, like draw-line. Breeze draws
transform-crop as a crop mark at 16 px and a dashed box at 22, so a 16 px
dashed box in ico/breeze-added/16/ replaces Breeze's 16 and 32 px art.
2026-10-03 12:20:38 -05:00
Jeff Patterson 379cb72941 Fixed tst_importcategory on macOS
The test set the elements folder in a settings file under XDG_CONFIG_HOME,
which macOS does not read, so common:// paths did not resolve and the
first placement failed. It now passes --common-elements-dir.
2026-10-03 12:20:38 -05:00
Jeff Patterson e4edbe53e1 Split the icon licenses in ico/copyright into one paragraph per license (#1269)
The icon section was one Breeze (LGPL) paragraph that listed GPL and
CC BY-ND icons in its text, so a DEP-5 reader saw every icon as LGPL.
Each license now has its own Files paragraph and License text.
2026-10-03 12:20:38 -05:00
Jeff Patterson da90cb8452 Served the remaining Breeze icons from ico/breeze and dropped unused icon files (#1269)
The search panel's close button and the five KDE Breeze icons that sat in
ico/breeze-icons/ now come from ico/breeze/, with 16, 22 and 32 px art.
André's three SVGs moved from ico/generated/ to ico/scalable/. Removed the
18 .svgz files and the QETIcon and QETOxygenLogo icons nothing used.
2026-10-03 12:20:38 -05:00
Andre Rummler d76f3528ae AutoNum: a lot of changes
Schemas now get saved with a UUID and do not have to be looked up according to the form. They can be renamed and it gets reflected in existing elements. The GUI for
editing them is now much easier, e.g. forms can be reshuffled. A formula can be applied. Many options now also for conductors and sheets.
2026-10-03 18:09:33 +02:00
Laurent Trinques 3bf1a7b86b Merge pull request #1273 from ispyisail/feature/wires-per-terminal-chains
Linux build and tests / Build and test (Qt 6, Debug) (push) Failing after 1m48s
Wire terminals in a chain, not a star, under a wire limit
2026-10-03 16:56:02 +02:00
Laurent Trinques 389fd454da Merge pull request #1278 from ispyisail/fix/301-dxf-picture-warning
Fix DXF export warning about pictures hidden by View > Show (#301)
2026-10-03 16:38:42 +02:00
Laurent Trinques dedd3b6d03 Merge pull request #1272 from ispyisail/feature/wires-per-terminal
Add an optional limit on wires per terminal (discussion #1158)
2026-10-03 16:35:10 +02:00
ispyisail 9e3376919c Merge branch 'feature/wires-per-terminal' into feature/wires-per-terminal-chains
# Conflicts:
#	sources/wiringrules.cpp
2026-10-04 01:43:37 +13:00
ispyisail 3150b42087 Warn with a pop-up, not a box, when a wires-per-terminal rule is turned on
Review of #1272: scorpio810 asked for a warning box for users; the inline
box added in 9a55939bb is replaced by a pop-up, as the element editor
gives for unnamed terminals. When OK in Settings > General or in Project
properties turns a rule on (a limit where there was none, or one wire
per folio report), a warning says the rules are experimental, may change
with settings to redo if wires and conductors become separate objects,
and can all be turned off in Settings > General. OK goes on. Changing a
limit that was already on, or turning rules off, shows nothing.

tst_wiringrules: when the warning is due (WiringRules::turnsRuleOn()).
Checked in the GUI from both pages, and that a plain OK shows nothing.

English for translators: "Warning"; "The wires-per-terminal rules are an
experimental feature. They count wires as QElectroTech represents them
today. They could change, and your settings need redoing, if wires and
conductors become separate objects in a future version. All these rules
can be turned off in Configure QElectroTech > General."

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015FPuYPS4T7QuEwjNu22rXD
2026-10-04 01:43:21 +13:00
ispyisail fc4e589d60 View > Show: no DXF picture warning when pictures are hidden
The DXF export warns that pictures become outlines. Pictures hidden by
View > Show are left out of the export, so they no longer trigger it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-04 01:32:03 +13:00
ispyisail 79b595d66d Merge branch 'feature/wires-per-terminal' into feature/wires-per-terminal-chains 2026-10-04 01:13:09 +13:00
ispyisail 9a55939bb4 Warn that the wires-per-terminal rules are experimental
Review of #1272 (scorpio810, after arummler's note that the rules would
need redesigning if wires and conductors become separate objects): a
warning box, with the standard warning icon, at the top of the rules in
Settings > General and in Project properties. It says the feature is
experimental, counts wires as QElectroTech models them today, and that
the rules, and the user's settings, could change if wires and conductors
are separated.

English for translators: "Experimental feature. These rules count wires
as QElectroTech represents them today; they could change, and your
settings need redoing, if wires and conductors become separate objects
in a future version."

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015FPuYPS4T7QuEwjNu22rXD
2026-10-04 01:13:09 +13:00
saschbe 7c963bf8e4 docs: document building and running the test suites 2026-10-03 14:06:05 +02:00