ORE Studio 0.0.4
Loading...
Searching...
No Matches
OreLogViewerWidget.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_ORE_LOG_VIEWER_WIDGET_HPP
21#define ORES_QT_ORE_LOG_VIEWER_WIDGET_HPP
22
23#include <memory>
24#include <QString>
25#include <QWidget>
26#include <QTabWidget>
27#include <QTableView>
28#include <QTextEdit>
29#include <QSplitter>
30#include <QLabel>
31#include <QSortFilterProxyModel>
32#include "ores.qt/ClientManager.hpp"
33#include "ores.qt/ClientTelemetryLogModel.hpp"
34#include "ores.logging/make_logger.hpp"
35
36namespace ores::qt {
37
46class OreLogViewerWidget : public QWidget {
47 Q_OBJECT
48
49private:
50 inline static std::string_view logger_name = "ores.qt.ore_log_viewer_widget";
51 [[nodiscard]] static auto& lg() {
52 using namespace ores::logging;
53 static auto instance = make_logger(logger_name);
54 return instance;
55 }
56
57public:
58 explicit OreLogViewerWidget(ClientManager* clientManager,
59 QWidget* parent = nullptr);
60
66 void load_result(const QString& result_id);
67
71 void clear();
72
73public slots:
74 void refresh();
75
76private slots:
77 void on_data_loaded();
78 void on_load_error(const QString& message, const QString& details);
79 void on_selection_changed(const QItemSelection& selected,
80 const QItemSelection& deselected);
81 void on_tab_changed(int index);
82
83private:
84 void setup_ui();
85 QTableView* make_table_view(QSortFilterProxyModel* proxy);
86 void update_tab_counts();
87
88 ClientManager* client_manager_;
89 QString current_result_id_;
90
91 std::unique_ptr<ClientTelemetryLogModel> model_;
92
93 // Source-filtered proxy views
94 QSortFilterProxyModel* ore_proxy_{nullptr};
95 QSortFilterProxyModel* wrap_proxy_{nullptr};
96 QSortFilterProxyModel* all_proxy_{nullptr};
97
98 QTabWidget* tabs_{nullptr};
99 QTableView* ore_view_{nullptr};
100 QTableView* wrap_view_{nullptr};
101 QTableView* all_view_{nullptr};
102
103 QSplitter* splitter_{nullptr};
104 QTextEdit* detail_pane_{nullptr};
105 QLabel* status_label_{nullptr};
106};
107
108} // namespace ores::qt
109
110#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
Displays ORE engine and wrapper logs for a single compute result.
Definition OreLogViewerWidget.hpp:46
void load_result(const QString &result_id)
Load logs for the given result id (UUID string).
Definition OreLogViewerWidget.cpp:142
void clear()
Clear all displayed log entries.
Definition OreLogViewerWidget.cpp:154