Use entity display name (not key) in detail/history window titles
Table of Contents
This page is a capture in the next bucket of the product backlog — a pre-sprint idea, not yet pulled into a sprint as a story.
What
Detail and history MDI window titles currently use the entity's primary key:
CountryDetailDialog shows "Country: AL" and the history window shows
"Country History: AL". For entities with a separate human-readable field this
is unfriendly — "Country: Albania" / "Country History: Albania" reads far
better.
Generalise via a Qt variability point rather than hardcoding name (many
entities have no name field — some are code-only, some use description):
- Add an optional
:title_field:Qt property on the entity model naming the field to show in window titles; default to the primary key when unset (so code-only entities keep working). ores.cpp.qt.controller_impl.org: in the detail-window title (~line 282) readtitle_fieldoff the in-scope domain object instead of the key.- History is trickier:
showHistoryWindowhas two overloads, and the oneonShowHistorycalls only receives the key string, not the domain object. Thread the display value through (pass the title text, or pass the whole object) so the history title can usetitle_fieldtoo. - Set
:title_field: nameonores.refdata.country.org(and currency, etc.).
Lands for every entity at once via the template; per-entity cost is one property.
Why
Window titles keyed on opaque codes (AL, AWG) make it hard to tell windows apart, especially with several open. A display name matches how users think about the record. Requested while testing the country UI.
References
projects/ores.codegen/library/templates/ores.cpp.qt.controller_impl.org— detail title (~282),showHistoryWindowoverloads (~304/326), history title (~366).projects/ores.refdata/modeling/ores.refdata.country.org— Qt section.