ORE Studio 0.0.4
Loading...
Searching...
No Matches
ConnectionDetailPanel.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_CONNECTION_DETAIL_PANEL_HPP
21#define ORES_QT_CONNECTION_DETAIL_PANEL_HPP
22
23#include <QWidget>
24#include <QStackedWidget>
25#include <QLabel>
26#include <QVBoxLayout>
27#include <QFormLayout>
28#include <boost/uuid/uuid.hpp>
29#include "ores.connections/domain/folder.hpp"
30#include "ores.connections/domain/server_environment.hpp"
31#include "ores.logging/make_logger.hpp"
32
33namespace ores::connections::service {
34class connection_manager;
35}
36
37namespace ores::qt {
38
47class ConnectionDetailPanel : public QWidget {
48 Q_OBJECT
49
50private:
51 inline static std::string_view logger_name =
52 "ores.qt.connection_detail_panel";
53
54 [[nodiscard]] static auto& lg() {
55 using namespace ores::logging;
56 static auto instance = make_logger(logger_name);
57 return instance;
58 }
59
60public:
61 explicit ConnectionDetailPanel(
63 QWidget* parent = nullptr);
64 ~ConnectionDetailPanel() override;
65
66 void showEmptyState();
67 void showFolder(const connections::domain::folder& folder, int itemCount);
68 void showEnvironment(const connections::domain::server_environment& env);
69
70private:
71 void setupEmptyPage();
72 void setupFolderPage();
73 void setupEnvironmentPage();
74 void updateTagBadges(const boost::uuids::uuid& envId);
75
77
78 QStackedWidget* stackedWidget_;
79
80 // Empty state page
81 QWidget* emptyPage_;
82
83 // Folder page
84 QWidget* folderPage_;
85 QLabel* folderNameLabel_;
86 QLabel* folderItemCountLabel_;
87 QLabel* folderDescriptionLabel_;
88
89 // Environment page
90 QWidget* environmentPage_;
91 QLabel* envNameLabel_;
92 QLabel* envHostLabel_;
93 QLabel* envPortLabel_;
94 QLabel* envUsernameLabel_;
95 QLabel* envDescriptionLabel_;
96 QWidget* envTagsContainer_;
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 folder for organizing server connections hierarchically.
Definition folder.hpp:35
Represents a server connection/environment configuration.
Definition server_environment.hpp:39
High-level service for managing server connections.
Definition connection_manager.hpp:48
Utilities for reading environment variables.
Definition environment.hpp:31
Detail panel showing read-only information about selected item.
Definition ConnectionDetailPanel.hpp:47