20#ifndef ORES_QT_FEATURE_FLAG_HISTORY_DIALOG_HPP
21#define ORES_QT_FEATURE_FLAG_HISTORY_DIALOG_HPP
30#include "ores.qt/ClientManager.hpp"
31#include "ores.variability/domain/feature_flags.hpp"
32#include "ores.logging/make_logger.hpp"
33#include "ui_FeatureFlagHistoryDialog.h"
36class FeatureFlagHistoryDialog;
48 inline static std::string_view logger_name =
49 "ores.qt.feature_flag_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
flagName()
const {
return flagName_; }
85 [[nodiscard]]
const std::vector<variability::domain::feature_flags>&
getHistory()
const {
90 void statusChanged(
const QString& message);
91 void errorOccurred(
const QString& error_message);
107 void onVersionSelected(
int index);
108 void onHistoryLoaded();
109 void onHistoryLoadError(
const QString& error);
110 void onOpenClicked();
111 void onRevertClicked();
112 void onReloadClicked();
115 void displayChangesTab(
int version_index);
116 void displayFullDetailsTab(
int version_index);
123 using DiffResult = QVector<QPair<QString, QPair<QString, QString>>>;
124 DiffResult calculateDiff(
129 void updateButtonStates();
130 int selectedVersionIndex()
const;
132 std::unique_ptr<Ui::FeatureFlagHistoryDialog> ui_;
135 std::vector<variability::domain::feature_flags> history_;
138 QAction* reloadAction_;
139 QAction* openAction_;
140 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
Manages the lifecycle of the network client and IO context.
Definition ClientManager.hpp:90
Widget for displaying feature flag version history.
Definition FeatureFlagHistoryDialog.hpp:44
void revertVersionRequested(const variability::domain::feature_flags &flag)
Emitted when user requests to revert to a selected version.
QString flagName() const
Returns the name of the feature flag.
Definition FeatureFlagHistoryDialog.hpp:80
const std::vector< variability::domain::feature_flags > & getHistory() const
Returns the loaded history vector for version navigation.
Definition FeatureFlagHistoryDialog.hpp:85
void markAsStale()
Mark the history data as stale and reload.
Definition FeatureFlagHistoryDialog.cpp:456
void openVersionRequested(const variability::domain::feature_flags &flag, int versionNumber)
Emitted when user requests to open a version in read-only mode.
Represents a feature flag in the domain layer.
Definition feature_flags.hpp:31