20#ifndef ORES_QT_ENTITY_LIST_MDI_WINDOW_HPP
21#define ORES_QT_ENTITY_LIST_MDI_WINDOW_HPP
29#include <QProgressBar>
32#include "ores.logging/make_logger.hpp"
33#include "ores.qt/AbstractClientModel.hpp"
66 inline static std::string_view logger_name =
"ores.qt.entity_list_mdi_window";
68 [[nodiscard]]
static auto& lg() {
70 static auto instance = make_logger(logger_name);
78 QSize sizeHint()
const override;
125 void closeEvent(QCloseEvent* event)
override;
142 QAbstractItemModel* sourceModel,
143 std::string_view settingsGroup,
145 const QSize& defaultSize = {900, 400},
146 int settingsVersion = 1,
147 QSplitter* splitter =
nullptr);
206 return tr(
"Data changed on server - click to reload");
210 void onPulseTimeout();
213 void startPulseAnimation();
214 void setupColumnVisibility();
215 void showHeaderContextMenu(
const QPoint& pos);
216 void restoreTableSettings();
219 QAction* refreshAction_{
nullptr};
220 QTimer* pulseTimer_{
nullptr};
221 QIcon normalReloadIcon_;
222 QIcon pulseReloadIcon_;
223 bool pulseState_{
false};
227 QProgressBar* loadingBar_{
nullptr};
230 QTableView* settingsTableView_{
nullptr};
231 QAbstractItemModel* settingsModel_{
nullptr};
232 QString settingsGroup_;
233 QVector<int> defaultHiddenColumns_;
234 QSize defaultSize_{900, 400};
235 int settingsVersion_{1};
236 QSplitter* settingsSplitter_{
nullptr};
Implements logging infrastructure for ORE Studio.
Definition boost_severity.hpp:28
Qt-based graphical user interface for ORE Studio.
Definition AboutDialog.hpp:29
QVector< int > defaultHiddenColumns(const std::array< ColumnMetadata, N > &columns)
Builds a QVector of hidden column indices from a metadata array.
Definition ColumnMetadata.hpp:98
Base class for entity list MDI windows providing stale indicator support.
Definition EntityListMdiWindow.hpp:62
QProgressBar * loadingBar()
Return the shared loading progress bar.
Definition EntityListMdiWindow.cpp:109
virtual QString staleRefreshTooltip() const
Get the stale tooltip text for the refresh action.
Definition EntityListMdiWindow.hpp:205
void clearStaleIndicator()
Clear the stale indicator.
Definition EntityListMdiWindow.cpp:69
void initializeTableSettings(QTableView *tableView, QAbstractItemModel *sourceModel, std::string_view settingsGroup, const QVector< int > &defaultHiddenColumns={}, const QSize &defaultSize={900, 400}, int settingsVersion=1, QSplitter *splitter=nullptr)
Configure table header, column visibility, and settings persistence.
Definition EntityListMdiWindow.cpp:130
virtual void doReload()=0
Subclass implementation of the reload operation.
void beginLoading()
Show the loading bar and disable the reload action.
Definition EntityListMdiWindow.cpp:120
void markAsStale()
Mark the list as stale (data changed on server).
Definition EntityListMdiWindow.cpp:58
virtual QString normalRefreshTooltip() const
Get the normal (non-stale) tooltip text for the refresh action.
Definition EntityListMdiWindow.hpp:198
QSize savedWindowSize_
Saved window size from QSettings.
Definition EntityListMdiWindow.hpp:245
virtual void saveSettings()
Save window settings (column visibility, window size, etc.).
Definition EntityListMdiWindow.cpp:165
void initializeStaleIndicator(QAction *refreshAction, const QString &iconPath)
Initialize the stale indicator support.
Definition EntityListMdiWindow.cpp:46
void reload()
Reload data from the server.
Definition EntityListMdiWindow.cpp:103
void connectModel(AbstractClientModel *model)
Wire endLoading() to the model's standard lifecycle signals.
Definition EntityListMdiWindow.cpp:227
void endLoading()
Hide the loading bar and re-enable the reload action.
Definition EntityListMdiWindow.cpp:125