QGIS API Documentation 3.99.0-Master (21b3aa880ba)
Loading...
Searching...
No Matches
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
22#include "qgis_gui.h"
23#include "qgis_sip.h"
24#include "qgscredentials.h"
25#include "qgsguiutils.h"
26
27#include <QString>
28
29class QPushButton;
30
35class GUI_EXPORT QgsCredentialDialog : public QDialog, public QgsCredentials, private Ui_QgsCredentialDialog
36{
37 Q_OBJECT
38 public:
40 QgsCredentialDialog( QWidget *parent SIP_TRANSFERTHIS = nullptr, Qt::WindowFlags fl = QgsGuiUtils::ModalDialogFlags );
41
42#ifndef SIP_RUN
43 signals:
44
46 void credentialsRequested( const QString &, QString *, QString *, const QString &, bool * );
47
49 void credentialsRequestedMasterPassword( QString *, bool, bool * );
50#endif
51
52 private slots:
53 void requestCredentials( const QString &, QString *, QString *, const QString &, bool * );
54
55 void requestCredentialsMasterPassword( QString *password, bool stored, bool *ok );
56
57 void leMasterPass_textChanged( const QString &pass );
58 void leMasterPassVerify_textChanged( const QString &pass );
59 void chkbxEraseAuthDb_toggled( bool checked );
60
61 protected:
62 bool request( const QString &realm, QString &username SIP_INOUT, QString &password SIP_INOUT, const QString &message = QString() ) override;
63
64 bool requestMasterPassword( QString &password SIP_INOUT, bool stored = false ) override;
65
66 private:
67
71 enum ConnectionsIgnoreMode
72 {
73 IgnoreTemporarily,
74 IgnoreForSession,
75 };
76
78 static QMutex sIgnoredConnectionsCacheMutex;
79
80 QString mRealm;
81
82 ConnectionsIgnoreMode mIgnoreMode = ConnectionsIgnoreMode::IgnoreTemporarily;
83};
84
85#endif
QgsCredentialDialog(QWidget *parent=nullptr, Qt::WindowFlags fl=QgsGuiUtils::ModalDialogFlags)
QgsCredentialDialog constructor.
void credentialsRequested(const QString &, QString *, QString *, const QString &, bool *)
void credentialsRequestedMasterPassword(QString *, bool, bool *)
virtual bool requestMasterPassword(QString &password, bool stored=false)=0
request a master password
QgsCredentials()=default
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:79