20#ifndef ORES_QT_CLIENT_CHANGE_REASON_MODEL_HPP
21#define ORES_QT_CLIENT_CHANGE_REASON_MODEL_HPP
24#include <QFutureWatcher>
25#include <QAbstractTableModel>
26#include "ores.qt/AbstractClientModel.hpp"
27#include "ores.qt/ClientManager.hpp"
28#include "ores.qt/RecencyPulseManager.hpp"
29#include "ores.qt/RecencyTracker.hpp"
30#include "ores.logging/make_logger.hpp"
31#include "ores.dq.api/domain/change_reason.hpp"
45 inline static std::string_view logger_name =
46 "ores.qt.client_change_reason_model";
48 [[nodiscard]]
static auto& lg() {
50 static auto instance = make_logger(logger_name);
72 QObject* parent =
nullptr);
76 int rowCount(
const QModelIndex& parent = QModelIndex())
const override;
77 int columnCount(
const QModelIndex& parent = QModelIndex())
const override;
78 QVariant data(
const QModelIndex& index,
int role = Qt::DisplayRole)
const override;
79 QVariant headerData(
int section, Qt::Orientation orientation,
80 int role = Qt::DisplayRole)
const override;
105 void onReasonsLoaded();
106 void onPulseStateChanged(
bool isOn);
107 void onPulsingComplete();
110 QVariant recency_foreground_color(
const std::string& code)
const;
114 std::vector<dq::domain::change_reason> reasons;
115 QString error_message;
116 QString error_details;
119 ClientManager* clientManager_;
120 std::vector<dq::domain::change_reason> reasons_;
121 QFutureWatcher<FetchResult>* watcher_;
122 bool is_fetching_{
false};
126 RecencyTracker<dq::domain::change_reason, ChangeReasonKeyExtractor> recencyTracker_;
127 RecencyPulseManager* pulseManager_;
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
Base class for all client-side entity models.
Definition AbstractClientModel.hpp:36
Model for displaying change reasons fetched from the server.
Definition ClientChangeReasonModel.hpp:41
const dq::domain::change_reason * getReason(int row) const
Get reason at the specified row.
Definition ClientChangeReasonModel.cpp:211
void refresh()
Refresh reason data from server asynchronously.
Definition ClientChangeReasonModel.cpp:140
Column
Enumeration of table columns for type-safe column access.
Definition ClientChangeReasonModel.hpp:58
Manages the lifecycle of the NATS client and login state.
Definition ClientManager.hpp:109