ORE Studio 0.0.4
Loading...
Searching...
No Matches
AppProvisionerWizard.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_APP_PROVISIONER_WIZARD_HPP
21#define ORES_QT_APP_PROVISIONER_WIZARD_HPP
22
23#include <boost/uuid/uuid.hpp>
24#include <QWizard>
25#include "ores.qt/ClientManager.hpp"
26#include "ores.qt/ChangeReasonCache.hpp"
27#include "ores.logging/make_logger.hpp"
28
29namespace ores::qt {
30
31// Forward declarations — pages are defined in the .cpp.
32class AppIdentityPage;
33class VersionDetailsPage;
34class PlatformsPage;
35class PackageUploadPage;
36class AuditPage;
37class AppProvisionerReviewPage;
38
52class AppProvisionerWizard : public QWizard {
53 Q_OBJECT
54
55private:
56 inline static std::string_view logger_name =
57 "ores.qt.app_provisioner_wizard";
58
59 [[nodiscard]] static auto& lg() {
60 using namespace ores::logging;
61 static auto instance = make_logger(logger_name);
62 return instance;
63 }
64
65public:
66 enum Page {
67 kAppIdentityPage = 0,
68 kVersionDetailsPage = 1,
69 kPlatformsPage = 2,
70 kPackageUploadPage = 3,
71 kAuditPage = 4,
72 kReviewPage = 5,
73 };
74
75 explicit AppProvisionerWizard(ClientManager* clientManager,
76 ChangeReasonCache* changeReasonCache,
77 const std::string& httpBaseUrl,
78 QWidget* parent = nullptr);
79
85 bool submit();
86
87signals:
88 void provisioned();
89
90private:
91 friend class AppProvisionerReviewPage; // needs access to page pointers in initializePage()
92
93 ClientManager* client_manager_;
94 ChangeReasonCache* change_reason_cache_;
95 std::string http_base_url_;
96
97 // Pre-generated UUIDs so PackageUploadPage knows the version ID before
98 // the version record is saved.
99 boost::uuids::uuid app_id_;
100 boost::uuids::uuid app_version_id_;
101
102 // Non-owning pointers — pages are owned by QWizard.
103 AppIdentityPage* app_identity_page_;
104 VersionDetailsPage* version_details_page_;
105 PlatformsPage* platforms_page_;
106 PackageUploadPage* package_upload_page_;
107 AuditPage* audit_page_;
108 AppProvisionerReviewPage* app_provisioner_review_page_;
109};
110
111} // namespace ores::qt
112
113#endif
Implements logging infrastructure for ORE Studio.
Definition boost_severity.hpp:28
Qt-based graphical user interface for ORE Studio.
Definition AboutDialog.hpp:29
Step-by-step wizard for provisioning a new compute application.
Definition AppProvisionerWizard.hpp:52
bool submit()
Called by AppProvisionerReviewPage::validatePage() to perform the server requests....
Definition AppProvisionerWizard.cpp:638
Shared cache for change reasons used across all entity dialogs.
Definition ChangeReasonCache.hpp:47
Manages the lifecycle of the NATS client and login state.
Definition ClientManager.hpp:109