20#ifndef ORES_QT_CHANGE_REASON_DETAIL_DIALOG_HPP
21#define ORES_QT_CHANGE_REASON_DETAIL_DIALOG_HPP
27#include "ores.qt/ClientManager.hpp"
28#include "ores.qt/DetailDialogBase.hpp"
29#include "ores.qt/ProvenanceWidget.hpp"
30#include "ores.logging/make_logger.hpp"
31#include "ores.dq.api/domain/change_reason.hpp"
32#include "ores.dq.api/domain/change_reason_category.hpp"
35class ChangeReasonDetailDialog;
50 inline static std::string_view logger_name =
51 "ores.qt.change_reason_detail_dialog";
53 [[nodiscard]]
static auto& lg() {
55 static auto instance = make_logger(logger_name);
64 void setUsername(
const std::string& username);
68 void setCreateMode(
bool createMode);
69 void setReadOnly(
bool readOnly,
int versionNumber = 0);
70 void setHistory(
const std::vector<dq::domain::change_reason>& history,
75 void setCategories(
const std::vector<dq::domain::change_reason_category>& categories);
77 QString changeReasonCode()
const;
78 bool isDirty()
const {
return isDirty_; }
79 bool isReadOnly()
const {
return isReadOnly_; }
82 void isDirtyChanged(
bool dirty);
83 void changeReasonSaved(
const QString& code);
84 void changeReasonDeleted(
const QString& code);
94 void onDeleteClicked();
95 void onFieldChanged();
98 void onFirstVersionClicked();
99 void onPrevVersionClicked();
100 void onNextVersionClicked();
101 void onLastVersionClicked();
104 void updateSaveButtonState();
105 void closeParentWindow();
106 void displayCurrentVersion();
107 void updateVersionNavButtonStates();
108 void showVersionNavActions(
bool visible);
109 void populateCategoryComboBox();
112 Ui::ChangeReasonDetailDialog* ui_;
114 QAction* revertAction_;
117 std::vector<dq::domain::change_reason_category> categories_;
121 std::string modifiedByUsername_;
125 std::vector<dq::domain::change_reason> history_;
126 int currentHistoryIndex_;
127 QAction* firstVersionAction_;
128 QAction* prevVersionAction_;
129 QAction* nextVersionAction_;
130 QAction* lastVersionAction_;
Implements logging infrastructure for ORE Studio.
Definition boost_severity.hpp:28
Qt-based graphical user interface for ORE Studio.
Definition AboutDialog.hpp:29
Defines a specific reason for record changes.
Definition change_reason.hpp:48
Dialog widget for creating and editing change reasons.
Definition ChangeReasonDetailDialog.hpp:46
ProvenanceWidget * provenanceWidget() const override
Returns the promoted ProvenanceWidget (named "provenanceWidget" in .ui).
Definition ChangeReasonDetailDialog.cpp:153
bool hasUnsavedChanges() const override
Definition ChangeReasonDetailDialog.hpp:90
QTabWidget * tabWidget() const override
Returns the dialog's QTabWidget (named "tabWidget" in .ui).
Definition ChangeReasonDetailDialog.cpp:151
QWidget * provenanceTab() const override
Returns the Provenance tab widget (named "provenanceTab" in .ui).
Definition ChangeReasonDetailDialog.cpp:152
Manages the lifecycle of the NATS client and login state.
Definition ClientManager.hpp:109
Base class for all detail dialogs.
Definition DetailDialogBase.hpp:74
Widget displaying the 6 standard record provenance fields.
Definition ProvenanceWidget.hpp:39