ORE Studio 0.0.4
Loading...
Searching...
No Matches
DatasetMdiWindow.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_DATASET_MDI_WINDOW_HPP
21#define ORES_QT_DATASET_MDI_WINDOW_HPP
22
23#include <QTableView>
24#include <QToolBar>
25#include <QSortFilterProxyModel>
26#include <boost/uuid/uuid.hpp>
27#include "ores.qt/EntityListMdiWindow.hpp"
28#include "ores.qt/ClientManager.hpp"
29#include "ores.qt/ClientDatasetModel.hpp"
30#include "ores.logging/make_logger.hpp"
31#include "ores.dq/domain/dataset.hpp"
32
33namespace ores::qt {
34
35class DatasetMdiWindow final : public EntityListMdiWindow {
36 Q_OBJECT
37
38private:
39 inline static std::string_view logger_name =
40 "ores.qt.dataset_mdi_window";
41
42 [[nodiscard]] static auto& lg() {
43 using namespace ores::logging;
44 static auto instance = make_logger(logger_name);
45 return instance;
46 }
47
48public:
49 explicit DatasetMdiWindow(ClientManager* clientManager,
50 const QString& username,
51 QWidget* parent = nullptr);
52 ~DatasetMdiWindow() override = default;
53
54 QSize sizeHint() const override { return QSize(1200, 600); }
55
56public slots:
57 void reload() override;
58
59signals:
60 void statusChanged(const QString& message);
61 void errorOccurred(const QString& error_message);
62 void showDatasetDetails(const dq::domain::dataset& dataset);
63 void showDatasetHistory(const boost::uuids::uuid& id);
64 void addNewRequested();
65
66private slots:
67 void onDataLoaded();
68 void onLoadError(const QString& error_message, const QString& details = {});
69 void onRowDoubleClicked(const QModelIndex& index);
70 void onAddClicked();
71 void onEditClicked();
72 void onDeleteClicked();
73 void onRefreshClicked();
74 void onSelectionChanged();
75 void onHistoryClicked();
76
77protected:
78 QString normalRefreshTooltip() const override {
79 return tr("Refresh datasets");
80 }
81
82private:
83 void setupUi();
84 void setupToolbar();
85 void setupConnections();
86 void updateActionStates();
87 void saveColumnVisibility();
88 void loadColumnVisibility();
89
90 ClientManager* clientManager_;
91 QString username_;
92 ClientDatasetModel* model_;
93 QSortFilterProxyModel* proxyModel_;
94 QTableView* tableView_;
95 QToolBar* toolbar_;
96
97 QAction* addAction_;
98 QAction* editAction_;
99 QAction* deleteAction_;
100 QAction* refreshAction_;
101 QAction* historyAction_;
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:35
Represents a data quality dataset with lineage tracking.
Definition dataset.hpp:36