Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[auth] New authentication settings widget
- Loading branch information
Showing
5 changed files
with
272 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
/*************************************************************************** | ||
qgsauthenticationwidget.cpp - QgsAuthenticationWidget | ||
--------------------- | ||
begin : 28.9.2017 | ||
copyright : (C) 2017 by Alessandro Pasotti | ||
email : apasotti 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 "qgsauthenticationwidget.h" | ||
|
||
QgsAuthenticationWidget::QgsAuthenticationWidget( QWidget *parent, const QString &dataprovider ) | ||
: QWidget( parent ) | ||
{ | ||
setupUi( new QgsAuthConfigSelect( this, dataprovider ) ); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
/*************************************************************************** | ||
qgsauthenticationwidget.h - QgsAuthenticationWidget | ||
--------------------- | ||
begin : 28.9.2017 | ||
copyright : (C) 2017 by Alessandro Pasotti | ||
email : apasotti 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 QGSAUTHENTICATIONWIDGET_H | ||
#define QGSAUTHENTICATIONWIDGET_H | ||
|
||
#include "qgis_gui.h" | ||
#include "qgis.h" | ||
|
||
#include "ui_qgsauthenticationwidget.h" | ||
|
||
#include <QWidget> | ||
|
||
/** \ingroup gui | ||
* Widget for entering authentication credentials both in the form username/password | ||
* and by using QGIS Authentication Database and its authentication configurations. | ||
*/ | ||
class GUI_EXPORT QgsAuthenticationWidget : public QWidget, private Ui::QgsAuthenticationWidget | ||
{ | ||
|
||
Q_OBJECT | ||
|
||
public: | ||
|
||
/** | ||
* Create a dialog for setting an associated authentication config, either | ||
* from existing configs, or creating/removing them from auth database | ||
* \param parent Parent widget | ||
* \param dataprovider The key of the calling layer provider, if applicable | ||
*/ | ||
explicit QgsAuthenticationWidget( QWidget *parent SIP_TRANSFERTHIS = 0, const QString &dataprovider = QString() ); | ||
|
||
}; | ||
|
||
#endif // QGSAUTHENTICATIONWIDGET_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,198 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<ui version="4.0"> | ||
<class>QgsAuthenticationWidget</class> | ||
<widget class="QWidget" name="QgsAuthenticationWidget"> | ||
<property name="geometry"> | ||
<rect> | ||
<x>0</x> | ||
<y>0</y> | ||
<width>400</width> | ||
<height>300</height> | ||
</rect> | ||
</property> | ||
<property name="windowTitle"> | ||
<string>Form</string> | ||
</property> | ||
<layout class="QVBoxLayout" name="verticalLayout_2"> | ||
<item> | ||
<widget class="QGroupBox" name="groupBox"> | ||
<property name="title"> | ||
<string>Authentication</string> | ||
</property> | ||
<layout class="QVBoxLayout" name="verticalLayout"> | ||
<item> | ||
<widget class="QTabWidget" name="tabAuth"> | ||
<property name="sizePolicy"> | ||
<sizepolicy hsizetype="Expanding" vsizetype="MinimumExpanding"> | ||
<horstretch>0</horstretch> | ||
<verstretch>0</verstretch> | ||
</sizepolicy> | ||
</property> | ||
<property name="currentIndex"> | ||
<number>1</number> | ||
</property> | ||
<widget class="QWidget" name="tabConfigurations"> | ||
<attribute name="title"> | ||
<string>Configurations</string> | ||
</attribute> | ||
<layout class="QVBoxLayout" name="verticalLayout_4"> | ||
<item> | ||
<widget class="QLabel" name="label_5"> | ||
<property name="text"> | ||
<string>Choose an authentication configuration or create a new one.</string> | ||
</property> | ||
<property name="wordWrap"> | ||
<bool>true</bool> | ||
</property> | ||
</widget> | ||
</item> | ||
<item> | ||
<widget class="QgsAuthConfigSelect" name="mAuthConfigSelect" native="true"> | ||
<property name="sizePolicy"> | ||
<sizepolicy hsizetype="Preferred" vsizetype="Fixed"> | ||
<horstretch>0</horstretch> | ||
<verstretch>0</verstretch> | ||
</sizepolicy> | ||
</property> | ||
<property name="minimumSize"> | ||
<size> | ||
<width>0</width> | ||
<height>20</height> | ||
</size> | ||
</property> | ||
</widget> | ||
</item> | ||
<item> | ||
<widget class="QLabel" name="label_6"> | ||
<property name="text"> | ||
<string>Credentials are safely stored in the encrypted QGIS authentication database, protected by your master password. </string> | ||
</property> | ||
<property name="wordWrap"> | ||
<bool>true</bool> | ||
</property> | ||
</widget> | ||
</item> | ||
<item> | ||
<spacer name="verticalSpacer_2"> | ||
<property name="orientation"> | ||
<enum>Qt::Vertical</enum> | ||
</property> | ||
<property name="sizeHint" stdset="0"> | ||
<size> | ||
<width>20</width> | ||
<height>80</height> | ||
</size> | ||
</property> | ||
</spacer> | ||
</item> | ||
</layout> | ||
</widget> | ||
<widget class="QWidget" name="tabBasic"> | ||
<attribute name="title"> | ||
<string>Basic</string> | ||
</attribute> | ||
<layout class="QGridLayout" name="gridLayout_3"> | ||
<item row="3" column="0" colspan="2"> | ||
<widget class="QLabel" name="label_4"> | ||
<property name="text"> | ||
<string><html><head/><body><p><span style=" font-weight:600; color:#ff0000;">Note: credentials are stored unencrypted (in clear text) in the project file.</span></p></body></html></string> | ||
</property> | ||
<property name="wordWrap"> | ||
<bool>true</bool> | ||
</property> | ||
</widget> | ||
</item> | ||
<item row="5" column="1"> | ||
<spacer name="verticalSpacer"> | ||
<property name="orientation"> | ||
<enum>Qt::Vertical</enum> | ||
</property> | ||
<property name="sizeHint" stdset="0"> | ||
<size> | ||
<width>0</width> | ||
<height>0</height> | ||
</size> | ||
</property> | ||
</spacer> | ||
</item> | ||
<item row="1" column="0"> | ||
<widget class="QLabel" name="label_2"> | ||
<property name="text"> | ||
<string>&User name</string> | ||
</property> | ||
<property name="buddy"> | ||
<cstring>txtUserName</cstring> | ||
</property> | ||
</widget> | ||
</item> | ||
<item row="2" column="1"> | ||
<widget class="QgsPasswordLineEdit" name="txtPassword"> | ||
<property name="echoMode"> | ||
<enum>QLineEdit::Password</enum> | ||
</property> | ||
</widget> | ||
</item> | ||
<item row="2" column="0"> | ||
<widget class="QLabel" name="label_3"> | ||
<property name="text"> | ||
<string>Password</string> | ||
</property> | ||
<property name="buddy"> | ||
<cstring>txtPassword</cstring> | ||
</property> | ||
</widget> | ||
</item> | ||
<item row="1" column="1"> | ||
<widget class="QLineEdit" name="txtUserName"/> | ||
</item> | ||
<item row="0" column="0" colspan="2"> | ||
<widget class="QLabel" name="lblBasic"> | ||
<property name="sizePolicy"> | ||
<sizepolicy hsizetype="Minimum" vsizetype="Fixed"> | ||
<horstretch>0</horstretch> | ||
<verstretch>0</verstretch> | ||
</sizepolicy> | ||
</property> | ||
<property name="text"> | ||
<string>If the service requires basic authentication, enter a user name and optional password</string> | ||
</property> | ||
<property name="textFormat"> | ||
<enum>Qt::PlainText</enum> | ||
</property> | ||
<property name="wordWrap"> | ||
<bool>true</bool> | ||
</property> | ||
</widget> | ||
</item> | ||
<item row="4" column="0" colspan="2"> | ||
<widget class="QPushButton" name="pushButton"> | ||
<property name="text"> | ||
<string>Convert to encrypted</string> | ||
</property> | ||
</widget> | ||
</item> | ||
</layout> | ||
</widget> | ||
</widget> | ||
</item> | ||
</layout> | ||
</widget> | ||
</item> | ||
</layout> | ||
</widget> | ||
<customwidgets> | ||
<customwidget> | ||
<class>QgsPasswordLineEdit</class> | ||
<extends>QLineEdit</extends> | ||
<header>qgspasswordlineedit.h</header> | ||
</customwidget> | ||
<customwidget> | ||
<class>QgsAuthConfigSelect</class> | ||
<extends>QWidget</extends> | ||
<header location="global">qgsauthconfigselect.h</header> | ||
<container>1</container> | ||
</customwidget> | ||
</customwidgets> | ||
<resources/> | ||
<connections/> | ||
</ui> |