-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPasswordManager.h
More file actions
58 lines (52 loc) · 1.36 KB
/
Copy pathPasswordManager.h
File metadata and controls
58 lines (52 loc) · 1.36 KB
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
#pragma once
#include <QtWidgets>
#include <QClipboard>
#include <QFileDialog>
#include <QString>
#include <QStandardItemModel>
#include <QtWidgets/QMainWindow>
#include "ui_PasswordManager.h"
#include <QInputDialog>
class PasswordManager : public QMainWindow
{
Q_OBJECT
public:
PasswordManager(QWidget* parent = nullptr);
~PasswordManager();
void closeEvent(QCloseEvent* event);
private:
enum STATE {
none,
newFile,
openFile,
unlocked
} state;
private slots:
void on_select_file();
void on_new_file();
void on_save_file();
void on_save_as_file();
void on_show_password();
void on_hide_password();
void on_confirm_password();
void add_data(QString platform, QString username, QString password);
void on_push_new();
void on_remove_row();
void on_menu(QAction* action);
void on_set_password();
void update_state(enum STATE new_state);
void clear_data();
void on_view(QModelIndex index);
void on_edit(QModelIndex index);
void on_copy_username();
void on_copy_password();
private:
Ui::PasswordManagerClass ui;
QClipboard* clipboard=QApplication::clipboard();
QStandardItemModel *model;
QString path;
QString key;
QStandardItem *item;
bool isSaved;
bool ask_save_file();
};