20#ifndef ORES_QT_CHANGE_REASON_HISTORY_DIALOG_HPP
21#define ORES_QT_CHANGE_REASON_HISTORY_DIALOG_HPP
30#include "ores.qt/ClientManager.hpp"
31#include "ores.dq/domain/change_reason.hpp"
32#include "ores.logging/make_logger.hpp"
33#include "ui_ChangeReasonHistoryDialog.h"
36class ChangeReasonHistoryDialog;
48 inline static std::string_view logger_name =
49 "ores.qt.change_reason_history_dialog";
51 [[nodiscard]]
static auto& lg() {
53 static auto instance = make_logger(logger_name);
57 const QIcon& getHistoryIcon()
const;
62 QWidget* parent =
nullptr);
67 QSize sizeHint()
const override;
80 [[nodiscard]] QString
code()
const {
return code_; }
83 void statusChanged(
const QString& message);
84 void errorOccurred(
const QString& error_message);
101 void onVersionSelected(
int index);
102 void onHistoryLoaded();
103 void onHistoryLoadError(
const QString& error);
104 void onOpenClicked();
105 void onRevertClicked();
106 void onReloadClicked();
109 void displayChangesTab(
int version_index);
110 void displayFullDetailsTab(
int version_index);
117 using DiffResult = QVector<QPair<QString, QPair<QString, QString>>>;
118 DiffResult calculateDiff(
123 void updateButtonStates();
124 int selectedVersionIndex()
const;
126 std::unique_ptr<Ui::ChangeReasonHistoryDialog> ui_;
129 std::vector<dq::domain::change_reason> versions_;
132 QAction* reloadAction_;
133 QAction* openAction_;
134 QAction* revertAction_;
Implements logging infrastructure for ORE Studio.
Definition boost_severity.hpp:28
Qt-based graphical user interface for ORE Studio.
Definition AboutDialog.hpp:35
Defines a specific reason for record changes.
Definition change_reason.hpp:47
Widget for displaying change reason version history.
Definition ChangeReasonHistoryDialog.hpp:44
void revertVersionRequested(const dq::domain::change_reason &reason)
Emitted when user requests to revert to a selected version.
void markAsStale()
Mark the history data as stale and reload.
Definition ChangeReasonHistoryDialog.cpp:478
QString code() const
Returns the code of the change reason.
Definition ChangeReasonHistoryDialog.hpp:80
void openVersionRequested(const dq::domain::change_reason &reason, int versionNumber)
Emitted when user requests to open a version in read-only mode.
Manages the lifecycle of the network client and IO context.
Definition ClientManager.hpp:90