Simplify and split DirectoryServicesWidget

The old UI was probably written under the assumption that there
will be support for multiple OpenPGP Keyserver entries at some point.
We now only support a single entry for keyserver.
As GnuPG only supports a single Keyserver URL the old widget
lead to confusion and buggy behavior as it allowed the user to
configure multiple PGP Keyservers which were not respected or
could not be configured through gpgconf.

GnuPG since 2.1.16 has a built in keyserver URL, the placeholder
text in the line entry when no other keyserver is configured is
intended to reflect that.

API compatibility is kept with the old widget operation. Even though
I doubt that the read only settings are actually used in practice.

While this fixes bugs let's keep it in master because of regression
risks.

BUG: 192059
BUG: 359151
parent cad9d0a6
This diff is collapsed.
......@@ -97,9 +97,7 @@ Q_SIGNALS:
private:
class Private;
Private *const d;
Q_PRIVATE_SLOT(d, void slotNewClicked())
Q_PRIVATE_SLOT(d, void slotNewX509Clicked())
Q_PRIVATE_SLOT(d, void slotNewOpenPGPClicked())
Q_PRIVATE_SLOT(d, void slotDeleteClicked())
Q_PRIVATE_SLOT(d, void slotSelectionChanged())
Q_PRIVATE_SLOT(d, void slotShowUserAndPasswordToggled(bool))
......
......@@ -14,120 +14,125 @@
<string>Directory Services Configuration</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QLabel" name="x500LA">
<property name="frameShape">
<enum>QFrame::NoFrame</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Plain</enum>
</property>
<property name="text">
<string>Directory services:</string>
</property>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QTreeView" name="treeView">
<property name="whatsThis">
<string>This is a list of all directory services that are configured for use with X.509 and OpenPGP.</string>
</property>
<property name="rootIsDecorated">
<bool>false</bool>
</property>
<property name="allColumnsShowFocus">
<bool>false</bool>
<widget class="QLabel" name="pgpKSLabel">
<property name="text">
<string>OpenPGP Keyserver:</string>
</property>
</widget>
</item>
<item>
<layout class="QVBoxLayout" name="vlay">
<property name="spacing">
<number>6</number>
</property>
<property name="margin">
<number>0</number>
</property>
<item>
<widget class="QToolButton" name="newTB">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="toolTip">
<string>Click to add a service</string>
</property>
<property name="whatsThis">
<string>Click this button to create a new directory service entry as a clone of the currently selected one (or with default values, if no other is selected). You can then configure details in the table on the left hand.</string>
</property>
<property name="text">
<string>New</string>
</property>
<property name="popupMode">
<enum>QToolButton::MenuButtonPopup</enum>
</property>
<property name="toolButtonStyle">
<enum>Qt::ToolButtonTextBesideIcon</enum>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="deleteTB">
<property name="enabled">
<bool>false</bool>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="toolTip">
<string>Click to remove the currently selected service</string>
</property>
<property name="whatsThis">
<string>Click this button to remove the currently selected directory service. The change will only take effect once you acknowledge the main configuration dialog.</string>
</property>
<property name="text">
<string>Delete</string>
</property>
<property name="toolButtonStyle">
<enum>Qt::ToolButtonTextBesideIcon</enum>
</property>
</widget>
</item>
<item>
<spacer>
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Expanding</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>51</height>
</size>
</property>
</spacer>
</item>
</layout>
<widget class="QLineEdit" name="pgpKeyserver">
</widget>
</item>
</layout>
</item>
<item>
<widget class="QCheckBox" name="showUserAndPasswordCB">
<property name="whatsThis">
<string>Use this option to switch display of username and password information on or off in the above table.</string>
</property>
<property name="text">
<string>Show user and password information</string>
<widget class="QGroupBox" name="x500LA">
<property name="title">
<string>X509 Directory services:</string>
</property>
<layout class="QVBoxLayout" name="grpVbox">
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QTreeView" name="treeView">
<property name="whatsThis">
<string>This is a list of all directory services that are configured for use with X.509.</string>
</property>
<property name="rootIsDecorated">
<bool>false</bool>
</property>
<property name="allColumnsShowFocus">
<bool>false</bool>
</property>
</widget>
</item>
<item>
<layout class="QVBoxLayout" name="vlay">
<property name="spacing">
<number>6</number>
</property>
<property name="margin">
<number>0</number>
</property>
<item>
<widget class="QToolButton" name="newTB">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="toolTip">
<string>Click to add a service</string>
</property>
<property name="whatsThis">
<string>Click this button to create a new directory service entry as a clone of the currently selected one (or with default values, if no other is selected). You can then configure details in the table on the left hand.</string>
</property>
<property name="text">
<string>New</string>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="deleteTB">
<property name="enabled">
<bool>false</bool>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="toolTip">
<string>Click to remove the currently selected service</string>
</property>
<property name="whatsThis">
<string>Click this button to remove the currently selected directory service. The change will only take effect once you acknowledge the main configuration dialog.</string>
</property>
<property name="text">
<string>Delete</string>
</property>
<property name="toolButtonStyle">
<enum>Qt::ToolButtonTextBesideIcon</enum>
</property>
</widget>
</item>
<item>
<spacer>
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Expanding</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>51</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
</layout>
</item>
<item>
<widget class="QCheckBox" name="showUserAndPasswordCB">
<property name="whatsThis">
<string>Use this option to switch display of username and password information on or off in the above table.</string>
</property>
<property name="text">
<string>Show user and password information</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
</layout>
......@@ -138,7 +143,7 @@
<sender>newTB</sender>
<signal>clicked()</signal>
<receiver>DirectoryServicesWidget</receiver>
<slot>slotNewClicked()</slot>
<slot>slotNewX509Clicked()</slot>
<hints>
<hint type="sourcelabel">
<x>535</x>
......@@ -184,7 +189,7 @@
</connection>
</connections>
<slots>
<slot>slotNewClicked()</slot>
<slot>slotNewX509Clicked()</slot>
<slot>slotDeleteClicked()</slot>
<slot>slotShowUserAndPasswordToggled(bool)</slot>
</slots>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment