QGIS API Documentation  2.18.21-Las Palmas (9fba24a)
qgscredentialdialog.h
Go to the documentation of this file.
1 /***************************************************************************
2  qgscredentialdialog.h - description
3  -------------------
4  begin : February 2010
5  copyright : (C) 2010 by Juergen E. Fischer
6  email : jef at norbit dot de
7  ***************************************************************************/
8 
9 /***************************************************************************
10  * *
11  * This program is free software; you can redistribute it and/or modify *
12  * it under the terms of the GNU General Public License as published by *
13  * the Free Software Foundation; either version 2 of the License, or *
14  * (at your option) any later version. *
15  * *
16  ***************************************************************************/
17 #ifndef QGSCREDENTIALDIALOG_H
18 #define QGSCREDENTIALDIALOG_H
19 
20 #include <ui_qgscredentialdialog.h>
21 #include <qgisgui.h>
22 #include "qgscredentials.h"
23 
24 #include <QString>
25 
26 class QPushButton;
27 
31 class GUI_EXPORT QgsCredentialDialog : public QDialog, public QgsCredentials, private Ui_QgsCredentialDialog
32 {
33  Q_OBJECT
34  public:
35  QgsCredentialDialog( QWidget *parent = nullptr, const Qt::WindowFlags& fl = QgisGui::ModalDialogFlags );
37 
38  signals:
39 
41  void credentialsRequested( const QString&, QString *, QString *, const QString&, bool * );
42 
44  void credentialsRequestedMasterPassword( QString *, bool, bool * );
45 
46  private slots:
47  void requestCredentials( const QString&, QString *, QString *, const QString&, bool * );
48 
49  void requestCredentialsMasterPassword( QString *password, bool stored, bool *ok );
50 
51  void on_chkMasterPassShow_stateChanged( int state );
52  void on_leMasterPass_textChanged( const QString& pass );
53  void on_leMasterPassVerify_textChanged( const QString& pass );
54  void on_chkbxEraseAuthDb_toggled( bool checked );
55 
56  protected:
57  virtual bool request( const QString& realm, QString &username, QString &password, const QString& message = QString::null ) override;
58 
59  virtual bool requestMasterPassword( QString &password, bool stored = false ) override;
60 
61  private:
62  QPushButton *mOkButton;
63 };
64 
65 #endif
static const Qt::WindowFlags ModalDialogFlags
Definition: qgisgui.h:50
Interface for requesting credentials in QGIS in GUI independent way.
virtual bool requestMasterPassword(QString &password, bool stored=false)=0
request a master password
virtual bool request(const QString &realm, QString &username, QString &password, const QString &message=QString::null)=0
request a password
typedef WindowFlags
A generic dialog for requesting credentials.