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::utility::log;
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
62signals:
63 void changeCompleted(bool success, const QString& error_message);
64
65private:
66 void setupUI();
67 void enableForm(bool enabled);
68 bool validateInput();
69
70private:
71 // UI components
72 QLineEdit* new_password_edit_;
73 QLineEdit* confirm_password_edit_;
74 QPushButton* change_button_;
75 QPushButton* cancel_button_;
76 QLabel* status_label_;
77 QLabel* info_label_;
78
79 // Dependencies
80 ClientManager* clientManager_;
81};
82
83}
84
85#endif
Qt-based graphical user interface for ORE Studio.
Definition AboutDialog.hpp:35
Implements logging for ORE Studio.
Definition lifecycle_manager.hpp:30
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:56