-
Notifications
You must be signed in to change notification settings - Fork 0
/
passwordinfo.cpp
41 lines (34 loc) · 884 Bytes
/
passwordinfo.cpp
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
// ====================
// passwordinfo.cpp
// ====================
#include "passwordinfo.h"
#include "ui_passwordinfo.h"
#include <QClipboard>
#include <QApplication>
// ====================
// Constructor & Destructor
// ====================
passwordInfo::passwordInfo(QWidget *parent, const QString &password) :
QDialog(parent),
ui(new Ui::passwordInfo),
m_password(password)
{
ui->setupUi(this);
setWindowTitle("Falkenberg's Password Manager"); // Set up window title
}
passwordInfo::~passwordInfo()
{
delete ui;
}
// ====================
// Event Handlers
// ====================
void passwordInfo::on_copyButton_clicked()
{
QClipboard *clipboard = QApplication::clipboard();
clipboard->setText(m_password); // Copy the password to the clipboard
}
void passwordInfo::on_acknowledgeButton_clicked()
{
accept(); // Close the dialog
}