18 #include "ui_qgsauthmethodplugins.h" 24 #include <QTableWidget> 33 , mAuthNotifyLayout( nullptr )
34 , mAuthNotify( nullptr )
41 mAuthNotifyLayout->
addWidget( mAuthNotify );
57 void QgsAuthMethodPlugins::setupTable()
59 tblAuthPlugins->setColumnCount( 3 );
60 tblAuthPlugins->verticalHeader()->hide();
61 tblAuthPlugins->horizontalHeader()->setVisible(
true );
63 tblAuthPlugins->setHorizontalHeaderItem( 1,
new QTableWidgetItem(
tr(
"Description" ) ) );
64 tblAuthPlugins->setHorizontalHeaderItem( 2,
new QTableWidgetItem(
tr(
"Works with" ) ) );
65 tblAuthPlugins->horizontalHeader()->setStretchLastSection(
true );
66 tblAuthPlugins->setAlternatingRowColors(
true );
67 tblAuthPlugins->setColumnWidth( 0, 150 );
68 tblAuthPlugins->setColumnWidth( 1, 300 );
70 tblAuthPlugins->verticalHeader()->setResizeMode( QHeaderView::ResizeToContents );
71 tblAuthPlugins->setSortingEnabled(
true );
72 tblAuthPlugins->setSelectionBehavior( QAbstractItemView::SelectRows );
75 void QgsAuthMethodPlugins::populateTable()
90 tblAuthPlugins->setItem( i, 0, twi );
94 tblAuthPlugins->setItem( i, 1, twi );
96 twi =
new QTableWidgetItem( authmethod->supportedDataProviders().join(
", " ) );
98 tblAuthPlugins->setItem( i, 2, twi );
100 tblAuthPlugins->sortItems( 0 );
107 , mAuthUtilitiesMenu( nullptr )
108 , mActionSetMasterPassword( nullptr )
109 , mActionClearCachedMasterPassword( nullptr )
110 , mActionResetMasterPassword( nullptr )
111 , mActionClearCachedAuthConfigs( nullptr )
112 , mActionRemoveAuthConfigs( nullptr )
113 , mActionEraseAuthDatabase( nullptr )
118 wdgtConfigEditor->setRelayMessages(
false );
119 wdgtConfigEditor->setShowUtilitiesButton(
false );
120 setupUtilitiesMenu();
124 grpbxManagers->setEnabled(
false );
132 void QgsAuthEditorWidgets::on_btnCertManager_clicked()
141 void QgsAuthEditorWidgets::on_btnAuthPlugins_clicked()
150 void QgsAuthEditorWidgets::setupUtilitiesMenu()
156 mActionSetMasterPassword =
new QAction(
"Input master password",
this );
157 mActionClearCachedMasterPassword =
new QAction(
"Clear cached master password",
this );
158 mActionResetMasterPassword =
new QAction(
"Reset master password",
this );
159 mActionClearCachedAuthConfigs =
new QAction(
"Clear cached authentication configurations",
this );
160 mActionRemoveAuthConfigs =
new QAction(
"Remove all authentication configurations",
this );
161 mActionEraseAuthDatabase =
new QAction(
"Erase authentication database",
this );
163 connect( mActionSetMasterPassword, SIGNAL( triggered() ),
this, SLOT( setMasterPassword() ) );
164 connect( mActionClearCachedMasterPassword, SIGNAL( triggered() ),
this, SLOT( clearCachedMasterPassword() ) );
165 connect( mActionResetMasterPassword, SIGNAL( triggered() ),
this, SLOT( resetMasterPassword() ) );
166 connect( mActionClearCachedAuthConfigs, SIGNAL( triggered() ),
this, SLOT( clearCachedAuthenticationConfigs() ) );
167 connect( mActionRemoveAuthConfigs, SIGNAL( triggered() ),
this, SLOT( removeAuthenticationConfigs() ) );
168 connect( mActionEraseAuthDatabase, SIGNAL( triggered() ),
this, SLOT( eraseAuthenticationDatabase() ) );
170 mAuthUtilitiesMenu =
new QMenu(
this );
171 mAuthUtilitiesMenu->
addAction( mActionSetMasterPassword );
172 mAuthUtilitiesMenu->
addAction( mActionClearCachedMasterPassword );
173 mAuthUtilitiesMenu->
addAction( mActionResetMasterPassword );
175 mAuthUtilitiesMenu->
addAction( mActionClearCachedAuthConfigs );
176 mAuthUtilitiesMenu->
addAction( mActionRemoveAuthConfigs );
178 mAuthUtilitiesMenu->
addAction( mActionEraseAuthDatabase );
180 btnAuthUtilities->setMenu( mAuthUtilitiesMenu );
183 void QgsAuthEditorWidgets::setMasterPassword()
188 void QgsAuthEditorWidgets::clearCachedMasterPassword()
193 void QgsAuthEditorWidgets::resetMasterPassword()
198 void QgsAuthEditorWidgets::clearCachedAuthenticationConfigs()
203 void QgsAuthEditorWidgets::removeAuthenticationConfigs()
208 void QgsAuthEditorWidgets::eraseAuthenticationDatabase()
215 int levelint = ( int )level;
224 int QgsAuthEditorWidgets::messageTimeout()
227 return settings.
value(
"/qgis/messageTimeout", 5 ).
toInt();
static void resetMasterPassword(QgsMessageBar *msgbar, int timeout=0, QWidget *parent=nullptr)
Reset the cached master password, updating its hash in authentication database and reseting all exist...
static void eraseAuthenticationDatabase(QgsMessageBar *msgbar, int timeout=0, QWidget *parent=nullptr)
Completely clear out the authentication database (configs and master password)
Dialog for viewing available authentication method plugins.
static QgsAuthManager * instance()
Enforce singleton pattern.
static void clearCachedMasterPassword(QgsMessageBar *msgbar, int timeout=0)
Clear the currently cached master password (not its hash in database)
static void removeAuthenticationConfigs(QgsMessageBar *msgbar, int timeout=0, QWidget *parent=nullptr)
Remove all authentication configs.
A bar for displaying non-blocking messages to the user.
static void setMasterPassword(QgsMessageBar *msgbar, int timeout=0)
Sets the cached master password (and verifies it if its hash is in authentication database) ...
QString tr(const char *sourceText, const char *disambiguation, int n)
MessageLevel
Message log level (mirrors that of QgsMessageLog, so it can also output there)
static void clearCachedAuthenticationConfigs(QgsMessageBar *msgbar, int timeout=0)
Clear all cached authentication configs for session.
void pushMessage(const QString &text, MessageLevel level=INFO, int duration=5)
convenience method for pushing a message to the bar
const_iterator constEnd() const
Dialog wrapper for widget to manage available certificate editors.
int toInt(bool *ok) const
QgsAuthMethodPlugins(QWidget *parent=nullptr)
Construct a dialog for viewing available authentication method plugins.
QVariant value(const QString &key, const QVariant &defaultValue) const
const_iterator constBegin() const
Abstract base class for authentication method plugins.
bool connect(const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)