mirror of
https://github.com/qgis/QGIS.git
synced 2025-10-15 00:02:52 -04:00
[auth] Redesign Authentication section of Options
- Separate management options from auth config table - Add standalone certificate manager - Add installed auth method plugin dialog, indicating usage per plugin
This commit is contained in:
parent
b6459b06f1
commit
0975c9f7aa
25
python/gui/auth/qgsauthcertificatemanager.sip
Normal file
25
python/gui/auth/qgsauthcertificatemanager.sip
Normal file
@ -0,0 +1,25 @@
|
||||
class QgsAuthCertEditors : QWidget
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qgsauthcertificatemanager.h>
|
||||
%End
|
||||
|
||||
public:
|
||||
explicit QgsAuthCertEditors( QWidget *parent /TransferThis/ = 0 );
|
||||
|
||||
~QgsAuthCertEditors();
|
||||
};
|
||||
|
||||
class QgsAuthCertManager : QDialog
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qgsauthcertificatemanager.h>
|
||||
%End
|
||||
|
||||
public:
|
||||
explicit QgsAuthCertManager( QWidget *parent /TransferThis/ = 0 );
|
||||
|
||||
~QgsAuthCertManager();
|
||||
|
||||
QgsAuthCertEditors *certEditorsWidget();
|
||||
};
|
@ -5,9 +5,14 @@ class QgsAuthConfigEditor : QWidget
|
||||
%End
|
||||
|
||||
public:
|
||||
explicit QgsAuthConfigEditor( QWidget *parent /TransferThis/ = 0 );
|
||||
explicit QgsAuthConfigEditor( QWidget *parent /TransferThis/ = 0, bool showUtilities = true, QgsMessageBar *msgbar /TransferThis/ = 0 );
|
||||
~QgsAuthConfigEditor();
|
||||
|
||||
void toggleTitleVisibility( bool visible );
|
||||
|
||||
public slots:
|
||||
|
||||
void showUtilitiesButton( bool show = true );
|
||||
|
||||
void setMessageBar( QgsMessageBar *msgbar /TransferThis/ = 0 );
|
||||
};
|
||||
|
@ -1,3 +1,16 @@
|
||||
class QgsAuthMethodPlugins : QDialog
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qgsautheditorwidgets.h>
|
||||
%End
|
||||
|
||||
public:
|
||||
explicit QgsAuthMethodPlugins( QWidget *parent /TransferThis/ = 0 );
|
||||
|
||||
~QgsAuthMethodPlugins();
|
||||
};
|
||||
|
||||
|
||||
class QgsAuthEditorWidgets : QWidget
|
||||
{
|
||||
%TypeHeaderCode
|
||||
@ -8,6 +21,4 @@ class QgsAuthEditorWidgets : QWidget
|
||||
explicit QgsAuthEditorWidgets( QWidget *parent /TransferThis/ = 0 );
|
||||
|
||||
~QgsAuthEditorWidgets();
|
||||
|
||||
QTabWidget * tabbedWidget();
|
||||
};
|
||||
|
@ -143,6 +143,7 @@
|
||||
|
||||
%Include auth/qgsauthauthoritieseditor.sip
|
||||
%Include auth/qgsauthcertificateinfo.sip
|
||||
%Include auth/qgsauthcertificatemanager.sip
|
||||
%Include auth/qgsauthcerttrustpolicycombobox.sip
|
||||
%Include auth/qgsauthconfigeditor.sip
|
||||
%Include auth/qgsauthconfigselect.sip
|
||||
|
@ -61,10 +61,12 @@ SET(QGIS_GUI_SRCS
|
||||
|
||||
auth/qgsauthauthoritieseditor.cpp
|
||||
auth/qgsauthcertificateinfo.cpp
|
||||
auth/qgsauthcertificatemanager.cpp
|
||||
auth/qgsauthcerttrustpolicycombobox.cpp
|
||||
auth/qgsauthconfigedit.cpp
|
||||
auth/qgsauthconfigeditor.cpp
|
||||
auth/qgsauthconfigselect.cpp
|
||||
auth/qgsautheditorwidgets.cpp
|
||||
auth/qgsauthguiutils.cpp
|
||||
auth/qgsauthidentitieseditor.cpp
|
||||
auth/qgsauthimportcertdialog.cpp
|
||||
@ -444,6 +446,7 @@ SET(QGIS_GUI_MOC_HDRS
|
||||
|
||||
auth/qgsauthauthoritieseditor.h
|
||||
auth/qgsauthcertificateinfo.h
|
||||
auth/qgsauthcertificatemanager.h
|
||||
auth/qgsauthcerttrustpolicycombobox.h
|
||||
auth/qgsauthconfigedit.h
|
||||
auth/qgsauthconfigeditor.h
|
||||
@ -560,6 +563,7 @@ SET(QGIS_GUI_HDRS
|
||||
|
||||
auth/qgsauthauthoritieseditor.h
|
||||
auth/qgsauthcertificateinfo.h
|
||||
auth/qgsauthcertificatemanager.h
|
||||
auth/qgsauthcerttrustpolicycombobox.h
|
||||
auth/qgsauthconfigedit.h
|
||||
auth/qgsauthconfigeditor.h
|
||||
|
56
src/gui/auth/qgsauthcertificatemanager.cpp
Normal file
56
src/gui/auth/qgsauthcertificatemanager.cpp
Normal file
@ -0,0 +1,56 @@
|
||||
/***************************************************************************
|
||||
qgsauthcertificatemanager.cpp
|
||||
---------------------
|
||||
begin : September, 2015
|
||||
copyright : (C) 2015 by Boundless Spatial, Inc. USA
|
||||
author : Larry Shaffer
|
||||
email : lshaffer at boundlessgeo dot com
|
||||
***************************************************************************
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
* it under the terms of the GNU General Public License as published by *
|
||||
* the Free Software Foundation; either version 2 of the License, or *
|
||||
* (at your option) any later version. *
|
||||
* *
|
||||
***************************************************************************/
|
||||
|
||||
#include "qgsauthcertificatemanager.h"
|
||||
|
||||
#include <QDialog>
|
||||
#include <QDialogButtonBox>
|
||||
#include <QPushButton>
|
||||
|
||||
QgsAuthCertEditors::QgsAuthCertEditors( QWidget *parent )
|
||||
: QWidget( parent )
|
||||
{
|
||||
setupUi( this );
|
||||
}
|
||||
|
||||
QgsAuthCertEditors::~QgsAuthCertEditors()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
|
||||
QgsAuthCertManager::QgsAuthCertManager( QWidget *parent )
|
||||
: QDialog( parent )
|
||||
{
|
||||
setWindowTitle( tr( "Certificate Manager" ) );
|
||||
QVBoxLayout *layout = new QVBoxLayout( this );
|
||||
layout->setMargin( 6 );
|
||||
|
||||
mCertEditors = new QgsAuthCertEditors( this );
|
||||
layout->addWidget( mCertEditors );
|
||||
|
||||
QDialogButtonBox *buttonBox = new QDialogButtonBox( QDialogButtonBox::Close,
|
||||
Qt::Horizontal, this );
|
||||
buttonBox->button( QDialogButtonBox::Close )->setDefault( true );
|
||||
connect( buttonBox, SIGNAL( rejected() ), this, SLOT( close() ) );
|
||||
layout->addWidget( buttonBox );
|
||||
|
||||
setLayout( layout );
|
||||
}
|
||||
|
||||
QgsAuthCertManager::~QgsAuthCertManager()
|
||||
{
|
||||
}
|
69
src/gui/auth/qgsauthcertificatemanager.h
Normal file
69
src/gui/auth/qgsauthcertificatemanager.h
Normal file
@ -0,0 +1,69 @@
|
||||
/***************************************************************************
|
||||
qgsauthcertificatemanager.h
|
||||
---------------------
|
||||
begin : September, 2015
|
||||
copyright : (C) 2015 by Boundless Spatial, Inc. USA
|
||||
author : Larry Shaffer
|
||||
email : lshaffer at boundlessgeo dot com
|
||||
***************************************************************************
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
* it under the terms of the GNU General Public License as published by *
|
||||
* the Free Software Foundation; either version 2 of the License, or *
|
||||
* (at your option) any later version. *
|
||||
* *
|
||||
***************************************************************************/
|
||||
|
||||
#ifndef QGSAUTHCERTIFICATEMANAGER_H
|
||||
#define QGSAUTHCERTIFICATEMANAGER_H
|
||||
|
||||
#include "ui_qgsauthcertificatemanager.h"
|
||||
|
||||
#include <QWidget>
|
||||
#include <QDialog>
|
||||
|
||||
|
||||
/** \ingroup gui
|
||||
* Wrapper widget to manage available certificate editors
|
||||
*/
|
||||
class GUI_EXPORT QgsAuthCertEditors : public QWidget, private Ui::QgsAuthCertManager
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
/**
|
||||
* Construct a widget to contain various certificate editors
|
||||
* @param parent Parent widget
|
||||
*/
|
||||
explicit QgsAuthCertEditors( QWidget *parent = 0 );
|
||||
|
||||
~QgsAuthCertEditors();
|
||||
};
|
||||
|
||||
|
||||
//////////////// Embed in dialog ///////////////////
|
||||
|
||||
/** \ingroup gui
|
||||
* Dialog wrapper for widget to manage available certificate editors
|
||||
*/
|
||||
class GUI_EXPORT QgsAuthCertManager : public QDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
/**
|
||||
* Construct a dialog wrapper for widget to manage available certificate editors
|
||||
* @param parent Parent widget
|
||||
*/
|
||||
explicit QgsAuthCertManager( QWidget *parent = 0 );
|
||||
|
||||
~QgsAuthCertManager();
|
||||
|
||||
/** Get access to embedded editors widget */
|
||||
QgsAuthCertEditors *certEditorsWidget() { return mCertEditors; }
|
||||
|
||||
private:
|
||||
QgsAuthCertEditors *mCertEditors;
|
||||
};
|
||||
|
||||
#endif // QGSAUTHCERTIFICATEMANAGER_H
|
@ -26,7 +26,7 @@
|
||||
#include "qgsauthconfigedit.h"
|
||||
#include "qgsauthguiutils.h"
|
||||
|
||||
QgsAuthConfigEditor::QgsAuthConfigEditor( QWidget *parent )
|
||||
QgsAuthConfigEditor::QgsAuthConfigEditor( QWidget *parent, bool showUtilities, QgsMessageBar *msgbar )
|
||||
: QWidget( parent )
|
||||
, mConfigModel( 0 )
|
||||
, mAuthUtilitiesMenu( 0 )
|
||||
@ -49,6 +49,10 @@ QgsAuthConfigEditor::QgsAuthConfigEditor( QWidget *parent )
|
||||
else
|
||||
{
|
||||
setupUi( this );
|
||||
|
||||
setMessageBar( msgbar );
|
||||
showUtilitiesButton( showUtilities );
|
||||
|
||||
mConfigModel = new QSqlTableModel( this, QgsAuthManager::instance()->authDbConnection() );
|
||||
mConfigModel->setTable( QgsAuthManager::instance()->authDbConfigTable() );
|
||||
mConfigModel->select();
|
||||
@ -113,6 +117,7 @@ QgsAuthConfigEditor::QgsAuthConfigEditor( QWidget *parent )
|
||||
mAuthUtilitiesMenu->addAction( mActionEraseAuthDatabase );
|
||||
|
||||
btnAuthUtilities->setMenu( mAuthUtilitiesMenu );
|
||||
lblAuthConfigDb->setVisible( false );
|
||||
}
|
||||
}
|
||||
|
||||
@ -164,6 +169,20 @@ void QgsAuthConfigEditor::toggleTitleVisibility( bool visible )
|
||||
}
|
||||
}
|
||||
|
||||
void QgsAuthConfigEditor::showUtilitiesButton( bool show )
|
||||
{
|
||||
btnAuthUtilities->setVisible( show );
|
||||
}
|
||||
|
||||
void QgsAuthConfigEditor::setMessageBar( QgsMessageBar *msgbar )
|
||||
{
|
||||
if ( msgbar )
|
||||
{
|
||||
delete mMsgBar;
|
||||
mMsgBar = msgbar;
|
||||
}
|
||||
}
|
||||
|
||||
void QgsAuthConfigEditor::refreshTableView()
|
||||
{
|
||||
mConfigModel->select();
|
||||
|
@ -35,13 +35,22 @@ class GUI_EXPORT QgsAuthConfigEditor : public QWidget, private Ui::QgsAuthConfig
|
||||
public:
|
||||
/**
|
||||
* Widget for editing authentication configurations directly in database
|
||||
* @param showUtilities Whether to show the widget's utilities button
|
||||
* @param msgbar Substitute internal message bar for another
|
||||
*/
|
||||
explicit QgsAuthConfigEditor( QWidget *parent = 0 );
|
||||
explicit QgsAuthConfigEditor( QWidget *parent = 0, bool showUtilities = true, QgsMessageBar *msgbar = 0 );
|
||||
~QgsAuthConfigEditor();
|
||||
|
||||
/** Hide the widget's title, e.g. when embedding */
|
||||
void toggleTitleVisibility( bool visible );
|
||||
|
||||
public slots:
|
||||
/** Whether to show the widget's utilities button, e.g. when embedding */
|
||||
void showUtilitiesButton( bool show = true );
|
||||
|
||||
/** Substitute internal message bar for another, e.g. when embedding */
|
||||
void setMessageBar( QgsMessageBar *msgbar = 0 );
|
||||
|
||||
private slots:
|
||||
/** Repopulate the view with table contents */
|
||||
void refreshTableView();
|
||||
|
202
src/gui/auth/qgsautheditorwidgets.cpp
Normal file
202
src/gui/auth/qgsautheditorwidgets.cpp
Normal file
@ -0,0 +1,202 @@
|
||||
/***************************************************************************
|
||||
qgsautheditorwidgets.cpp
|
||||
---------------------
|
||||
begin : April 26, 2015
|
||||
copyright : (C) 2015 by Boundless Spatial, Inc. USA
|
||||
author : Larry Shaffer
|
||||
email : lshaffer at boundlessgeo dot com
|
||||
***************************************************************************
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
* it under the terms of the GNU General Public License as published by *
|
||||
* the Free Software Foundation; either version 2 of the License, or *
|
||||
* (at your option) any later version. *
|
||||
* *
|
||||
***************************************************************************/
|
||||
|
||||
#include "qgsautheditorwidgets.h"
|
||||
#include "ui_qgsauthmethodplugins.h"
|
||||
|
||||
#include <QAction>
|
||||
#include <QMenu>
|
||||
#include <QSettings>
|
||||
#include <QWidget>
|
||||
#include <QTableWidget>
|
||||
|
||||
#include "qgsauthcertificatemanager.h"
|
||||
#include "qgsauthguiutils.h"
|
||||
#include "qgsauthmanager.h"
|
||||
|
||||
|
||||
QgsAuthMethodPlugins::QgsAuthMethodPlugins( QWidget *parent )
|
||||
: QDialog( parent )
|
||||
{
|
||||
setupUi( this );
|
||||
connect( buttonBox, SIGNAL( rejected() ), this, SLOT( reject() ) );
|
||||
|
||||
setupTable();
|
||||
populateTable();
|
||||
}
|
||||
|
||||
QgsAuthMethodPlugins::~QgsAuthMethodPlugins()
|
||||
{
|
||||
}
|
||||
|
||||
void QgsAuthMethodPlugins::setupTable()
|
||||
{
|
||||
tblAuthPlugins->setColumnCount( 3 );
|
||||
tblAuthPlugins->verticalHeader()->hide();
|
||||
tblAuthPlugins->horizontalHeader()->setVisible( true );
|
||||
tblAuthPlugins->setHorizontalHeaderItem( 0, new QTableWidgetItem( tr( "Method" ) ) );
|
||||
tblAuthPlugins->setHorizontalHeaderItem( 1, new QTableWidgetItem( tr( "Description" ) ) );
|
||||
tblAuthPlugins->setHorizontalHeaderItem( 2, new QTableWidgetItem( tr( "Works with" ) ) );
|
||||
tblAuthPlugins->horizontalHeader()->setStretchLastSection( true );
|
||||
tblAuthPlugins->setAlternatingRowColors( true );
|
||||
tblAuthPlugins->setColumnWidth( 0, 150 );
|
||||
tblAuthPlugins->setColumnWidth( 1, 300 );
|
||||
tblAuthPlugins->setRowCount( QgsAuthManager::instance()->authMethodsKeys().size() );
|
||||
tblAuthPlugins->verticalHeader()->setResizeMode( QHeaderView::ResizeToContents );
|
||||
tblAuthPlugins->setSortingEnabled( true );
|
||||
tblAuthPlugins->setSelectionBehavior( QAbstractItemView::SelectRows );
|
||||
}
|
||||
|
||||
void QgsAuthMethodPlugins::populateTable()
|
||||
{
|
||||
QgsAuthMethodsMap authmethods( QgsAuthManager::instance()->authMethodsMap() );
|
||||
|
||||
int i = 0;
|
||||
for ( QgsAuthMethodsMap::const_iterator it = authmethods.constBegin(); it != authmethods.constEnd(); ++it, i++ )
|
||||
{
|
||||
QgsAuthMethod *authmethod( it.value() );
|
||||
if ( !authmethod )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
QTableWidgetItem *twi = new QTableWidgetItem( authmethod->key() );
|
||||
twi->setFlags( twi->flags() & ~Qt::ItemIsEditable );
|
||||
tblAuthPlugins->setItem( i, 0, twi );
|
||||
|
||||
twi = new QTableWidgetItem( authmethod->displayDescription() );
|
||||
twi->setFlags( twi->flags() & ~Qt::ItemIsEditable );
|
||||
tblAuthPlugins->setItem( i, 1, twi );
|
||||
|
||||
twi = new QTableWidgetItem( authmethod->supportedDataProviders().join( ", " ) );
|
||||
twi->setFlags( twi->flags() & ~Qt::ItemIsEditable );
|
||||
tblAuthPlugins->setItem( i, 2, twi );
|
||||
}
|
||||
tblAuthPlugins->sortItems( 0 );
|
||||
}
|
||||
|
||||
|
||||
|
||||
QgsAuthEditorWidgets::QgsAuthEditorWidgets( QWidget *parent )
|
||||
: QWidget( parent )
|
||||
{
|
||||
setupUi( this );
|
||||
wdgtConfigEditor->setMessageBar( messageBar() );
|
||||
wdgtConfigEditor->showUtilitiesButton( false );
|
||||
setupUtilitiesMenu();
|
||||
}
|
||||
|
||||
QgsAuthEditorWidgets::~QgsAuthEditorWidgets()
|
||||
{
|
||||
}
|
||||
|
||||
void QgsAuthEditorWidgets::on_btnCertManager_clicked()
|
||||
{
|
||||
QgsAuthCertManager *dlg = new QgsAuthCertManager( this );
|
||||
dlg->setWindowModality( Qt::ApplicationModal );
|
||||
dlg->resize( 750, 500 );
|
||||
dlg->exec();
|
||||
dlg->deleteLater();
|
||||
}
|
||||
|
||||
void QgsAuthEditorWidgets::on_btnAuthPlugins_clicked()
|
||||
{
|
||||
QgsAuthMethodPlugins *dlg = new QgsAuthMethodPlugins( this );
|
||||
dlg->setWindowModality( Qt::WindowModal );
|
||||
dlg->resize( 675, 500 );
|
||||
dlg->exec();
|
||||
dlg->deleteLater();
|
||||
}
|
||||
|
||||
void QgsAuthEditorWidgets::setupUtilitiesMenu()
|
||||
{
|
||||
connect( QgsAuthManager::instance(), SIGNAL( messageOut( const QString&, const QString&, QgsAuthManager::MessageLevel ) ),
|
||||
this, SLOT( authMessageOut( const QString&, const QString&, QgsAuthManager::MessageLevel ) ) );
|
||||
|
||||
// set up utility actions menu
|
||||
mActionSetMasterPassword = new QAction( "Input master password", this );
|
||||
mActionClearCachedMasterPassword = new QAction( "Clear cached master password", this );
|
||||
mActionResetMasterPassword = new QAction( "Reset master password", this );
|
||||
mActionClearCachedAuthConfigs = new QAction( "Clear cached authentication configurations", this );
|
||||
mActionRemoveAuthConfigs = new QAction( "Remove all authentication configurations", this );
|
||||
mActionEraseAuthDatabase = new QAction( "Erase authentication database", this );
|
||||
|
||||
connect( mActionSetMasterPassword, SIGNAL( triggered() ), this, SLOT( setMasterPassword() ) );
|
||||
connect( mActionClearCachedMasterPassword, SIGNAL( triggered() ), this, SLOT( clearCachedMasterPassword() ) );
|
||||
connect( mActionResetMasterPassword, SIGNAL( triggered() ), this, SLOT( resetMasterPassword() ) );
|
||||
connect( mActionClearCachedAuthConfigs, SIGNAL( triggered() ), this, SLOT( clearCachedAuthenticationConfigs() ) );
|
||||
connect( mActionRemoveAuthConfigs, SIGNAL( triggered() ), this, SLOT( removeAuthenticationConfigs() ) );
|
||||
connect( mActionEraseAuthDatabase, SIGNAL( triggered() ), this, SLOT( eraseAuthenticationDatabase() ) );
|
||||
|
||||
mAuthUtilitiesMenu = new QMenu( this );
|
||||
mAuthUtilitiesMenu->addAction( mActionSetMasterPassword );
|
||||
mAuthUtilitiesMenu->addAction( mActionClearCachedMasterPassword );
|
||||
mAuthUtilitiesMenu->addAction( mActionResetMasterPassword );
|
||||
mAuthUtilitiesMenu->addSeparator();
|
||||
mAuthUtilitiesMenu->addAction( mActionClearCachedAuthConfigs );
|
||||
mAuthUtilitiesMenu->addAction( mActionRemoveAuthConfigs );
|
||||
mAuthUtilitiesMenu->addSeparator();
|
||||
mAuthUtilitiesMenu->addAction( mActionEraseAuthDatabase );
|
||||
|
||||
btnAuthUtilities->setMenu( mAuthUtilitiesMenu );
|
||||
}
|
||||
|
||||
void QgsAuthEditorWidgets::setMasterPassword()
|
||||
{
|
||||
QgsAuthGuiUtils::setMasterPassword( messageBar(), messageTimeout() );
|
||||
}
|
||||
|
||||
void QgsAuthEditorWidgets::clearCachedMasterPassword()
|
||||
{
|
||||
QgsAuthGuiUtils::clearCachedMasterPassword( messageBar(), messageTimeout() );
|
||||
}
|
||||
|
||||
void QgsAuthEditorWidgets::resetMasterPassword()
|
||||
{
|
||||
QgsAuthGuiUtils::resetMasterPassword( messageBar(), messageTimeout(), this );
|
||||
}
|
||||
|
||||
void QgsAuthEditorWidgets::clearCachedAuthenticationConfigs()
|
||||
{
|
||||
QgsAuthGuiUtils::clearCachedAuthenticationConfigs( messageBar(), messageTimeout() );
|
||||
}
|
||||
|
||||
void QgsAuthEditorWidgets::removeAuthenticationConfigs()
|
||||
{
|
||||
QgsAuthGuiUtils::removeAuthenticationConfigs( messageBar(), messageTimeout(), this );
|
||||
}
|
||||
|
||||
void QgsAuthEditorWidgets::eraseAuthenticationDatabase()
|
||||
{
|
||||
QgsAuthGuiUtils::eraseAuthenticationDatabase( messageBar(), messageTimeout(), this );
|
||||
}
|
||||
|
||||
void QgsAuthEditorWidgets::authMessageOut( const QString& message, const QString& authtag, QgsAuthManager::MessageLevel level )
|
||||
{
|
||||
int levelint = ( int )level;
|
||||
messageBar()->pushMessage( authtag, message, ( QgsMessageBar::MessageLevel )levelint, 7 );
|
||||
}
|
||||
|
||||
QgsMessageBar *QgsAuthEditorWidgets::messageBar()
|
||||
{
|
||||
return mMsgBar;
|
||||
}
|
||||
|
||||
int QgsAuthEditorWidgets::messageTimeout()
|
||||
{
|
||||
QSettings settings;
|
||||
return settings.value( "/qgis/messageTimeout", 5 ).toInt();
|
||||
}
|
@ -19,11 +19,36 @@
|
||||
|
||||
#include <QWidget>
|
||||
#include "ui_qgsautheditorwidgets.h"
|
||||
|
||||
class QTabWidget;
|
||||
#include "ui_qgsauthmethodplugins.h"
|
||||
|
||||
/** \ingroup gui
|
||||
* Widget for tabbed interface to separately available authentication editors
|
||||
* Dialog for viewing available authentication method plugins
|
||||
*/
|
||||
class GUI_EXPORT QgsAuthMethodPlugins : public QDialog, private Ui::QgsAuthMethodPlugins
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
/**
|
||||
* Construct a dialog for viewing available authentication method plugins
|
||||
* @param parent Parent widget
|
||||
*/
|
||||
explicit QgsAuthMethodPlugins( QWidget *parent = 0 );
|
||||
|
||||
~QgsAuthMethodPlugins();
|
||||
|
||||
private slots:
|
||||
void populateTable();
|
||||
|
||||
private:
|
||||
void setupTable();
|
||||
QVBoxLayout *mAuthNotifyLayout;
|
||||
QLabel *mAuthNotify;
|
||||
};
|
||||
|
||||
|
||||
/** \ingroup gui
|
||||
* Wrapper widget for available authentication editors
|
||||
*/
|
||||
class GUI_EXPORT QgsAuthEditorWidgets : public QWidget, private Ui::QgsAuthEditors
|
||||
{
|
||||
@ -34,16 +59,48 @@ class GUI_EXPORT QgsAuthEditorWidgets : public QWidget, private Ui::QgsAuthEdito
|
||||
* Construct a widget to contain various authentication editors
|
||||
* @param parent Parent widget
|
||||
*/
|
||||
explicit QgsAuthEditorWidgets( QWidget *parent = 0 ) :
|
||||
QWidget( parent )
|
||||
{
|
||||
setupUi( this );
|
||||
}
|
||||
explicit QgsAuthEditorWidgets( QWidget *parent = 0 );
|
||||
|
||||
~QgsAuthEditorWidgets() {}
|
||||
~QgsAuthEditorWidgets();
|
||||
|
||||
/** Get access to embedded tabbed widget */
|
||||
QTabWidget * tabbedWidget() { return tabWidget; }
|
||||
private slots:
|
||||
void on_btnCertManager_clicked();
|
||||
void on_btnAuthPlugins_clicked();
|
||||
|
||||
/** Sets the cached master password (and verifies it if its hash is in authentication database) */
|
||||
void setMasterPassword();
|
||||
|
||||
/** Clear the currently cached master password (not its hash in database) */
|
||||
void clearCachedMasterPassword();
|
||||
|
||||
/** Reset the cached master password, updating its hash in authentication database and reseting all existing configs to use it */
|
||||
void resetMasterPassword();
|
||||
|
||||
/** Clear all cached authentication configs for session */
|
||||
void clearCachedAuthenticationConfigs();
|
||||
|
||||
/** Remove all authentication configs */
|
||||
void removeAuthenticationConfigs();
|
||||
|
||||
/** Completely clear out the authentication database (configs and master password) */
|
||||
void eraseAuthenticationDatabase();
|
||||
|
||||
/** Relay messages to widget's messagebar */
|
||||
void authMessageOut( const QString& message, const QString& authtag, QgsAuthManager::MessageLevel level );
|
||||
|
||||
private:
|
||||
void setupUtilitiesMenu();
|
||||
|
||||
QgsMessageBar * messageBar();
|
||||
int messageTimeout();
|
||||
|
||||
QMenu *mAuthUtilitiesMenu;
|
||||
QAction *mActionSetMasterPassword;
|
||||
QAction *mActionClearCachedMasterPassword;
|
||||
QAction *mActionResetMasterPassword;
|
||||
QAction *mActionClearCachedAuthConfigs;
|
||||
QAction *mActionRemoveAuthConfigs;
|
||||
QAction *mActionEraseAuthDatabase;
|
||||
};
|
||||
|
||||
#endif // QGSAUTHEDITORWIDGETS_H
|
||||
|
135
src/ui/auth/qgsauthcertificatemanager.ui
Normal file
135
src/ui/auth/qgsauthcertificatemanager.ui
Normal file
@ -0,0 +1,135 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>QgsAuthCertManager</class>
|
||||
<widget class="QWidget" name="QgsAuthCertManager">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>706</width>
|
||||
<height>495</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Authentication Certificate Editors</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<property name="leftMargin">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QTabWidget" name="tabWidget">
|
||||
<property name="currentIndex">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<widget class="QWidget" name="tabIdentities">
|
||||
<attribute name="title">
|
||||
<string>Identities</string>
|
||||
</attribute>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||
<property name="leftMargin">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QgsAuthIdentitiesEditor" name="wdgtIdentitiesEditor" native="true"/>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QWidget" name="tabServers">
|
||||
<attribute name="title">
|
||||
<string>Servers</string>
|
||||
</attribute>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_4">
|
||||
<property name="leftMargin">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QgsAuthServersEditor" name="wdgtServersEditor" native="true"/>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QWidget" name="tabAuthorities">
|
||||
<attribute name="title">
|
||||
<string>Authorities</string>
|
||||
</attribute>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_5">
|
||||
<property name="leftMargin">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QgsAuthAuthoritiesEditor" name="wdgtAuthoritiesEditor" native="true"/>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="lblNote">
|
||||
<property name="font">
|
||||
<font>
|
||||
<italic>true</italic>
|
||||
</font>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">color: rgb(128, 128, 128);</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Note: Editing writes directly to authentication database</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<customwidgets>
|
||||
<customwidget>
|
||||
<class>QgsAuthIdentitiesEditor</class>
|
||||
<extends>QWidget</extends>
|
||||
<header>qgsauthidentitieseditor.h</header>
|
||||
<container>1</container>
|
||||
</customwidget>
|
||||
<customwidget>
|
||||
<class>QgsAuthServersEditor</class>
|
||||
<extends>QWidget</extends>
|
||||
<header>qgsauthserverseditor.h</header>
|
||||
<container>1</container>
|
||||
</customwidget>
|
||||
<customwidget>
|
||||
<class>QgsAuthAuthoritiesEditor</class>
|
||||
<extends>QWidget</extends>
|
||||
<header>qgsauthauthoritieseditor.h</header>
|
||||
<container>1</container>
|
||||
</customwidget>
|
||||
</customwidgets>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
@ -30,86 +30,108 @@
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QTabWidget" name="tabWidget">
|
||||
<property name="currentIndex">
|
||||
<number>0</number>
|
||||
<widget class="QGroupBox" name="grpbxConfigs">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>5</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<widget class="QWidget" name="tabConfigs">
|
||||
<attribute name="title">
|
||||
<string>Configurations</string>
|
||||
</attribute>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_3">
|
||||
<property name="leftMargin">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QgsAuthConfigEditor" name="wdgtConfigEditor" native="true"/>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QWidget" name="tabIdentities">
|
||||
<attribute name="title">
|
||||
<string>Identities</string>
|
||||
</attribute>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||
<property name="leftMargin">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QgsAuthIdentitiesEditor" name="wdgtIdentitiesEditor" native="true"/>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QWidget" name="tabServers">
|
||||
<attribute name="title">
|
||||
<string>Servers</string>
|
||||
</attribute>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_4">
|
||||
<property name="leftMargin">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QgsAuthServersEditor" name="wdgtServersEditor" native="true"/>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QWidget" name="tabAuthorities">
|
||||
<attribute name="title">
|
||||
<string>Authorities</string>
|
||||
</attribute>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_5">
|
||||
<property name="leftMargin">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QgsAuthAuthoritiesEditor" name="wdgtAuthoritiesEditor" native="true"/>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<property name="title">
|
||||
<string>Configurations</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_3">
|
||||
<property name="leftMargin">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>12</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QgsAuthConfigEditor" name="wdgtConfigEditor" native="true"/>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QgsMessageBar" name="mMsgBar"/>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QGroupBox" name="grpbxManagers">
|
||||
<property name="title">
|
||||
<string>Management</string>
|
||||
</property>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<property name="leftMargin">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QPushButton" name="btnAuthPlugins">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Maximum" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Installed Plugins</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../../../images/images.qrc">
|
||||
<normaloff>:/images/themes/default/mIconProperties.svg</normaloff>:/images/themes/default/mIconProperties.svg</iconset>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="btnCertManager">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Maximum" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Manage Certificates</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../../../images/images.qrc">
|
||||
<normaloff>:/images/themes/default/mIconCertificateTrusted.svg</normaloff>:/images/themes/default/mIconCertificateTrusted.svg</iconset>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="btnAuthUtilities">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Maximum" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Utilities</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../../plugins/georeferencer/georeferencer.qrc">
|
||||
<normaloff>:/icons/default/mActionTransformSettings.png</normaloff>:/icons/default/mActionTransformSettings.png</iconset>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
@ -140,24 +162,15 @@
|
||||
<container>1</container>
|
||||
</customwidget>
|
||||
<customwidget>
|
||||
<class>QgsAuthIdentitiesEditor</class>
|
||||
<extends>QWidget</extends>
|
||||
<header>qgsauthidentitieseditor.h</header>
|
||||
<container>1</container>
|
||||
</customwidget>
|
||||
<customwidget>
|
||||
<class>QgsAuthServersEditor</class>
|
||||
<extends>QWidget</extends>
|
||||
<header>qgsauthserverseditor.h</header>
|
||||
<container>1</container>
|
||||
</customwidget>
|
||||
<customwidget>
|
||||
<class>QgsAuthAuthoritiesEditor</class>
|
||||
<extends>QWidget</extends>
|
||||
<header>qgsauthauthoritieseditor.h</header>
|
||||
<class>QgsMessageBar</class>
|
||||
<extends>QFrame</extends>
|
||||
<header>qgsmessagebar.h</header>
|
||||
<container>1</container>
|
||||
</customwidget>
|
||||
</customwidgets>
|
||||
<resources/>
|
||||
<resources>
|
||||
<include location="../../../images/images.qrc"/>
|
||||
<include location="../../plugins/georeferencer/georeferencer.qrc"/>
|
||||
</resources>
|
||||
<connections/>
|
||||
</ui>
|
||||
|
50
src/ui/auth/qgsauthmethodplugins.ui
Normal file
50
src/ui/auth/qgsauthmethodplugins.ui
Normal file
@ -0,0 +1,50 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>QgsAuthMethodPlugins</class>
|
||||
<widget class="QDialog" name="QgsAuthMethodPlugins">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>400</width>
|
||||
<height>300</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Dialog</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<property name="leftMargin">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="text">
|
||||
<string>Installed authentication method plugins</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QTableWidget" name="tblAuthPlugins"/>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QDialogButtonBox" name="buttonBox">
|
||||
<property name="standardButtons">
|
||||
<set>QDialogButtonBox::Close</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
Loading…
x
Reference in New Issue
Block a user