1 /***************************************************************************
2 * Copyright (C) 2005-2007 by Tarek Saidi *
3 * tarek.saidi@arcor.de *
5 * This program 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; version 2 of the License. *
9 * This program is distributed in the hope that it will be useful, *
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
12 * GNU General Public License for more details. *
14 * You should have received a copy of the GNU General Public License *
15 * along with this program; if not, write to the *
16 * Free Software Foundation, Inc., *
17 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
18 ***************************************************************************/
20 #ifndef PASSWORDDIALOG_H
21 #define PASSWORDDIALOG_H
23 #include <QPaintEvent>
24 #include "ui_PasswordDlg.h"
27 class PasswordDialog : public QDialog, private Ui_PasswordDlg {
31 Mode_Ask, // Normal password entry when opening a database
32 Mode_Set, // Setting password for the first time after creating a new database
33 Mode_Change // Changing the password of a database
38 Flag_Auto = 0x01 // Dialog was automatically opened on start-up
42 Exit_Ok=QDialog::Accepted,
43 Exit_Cancel=QDialog::Rejected,
47 typedef bool (KeyFileGenProc)(const QString& filename,QString* error);
49 PasswordDialog(QWidget* parent,DlgMode mode,DlgFlags flags,const QString& filename=QString());
52 QString selectedBookmark();
59 void OnButtonBrowse();
63 void ChangeEchoModeDatabaseKey();
64 void OnBookmarkTriggered(QAction* action);
65 void OnCheckBoxesChanged();
71 QString BookmarkFilename;
75 void setStatePasswordOnly();
76 void setStateKeyFileOnly();
78 virtual void paintEvent(QPaintEvent*);