dbhub: Add list of CA certificates and restructure code

Change the layout of the preferences dialog a bit.

Remove the server selection combo box from the preferences dialog as it
will probably never be required. The way we do logins using certificates
kind of makes this obsolete, I think.

Restructure the whole remote code a little bit. Also add helper
functions here and there.

Show a list of our the CA certificates built into the application in the
preferences dialog. This list is read only of course but still
informative as it tells the user which sites are supported ny DB4S.
This commit is contained in:
Martin Kleusberg
2016-11-01 19:45:42 +01:00
parent e9894b47fa
commit 6283f97598
9 changed files with 284 additions and 212 deletions

View File

@@ -7,7 +7,7 @@
<x>0</x>
<y>0</y>
<width>590</width>
<height>555</height>
<height>614</height>
</rect>
</property>
<property name="windowTitle">
@@ -26,180 +26,137 @@
<attribute name="title">
<string>&amp;General</string>
</attribute>
<widget class="QWidget" name="formLayoutWidget">
<property name="geometry">
<rect>
<x>32</x>
<y>20</y>
<width>503</width>
<height>251</height>
</rect>
</property>
<layout class="QFormLayout" name="formLayout_3">
<item row="0" column="0">
<widget class="QLabel" name="label_4">
<property name="text">
<string>Default &amp;location</string>
</property>
<property name="buddy">
<cstring>locationEdit</cstring>
</property>
</widget>
</item>
<item row="0" column="1">
<layout class="QVBoxLayout" name="verticalLayout_6">
<item>
<widget class="QComboBox" name="comboDefaultLocation">
<item>
<property name="text">
<string>Remember last location</string>
</property>
</item>
<item>
<property name="text">
<string>Always use this location</string>
</property>
</item>
<item>
<property name="text">
<string>Remember last location for session only</string>
</property>
</item>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QLineEdit" name="locationEdit">
<property name="enabled">
<bool>false</bool>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>316</width>
<height>0</height>
</size>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="setLocationButton">
<property name="text">
<string>...</string>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_9">
<property name="text">
<string>Lan&amp;guage</string>
</property>
<property name="buddy">
<cstring>languageComboBox</cstring>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="labelUseRemotes">
<property name="text">
<string>Show remote options</string>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="labelUpdates">
<property name="text">
<string>Automatic &amp;updates</string>
</property>
<property name="buddy">
<cstring>checkUpdates</cstring>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="QCheckBox" name="checkUpdates">
<property name="text">
<string>enabled</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QComboBox" name="languageComboBox">
<property name="sizePolicy">
<sizepolicy hsizetype="Maximum" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="sizeAdjustPolicy">
<enum>QComboBox::AdjustToContents</enum>
</property>
<property name="minimumContentsLength">
<number>35</number>
</property>
<property name="iconSize">
<size>
<width>20</width>
<height>15</height>
</size>
</property>
</widget>
</item>
<item row="2" column="1">
<layout class="QHBoxLayout" name="horizontalLayout_3">
<item>
<widget class="QCheckBox" name="checkUseRemotes">
<layout class="QFormLayout" name="formLayout_3">
<item row="0" column="0">
<widget class="QLabel" name="label_4">
<property name="text">
<string>Default &amp;location</string>
</property>
<property name="buddy">
<cstring>locationEdit</cstring>
</property>
</widget>
</item>
<item row="0" column="1">
<layout class="QVBoxLayout" name="verticalLayout_6">
<item>
<widget class="QComboBox" name="comboDefaultLocation">
<item>
<property name="text">
<string>enabled</string>
<string>Remember last location</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QLabel" name="labelRemoteServer">
</item>
<item>
<property name="text">
<string>Remote server</string>
<string>Always use this location</string>
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="comboRemoteServer">
<item>
<property name="text">
<string>dbhub.io</string>
</item>
<item>
<property name="text">
<string>Remember last location for session only</string>
</property>
</item>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QLineEdit" name="locationEdit">
<property name="enabled">
<bool>false</bool>
</property>
</item>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>316</width>
<height>0</height>
</size>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="setLocationButton">
<property name="text">
<string>...</string>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_9">
<property name="text">
<string>Lan&amp;guage</string>
</property>
<property name="buddy">
<cstring>languageComboBox</cstring>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QComboBox" name="languageComboBox">
<property name="sizePolicy">
<sizepolicy hsizetype="Maximum" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="sizeAdjustPolicy">
<enum>QComboBox::AdjustToContents</enum>
</property>
<property name="minimumContentsLength">
<number>35</number>
</property>
<property name="iconSize">
<size>
<width>20</width>
<height>15</height>
</size>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="labelUseRemotes">
<property name="text">
<string>Show remote options</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QCheckBox" name="checkUseRemotes">
<property name="text">
<string>enabled</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="labelUpdates">
<property name="text">
<string>Automatic &amp;updates</string>
</property>
<property name="buddy">
<cstring>checkUpdates</cstring>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="QCheckBox" name="checkUpdates">
<property name="text">
<string>enabled</string>
</property>
</widget>
</item>
</layout>
</widget>
<widget class="QWidget" name="tab">
<attribute name="title">
@@ -1049,6 +1006,55 @@
</item>
</layout>
</widget>
<widget class="QWidget" name="tabRemote">
<attribute name="title">
<string>Remote</string>
</attribute>
<layout class="QFormLayout" name="formLayout_5">
<item row="0" column="0">
<widget class="QLabel" name="label_21">
<property name="text">
<string>CA certificates</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QTableWidget" name="tableCaCerts">
<column>
<property name="text">
<string>Subject CN</string>
</property>
<property name="toolTip">
<string>Common Name</string>
</property>
</column>
<column>
<property name="text">
<string>Subject O</string>
</property>
<property name="toolTip">
<string>Organization</string>
</property>
</column>
<column>
<property name="text">
<string>Valid from</string>
</property>
</column>
<column>
<property name="text">
<string>Valid to</string>
</property>
</column>
<column>
<property name="text">
<string>Serial number</string>
</property>
</column>
</widget>
</item>
</layout>
</widget>
</widget>
</item>
<item>
@@ -1118,8 +1124,8 @@
<slot>saveSettings()</slot>
<hints>
<hint type="sourcelabel">
<x>281</x>
<y>525</y>
<x>287</x>
<y>607</y>
</hint>
<hint type="destinationlabel">
<x>155</x>
@@ -1134,8 +1140,8 @@
<slot>reject()</slot>
<hints>
<hint type="sourcelabel">
<x>349</x>
<y>525</y>
<x>355</x>
<y>607</y>
</hint>
<hint type="destinationlabel">
<x>286</x>
@@ -1151,7 +1157,7 @@
<hints>
<hint type="sourcelabel">
<x>571</x>
<y>99</y>
<y>97</y>
</hint>
<hint type="destinationlabel">
<x>245</x>
@@ -1167,7 +1173,7 @@
<hints>
<hint type="sourcelabel">
<x>571</x>
<y>137</y>
<y>135</y>
</hint>
<hint type="destinationlabel">
<x>245</x>
@@ -1198,8 +1204,8 @@
<slot>chooseLocation()</slot>
<hints>
<hint type="sourcelabel">
<x>567</x>
<y>100</y>
<x>571</x>
<y>114</y>
</hint>
<hint type="destinationlabel">
<x>294</x>
@@ -1214,12 +1220,12 @@
<slot>setVisible(bool)</slot>
<hints>
<hint type="sourcelabel">
<x>375</x>
<y>202</y>
<x>365</x>
<y>207</y>
</hint>
<hint type="destinationlabel">
<x>64</x>
<y>243</y>
<x>55</x>
<y>252</y>
</hint>
</hints>
</connection>
@@ -1230,12 +1236,28 @@
<slot>setVisible(bool)</slot>
<hints>
<hint type="sourcelabel">
<x>375</x>
<y>202</y>
<x>365</x>
<y>207</y>
</hint>
<hint type="destinationlabel">
<x>375</x>
<y>251</y>
<x>365</x>
<y>252</y>
</hint>
</hints>
</connection>
<connection>
<sender>checkUseRemotes</sender>
<signal>toggled(bool)</signal>
<receiver>PreferencesDialog</receiver>
<slot>activateRemoteTab(bool)</slot>
<hints>
<hint type="sourcelabel">
<x>161</x>
<y>172</y>
</hint>
<hint type="destinationlabel">
<x>382</x>
<y>572</y>
</hint>
</hints>
</connection>
@@ -1246,5 +1268,6 @@
<slot>showColourDialog(QTreeWidgetItem*,int)</slot>
<slot>addExtension()</slot>
<slot>removeExtension()</slot>
<slot>activateRemoteTab(bool)</slot>
</slots>
</ui>