summaryrefslogtreecommitdiffstats
path: root/examples/network/securesocketclient
diff options
context:
space:
mode:
authorDavid Boddie <david.boddie@nokia.com>2011-04-27 19:16:41 +0200
committerDavid Boddie <david.boddie@nokia.com>2011-05-23 14:24:07 +0200
commit0748751c9f097d9d866605306bbdd4b96e2a5c4e (patch)
tree1838365e6ad6592a26e193289d2136cb89319972 /examples/network/securesocketclient
parent5feefb0c039dae04290d1fca7c2f24276b6f7582 (diff)
Squashed commit of the changes from the mobile-examples repository
(4.7-generated-declarative branch).
Diffstat (limited to 'examples/network/securesocketclient')
-rw-r--r--examples/network/securesocketclient/certificateinfo.cpp4
-rw-r--r--examples/network/securesocketclient/certificateinfo.ui68
-rw-r--r--examples/network/securesocketclient/main.cpp4
-rw-r--r--examples/network/securesocketclient/securesocketclient.pro3
-rw-r--r--examples/network/securesocketclient/sslclient.cpp7
-rw-r--r--examples/network/securesocketclient/sslclient.ui223
-rw-r--r--examples/network/securesocketclient/sslerrors.ui57
7 files changed, 201 insertions, 165 deletions
diff --git a/examples/network/securesocketclient/certificateinfo.cpp b/examples/network/securesocketclient/certificateinfo.cpp
index ff3a4d2f3c..b1a9acb0b2 100644
--- a/examples/network/securesocketclient/certificateinfo.cpp
+++ b/examples/network/securesocketclient/certificateinfo.cpp
@@ -47,7 +47,7 @@ CertificateInfo::CertificateInfo(QWidget *parent)
form = new Ui_CertificateInfo;
form->setupUi(this);
- connect(form->certificationPathView, SIGNAL(currentRowChanged(int)),
+ connect(form->certificationPathView, SIGNAL(currentIndexChanged(int)),
this, SLOT(updateCertificateInfo(int)));
}
@@ -69,7 +69,7 @@ void CertificateInfo::setCertificateChain(const QList<QSslCertificate> &chain)
.arg(cert.subjectInfo(QSslCertificate::CommonName)));
}
- form->certificationPathView->setCurrentRow(0);
+ form->certificationPathView->setCurrentIndex(0);
}
void CertificateInfo::updateCertificateInfo(int index)
diff --git a/examples/network/securesocketclient/certificateinfo.ui b/examples/network/securesocketclient/certificateinfo.ui
index 3761fe8f50..c5238eb3e1 100644
--- a/examples/network/securesocketclient/certificateinfo.ui
+++ b/examples/network/securesocketclient/certificateinfo.ui
@@ -1,7 +1,8 @@
-<ui version="4.0" >
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
<class>CertificateInfo</class>
- <widget class="QDialog" name="CertificateInfo" >
- <property name="geometry" >
+ <widget class="QDialog" name="CertificateInfo">
+ <property name="geometry">
<rect>
<x>0</x>
<y>0</y>
@@ -9,42 +10,57 @@
<height>397</height>
</rect>
</property>
- <property name="windowTitle" >
+ <property name="windowTitle">
<string>Display Certificate Information</string>
</property>
- <layout class="QVBoxLayout" >
+ <layout class="QVBoxLayout">
+ <property name="sizeConstraint">
+ <enum>QLayout::SetDefaultConstraint</enum>
+ </property>
<item>
- <widget class="QGroupBox" name="groupBox" >
- <property name="title" >
+ <widget class="QLabel" name="label">
+ <property name="text">
<string>Certification Path</string>
</property>
- <layout class="QHBoxLayout" >
- <item>
- <widget class="QListWidget" name="certificationPathView" />
- </item>
- </layout>
</widget>
</item>
<item>
- <widget class="QGroupBox" name="groupBox_2" >
- <property name="title" >
+ <widget class="QComboBox" name="certificationPathView">
+ <property name="minimumContentsLength">
+ <number>3</number>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLabel" name="label_2">
+ <property name="text">
<string>Certificate Information</string>
</property>
- <layout class="QHBoxLayout" >
- <item>
- <widget class="QListWidget" name="certificateInfoView" />
- </item>
- </layout>
</widget>
</item>
<item>
- <layout class="QHBoxLayout" >
+ <widget class="QListWidget" name="certificateInfoView">
+ <property name="font">
+ <font>
+ <pointsize>8</pointsize>
+ </font>
+ </property>
+ <property name="wordWrap">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <layout class="QHBoxLayout">
+ <property name="sizeConstraint">
+ <enum>QLayout::SetDefaultConstraint</enum>
+ </property>
<item>
<spacer>
- <property name="orientation" >
+ <property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
- <property name="sizeHint" >
+ <property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
@@ -53,8 +69,8 @@
</spacer>
</item>
<item>
- <widget class="QDialogButtonBox" name="buttonBox" >
- <property name="standardButtons" >
+ <widget class="QDialogButtonBox" name="buttonBox">
+ <property name="standardButtons">
<set>QDialogButtonBox::Close</set>
</property>
</widget>
@@ -71,11 +87,11 @@
<receiver>CertificateInfo</receiver>
<slot>accept()</slot>
<hints>
- <hint type="sourcelabel" >
+ <hint type="sourcelabel">
<x>343</x>
<y>374</y>
</hint>
- <hint type="destinationlabel" >
+ <hint type="destinationlabel">
<x>352</x>
<y>422</y>
</hint>
diff --git a/examples/network/securesocketclient/main.cpp b/examples/network/securesocketclient/main.cpp
index c15534b523..ca50f31dcf 100644
--- a/examples/network/securesocketclient/main.cpp
+++ b/examples/network/securesocketclient/main.cpp
@@ -56,7 +56,11 @@ int main(int argc, char **argv)
}
SslClient client;
+#ifdef Q_OS_SYMBIAN
+ client.showMaximized();
+#else
client.show();
+#endif
return app.exec();
}
diff --git a/examples/network/securesocketclient/securesocketclient.pro b/examples/network/securesocketclient/securesocketclient.pro
index f6276dd0bf..ae4b15ffbe 100644
--- a/examples/network/securesocketclient/securesocketclient.pro
+++ b/examples/network/securesocketclient/securesocketclient.pro
@@ -18,4 +18,7 @@ INSTALLS += target sources
symbian {
TARGET.UID3 = 0xA000CF67
CONFIG += qt_example
+ TARGET.CAPABILITY = NetworkServices
}
+maemo5: CONFIG += qt_example
+
diff --git a/examples/network/securesocketclient/sslclient.cpp b/examples/network/securesocketclient/sslclient.cpp
index 43b81cd984..11e6ffd537 100644
--- a/examples/network/securesocketclient/sslclient.cpp
+++ b/examples/network/securesocketclient/sslclient.cpp
@@ -82,7 +82,6 @@ void SslClient::updateEnabledState()
form->connectButton->setEnabled(unconnected && !form->hostNameEdit->text().isEmpty());
bool connected = socket && socket->state() == QAbstractSocket::ConnectedState;
- form->sessionBox->setEnabled(connected);
form->sessionOutput->setEnabled(connected);
form->sessionInput->setEnabled(connected);
form->sessionInputLabel->setEnabled(connected);
@@ -193,6 +192,9 @@ void SslClient::sslErrors(const QList<QSslError> &errors)
ui.sslErrorList->addItem(error.errorString());
executingDialog = true;
+#ifdef Q_OS_SYMBIAN
+ errorDialog.showMaximized();
+#endif
if (errorDialog.exec() == QDialog::Accepted)
socket->ignoreSslErrors();
executingDialog = false;
@@ -206,6 +208,9 @@ void SslClient::displayCertificateInfo()
{
CertificateInfo *info = new CertificateInfo(this);
info->setCertificateChain(socket->peerCertificateChain());
+#ifdef Q_OS_SYMBIAN
+ info->showMaximized();
+#endif
info->exec();
info->deleteLater();
}
diff --git a/examples/network/securesocketclient/sslclient.ui b/examples/network/securesocketclient/sslclient.ui
index 5a24751168..4b81fe46eb 100644
--- a/examples/network/securesocketclient/sslclient.ui
+++ b/examples/network/securesocketclient/sslclient.ui
@@ -1,7 +1,8 @@
-<ui version="4.0" >
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
<class>Form</class>
- <widget class="QWidget" name="Form" >
- <property name="geometry" >
+ <widget class="QWidget" name="Form">
+ <property name="geometry">
<rect>
<x>0</x>
<y>0</y>
@@ -9,147 +10,149 @@
<height>320</height>
</rect>
</property>
- <property name="windowTitle" >
+ <property name="windowTitle">
<string>Secure Socket Client</string>
</property>
- <layout class="QVBoxLayout" >
- <item>
- <layout class="QGridLayout" >
- <item row="0" column="0" >
- <widget class="QLabel" name="hostNameLabel" >
- <property name="text" >
+ <layout class="QGridLayout" name="gridLayout">
+ <item row="0" column="0" colspan="2">
+ <layout class="QGridLayout">
+ <item row="0" column="0">
+ <widget class="QLabel" name="hostNameLabel">
+ <property name="text">
<string>Host name:</string>
</property>
</widget>
</item>
- <item row="0" column="1" >
- <widget class="QLineEdit" name="hostNameEdit" >
- <property name="text" >
+ <item row="0" column="1">
+ <widget class="QLineEdit" name="hostNameEdit">
+ <property name="text">
<string>imap.example.com</string>
</property>
</widget>
</item>
- <item row="1" column="0" >
- <widget class="QLabel" name="portLabel" >
- <property name="text" >
+ <item row="1" column="0">
+ <widget class="QLabel" name="portLabel">
+ <property name="text">
<string>Port:</string>
</property>
</widget>
</item>
- <item row="1" column="1" >
- <widget class="QSpinBox" name="portBox" >
- <property name="minimum" >
+ <item row="1" column="1">
+ <widget class="QSpinBox" name="portBox">
+ <property name="minimum">
<number>1</number>
</property>
- <property name="maximum" >
+ <property name="maximum">
<number>65535</number>
</property>
- <property name="value" >
+ <property name="value">
<number>993</number>
</property>
</widget>
</item>
</layout>
</item>
- <item>
- <widget class="QPushButton" name="connectButton" >
- <property name="enabled" >
+ <item row="1" column="0">
+ <widget class="QLabel" name="label">
+ <property name="text">
+ <string>Active session</string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="1">
+ <widget class="QPushButton" name="connectButton">
+ <property name="enabled">
<bool>true</bool>
</property>
- <property name="text" >
+ <property name="text">
<string>Connect to host</string>
</property>
- <property name="default" >
+ <property name="default">
<bool>true</bool>
</property>
</widget>
</item>
- <item>
- <widget class="QGroupBox" name="sessionBox" >
- <property name="enabled" >
+ <item row="2" column="0" colspan="2">
+ <layout class="QHBoxLayout">
+ <item>
+ <widget class="QLabel" name="cipherText">
+ <property name="text">
+ <string>Cryptographic Cipher:</string>
+ </property>
+ <property name="wordWrap">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLabel" name="cipherLabel">
+ <property name="text">
+ <string>&lt;none&gt;</string>
+ </property>
+ <property name="alignment">
+ <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+ </property>
+ <property name="wordWrap">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item row="3" column="0" colspan="2">
+ <widget class="QTextEdit" name="sessionOutput">
+ <property name="enabled">
<bool>false</bool>
</property>
- <property name="title" >
- <string>Active session</string>
+ <property name="focusPolicy">
+ <enum>Qt::StrongFocus</enum>
</property>
- <layout class="QVBoxLayout" >
- <item>
- <layout class="QHBoxLayout" >
- <item>
- <widget class="QLabel" name="cipherText" >
- <property name="text" >
- <string>Cryptographic Cipher:</string>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QLabel" name="cipherLabel" >
- <property name="text" >
- <string>&lt;none></string>
- </property>
- <property name="alignment" >
- <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
- </property>
- </widget>
- </item>
- </layout>
- </item>
- <item>
- <widget class="QTextEdit" name="sessionOutput" >
- <property name="enabled" >
- <bool>false</bool>
- </property>
- <property name="focusPolicy" >
- <enum>Qt::NoFocus</enum>
- </property>
- <property name="readOnly" >
- <bool>true</bool>
- </property>
- <property name="html" >
- <string>&lt;html>&lt;head>&lt;meta name="qrichtext" content="1" />&lt;style type="text/css">
+ <property name="readOnly">
+ <bool>true</bool>
+ </property>
+ <property name="html">
+ <string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
+&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
p, li { white-space: pre-wrap; }
-&lt;/style>&lt;/head>&lt;body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal;">
-&lt;p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">&lt;/p>&lt;/body>&lt;/html></string>
- </property>
- </widget>
- </item>
- <item>
- <layout class="QHBoxLayout" >
- <item>
- <widget class="QLabel" name="sessionInputLabel" >
- <property name="text" >
- <string>Input:</string>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QLineEdit" name="sessionInput" >
- <property name="enabled" >
- <bool>false</bool>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QPushButton" name="sendButton" >
- <property name="enabled" >
- <bool>false</bool>
- </property>
- <property name="focusPolicy" >
- <enum>Qt::TabFocus</enum>
- </property>
- <property name="text" >
- <string>&amp;Send</string>
- </property>
- <property name="default" >
- <bool>true</bool>
- </property>
- </widget>
- </item>
- </layout>
- </item>
- </layout>
+&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;&quot;&gt;
+&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Sans Serif'; font-size:9pt;&quot;&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
+ </property>
</widget>
</item>
+ <item row="4" column="0" colspan="2">
+ <layout class="QHBoxLayout">
+ <item>
+ <widget class="QLabel" name="sessionInputLabel">
+ <property name="text">
+ <string>Input:</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLineEdit" name="sessionInput">
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QPushButton" name="sendButton">
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="focusPolicy">
+ <enum>Qt::TabFocus</enum>
+ </property>
+ <property name="text">
+ <string>&amp;Send</string>
+ </property>
+ <property name="default">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
</layout>
</widget>
<resources/>
@@ -160,11 +163,11 @@ p, li { white-space: pre-wrap; }
<receiver>connectButton</receiver>
<slot>animateClick()</slot>
<hints>
- <hint type="sourcelabel" >
+ <hint type="sourcelabel">
<x>126</x>
<y>20</y>
</hint>
- <hint type="destinationlabel" >
+ <hint type="destinationlabel">
<x>142</x>
<y>78</y>
</hint>
@@ -176,11 +179,11 @@ p, li { white-space: pre-wrap; }
<receiver>sendButton</receiver>
<slot>animateClick()</slot>
<hints>
- <hint type="sourcelabel" >
+ <hint type="sourcelabel">
<x>142</x>
<y>241</y>
</hint>
- <hint type="destinationlabel" >
+ <hint type="destinationlabel">
<x>297</x>
<y>234</y>
</hint>
diff --git a/examples/network/securesocketclient/sslerrors.ui b/examples/network/securesocketclient/sslerrors.ui
index 4aac18cddb..1aadbfeca5 100644
--- a/examples/network/securesocketclient/sslerrors.ui
+++ b/examples/network/securesocketclient/sslerrors.ui
@@ -1,7 +1,8 @@
-<ui version="4.0" >
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
<class>SslErrors</class>
- <widget class="QDialog" name="SslErrors" >
- <property name="geometry" >
+ <widget class="QDialog" name="SslErrors">
+ <property name="geometry">
<rect>
<x>0</x>
<y>0</y>
@@ -9,44 +10,48 @@
<height>216</height>
</rect>
</property>
- <property name="windowTitle" >
+ <property name="windowTitle">
<string>Unable To Validate The Connection</string>
</property>
- <layout class="QVBoxLayout" >
+ <layout class="QVBoxLayout">
<item>
- <widget class="QLabel" name="label" >
- <property name="text" >
- <string>&lt;html>&lt;head>&lt;meta name="qrichtext" content="1" />&lt;style type="text/css">
+ <widget class="QLabel" name="label">
+ <property name="text">
+ <string>&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
p, li { white-space: pre-wrap; }
-&lt;/style>&lt;/head>&lt;body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal;">
-&lt;p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">&lt;span style=" font-weight:600; color:#ff0000;">Warning&lt;/span>&lt;span style=" color:#ff0000;">:&lt;/span>&lt;span style=" color:#000000;"> One or more errors with this connection prevent validating the authenticity of the host you are connecting to. Please review the following list of errors, and click &lt;/span>&lt;span style=" color:#000000;">Ignore&lt;/span>&lt;span style=" color:#000000;"> to continue, or &lt;/span>&lt;span style=" color:#000000;">Cancel&lt;/span>&lt;span style=" color:#000000;"> to abort the connection.&lt;/span>&lt;/p>&lt;/body>&lt;/html></string>
+&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal;&quot;&gt;
+&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-weight:600; color:#ff0000;&quot;&gt;Warning&lt;/span&gt;&lt;span style=&quot; color:#ff0000;&quot;&gt;:&lt;/span&gt;&lt;span style=&quot; color:#000000;&quot;&gt; One or more errors with this connection prevent validating the authenticity of the host you are connecting to. Please review the following list of errors, and click &lt;/span&gt;&lt;span style=&quot; color:#000000;&quot;&gt;Ignore&lt;/span&gt;&lt;span style=&quot; color:#000000;&quot;&gt; to continue, or &lt;/span&gt;&lt;span style=&quot; color:#000000;&quot;&gt;Cancel&lt;/span&gt;&lt;span style=&quot; color:#000000;&quot;&gt; to abort the connection.&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
- <property name="wordWrap" >
+ <property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
<item>
- <widget class="QListWidget" name="sslErrorList" />
+ <widget class="QListWidget" name="sslErrorList">
+ <property name="wordWrap">
+ <bool>true</bool>
+ </property>
+ </widget>
</item>
<item>
- <layout class="QHBoxLayout" >
+ <layout class="QHBoxLayout">
<item>
- <widget class="QPushButton" name="certificateChainButton" >
- <property name="text" >
+ <widget class="QPushButton" name="certificateChainButton">
+ <property name="text">
<string>View Certificate Chain</string>
</property>
- <property name="autoDefault" >
+ <property name="autoDefault">
<bool>false</bool>
</property>
</widget>
</item>
<item>
<spacer>
- <property name="orientation" >
+ <property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
- <property name="sizeHint" >
+ <property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
@@ -55,15 +60,15 @@ p, li { white-space: pre-wrap; }
</spacer>
</item>
<item>
- <widget class="QPushButton" name="pushButton" >
- <property name="text" >
+ <widget class="QPushButton" name="pushButton">
+ <property name="text">
<string>Ignore</string>
</property>
</widget>
</item>
<item>
- <widget class="QPushButton" name="pushButton_2" >
- <property name="text" >
+ <widget class="QPushButton" name="pushButton_2">
+ <property name="text">
<string>Cancel</string>
</property>
</widget>
@@ -80,11 +85,11 @@ p, li { white-space: pre-wrap; }
<receiver>SslErrors</receiver>
<slot>accept()</slot>
<hints>
- <hint type="sourcelabel" >
+ <hint type="sourcelabel">
<x>235</x>
<y>185</y>
</hint>
- <hint type="destinationlabel" >
+ <hint type="destinationlabel">
<x>228</x>
<y>287</y>
</hint>
@@ -96,11 +101,11 @@ p, li { white-space: pre-wrap; }
<receiver>SslErrors</receiver>
<slot>reject()</slot>
<hints>
- <hint type="sourcelabel" >
+ <hint type="sourcelabel">
<x>325</x>
<y>192</y>
</hint>
- <hint type="destinationlabel" >
+ <hint type="destinationlabel">
<x>333</x>
<y>231</y>
</hint>