1 /* vi: set sw=4 ts=4: 2 * 3 * Copyright (C) 2011 Christian Hohnstaedt. 4 * 5 * All rights reserved. 6 */ 7 8 #ifndef __PWDIALOG_H 9 #define __PWDIALOG_H 10 11 #include <QByteArray> 12 #include "ui_PwDialog.h" 13 #include "lib/Passwd.h" 14 #include "lib/pki_x509.h" 15 #include "lib/pass_info.h" 16 17 class PwDialog: public QDialog, public Ui::PwDialog 18 { 19 Q_OBJECT 20 21 private: 22 bool wrDialog; 23 Passwd final; 24 pass_info *pi; 25 26 public: 27 PwDialog(pass_info *p, bool write = false); getPass()28 Passwd getPass() { 29 return final; 30 } 31 void addAbortButton(); 32 void setRW(bool write); 33 34 static enum open_result execute(pass_info *p, Passwd *passwd, 35 bool write = false, bool abort = false); 36 static int pwCallback(char *buf, int size, int rwflag, void *userdata); 37 38 public slots: 39 void accept(); 40 void buttonPress(QAbstractButton *but); 41 }; 42 #endif 43