ORE Studio 0.0.4
Loading...
Searching...
No Matches
ChangePasswordDialog.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_CHANGEPASSWORDDIALOG_HPP
21#define ORES_QT_CHANGEPASSWORDDIALOG_HPP
22
23#include <QLabel>
24#include <QDialog>
25#include <QLineEdit>
26#include <QPushButton>
27#include "ores.qt/ClientManager.hpp"
28
29namespace ores::qt {
30
37class ChangePasswordDialog : public QDialog {
38 Q_OBJECT
39
40private:
41 inline static std::string_view logger_name = "ores.qt.change_password_dialog";
42
43 static auto& lg() {
44 using namespace ores::logging;
45 static auto instance = make_logger(logger_name);
46 return instance;
47 }
48
49public:
55 explicit ChangePasswordDialog(ClientManager* clientManager, QWidget* parent = nullptr);
56 ~ChangePasswordDialog() override;
57
58private slots:
59 void onChangeClicked();
60 void onChangeResult(bool success, const QString& error_message);
61 void updatePasswordMatchIndicator();
62
63signals:
64 void changeCompleted(bool success, const QString& error_message);
65
66private:
67 void setupUI();
68 void enableForm(bool enabled);
69 bool validateInput();
70
71private:
72 // UI components
73 QLineEdit* new_password_edit_;
74 QLineEdit* confirm_password_edit_;
75 QPushButton* change_button_;
76 QPushButton* cancel_button_;
77 QLabel* status_label_;
78 QLabel* info_label_;
79
80 // Dependencies
81 ClientManager* clientManager_;
82};
83
84}
85
86#endif
Implements logging infrastructure for ORE Studio.
Definition boost_severity.hpp:28
Qt-based graphical user interface for ORE Studio.
Definition AboutDialog.hpp:35
Dialog for changing user password after forced password reset.
Definition ChangePasswordDialog.hpp:37
Manages the lifecycle of the network client and IO context.
Definition ClientManager.hpp:90