Skip to content
Permalink
Browse files

[auth] Update embedded QgsAuthSettingsWidget spacing

- Minimize all text-wrapped QLabel text in QgsAuthSettingsWidget
  (wrapped text defaulted to 3 lines of spacing, even if not used)
- Remove default 'Basic' text
- Hide Basic QLabel if there is no text
- Add 'Optional' placholder text for Password of Basic
- Fix non-expanded Name and URL fields for newhttpconnectionbase.ui
- Smaller minimum size for QgsAuthConfigSelect
- Minimize 'Convert to configuration' button width
  • Loading branch information
dakcarto committed Oct 4, 2017
1 parent 191942a commit 74e9242d44e7cb80a34245973902be9e70850c76
@@ -38,6 +38,7 @@ QgsAuthSettingsWidget::QgsAuthSettingsWidget( QWidget *parent,
{
mAuthConfigSelect->setConfigId( configId );
}
setBasicText( "" );
connect( btnConvertToEncrypted, &QPushButton::clicked, this, &QgsAuthSettingsWidget::convertToEncrypted );
connect( txtUserName, &QLineEdit::textChanged, this, &QgsAuthSettingsWidget::userNameTextChanged );
connect( txtPassword, &QLineEdit::textChanged, this, &QgsAuthSettingsWidget::passwordTextChanged );
@@ -55,6 +56,8 @@ void QgsAuthSettingsWidget::setWarningText( const QString &warningText )
void QgsAuthSettingsWidget::setBasicText( const QString &basicText )
{
lblBasic->setText( basicText );
// hide unused widget so its word wrapping does not add to parent widget's height
lblBasic->setVisible( ! basicText.isEmpty() );
}

const QString QgsAuthSettingsWidget::username() const
@@ -29,7 +29,7 @@
<item>
<layout class="QGridLayout" name="gridLayout">
<property name="verticalSpacing">
<number>10</number>
<number>6</number>
</property>
<item row="1" column="0">
<widget class="QComboBox" name="cmbConfigSelect">
@@ -41,7 +41,7 @@
</property>
<property name="minimumSize">
<size>
<width>250</width>
<width>125</width>
<height>0</height>
</size>
</property>
@@ -146,12 +146,6 @@
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
</layout>
@@ -6,14 +6,29 @@
<rect>
<x>0</x>
<y>0</y>
<width>405</width>
<height>264</height>
<width>315</width>
<height>243</height>
</rect>
</property>
<property name="windowTitle">
<string>Form</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<property name="spacing">
<number>0</number>
</property>
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item>
<widget class="QTabWidget" name="tabAuth">
<property name="sizePolicy">
@@ -30,39 +45,66 @@
<string>Configurations</string>
</attribute>
<layout class="QVBoxLayout" name="verticalLayout_4">
<property name="spacing">
<number>6</number>
</property>
<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_5">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Minimum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Choose an authentication configuration or create a new one.</string>
<string>Choose or create a configuration.</string>
</property>
<property name="textFormat">
<enum>Qt::PlainText</enum>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QgsAuthConfigSelect" name="mAuthConfigSelect">
<widget class="QgsAuthConfigSelect" name="mAuthConfigSelect" native="true">
<property name="enabled">
<bool>true</bool>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
<sizepolicy hsizetype="Maximum" vsizetype="Minimum">
<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="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Minimum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Credentials are safely stored in the encrypted QGIS authentication database, protected by your master password. </string>
<string>Credentials are encrypted and stored in the QGIS authentication database. </string>
</property>
<property name="textFormat">
<enum>Qt::PlainText</enum>
</property>
<property name="wordWrap">
<bool>true</bool>
@@ -76,8 +118,8 @@
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>80</height>
<width>0</width>
<height>0</height>
</size>
</property>
</spacer>
@@ -89,7 +131,22 @@
<string>Basic</string>
</attribute>
<layout class="QGridLayout" name="gridLayout_3">
<item row="5" column="1">
<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>
<property name="spacing">
<number>6</number>
</property>
<item row="6" column="1">
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
@@ -114,9 +171,18 @@
</item>
<item row="2" column="1">
<widget class="QgsPasswordLineEdit" name="txtPassword">
<property name="minimumSize">
<size>
<width>80</width>
<height>0</height>
</size>
</property>
<property name="echoMode">
<enum>QLineEdit::Password</enum>
</property>
<property name="placeholderText">
<string>Optional</string>
</property>
</widget>
</item>
<item row="2" column="0">
@@ -130,7 +196,14 @@
</widget>
</item>
<item row="1" column="1">
<widget class="QLineEdit" name="txtUserName"/>
<widget class="QLineEdit" name="txtUserName">
<property name="minimumSize">
<size>
<width>80</width>
<height>0</height>
</size>
</property>
</widget>
</item>
<item row="1" column="2">
<widget class="QCheckBox" name="cbStoreUsername">
@@ -152,17 +225,16 @@
</property>
</widget>
</item>
<item row="4" column="0" colspan="3">
<widget class="QPushButton" name="btnConvertToEncrypted">
<property name="text">
<string>Convert to configuration</string>
</property>
</widget>
</item>
<item row="3" column="0" colspan="3">
<widget class="QLabel" name="lblWarning">
<property name="text">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;span style=&quot; font-weight:600; color:#ff0000;&quot;&gt;Warning: credentials are stored unencrypted (in clear text) in the project file!&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;span style=&quot; font-weight:600; color:#ff0000;&quot;&gt;Warning: credentials stored unencrypted!&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="textFormat">
<enum>Qt::RichText</enum>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
<property name="wordWrap">
<bool>true</bool>
@@ -171,23 +243,37 @@
</item>
<item row="0" column="0" colspan="3">
<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>
<string/>
</property>
<property name="textFormat">
<enum>Qt::PlainText</enum>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
<property name="textInteractionFlags">
<set>Qt::NoTextInteraction</set>
</property>
</widget>
</item>
<item row="4" column="0" colspan="3">
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QPushButton" name="btnConvertToEncrypted">
<property name="sizePolicy">
<sizepolicy hsizetype="Maximum" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Convert to configuration</string>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
</widget>
@@ -202,8 +288,9 @@
</customwidget>
<customwidget>
<class>QgsAuthConfigSelect</class>
<extends>QLineEdit</extends>
<extends>QWidget</extends>
<header>qgsauthconfigselect.h</header>
<container>1</container>
</customwidget>
</customwidgets>
<tabstops>
@@ -94,6 +94,18 @@
<string>Authentication</string>
</property>
<layout class="QGridLayout" name="gridLayout">
<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 row="0" column="0">
<widget class="QgsAuthSettingsWidget" name="mAuthSettings" native="true"/>
</item>

0 comments on commit 74e9242

Please sign in to comment.
You can’t perform that action at this time.