keepassxc/src/gui/DatabaseOpenWidget.h

72 lines
1.8 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 <QScopedPointer>
#include "gui/DialogyWidget.h"
2012-10-12 06:12:00 -04:00
#include "keys/CompositeKey.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();
2012-07-06 12:50:52 -04:00
void load(const QString& filename);
void enterKey(const QString& pw, const QString& keyFile);
void enterKey(const CompositeKey& masterKey);
Database* database();
Q_SIGNALS:
void editFinished(bool accepted);
2011-11-13 08:55:20 -05:00
2012-10-12 06:12:00 -04:00
protected:
CompositeKey databaseKey();
protected Q_SLOTS:
virtual void openDatabase();
void openDatabase(const CompositeKey& masterKey);
void reject();
2011-11-13 08:55:20 -05:00
private Q_SLOTS:
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;
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