20#ifndef ORES_QT_INSTRUMENT_DETAIL_DIALOG_HPP
21#define ORES_QT_INSTRUMENT_DETAIL_DIALOG_HPP
23#include "ores.qt/ClientManager.hpp"
24#include "ores.qt/DetailDialogBase.hpp"
25#include "ores.logging/make_logger.hpp"
26#include "ores.trading.api/domain/instrument.hpp"
29class InstrumentDetailDialog;
45 inline static std::string_view logger_name =
46 "ores.qt.instrument_detail_dialog";
48 [[nodiscard]]
static auto& lg() {
50 static auto instance = make_logger(logger_name);
59 void setUsername(
const std::string& username);
61 void setCreateMode(
bool createMode);
62 void setReadOnly(
bool readOnly);
65 void instrumentSaved(
const QString&
id);
66 void instrumentDeleted(
const QString&
id);
70 void onDeleteClicked();
71 void onFieldChanged();
81 void setupConnections();
82 void updateUiFromInstrument();
83 void updateInstrumentFromUi();
84 void updateSaveButtonState();
87 Ui::InstrumentDetailDialog* ui_;
89 std::string username_;
91 bool createMode_{
true};
92 bool readOnly_{
false};
93 bool hasChanges_{
false};
Implements logging infrastructure for ORE Studio.
Definition boost_severity.hpp:28
Qt-based graphical user interface for ORE Studio.
Definition AboutDialog.hpp:29
Manages the lifecycle of the NATS client and login state.
Definition ClientManager.hpp:109
Base class for all detail dialogs.
Definition DetailDialogBase.hpp:74
Detail dialog for viewing and editing instrument records.
Definition InstrumentDetailDialog.hpp:41
ProvenanceWidget * provenanceWidget() const override
Returns the promoted ProvenanceWidget (named "provenanceWidget" in .ui).
Definition InstrumentDetailDialog.cpp:59
bool hasUnsavedChanges() const override
Definition InstrumentDetailDialog.hpp:77
QTabWidget * tabWidget() const override
Returns the dialog's QTabWidget (named "tabWidget" in .ui).
Definition InstrumentDetailDialog.cpp:51
QWidget * provenanceTab() const override
Returns the Provenance tab widget (named "provenanceTab" in .ui).
Definition InstrumentDetailDialog.cpp:55
Widget displaying the 6 standard record provenance fields.
Definition ProvenanceWidget.hpp:39
Parent instrument record holding economic terms for a trade.
Definition instrument.hpp:40