diff options
Diffstat (limited to 'examples/network/securesocketclient')
8 files changed, 212 insertions, 165 deletions
diff --git a/examples/network/securesocketclient/certificateinfo.cpp b/examples/network/securesocketclient/certificateinfo.cpp index ff3a4d2..b1a9acb 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 3761fe8..c5238eb 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 c15534b..ca50f31 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.desktop b/examples/network/securesocketclient/securesocketclient.desktop new file mode 100644 index 0000000..8335b27 --- /dev/null +++ b/examples/network/securesocketclient/securesocketclient.desktop @@ -0,0 +1,11 @@ +[Desktop Entry] +Encoding=UTF-8 +Version=1.0 +Type=Application +Terminal=false +Name=Secure Socket Client +Exec=/opt/usr/bin/securesocketclient +Icon=securesocketclient +X-Window-Icon= +X-HildonDesk-ShowInToolbar=true +X-Osso-Type=application/x-executable diff --git a/examples/network/securesocketclient/securesocketclient.pro b/examples/network/securesocketclient/securesocketclient.pro index ff4f4587..78302b1 100644 --- a/examples/network/securesocketclient/securesocketclient.pro +++ b/examples/network/securesocketclient/securesocketclient.pro @@ -18,4 +18,7 @@ INSTALLS += target sources symbian { TARGET.UID3 = 0xA000CF67 include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) + TARGET.CAPABILITY = NetworkServices } +maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) + diff --git a/examples/network/securesocketclient/sslclient.cpp b/examples/network/securesocketclient/sslclient.cpp index 43b81cd..11e6ffd 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 5a24751..4b81fe4 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><none></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><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><html><head><meta name="qrichtext" content="1" /><style type="text/css"> + <property name="readOnly"> + <bool>true</bool> + </property> + <property name="html"> + <string><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> +<html><head><meta name="qrichtext" content="1" /><style type="text/css"> p, li { white-space: pre-wrap; } -</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal;"> -<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;"></p></body></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>&Send</string> - </property> - <property name="default" > - <bool>true</bool> - </property> - </widget> - </item> - </layout> - </item> - </layout> +</style></head><body style=" font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;"> +<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; font-family:'Sans Serif'; font-size:9pt;"></p></body></html></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>&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 4aac18c..1aadbfe 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><html><head><meta name="qrichtext" content="1" /><style type="text/css"> + <widget class="QLabel" name="label"> + <property name="text"> + <string><html><head><meta name="qrichtext" content="1" /><style type="text/css"> p, li { white-space: pre-wrap; } -</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal;"> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-weight:600; color:#ff0000;">Warning</span><span style=" color:#ff0000;">:</span><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 </span><span style=" color:#000000;">Ignore</span><span style=" color:#000000;"> to continue, or </span><span style=" color:#000000;">Cancel</span><span style=" color:#000000;"> to abort the connection.</span></p></body></html></string> +</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal;"> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-weight:600; color:#ff0000;">Warning</span><span style=" color:#ff0000;">:</span><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 </span><span style=" color:#000000;">Ignore</span><span style=" color:#000000;"> to continue, or </span><span style=" color:#000000;">Cancel</span><span style=" color:#000000;"> to abort the connection.</span></p></body></html></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> |