ORE Studio 0.0.4
Loading...
Searching...
No Matches
CatalogMdiWindow.hpp
1/* -*- mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
2 *
3 * Copyright (C) 2025 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_CATALOG_MDI_WINDOW_HPP
21#define ORES_QT_CATALOG_MDI_WINDOW_HPP
22
23#include <QTableView>
24#include <QToolBar>
25#include "ores.qt/EntityListMdiWindow.hpp"
26#include "ores.qt/ClientCatalogModel.hpp"
27#include "ores.qt/ClientManager.hpp"
28#include "ores.dq.api/domain/catalog.hpp"
29#include "ores.logging/make_logger.hpp"
30
31namespace ores::qt {
32
40 Q_OBJECT
41
42private:
43 inline static std::string_view logger_name = "ores.qt.catalog_mdi_window";
44
45 [[nodiscard]] static auto& lg() {
46 using namespace ores::logging;
47 static auto instance = make_logger(logger_name);
48 return instance;
49 }
50
51public:
52 explicit CatalogMdiWindow(ClientManager* clientManager,
53 const QString& username,
54 QWidget* parent = nullptr);
55
56public slots:
57 void doReload() override;
58
59signals:
60 void statusChanged(const QString& message);
61 void errorOccurred(const QString& message);
62 void showCatalogDetails(const dq::domain::catalog& catalog);
63 void addNewRequested();
64 void showCatalogHistory(const QString& name);
65
66private slots:
67 void onAddClicked();
68 void onEditClicked();
69 void onDeleteClicked();
70 void onHistoryClicked();
71 void onRefreshClicked();
72 void onDoubleClicked(const QModelIndex& index);
73
74protected:
75 QString normalRefreshTooltip() const override {
76 return tr("Refresh catalogs");
77 }
78
79private:
80 void setupUi();
81 void setupToolbar();
82 void setupConnections();
83 void updateActionStates();
84
85 ClientManager* clientManager_;
86 QString username_;
87 QTableView* tableView_;
88 ClientCatalogModel* model_;
89 QToolBar* toolbar_;
90 QAction* addAction_;
91 QAction* editAction_;
92 QAction* deleteAction_;
93 QAction* historyAction_;
94 QAction* refreshAction_;
95};
96
97}
98
99#endif
Implements logging infrastructure for ORE Studio.
Definition boost_severity.hpp:28
Qt-based graphical user interface for ORE Studio.
Definition AboutDialog.hpp:29
Represents a logical grouping of related datasets.
Definition catalog.hpp:39
MDI window for displaying and managing catalogs.
Definition CatalogMdiWindow.hpp:39
QString normalRefreshTooltip() const override
Get the normal (non-stale) tooltip text for the refresh action.
Definition CatalogMdiWindow.hpp:75
Table model for displaying catalogs in a QTableView.
Definition ClientCatalogModel.hpp:42
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