20#ifndef ORES_QT_CHANGE_REASON_CATEGORY_DETAIL_DIALOG_HPP
21#define ORES_QT_CHANGE_REASON_CATEGORY_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_category.hpp"
34class ChangeReasonCategoryDetailDialog;
49 inline static std::string_view logger_name =
50 "ores.qt.change_reason_category_detail_dialog";
52 [[nodiscard]]
static auto& lg() {
54 static auto instance = make_logger(logger_name);
63 void setUsername(
const std::string& username);
67 void setCreateMode(
bool createMode);
68 void setReadOnly(
bool readOnly,
int versionNumber = 0);
69 void setHistory(
const std::vector<dq::domain::change_reason_category>& history,
74 QString categoryCode()
const;
75 bool isDirty()
const {
return isDirty_; }
76 bool isReadOnly()
const {
return isReadOnly_; }
79 void isDirtyChanged(
bool dirty);
80 void categorySaved(
const QString& code);
81 void categoryDeleted(
const QString& code);
91 void onDeleteClicked();
92 void onFieldChanged();
95 void onFirstVersionClicked();
96 void onPrevVersionClicked();
97 void onNextVersionClicked();
98 void onLastVersionClicked();
101 void updateSaveButtonState();
102 void closeParentWindow();
103 void displayCurrentVersion();
104 void updateVersionNavButtonStates();
105 void showVersionNavActions(
bool visible);
108 Ui::ChangeReasonCategoryDetailDialog* ui_;
110 QAction* revertAction_;
116 std::string modifiedByUsername_;
120 std::vector<dq::domain::change_reason_category> history_;
121 int currentHistoryIndex_;
122 QAction* firstVersionAction_;
123 QAction* prevVersionAction_;
124 QAction* nextVersionAction_;
125 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
Groups change reasons into logical categories.
Definition change_reason_category.hpp:46
Dialog widget for creating and editing change reason categories.
Definition ChangeReasonCategoryDetailDialog.hpp:45
ProvenanceWidget * provenanceWidget() const override
Returns the promoted ProvenanceWidget (named "provenanceWidget" in .ui).
Definition ChangeReasonCategoryDetailDialog.cpp:142
bool hasUnsavedChanges() const override
Definition ChangeReasonCategoryDetailDialog.hpp:87
QTabWidget * tabWidget() const override
Returns the dialog's QTabWidget (named "tabWidget" in .ui).
Definition ChangeReasonCategoryDetailDialog.cpp:140
QWidget * provenanceTab() const override
Returns the Provenance tab widget (named "provenanceTab" in .ui).
Definition ChangeReasonCategoryDetailDialog.cpp:141
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