Initial revision.
[secretnotes] / src / passworddialog.h
1 /*
2  *  This file is part of Secret Notes.
3  *  Copyright (C) 2010 Janusz Sobczak
4  *
5  *  Secret Notes is free software: you can redistribute it and/or modify
6  *  it under the terms of the GNU General Public License as published by
7  *  the Free Software Foundation, either version 3 of the License, or
8  *  (at your option) any later version.
9  *
10  *  Secret Notes is distributed in the hope that it will be useful,
11  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13  *  GNU General Public License for more details.
14  *
15  *  You should have received a copy of the GNU General Public License
16  *  along with Secret Notes.  If not, see <http://www.gnu.org/licenses/>.
17  */
18 #ifndef PASSWORDDIALOG_H
19 #define PASSWORDDIALOG_H
20
21 #include <QDialog>
22
23 namespace Ui {
24     class PasswordDialog;
25 }
26
27 class PasswordDialog : public QDialog {
28     Q_OBJECT
29 public:
30     PasswordDialog(QWidget *parent = 0, const char *password = 0);
31     ~PasswordDialog();
32     void hideOldPassword(bool hide);
33     QString getPassword();
34
35 protected:
36     void changeEvent(QEvent *e);
37
38 private:
39     Ui::PasswordDialog *ui;
40     QString oldPassword;
41     bool verifyOldPassword;
42     bool isOldPasswordCorrect;
43     bool isNewPasswordCorrect;
44     void enableOKButton(bool ena);
45
46
47 private slots:
48     void on_newAgainEdit_textChanged(QString );
49     void on_newEdit_textChanged(QString );
50     void on_oldEdit_textChanged(QString );
51 };
52
53 #endif // PASSWORDDIALOG_H