20#ifndef ORES_QT_ADD_ITEM_DIALOG_HPP
21#define ORES_QT_ADD_ITEM_DIALOG_HPP
33#include <boost/uuid/uuid.hpp>
34#include "ores.connections/domain/folder.hpp"
35#include "ores.connections/domain/environment.hpp"
36#include "ores.connections/domain/connection.hpp"
37#include "ores.connections/domain/tag.hpp"
38#include "ores.logging/make_logger.hpp"
39#include "ores.qt/ConnectionTypes.hpp"
42class TagSelectorWidget;
45namespace ores::connections::service {
46class connection_manager;
71 inline static std::string_view logger_name =
"ores.qt.add_item_dialog";
73 [[nodiscard]]
static auto& lg() {
75 static auto instance = make_logger(logger_name);
82 QWidget* parent =
nullptr);
86 ItemType itemType()
const {
return itemType_; }
88 void setCreateMode(
bool createMode);
89 bool isCreateMode()
const {
return isCreateMode_; }
94 void setInitialParent(
const std::optional<boost::uuids::uuid>& parentId);
103 void setInitialFolder(
const std::optional<boost::uuids::uuid>& folderId);
104 std::optional<std::string> getPassword()
const;
107 void setTags(
const std::vector<connections::domain::tag>& tags);
108 std::vector<boost::uuids::uuid> getSelectedTagIds()
const;
113 QString itemName()
const;
116 void statusMessage(
const QString& message);
117 void errorMessage(
const QString& message);
118 void folderSaved(
const boost::uuids::uuid&
id,
const QString& name);
119 void environmentSaved(
const boost::uuids::uuid&
id,
const QString& name);
120 void connectionSaved(
const boost::uuids::uuid&
id,
const QString& name);
123 void onSaveClicked();
124 void onTestClicked();
125 void onTypeChanged(
int index);
126 void onPasswordChanged();
127 void onEnvironmentComboChanged(
int index);
128 void togglePasswordVisibility();
129 void updateSaveButtonState();
134 void populateFolderCombo();
135 void populateEnvironmentCombo();
136 void updateFieldVisibility();
137 bool validateInput();
139 void saveEnvironment();
140 void saveConnection();
146 QAction* saveAction_;
147 QAction* testAction_;
150 QComboBox* typeCombo_;
153 QLineEdit* nameEdit_;
154 QComboBox* folderCombo_;
155 QTextEdit* descriptionEdit_;
158 QLabel* environmentLabel_;
159 QComboBox* environmentCombo_;
163 QLineEdit* hostEdit_;
165 QSpinBox* portSpinBox_;
166 QLabel* httpPortLabel_;
167 QSpinBox* httpPortSpinBox_;
168 QLabel* namespaceLabel_;
169 QLineEdit* namespaceEdit_;
172 QLabel* usernameLabel_;
173 QLineEdit* usernameEdit_;
174 QLabel* passwordLabel_;
175 QLineEdit* passwordEdit_;
176 QCheckBox* showPasswordCheckbox_;
177 QWidget* passwordWidget_;
184 ItemType itemType_{ItemType::Connection};
185 bool isCreateMode_{
true};
186 bool passwordChanged_{
false};
189 boost::uuids::uuid folderId_;
190 boost::uuids::uuid pureEnvironmentId_;
191 boost::uuids::uuid connectionId_;
194 std::optional<boost::uuids::uuid> linkedEnvironmentId_;
Implements logging infrastructure for ORE Studio.
Definition boost_severity.hpp:28
Qt-based graphical user interface for ORE Studio.
Definition AboutDialog.hpp:29
ItemType
Item type selector for the combined add dialog.
Definition AddItemDialog.hpp:54
std::function< QString(const QString &host, int port, const QString &username, const QString &password)> TestConnectionCallback
Callback type for testing connections.
Definition ConnectionTypes.hpp:36
Represents a saved connection with credentials.
Definition connection.hpp:40
Represents a pure server environment (host + port only, no credentials).
Definition environment.hpp:39
Represents a folder for organizing server connections hierarchically.
Definition folder.hpp:35
High-level service for managing server connections and environments.
Definition connection_manager.hpp:53
Utilities for reading environment variables.
Definition environment.hpp:31
Combined modeless dialog for creating and editing folders, environments, and connections.
Definition AddItemDialog.hpp:67
Widget for selecting and displaying tags as pill badges.
Definition TagSelectorWidget.hpp:43