20#ifndef ORES_QT_CURRENCY_MDI_WINDOW_HPP
21#define ORES_QT_CURRENCY_MDI_WINDOW_HPP
29#include <QSortFilterProxyModel>
31#include "ores.qt/ClientManager.hpp"
32#include "ores.utility/log/make_logger.hpp"
33#include "ores.qt/ClientCurrencyModel.hpp"
34#include "ores.qt/PaginationWidget.hpp"
45 inline static std::string_view logger_name =
46 "ores.qt.currency_mdi_window";
48 [[nodiscard]]
static auto& lg() {
50 static auto instance = make_logger(logger_name);
56 const QString& username,
57 QWidget* parent =
nullptr);
62 QSize sizeHint()
const override;
65 void statusChanged(
const QString& message);
66 void errorOccurred(
const QString& error_message);
67 void selectionChanged(
int selection_count);
68 void addNewRequested();
70 void currencyDeleted(
const QString& iso_code);
71 void showCurrencyHistory(
const QString& iso_code);
77 void deleteSelected();
78 void viewHistorySelected();
101 void onLoadError(
const QString& error_message);
102 void onRowDoubleClicked(
const QModelIndex& index);
103 void onSelectionChanged();
104 void onConnectionStateChanged();
107 void updateActionStates();
108 void setupReloadAction();
109 void startPulseAnimation();
110 void stopPulseAnimation();
113 QVBoxLayout* verticalLayout_;
114 QTableView* currencyTableView_;
119 QAction* reloadAction_;
120 QIcon normalReloadIcon_;
121 QIcon staleReloadIcon_;
123 bool pulseState_{
false};
127 QAction* editAction_;
128 QAction* deleteAction_;
129 QAction* historyAction_;
131 std::unique_ptr<ClientCurrencyModel> currencyModel_;
132 QSortFilterProxyModel* proxyModel_;
135 bool isStale_{
false};
Qt-based graphical user interface for ORE Studio.
Definition AboutDialog.hpp:35
Implements logging for ORE Studio.
Definition lifecycle_manager.hpp:30
Model for displaying currencies fetched from the server via client.
Definition ClientCurrencyModel.hpp:41
Manages the lifecycle of the network client and IO context.
Definition ClientManager.hpp:56
MDI window for displaying currencies.
Definition CurrencyMdiWindow.hpp:41
void clearStaleIndicator()
Clear the stale indicator.
Definition CurrencyMdiWindow.cpp:813
void markAsStale()
Mark the data as stale (changed on server).
Definition CurrencyMdiWindow.cpp:804
Widget providing pagination controls for data tables.
Definition PaginationWidget.hpp:38
Represents a currency with its metadata and formatting rules.
Definition currency.hpp:30