20#ifndef ORES_QT_CHANGE_REASON_CATEGORY_DETAIL_DIALOG_HPP
21#define ORES_QT_CHANGE_REASON_CATEGORY_DETAIL_DIALOG_HPP
26#include "ores.qt/ClientManager.hpp"
27#include "ores.qt/DetailDialogBase.hpp"
28#include "ores.logging/make_logger.hpp"
29#include "ores.dq/domain/change_reason_category.hpp"
32class ChangeReasonCategoryDetailDialog;
47 inline static std::string_view logger_name =
48 "ores.qt.change_reason_category_detail_dialog";
50 [[nodiscard]]
static auto& lg() {
52 static auto instance = make_logger(logger_name);
61 void setUsername(
const std::string& username);
65 void setCreateMode(
bool createMode);
66 void setReadOnly(
bool readOnly,
int versionNumber = 0);
67 void setHistory(
const std::vector<dq::domain::change_reason_category>& history,
72 QString categoryCode()
const;
73 bool isDirty()
const {
return isDirty_; }
74 bool isReadOnly()
const {
return isReadOnly_; }
77 void isDirtyChanged(
bool dirty);
78 void categorySaved(
const QString& code);
79 void categoryDeleted(
const QString& code);
83 void onDeleteClicked();
84 void onFieldChanged();
87 void onFirstVersionClicked();
88 void onPrevVersionClicked();
89 void onNextVersionClicked();
90 void onLastVersionClicked();
93 void updateSaveButtonState();
94 void closeParentWindow();
95 void displayCurrentVersion();
96 void updateVersionNavButtonStates();
97 void showVersionNavActions(
bool visible);
100 Ui::ChangeReasonCategoryDetailDialog* ui_;
102 QAction* saveAction_;
103 QAction* deleteAction_;
104 QAction* revertAction_;
110 std::string modifiedByUsername_;
114 std::vector<dq::domain::change_reason_category> history_;
115 int currentHistoryIndex_;
116 QAction* firstVersionAction_;
117 QAction* prevVersionAction_;
118 QAction* nextVersionAction_;
119 QAction* lastVersionAction_;
Implements logging infrastructure for ORE Studio.
Definition boost_severity.hpp:28
Qt-based graphical user interface for ORE Studio.
Definition AboutDialog.hpp:35
Groups change reasons into logical categories.
Definition change_reason_category.hpp:45
Dialog widget for creating and editing change reason categories.
Definition ChangeReasonCategoryDetailDialog.hpp:43
Manages the lifecycle of the network client and IO context.
Definition ClientManager.hpp:90
Base class for all detail dialogs.
Definition DetailDialogBase.hpp:54