-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathretrievepassword.h
64 lines (53 loc) · 1.96 KB
/
retrievepassword.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#ifndef RETRIEVEPASSWORD_H
#define RETRIEVEPASSWORD_H
#include <QDialog>
#include <QString>
#include <QPointer>
// ====================
// Forward Declarations
// ====================
namespace Ui {
class retrievePassword;
}
class editPasswordData;
// ====================
// retrievePassword Class
// ====================
class retrievePassword : public QDialog
{
Q_OBJECT
// ====================
// Public Methods
// ====================
public:
explicit retrievePassword(QWidget *parent = nullptr); // Constructor
~retrievePassword(); // Destructor
// ====================
// Signal Declarations
// ====================
signals:
void emitBackClicked(); // Signal emitted when the back button is clicked
// ====================
// Private Slots
// ====================
private slots:
void loadPasswords(); // Load and decrypt saved passwords
void deletePassword(const QString &passId, int row); // Delete a password entry
void on_backButton_clicked(); // Handle back button click
// New slot to handle data overwrite
void handleOverwriteData(const QString &passId, const QString &dateStored, const QString &password, const QString &username, const QString &thoughts);
// ====================
// Private Methods
// ====================
private:
void updatePasswordEntry(const QString &oldPassId, const QString &newPassId, const QString &password, const QString &user, const QString &thoughts); // Update password entry
void saveUpdatedDataToFile(const QString &oldPassId, const QString &newPassId, const QString &password, const QString &user, const QString &thoughts); // Save updated data to file
bool doesPassIdExist(const QString &passId);
// ====================
// Private Members
// ====================
private:
Ui::retrievePassword *ui; // User interface pointer
editPasswordData *editDialog = nullptr; // Pointer to edit dialog
};
#endif // RETRIEVEPASSWORD_H