20#ifndef ORES_QT_ACCOUNT_HISTORY_DIALOG_HPP
21#define ORES_QT_ACCOUNT_HISTORY_DIALOG_HPP
30#include "ores.qt/ClientManager.hpp"
31#include "ores.iam/domain/account_version.hpp"
32#include "ores.iam/domain/account_version_history.hpp"
33#include "ores.logging/make_logger.hpp"
34#include "ui_AccountHistoryDialog.h"
37class AccountHistoryDialog;
49 inline static std::string_view logger_name =
50 "ores.qt.account_history_dialog";
52 [[nodiscard]]
static auto& lg() {
54 static auto instance = make_logger(logger_name);
58 const QIcon& getHistoryIcon()
const;
63 QWidget* parent =
nullptr);
68 QSize sizeHint()
const override;
81 [[nodiscard]] QString
username()
const {
return username_; }
84 void statusChanged(
const QString& message);
85 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::AccountHistoryDialog> ui_;
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
Represents an account for an entity in the system.
Definition account.hpp:32
Represents a specific version of an account with metadata.
Definition account_version.hpp:32
Contains the full version history for an account.
Definition account_version_history.hpp:32
Widget for displaying account version history.
Definition AccountHistoryDialog.hpp:45
QString username() const
Returns the username of the account.
Definition AccountHistoryDialog.hpp:81
void openVersionRequested(const iam::domain::account &account, int versionNumber)
Emitted when user requests to open a version in read-only mode.
void markAsStale()
Mark the history data as stale and reload.
Definition AccountHistoryDialog.cpp:455
void revertVersionRequested(const iam::domain::account &account)
Emitted when user requests to revert to a selected version.
Manages the lifecycle of the network client and IO context.
Definition ClientManager.hpp:90