Commit Graph

10156 Commits

Author SHA1 Message Date
ispyisail 16173c2070 Merge pull request #1316 from ispyisail/perf/live-timing
Add an optional timing log for live mode
2026-10-05 22:14:50 +13:00
ispyisail 97e81f7ebf Merge pull request #1314 from ispyisail/feature/live-remember
Remember live mode's start warning and "Always" across restarts
2026-10-05 22:14:31 +13:00
ispyisail 082b55b759 Merge pull request #1315 from ispyisail/feature/assistant-house-style
Add a house style that every AI assistant reads
2026-10-05 22:02:05 +13:00
ispyisail db9ba6c1ca Merge remote-tracking branch 'upstream/master' into perf/live-timing
# Conflicts:
#	sources/scripting/liveserver.cpp
2026-10-05 21:36:17 +13:00
ispyisail 7ddf2ca14f Merge remote-tracking branch 'upstream/master' into feature/assistant-house-style
# Conflicts:
#	misc/qet-mcp/README.md
#	misc/qet-mcp/qet_mcp.py
2026-10-05 21:36:08 +13:00
ispyisail 33f7d27388 Merge remote-tracking branch 'upstream/master' into feature/live-remember
# Conflicts:
#	lang/qet_en.ts
2026-10-05 21:35:52 +13:00
ispyisail 32f7b94594 Merge pull request #1313 from ispyisail/feature/live-tools
Linux build and tests / Build and test (Qt 6, Debug) (push) Failing after 1m50s
Add printing, save/close and a layout check to live mode
2026-10-05 21:33:18 +13:00
ispyisail dccde2b8c8 Merge pull request #1312 from ispyisail/feature/live-new-project
Add live-mode commands to create, open and switch projects
2026-10-05 21:32:59 +13:00
ispyisail 9b775baf6e qet-mcp README: the live timing log
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-05 20:35:19 +13:00
ispyisail a4f12917bc qet-mcp README: the house style
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-05 20:34:57 +13:00
ispyisail 36d574179b Assistant house style: rewrite qet-assistant.json when the style changes
qet.setHouseStyle() only saved the setting, so an assistant reading
qet-assistant.json saw the old text until QElectroTech restarted.
AssistantInfo::refresh() writes the file again, but only in a
QElectroTech that writes it at all: a headless --run would otherwise
replace the open QElectroTech's live channel with its own empty one.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-05 20:34:57 +13:00
ispyisail 44dfb9d8d5 Assistant house style: a drawing-convention text every AI assistant reads
QetSettings::houseStyle()/setHouseStyle() (assistant/house_style),
qet.houseStyle()/qet.setHouseStyle() in the script API, a house_style
field in qet-assistant.json, and qet_about in the qet MCP server
showing it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-05 20:34:56 +13:00
ispyisail 193d177d95 qet-mcp README: remembered live-mode choices
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-05 20:34:44 +13:00
ispyisail 8b130497e0 qet-mcp README: print, save/close, changes, live layout check, index cache, standard symbols
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-05 20:34:26 +13:00
ispyisail 4ceeeed302 qet-mcp README: the live project tools
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-05 20:34:14 +13:00
ispyisail 76d9ab2911 Live mode: English for the print question
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-05 20:34:14 +13:00
ispyisail 0bb0ea225f Live mode print: draw at 96 dpi, as the PDF export does
At the printer's own resolution (600-1200 dpi) symbols and texts were
replayed many times too big next to the wires and grid. Seen on a test
print to PDF; the same page now matches qet_export's PDF.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-05 20:34:14 +13:00
ispyisail 0df8ca5b3c Live mode: print, save/close, changes, snapshot; house-style layout rules; saved symbol index
QElectroTech (LiveServer):
- print: folios to the default (or a named) printer with no print dialog,
  always after asking the user (paper cannot be undone); or to a new PDF
  file. Rendered as the PDF export draws a folio (no grid, no terminals).
- save_project (own file, or save as a new file, never over one) and
  close_project (only without unsaved changes: never discards work).
- changes: the undo history, each step marked assistant or user, with
  "since" to ask what changed after a point.
- snapshot: a copy of the open project as on screen, for a check to read,
  without saving it or changing its file.
- qet.elementTextGeometry(): where a symbol's text is drawn on the folio.

qet MCP server:
- qet_live_print, qet_live_save_project, qet_live_close_project,
  qet_live_changes, qet_live_layout_check (snapshot + qet_layout_check, no
  "run this script?" window); write paths never overwrite.
- Layout rules from the house style, for file and live checks alike:
  label_on_wire, four_way_junction, misaligned_branch.
- The element index is saved under ~/.cache/qet-mcp: a new server process
  loads 8839 symbols in 0.4 s instead of parsing them for 6.9 s; the
  change check is a third faster.
- qet_about lists the installation's standard symbols
  (standard-symbols.json in QElectroTech's data folder) when there are any.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-05 20:34:14 +13:00
ispyisail 85492c8f75 Live mode: English for the remembered-choice texts
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-05 20:22:38 +13:00
ispyisail 2fb48e791b Live mode: open_project never stops on the backup question
openAndAddProject() asked "Créer une copie de sauvegarde ?" even when
called non-interactively, so open_project waited for an answer from the
user in front of the window. Only live mode opens projects that way.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-05 19:15:19 +13:00
ispyisail 550dcdda71 Live mode: remember the start warning and "always" across restarts
Live mode asked at every start (the "Mode direct" warning) and forgot
"always" for scripts when QElectroTech closed, so a user who works
with an assistant every day re-enabled it every day. Both are now
opt-in and remembered: the warning has a "Ne plus demander au
démarrage" checkbox (scripting/live_skip_warning), and the ask-first
choice is saved (scripting/live_ask_first; the Assistant panel's
checkbox and "Toujours" in the script window). The status bar still
shows live mode whenever it is open. Switching live mode off in the
settings clears "don't ask again", so turning it back on warns again.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-05 19:11:47 +13:00
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
ispyisail e77a175fc9 Live mode: optional timing of each request (QET_LIVE_PERF_LOG)
A request with "timing": true gets queue, confirm and exec times in its
answer; with QET_LIVE_PERF_LOG set, QElectroTech also appends one JSON
line per request, with the time until the folio is next painted. The
qet MCP server logs its side of each live call to the same file.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-05 18:32:42 +13:00
Laurent Trinques a5cd68ced5 Merge pull request #1311 from ispyisail/feature/xref-stack-option
Add a setting for stacking cross references at the folio bottom
2026-10-05 06:34:49 +02:00
ispyisail b8eb5c90a1 Cross references at the folio bottom: stack only when texts overlap, add a checkbox (#1287 follow-up)
The stacking added in #1287 tested the crosses' bounding rects, so
crosses whose frames or empty margins touched were raised although no
text was hidden (the list display case found in review). The texts each
cross really draws are now recorded while its geometry is built, and a
cross is raised only when one of its texts would be drawn over a text of
another one.

A new "Empiler les références dont les textes se chevauchent" checkbox
in the cross reference properties, per type, turns the stacking off;
the crosses of that type are then only centred, as before #1287. It is
saved in the project (xref attribute "stackoverlapping") and in the
settings, and is on when absent.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-05 17:24:11 +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