ORE Studio 0.0.4
Loading...
Searching...
No Matches
QueueMonitorMdiWindow.hpp
1/* -*- mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
2 *
3 * Copyright (C) 2026 Marco Craveiro <marco.craveiro@gmail.com>
4 *
5 * This program is free software; you can redistribute it and/or modify it under
6 * the terms of the GNU General Public License as published by the Free Software
7 * Foundation; either version 3 of the License, or (at your option) any later
8 * version.
9 *
10 * This program is distributed in the hope that it will be useful, but WITHOUT
11 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
12 * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
13 * details.
14 *
15 * You should have received a copy of the GNU General Public License along with
16 * this program; if not, write to the Free Software Foundation, Inc., 51
17 * Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18 *
19 */
20#ifndef ORES_QT_QUEUE_MONITOR_MDI_WINDOW_HPP
21#define ORES_QT_QUEUE_MONITOR_MDI_WINDOW_HPP
22
23#include <QToolBar>
24#include <QTableView>
25#include <QSortFilterProxyModel>
26#include "ores.qt/EntityListMdiWindow.hpp"
27#include "ores.qt/ClientManager.hpp"
28#include "ores.qt/ClientQueueModel.hpp"
29#include "ores.logging/make_logger.hpp"
30
31namespace ores::qt {
32
41 Q_OBJECT
42
43private:
44 inline static std::string_view logger_name =
45 "ores.qt.queue_monitor_mdi_window";
46
47 [[nodiscard]] static auto& lg() {
48 using namespace ores::logging;
49 static auto instance = make_logger(logger_name);
50 return instance;
51 }
52
53public:
54 explicit QueueMonitorMdiWindow(ClientManager* clientManager,
55 QWidget* parent = nullptr);
56 ~QueueMonitorMdiWindow() override = default;
57
58public slots:
59 void doReload() override;
60
61signals:
62 void statusChanged(const QString& message);
63 void errorOccurred(const QString& error_message);
64 void viewChartRequested(const QString& queueId, const QString& queueName);
65 void openDetailsRequested(const QString& queueId, const QString& queueName);
66 void createQueueRequested();
67 void deleteQueueRequested(const QString& queueName);
68 void purgeQueueRequested(const QString& queueName);
69
70protected:
71 QString normalRefreshTooltip() const override {
72 return tr("Refresh queue metrics");
73 }
74
75private slots:
76 void onDataLoaded();
77 void onLoadError(const QString& error_message, const QString& details = {});
78 void onSelectionChanged();
79 void onRowDoubleClicked(const QModelIndex& index);
80 void onViewChart();
81 void onCreateQueue();
82 void onDeleteQueue();
83 void onPurgeQueue();
84
85private:
86 void setupUi();
87 void setupToolbar();
88 void setupTable();
89 void setupConnections();
90 void updateActionStates();
91
92 ClientManager* clientManager_;
93 QToolBar* toolbar_;
94 QTableView* tableView_;
95 ClientQueueModel* model_;
96 QSortFilterProxyModel* proxyModel_;
97 QAction* reloadAction_;
98 QAction* chartAction_;
99 QAction* createAction_;
100 QAction* deleteQueueAction_;
101 QAction* purgeAction_;
102};
103
104}
105
106#endif
Implements logging infrastructure for ORE Studio.
Definition boost_severity.hpp:28
Qt-based graphical user interface for ORE Studio.
Definition AboutDialog.hpp:29
Manages the lifecycle of the NATS client and login state.
Definition ClientManager.hpp:109
Base class for entity list MDI windows providing stale indicator support.
Definition EntityListMdiWindow.hpp:62
MDI window for monitoring and managing message queues.
Definition QueueMonitorMdiWindow.hpp:40
QString normalRefreshTooltip() const override
Get the normal (non-stale) tooltip text for the refresh action.
Definition QueueMonitorMdiWindow.hpp:71