Commit Graph

13 Commits

Author SHA1 Message Date
ispyisail 12ecf6b28f Add read-only enforcement, preview, import/export to custom SQL reports
Refs discussion #886: a saved-report manager built on custom SQL and
nomenclature.json. Most of what was asked for already existed --
Projet > Exporter au format CSV already builds/saves/reuses named
SELECT queries via ElementQueryWidget and nomenclature.json, and
Projet > Ajouter une nomenclature already inserts one into a folio.
This fills the three real gaps.

- projectDataBase::isReadOnlySelect() rejects anything that isn't a
  single SELECT/WITH statement. Checked in newQuery() itself, the one
  choke point every query path already goes through -- including a
  query loaded from a saved nomenclature/summary table's <query>
  element on project open, not just the dialog's own custom-SQL box.
  ElementQueryWidget shows the same check live as you type, and
  BOMExportDialog surfaces it before running or exporting anything.
- BOMExportDialog gains a Preview button + table (QSqlQueryModel),
  so a report can be checked on screen before committing to a CSV file.
- ElementQueryWidget gains Importer.../Exporter... buttons that
  read/write nomenclature.json's saved reports as a JSON file, so a
  report can be handed to a colleague or another install. Import asks
  before overwriting a locally-saved report of the same name.

Verified: Qt 6.10.2, builds clean, ctest 8/8. Drove the real dialog
through Xvfb: typed "DROP TABLE element" into the custom-SQL box and
got the inline warning immediately, then confirmed Preview also
refuses it with a "Requête refusée" dialog rather than running it.
Preview against the real default query returned live column headers
and a row. Export opens a save dialog without crashing.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-17 10:09:14 +12:00
enesgursoy6110 77f8e26ffc Address smart device BOM review feedback 2026-09-11 20:12:09 +03:00
Claveau Joshua 319188e010 Export to csv improvement
Export to csv doesn't use is own datase, but the project database
instead.
2020-08-17 16:42:07 +02:00
joshua c68c1a281e CSV export : minor gui change 2019-11-11 11:17:18 +01:00
joshua f912eea8d4 CSV export : improve save/load export configuration. 2019-11-10 19:46:28 +01:00
joshua 35d6fe5935 CSV export : change menu and dialog text 2019-11-09 14:33:33 +01:00
joshua 43361942e3 CSV export : improve selection type. 2019-11-09 14:28:13 +01:00
joshua c8ab83a3ad CSV export : improve database and query 2019-11-09 11:38:30 +01:00
Laurent Trinques 13971c00ee Typo 2019-11-06 16:13:41 +01:00
Laurent Trinques 60d2c403b3 Nomenclature export : Minor change in UI 2019-11-06 16:10:24 +01:00
Laurent Trinques 9c874af52e Nomenclature export : add coil and protection query 2019-11-06 14:16:55 +01:00
joshua 97a2c8d2c9 Nomenclature export : items double click
User can double click on item to add/remove information to export.
2019-11-04 20:16:48 +01:00
joshua ff7eb4d11c Revampe nomenclature
Nomenclature is now totally revamped, user can define information to
export and the order of theme.
2019-11-03 13:27:46 +01:00