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/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
56 QSize sizeHint() const override { return QSize(800, 500); }
57
58public slots:
59 void reload() override;
60
61signals:
62 void statusChanged(const QString& message);
63 void errorOccurred(const QString& message);
64 void showCatalogDetails(const dq::domain::catalog& catalog);
65 void addNewRequested();
66 void showCatalogHistory(const QString& name);
67
68private slots:
69 void onAddClicked();
70 void onEditClicked();
71 void onDeleteClicked();
72 void onHistoryClicked();
73 void onRefreshClicked();
74 void onDoubleClicked(const QModelIndex& index);
75
76protected:
77 QString normalRefreshTooltip() const override {
78 return tr("Refresh catalogs");
79 }
80
81private:
82 void setupUi();
83 void setupToolbar();
84 void setupConnections();
85 void updateActionStates();
86
87 ClientManager* clientManager_;
88 QString username_;
89 QTableView* tableView_;
90 ClientCatalogModel* model_;
91 QToolBar* toolbar_;
92 QAction* addAction_;
93 QAction* editAction_;
94 QAction* deleteAction_;
95 QAction* historyAction_;
96 QAction* refreshAction_;
97};
98
99}
100
101#endif
Implements logging infrastructure for ORE Studio.
Definition boost_severity.hpp:28
Qt-based graphical user interface for ORE Studio.
Definition AboutDialog.hpp:35
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:77
Table model for displaying catalogs in a QTableView.
Definition ClientCatalogModel.hpp:40
Manages the lifecycle of the network client and IO context.
Definition ClientManager.hpp:90
Base class for entity list MDI windows providing stale indicator support.
Definition EntityListMdiWindow.hpp:56