2014-01-12 16:57:01 +01:00
|
|
|
/*
|
|
|
|
* Copyright (C) 2014 Felix Geyer <debfx@fobos.de>
|
2017-06-09 23:40:36 +02:00
|
|
|
* Copyright (C) 2017 KeePassXC Team <team@keepassxc.org>
|
2014-01-12 16:57:01 +01:00
|
|
|
*
|
|
|
|
* This program is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation, either version 2 or (at your option)
|
|
|
|
* version 3 of the License.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef KEEPASSX_PASSWORDEDIT_H
|
|
|
|
#define KEEPASSX_PASSWORDEDIT_H
|
|
|
|
|
2019-08-30 20:18:41 -04:00
|
|
|
#include <QAction>
|
2014-01-12 16:57:01 +01:00
|
|
|
#include <QLineEdit>
|
2018-11-23 13:49:55 +01:00
|
|
|
#include <QPointer>
|
2014-01-12 16:57:01 +01:00
|
|
|
|
|
|
|
class PasswordEdit : public QLineEdit
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
|
|
|
static const QColor CorrectSoFarColor;
|
|
|
|
static const QColor ErrorColor;
|
|
|
|
|
2015-07-24 18:28:12 +02:00
|
|
|
explicit PasswordEdit(QWidget* parent = nullptr);
|
2014-01-12 16:57:01 +01:00
|
|
|
void enableVerifyMode(PasswordEdit* baseEdit);
|
2018-10-30 15:16:49 +02:00
|
|
|
bool isPasswordVisible() const;
|
2014-01-12 16:57:01 +01:00
|
|
|
|
2017-03-10 15:58:42 +01:00
|
|
|
public slots:
|
2014-01-12 16:57:01 +01:00
|
|
|
void setShowPassword(bool show);
|
|
|
|
|
2017-03-10 15:58:42 +01:00
|
|
|
signals:
|
2014-01-12 16:57:01 +01:00
|
|
|
void showPasswordChanged(bool show);
|
|
|
|
|
2017-03-10 15:58:42 +01:00
|
|
|
private slots:
|
2014-01-12 16:57:01 +01:00
|
|
|
void updateStylesheet();
|
2018-10-28 12:49:32 +01:00
|
|
|
void autocompletePassword(const QString& password);
|
2014-01-12 16:57:01 +01:00
|
|
|
|
|
|
|
private:
|
|
|
|
bool passwordsEqual() const;
|
|
|
|
|
2019-08-30 20:18:41 -04:00
|
|
|
QPointer<QAction> m_errorAction;
|
|
|
|
QPointer<QAction> m_correctAction;
|
2018-11-23 13:49:55 +01:00
|
|
|
QPointer<PasswordEdit> m_basePasswordEdit;
|
2014-01-12 16:57:01 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // KEEPASSX_PASSWORDEDIT_H
|