-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPassWindow.hpp
74 lines (64 loc) · 1.74 KB
/
PassWindow.hpp
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
65
66
67
68
69
70
71
72
73
74
#ifndef PAMA_PASSWINDOW_H
#define PAMA_PASSWINDOW_H
#include <QBoxLayout.h>
#include <QCombobox.h>
#include <QGroupBox.h>
#include <QLabel.h>
#include <QListView.h>
#include <QMainWindow.h>
#include <QPushButton.h>
#include "crypto.hpp"
#include "pvars.hpp"
#include "pwidget.hpp"
#include "utils.hpp"
#include <QDebug.h>
class PassWindow : public QMainWindow
{
Q_OBJECT
public: //ctor dtor
PassWindow(PVars* vars, QWidget* parent = nullptr);
~PassWindow();
signals:
void password_validated(const QString password);
protected: //objects
PVars* vars;
QVBoxLayout* vlayout;
QVBoxLayout* entriesLayout;
QWidget* mainWidget;
QLabel* titleLabel;
QGroupBox* entriesBox;
QLabel* emailLabel;
PLineEdit* emailEntry;
QHBoxLayout* passwordLayout;
QLabel* passwordLabel;
QPushButton* forgotButton;
PLineEdit* passwordEntry;
QPushButton* loginButton;
QLabel* errorLabel;
QHBoxLayout* settingsLayout;
QFrame* settingsFrame;
PComboBox* languageCB;
QListView* listView;
QPushButton* themeBtn;
private: //variables
short remaining_tests = 3;
bool is_error_raised = false;
QString black = "#0A0905";
QString bright_dark = "#262625";
QString white = "#FCFCFA";
// TODO: change the code to remove the line below
QString entryStyle_base = "background-color: %0; color: %1; padding-left: 15px; padding-right: 15px; border-radius: 5px;"; //can the user create a new property in qss ? ::error who can be manage with a bool
QString entryStyle;
protected: //methods
void clear_focus();
void raise_error(const QString message);
void apply_style();
protected slots: //slots
void mousePressEvent(QMouseEvent* e);
void clear_error();
void password_forgot();
void check_password();
void language_changed(const QModelIndex& i);
void change_theme();
};
#endif