20#ifndef ORES_QT_COUNTRY_MDI_WINDOW_HPP
21#define ORES_QT_COUNTRY_MDI_WINDOW_HPP
26#include <QSortFilterProxyModel>
29#include "ores.qt/EntityListMdiWindow.hpp"
30#include "ores.qt/ClientManager.hpp"
31#include "ores.logging/make_logger.hpp"
32#include "ores.qt/ClientCountryModel.hpp"
33#include "ores.qt/PaginationWidget.hpp"
46 inline static std::string_view logger_name =
47 "ores.qt.country_mdi_window";
49 [[nodiscard]]
static auto& lg() {
51 static auto instance = make_logger(logger_name);
58 const QString& username,
59 QWidget* parent =
nullptr);
64 QSize sizeHint()
const override;
67 void statusChanged(
const QString& message);
68 void errorOccurred(
const QString& error_message);
69 void selectionChanged(
int selection_count);
70 void addNewRequested();
72 void countryDeleted(
const QString& alpha2_code);
73 void showCountryHistory(
const QString& alpha2_code);
76 void reload()
override;
79 void deleteSelected();
80 void viewHistorySelected();
85 void onLoadError(
const QString& error_message,
const QString& details = {});
86 void onRowDoubleClicked(
const QModelIndex& index);
87 void onSelectionChanged();
88 void onConnectionStateChanged();
94 void updateActionStates();
95 void setupReloadAction();
96 void setupColumnVisibility();
97 void showHeaderContextMenu(
const QPoint& pos);
99 void restoreSettings();
102 void closeEvent(QCloseEvent* event)
override;
105 QVBoxLayout* verticalLayout_;
106 QTableView* countryTableView_;
111 QAction* reloadAction_;
114 QAction* editAction_;
115 QAction* deleteAction_;
116 QAction* historyAction_;
118 std::unique_ptr<ClientCountryModel> countryModel_;
119 QSortFilterProxyModel* proxyModel_;
Implements logging infrastructure for ORE Studio.
Definition boost_severity.hpp:28
Qt-based graphical user interface for ORE Studio.
Definition AboutDialog.hpp:35
Model for displaying countries fetched from the server.
Definition ClientCountryModel.hpp:42
Manages the lifecycle of the network client and IO context.
Definition ClientManager.hpp:90
MDI window for displaying countries.
Definition CountryMdiWindow.hpp:42
QString normalRefreshTooltip() const override
Get the normal (non-stale) tooltip text for the refresh action.
Definition CountryMdiWindow.hpp:91
Base class for entity list MDI windows providing stale indicator support.
Definition EntityListMdiWindow.hpp:56
Cache for dynamically loaded images (flags, icons) from the server.
Definition ImageCache.hpp:52
Widget providing pagination controls for data tables.
Definition PaginationWidget.hpp:39
Represents a country using ISO 3166-1 standard codes.
Definition country.hpp:33