20#ifndef ORES_QT_LOGIN_DIALOG_HPP
21#define ORES_QT_LOGIN_DIALOG_HPP
33#include "ores.qt/ClientManager.hpp"
34#include "ores.logging/make_logger.hpp"
49 inline static std::string_view logger_name =
"ores.qt.login_dialog";
51 [[nodiscard]]
static auto& lg() {
53 static auto instance = make_logger(logger_name);
64 enum class Type { Environment, Connection };
74 QSize sizeHint()
const override;
141 void keyPressEvent(QKeyEvent* event)
override;
161 void signUpRequested();
162 void closeRequested();
187 void onLoginClicked();
188 void onSignUpClicked();
189 void onGetStartedClicked();
190 void onShowPasswordToggled(
bool checked);
192 void onQuickConnectChanged(
int idx);
196 void setupLeftPanel(QWidget* parent);
197 void setupRightPanel(QWidget* parent);
198 void setupHeader(QVBoxLayout* layout, QWidget* parent);
199 void setupAuthFields(QVBoxLayout* layout, QWidget* parent);
200 void setupServerFields(QVBoxLayout* layout, QWidget* parent);
201 void setupActions(QVBoxLayout* layout, QWidget* parent);
202 void setupFooter(QVBoxLayout* layout, QWidget* parent);
203 void enableForm(
bool enabled);
204 void lockServerFields(
bool locked);
205 void lockCredentialFields(
bool locked);
208 QLabel* loginTitleLabel_;
209 QLineEdit* usernameEdit_;
210 QLineEdit* passwordEdit_;
211 QCheckBox* showPasswordCheck_;
212 QCheckBox* rememberMeCheck_;
213 QPushButton* loginButton_;
214 QPushButton* signUpButton_;
215 QLabel* signUpLabel_;
216 QLabel* statusLabel_;
219 QLineEdit* hostEdit_;
220 QSpinBox* portSpinBox_;
221 QLineEdit* subjectPrefixEdit_;
224 QLabel* quickConnectLabel_{
nullptr};
225 QComboBox* quickConnectCombo_{
nullptr};
228 bool serverFieldsLocked_{
false};
229 bool credentialFieldsLocked_{
false};
232 ClientManager* clientManager_{
nullptr};
Implements logging infrastructure for ORE Studio.
Definition boost_severity.hpp:28
Qt-based graphical user interface for ORE Studio.
Definition AboutDialog.hpp:29
Result of a login attempt.
Definition ClientManager.hpp:70
Manages the lifecycle of the NATS client and login state.
Definition ClientManager.hpp:109
Login dialog with dark theme.
Definition LoginDialog.hpp:45
void loginSucceeded(const QString &username)
Emitted when login succeeds.
void loginFailed(const QString &errorMessage)
Emitted when login fails.
void httpBaseUrlDiscovered(const QString &baseUrl)
Emitted when the HTTP base URL is discovered via NATS service discovery during login....
void connectionSelected(const QString &connectionName)
Emitted when a full connection is selected from the quick-connect combo. MainWindow handles this by f...
QString getServer() const
Get the current server/host field value.
Definition LoginDialog.cpp:184
void environmentSelected(const QString &environmentName)
Emitted when an environment is selected from the quick-connect combo. MainWindow handles this by fill...
QString getSubjectPrefix() const
Get the current subject prefix field value.
Definition LoginDialog.cpp:192
void setClientManager(ClientManager *clientManager)
Set the client manager for performing login.
Definition LoginDialog.cpp:172
QString getPassword() const
Get the password that was entered for login.
Definition LoginDialog.cpp:180
void setSubjectPrefix(const QString &prefix)
Set the NATS subject prefix field value.
Definition LoginDialog.cpp:168
int getPort() const
Get the current port field value.
Definition LoginDialog.cpp:188
void setQuickConnectItems(const QList< QuickConnectItem > &items)
Populate the quick-connect combo with environments and connections.
Definition LoginDialog.cpp:82
void bootstrapModeDetected()
Emitted when the server is in bootstrap mode.
void setUsername(const QString &username)
Set the username field value.
Definition LoginDialog.cpp:160
void setPassword(const QString &password)
Set the password field value.
Definition LoginDialog.cpp:164
QString getUsername() const
Get the username that was used for login.
Definition LoginDialog.cpp:176
void setPort(int port)
Set the port field value.
Definition LoginDialog.cpp:156
void tenantBootstrapDetected()
Emitted when the tenant is in bootstrap mode.
void setServer(const QString &server)
Set the server/host field value.
Definition LoginDialog.cpp:152
An item for the unified quick-connect combo.
Definition LoginDialog.hpp:63