QGIS API Documentation  3.22.4-Białowieża (ce8e65e95e)
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 "qgsguiutils.h"
22 #include "qgscredentials.h"
23 
24 #include <QString>
25 #include "qgis_sip.h"
26 #include "qgis_gui.h"
27 
28 class QPushButton;
29 
34 class GUI_EXPORT QgsCredentialDialog : public QDialog, public QgsCredentials, private Ui_QgsCredentialDialog
35 {
36  Q_OBJECT
37  public:
39  QgsCredentialDialog( QWidget *parent SIP_TRANSFERTHIS = nullptr, Qt::WindowFlags fl = QgsGuiUtils::ModalDialogFlags );
40 
41 #ifndef SIP_RUN
42  signals:
43 
45  void credentialsRequested( const QString &, QString *, QString *, const QString &, bool * );
46 
48  void credentialsRequestedMasterPassword( QString *, bool, bool * );
49 #endif
50 
51  private slots:
52  void requestCredentials( const QString &, QString *, QString *, const QString &, bool * );
53 
54  void requestCredentialsMasterPassword( QString *password, bool stored, bool *ok );
55 
56  void leMasterPass_textChanged( const QString &pass );
57  void leMasterPassVerify_textChanged( const QString &pass );
58  void chkbxEraseAuthDb_toggled( bool checked );
59 
60  protected:
61  bool request( const QString &realm, QString &username SIP_INOUT, QString &password SIP_INOUT, const QString &message = QString() ) override;
62 
63  bool requestMasterPassword( QString &password SIP_INOUT, bool stored = false ) override;
64 
65  private:
66 
70  enum ConnectionsIgnoreMode
71  {
72  IgnoreTemporarily,
73  IgnoreForSession,
74  };
75 
77  static QMutex sIgnoredConnectionsCacheMutex;
78 
79  ConnectionsIgnoreMode mIgnoreMode = ConnectionsIgnoreMode::IgnoreTemporarily;
80 
81 };
82 
83 #endif
A generic dialog for requesting credentials.
void credentialsRequested(const QString &, QString *, QString *, const QString &, bool *)
void credentialsRequestedMasterPassword(QString *, bool, bool *)
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())=0
request a password
#define SIP_TRANSFERTHIS
Definition: qgis_sip.h:53
#define SIP_INOUT
Definition: qgis_sip.h:71