|
ORE Studio 0.0.4
|
Detail dialog for viewing and editing a trade and its linked instrument. More...
#include <TradeDetailDialog.hpp>


Signals | |
| void | tradeSaved (const QString &code) |
| void | tradeDeleted (const QString &code) |
Signals inherited from DetailDialogBase | |
| void | closeRequested () |
| Emitted when the dialog wants to close its container window. | |
| void | statusMessage (const QString &message) |
| Emitted to show a status message in the status bar. | |
| void | errorMessage (const QString &message) |
| Emitted when an error occurs that should be shown to the user. | |
Public Member Functions | |
| TradeDetailDialog (QWidget *parent=nullptr) | |
| void | setClientManager (ClientManager *clientManager) |
| void | setUsername (const std::string &username) |
| void | setImageCache (ImageCache *cache) |
| void | setTradeBundle (const trading::messaging::trade_export_item &bundle) |
| Populate the dialog with a trade bundle (trade + instrument). | |
| void | setCreateMode (bool createMode) |
| void | setReadOnly (bool readOnly) |
Public Member Functions inherited from DetailDialogBase | |
| bool | isCloseConfirmed () const |
| Returns true if the user has already confirmed closing this dialog. | |
| void | setChangeReasonCache (ChangeReasonCache *cache) |
| Inject the shared change reason cache. | |
Protected Member Functions | |
| QTabWidget * | tabWidget () const override |
| Returns the dialog's QTabWidget (named "tabWidget" in .ui). | |
| QWidget * | provenanceTab () const override |
| Returns the Provenance tab widget (named "provenanceTab" in .ui). | |
| ProvenanceWidget * | provenanceWidget () const override |
| Returns the promoted ProvenanceWidget (named "provenanceWidget" in .ui). | |
| bool | hasUnsavedChanges () const override |
| void | showEvent (QShowEvent *event) override |
Protected Member Functions inherited from DetailDialogBase | |
| void | requestClose () |
| Request closure of the container window. | |
| void | notifySaveSuccess (const QString &message) |
| Notify that a save operation completed successfully. | |
| void | setProvenanceEnabled (bool enabled) |
| Enable or disable the Provenance tab. | |
| void | populateProvenance (int version, const std::string &modified_by, const std::string &performed_by, std::chrono::system_clock::time_point recorded_at, const std::string &change_reason_code, const std::string &change_commentary) |
| Populate the embedded ProvenanceWidget with entity data. | |
| void | clearProvenance () |
| Clear all fields in the embedded ProvenanceWidget. | |
| std::optional< change_reason_selection > | promptChangeReason (ChangeReasonDialog::OperationType opType, bool isDirty, std::string_view category="system") |
| Show the change reason dialog and return the user's selection. | |
Additional Inherited Members | |
Protected Slots inherited from DetailDialogBase | |
| void | onCloseClicked () |
| Called when the Close button is clicked. | |
Static Protected Member Functions inherited from DetailDialogBase | |
| template<typename T > | |
| static std::optional< T > | nulloptIfZero (T v) |
| Return std::optional(v) when v is non-zero, std::nullopt otherwise. | |
Detail dialog for viewing and editing a trade and its linked instrument.
The dialog contains trade tabs (General, Dates) followed by instrument-family tabs that are revealed once the instrument loads asynchronously. A single Provenance tab holds two sections — Trade and Instrument — so that both audit trails are visible in one place.
Save semantics: if the instrument is dirty, it is saved first; the trade is then always saved so that any instrument change is reflected in the trade version number (downstream notification invariant).
| void setTradeBundle | ( | const trading::messaging::trade_export_item & | bundle | ) |
Populate the dialog with a trade bundle (trade + instrument).
The caller must provide the resolved instrument variant alongside the trade. When the trade has no linked instrument (create mode, or a version with no instrument reference) pass a trade_export_item whose instrument is monostate; the dialog then routes to IInstrumentForm::clear() instead of setInstrument().
|
overrideprotectedvirtual |
Returns the dialog's QTabWidget (named "tabWidget" in .ui).
Implements DetailDialogBase.
|
overrideprotectedvirtual |
Returns the Provenance tab widget (named "provenanceTab" in .ui).
Implements DetailDialogBase.
|
overrideprotectedvirtual |
Returns the promoted ProvenanceWidget (named "provenanceWidget" in .ui).
Implements DetailDialogBase.
|
overrideprotectedvirtual |
Returns true if the dialog has unsaved changes. Subclasses override.
Reimplemented from DetailDialogBase.