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/>.
|
|
|
|
*/
|
|
|
|
|
2012-04-18 16:08:22 -04:00
|
|
|
#ifndef KEEPASSX_DATABASEOPENDIALOG_H
|
|
|
|
#define KEEPASSX_DATABASEOPENDIALOG_H
|
2011-11-13 08:55:20 -05:00
|
|
|
|
|
|
|
#include <QtCore/QScopedPointer>
|
|
|
|
#include <QtGui/QDialog>
|
|
|
|
|
2012-04-05 13:03:55 -04:00
|
|
|
class Database;
|
|
|
|
class QFile;
|
|
|
|
|
2011-11-13 08:55:20 -05:00
|
|
|
namespace Ui {
|
2012-04-05 12:31:12 -04:00
|
|
|
class DatabaseOpenDialog;
|
2011-11-13 08:55:20 -05:00
|
|
|
}
|
|
|
|
|
2012-04-05 12:31:12 -04:00
|
|
|
class DatabaseOpenDialog : public QDialog
|
2011-11-13 08:55:20 -05:00
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
2012-05-12 04:08:41 -04:00
|
|
|
DatabaseOpenDialog(QFile* file, const QString& filename, QWidget* parent = 0);
|
2012-04-05 12:31:12 -04:00
|
|
|
~DatabaseOpenDialog();
|
2012-04-05 13:03:55 -04:00
|
|
|
Database* database();
|
2012-04-24 05:47:16 -04:00
|
|
|
void enterKey(const QString& pw, const QString& keyFile);
|
2011-11-13 08:55:20 -05:00
|
|
|
|
2012-05-12 04:08:41 -04:00
|
|
|
protected Q_SLOTS:
|
|
|
|
virtual void openDatabase();
|
|
|
|
|
2011-11-13 08:55:20 -05:00
|
|
|
private Q_SLOTS:
|
2011-11-16 12:46:09 -05:00
|
|
|
void togglePassword(bool checked);
|
|
|
|
void activatePassword();
|
2011-12-24 13:19:52 -05:00
|
|
|
void activateKeyFile();
|
|
|
|
void setOkButtonEnabled();
|
|
|
|
void browseKeyFile();
|
2011-11-13 08:55:20 -05:00
|
|
|
|
2012-05-12 04:08:41 -04:00
|
|
|
protected:
|
2012-04-23 13:44:43 -04:00
|
|
|
const QScopedPointer<Ui::DatabaseOpenDialog> m_ui;
|
2012-04-05 13:03:55 -04:00
|
|
|
Database* m_db;
|
2012-04-23 13:44:43 -04:00
|
|
|
QFile* const m_file;
|
|
|
|
const QString m_filename;
|
2011-11-13 08:55:20 -05:00
|
|
|
|
2012-05-12 04:08:41 -04:00
|
|
|
private:
|
2012-04-05 12:31:12 -04:00
|
|
|
Q_DISABLE_COPY(DatabaseOpenDialog)
|
2011-11-13 08:55:20 -05:00
|
|
|
};
|
|
|
|
|
2012-04-18 16:08:22 -04:00
|
|
|
#endif // KEEPASSX_DATABASEOPENDIALOG_H
|