keepassxc/src/gui/DatabaseOpenWidget.h

68 lines
1.7 KiB
C
Raw Normal View History

2011-11-13 08:55:20 -05:00
/*
* Copyright (C) 2011 Felix Geyer <debfx@fobos.de>
*
* 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_DATABASEOPENWIDGET_H
#define KEEPASSX_DATABASEOPENWIDGET_H
2011-11-13 08:55:20 -05:00
#include <QtCore/QScopedPointer>
#include "gui/DialogyWidget.h"
2011-11-13 08:55:20 -05:00
class Database;
class QFile;
2011-11-13 08:55:20 -05:00
namespace Ui {
class DatabaseOpenWidget;
2011-11-13 08:55:20 -05:00
}
class DatabaseOpenWidget : public DialogyWidget
2011-11-13 08:55:20 -05:00
{
Q_OBJECT
public:
explicit DatabaseOpenWidget(QWidget* parent = Q_NULLPTR);
~DatabaseOpenWidget();
void load(QFile* file, const QString& filename);
void enterKey(const QString& pw, const QString& keyFile);
Database* database();
Q_SIGNALS:
void editFinished(bool accepted);
2011-11-13 08:55:20 -05:00
protected Q_SLOTS:
virtual void openDatabase();
void reject();
2011-11-13 08:55:20 -05:00
private Q_SLOTS:
void togglePassword(bool checked);
void activatePassword();
void activateKeyFile();
void setOkButtonEnabled();
void browseKeyFile();
2011-11-13 08:55:20 -05:00
protected:
const QScopedPointer<Ui::DatabaseOpenWidget> m_ui;
Database* m_db;
QFile* m_file;
QString m_filename;
2011-11-13 08:55:20 -05:00
private:
Q_DISABLE_COPY(DatabaseOpenWidget)
2011-11-13 08:55:20 -05:00
};
#endif // KEEPASSX_DATABASEOPENWIDGET_H