diff options
author | David Boddie <david.boddie@nokia.com> | 2011-04-28 17:39:11 (GMT) |
---|---|---|
committer | David Boddie <david.boddie@nokia.com> | 2011-04-28 17:39:11 (GMT) |
commit | 3abaecc3aec4e46f1c5969c33875fd45aa542385 (patch) | |
tree | 58613c5d2b765018c31d0b189e9c5a34d8adde69 /examples/network | |
parent | ddb22795641253a026b72f752ebc769745dd41be (diff) | |
download | Qt-3abaecc3aec4e46f1c5969c33875fd45aa542385.zip Qt-3abaecc3aec4e46f1c5969c33875fd45aa542385.tar.gz Qt-3abaecc3aec4e46f1c5969c33875fd45aa542385.tar.bz2 |
Squashed commit of the changes from the mobile-examples repository
(4.7-generated-declarative branch).
Diffstat (limited to 'examples/network')
62 files changed, 713 insertions, 210 deletions
diff --git a/examples/network/bearercloud/bearercloud.desktop b/examples/network/bearercloud/bearercloud.desktop new file mode 100644 index 0000000..4e494e0 --- /dev/null +++ b/examples/network/bearercloud/bearercloud.desktop @@ -0,0 +1,11 @@ +[Desktop Entry] +Encoding=UTF-8 +Version=1.0 +Type=Application +Terminal=false +Name=Bearer Cloud +Exec=/opt/usr/bin/bearercloud +Icon=bearercloud +X-Window-Icon= +X-HildonDesk-ShowInToolbar=true +X-Osso-Type=application/x-executable diff --git a/examples/network/bearercloud/bearercloud.pro b/examples/network/bearercloud/bearercloud.pro index c07626a..ff3f917c 100644 --- a/examples/network/bearercloud/bearercloud.pro +++ b/examples/network/bearercloud/bearercloud.pro @@ -13,4 +13,10 @@ QT = core gui network svg CONFIG += console -symbian:TARGET.CAPABILITY = NetworkServices ReadUserData +symbian: { + TARGET.CAPABILITY = NetworkServices ReadUserData + include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) +} +maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) +symbian: warning(This example might not fully work on Symbian platform) +maemo5: warning(This example might not fully work on Maemo platform) diff --git a/examples/network/bearermonitor/bearermonitor.cpp b/examples/network/bearermonitor/bearermonitor.cpp index 942b19c..43ae8e9 100644 --- a/examples/network/bearermonitor/bearermonitor.cpp +++ b/examples/network/bearermonitor/bearermonitor.cpp @@ -63,7 +63,7 @@ BearerMonitor::BearerMonitor(QWidget *parent) delete tabWidget->currentWidget(); sessionGroup->hide(); #endif -#if defined(Q_OS_SYMBIAN) || defined(Q_OS_WINCE) || defined(MAEMO_UI) +#if defined(Q_OS_SYMBIAN) || defined(Q_OS_WINCE) || defined(MAEMO_UI) || defined(Q_WS_SIMULATOR) setWindowState(Qt::WindowMaximized); #endif updateConfigurations(); @@ -87,7 +87,7 @@ BearerMonitor::BearerMonitor(QWidget *parent) this, SLOT(configurationChanged(const QNetworkConfiguration))); connect(&manager, SIGNAL(updateCompleted()), this, SLOT(updateConfigurations())); -#ifdef Q_OS_WIN +#if defined(Q_OS_WIN) connect(registerButton, SIGNAL(clicked()), this, SLOT(registerNetwork())); connect(unregisterButton, SIGNAL(clicked()), this, SLOT(unregisterNetwork())); #else @@ -226,7 +226,7 @@ void BearerMonitor::updateConfigurations() if (defaultConfiguration.type() == QNetworkConfiguration::ServiceNetwork) updateSnapConfiguration(defaultItem, defaultConfiguration); - } else if (defaultConfiguration.isValid()) { + } else { configurationAdded(defaultConfiguration); } @@ -260,7 +260,7 @@ void BearerMonitor::onlineStateChanged(bool isOnline) onlineState->setText(tr("Offline")); } -#ifdef Q_OS_WIN +#if defined(Q_OS_WIN) void BearerMonitor::registerNetwork() { QTreeWidgetItem *item = treeWidget->currentItem(); diff --git a/examples/network/bearermonitor/bearermonitor.desktop b/examples/network/bearermonitor/bearermonitor.desktop new file mode 100644 index 0000000..14f1094 --- /dev/null +++ b/examples/network/bearermonitor/bearermonitor.desktop @@ -0,0 +1,11 @@ +[Desktop Entry] +Encoding=UTF-8 +Version=1.0 +Type=Application +Terminal=false +Name=Bearer Monitor +Exec=/opt/usr/bin/bearermonitor +Icon=bearermonitor +X-Window-Icon= +X-HildonDesk-ShowInToolbar=true +X-Osso-Type=application/x-executable diff --git a/examples/network/bearermonitor/bearermonitor.h b/examples/network/bearermonitor/bearermonitor.h index a06522f..f4dbf81 100644 --- a/examples/network/bearermonitor/bearermonitor.h +++ b/examples/network/bearermonitor/bearermonitor.h @@ -43,7 +43,7 @@ #include <qnetworkconfigmanager.h> #include <qnetworksession.h> -#if defined (Q_OS_SYMBIAN) || defined(Q_OS_WINCE) +#if defined (Q_OS_SYMBIAN) || defined(Q_OS_WINCE) || defined(Q_WS_SIMULATOR) #include "ui_bearermonitor_240_320.h" #elif defined(MAEMO_UI) #include "ui_bearermonitor_maemo.h" @@ -72,7 +72,7 @@ private slots: void onlineStateChanged(bool isOnline); -#ifdef Q_OS_WIN +#if defined(Q_OS_WIN) || defined(Q_WS_SIMULATOR) void registerNetwork(); void unregisterNetwork(); #endif diff --git a/examples/network/bearermonitor/bearermonitor.pro b/examples/network/bearermonitor/bearermonitor.pro index bd9bd68..a91f064 100644 --- a/examples/network/bearermonitor/bearermonitor.pro +++ b/examples/network/bearermonitor/bearermonitor.pro @@ -23,4 +23,11 @@ wince*:LIBS += -lws2 CONFIG += console -symbian:TARGET.CAPABILITY = NetworkServices ReadUserData +symbian: { + TARGET.CAPABILITY = NetworkServices ReadUserData + include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) +} +maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) + +symbian: warning(This example might not fully work on Symbian platform) +maemo5: warning(This example might not fully work on Maemo platform) diff --git a/examples/network/blockingfortuneclient/blockingclient.cpp b/examples/network/blockingfortuneclient/blockingclient.cpp index f5def3d..bd2fb82 100644 --- a/examples/network/blockingfortuneclient/blockingclient.cpp +++ b/examples/network/blockingfortuneclient/blockingclient.cpp @@ -44,7 +44,7 @@ #include "blockingclient.h" BlockingClient::BlockingClient(QWidget *parent) - : QDialog(parent) + : QWidget(parent) { hostLabel = new QLabel(tr("&Server name:")); portLabel = new QLabel(tr("S&erver port:")); @@ -68,12 +68,35 @@ BlockingClient::BlockingClient(QWidget *parent) portLineEdit = new QLineEdit; portLineEdit->setValidator(new QIntValidator(1, 65535, this)); +#if defined(Q_OS_SYMBIAN) || defined(Q_WS_MAEMO_5) || defined(Q_WS_SIMULATOR) + Qt::InputMethodHint hints = Qt::ImhDigitsOnly; + portLineEdit->setInputMethodHints(hints); +#endif + hostLabel->setBuddy(hostLineEdit); portLabel->setBuddy(portLineEdit); statusLabel = new QLabel(tr("This examples requires that you run the " "Fortune Server example as well.")); + statusLabel->setWordWrap(true); + +#ifdef Q_OS_SYMBIAN + QMenu *menu = new QMenu(this); + fortuneAction = menu->addAction(tr("Get Fortune")); + fortuneAction->setVisible(false); + + QAction *optionsAction = new QAction(tr("Options"), this); + optionsAction->setMenu(menu); + optionsAction->setSoftKeyRole(QAction::PositiveSoftKey); + addAction(optionsAction); + + exitAction = new QAction(tr("Exit"), this); + exitAction->setSoftKeyRole(QAction::NegativeSoftKey); + addAction(exitAction); + connect(fortuneAction, SIGNAL(triggered()), this, SLOT(requestNewFortune())); + connect(exitAction, SIGNAL(triggered()), this, SLOT(close())); +#else getFortuneButton = new QPushButton(tr("Get Fortune")); getFortuneButton->setDefault(true); getFortuneButton->setEnabled(false); @@ -84,13 +107,14 @@ BlockingClient::BlockingClient(QWidget *parent) buttonBox->addButton(getFortuneButton, QDialogButtonBox::ActionRole); buttonBox->addButton(quitButton, QDialogButtonBox::RejectRole); + connect(getFortuneButton, SIGNAL(clicked()), this, SLOT(requestNewFortune())); + connect(quitButton, SIGNAL(clicked()), this, SLOT(close())); +#endif + connect(hostLineEdit, SIGNAL(textChanged(QString)), this, SLOT(enableGetFortuneButton())); connect(portLineEdit, SIGNAL(textChanged(QString)), this, SLOT(enableGetFortuneButton())); - connect(getFortuneButton, SIGNAL(clicked()), - this, SLOT(requestNewFortune())); - connect(quitButton, SIGNAL(clicked()), this, SLOT(close())); //! [0] connect(&thread, SIGNAL(newFortune(QString)), this, SLOT(showFortune(QString))); @@ -105,7 +129,9 @@ BlockingClient::BlockingClient(QWidget *parent) mainLayout->addWidget(portLabel, 1, 0); mainLayout->addWidget(portLineEdit, 1, 1); mainLayout->addWidget(statusLabel, 2, 0, 1, 2); +#ifndef Q_OS_SYMBIAN mainLayout->addWidget(buttonBox, 3, 0, 1, 2); +#endif setLayout(mainLayout); setWindowTitle(tr("Blocking Fortune Client")); @@ -115,7 +141,11 @@ BlockingClient::BlockingClient(QWidget *parent) //! [2] void BlockingClient::requestNewFortune() { +#ifdef Q_OS_SYMBIAN + fortuneAction->setVisible(false); +#else getFortuneButton->setEnabled(false); +#endif thread.requestNewFortune(hostLineEdit->text(), portLineEdit->text().toInt()); } @@ -133,7 +163,11 @@ void BlockingClient::showFortune(const QString &nextFortune) //! [4] currentFortune = nextFortune; statusLabel->setText(currentFortune); +#ifdef Q_OS_SYMBIAN + fortuneAction->setVisible(true); +#else getFortuneButton->setEnabled(true); +#endif } //! [4] @@ -158,11 +192,19 @@ void BlockingClient::displayError(int socketError, const QString &message) .arg(message)); } +#ifdef Q_OS_SYMBIAN + fortuneAction->setVisible(true); +#else getFortuneButton->setEnabled(true); +#endif } void BlockingClient::enableGetFortuneButton() { - getFortuneButton->setEnabled(!hostLineEdit->text().isEmpty() - && !portLineEdit->text().isEmpty()); + bool enable(!hostLineEdit->text().isEmpty() && !portLineEdit->text().isEmpty()); +#ifdef Q_OS_SYMBIAN + fortuneAction->setVisible(enable); +#else + getFortuneButton->setEnabled(enable); +#endif } diff --git a/examples/network/blockingfortuneclient/blockingclient.h b/examples/network/blockingfortuneclient/blockingclient.h index 8b76fa6..83ff93b 100644 --- a/examples/network/blockingfortuneclient/blockingclient.h +++ b/examples/network/blockingfortuneclient/blockingclient.h @@ -41,7 +41,7 @@ #ifndef BLOCKINGCLIENT_H #define BLOCKINGCLIENT_H -#include <QDialog> +#include <QWidget> #include "fortunethread.h" @@ -50,10 +50,11 @@ class QDialogButtonBox; class QLabel; class QLineEdit; class QPushButton; +class QAction; QT_END_NAMESPACE //! [0] -class BlockingClient : public QDialog +class BlockingClient : public QWidget { Q_OBJECT @@ -72,9 +73,14 @@ private: QLineEdit *hostLineEdit; QLineEdit *portLineEdit; QLabel *statusLabel; +#ifdef Q_OS_SYMBIAN + QAction *fortuneAction; + QAction *exitAction; +#else QPushButton *getFortuneButton; QPushButton *quitButton; QDialogButtonBox *buttonBox; +#endif FortuneThread thread; QString currentFortune; diff --git a/examples/network/blockingfortuneclient/blockingfortuneclient.desktop b/examples/network/blockingfortuneclient/blockingfortuneclient.desktop new file mode 100644 index 0000000..87b1309 --- /dev/null +++ b/examples/network/blockingfortuneclient/blockingfortuneclient.desktop @@ -0,0 +1,11 @@ +[Desktop Entry] +Encoding=UTF-8 +Version=1.0 +Type=Application +Terminal=false +Name=Blocking Fortune Client +Exec=/opt/usr/bin/blockingfortuneclient +Icon=blockingfortuneclient +X-Window-Icon= +X-HildonDesk-ShowInToolbar=true +X-Osso-Type=application/x-executable diff --git a/examples/network/blockingfortuneclient/blockingfortuneclient.pro b/examples/network/blockingfortuneclient/blockingfortuneclient.pro index 5840d30..c6a6b50 100644 --- a/examples/network/blockingfortuneclient/blockingfortuneclient.pro +++ b/examples/network/blockingfortuneclient/blockingfortuneclient.pro @@ -11,4 +11,11 @@ sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS blockingfortuneclient.pr sources.path = $$[QT_INSTALL_EXAMPLES]/network/blockingfortuneclient INSTALLS += target sources -symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) +symbian: { + TARGET.CAPABILITY = NetworkServices + include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) +} +maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) + +symbian: warning(This example might not fully work on Symbian platform) +maemo5: warning(This example might not fully work on Maemo platform) diff --git a/examples/network/blockingfortuneclient/main.cpp b/examples/network/blockingfortuneclient/main.cpp index d1ff165..97ce59f 100644 --- a/examples/network/blockingfortuneclient/main.cpp +++ b/examples/network/blockingfortuneclient/main.cpp @@ -46,6 +46,10 @@ int main(int argc, char *argv[]) { QApplication app(argc, argv); BlockingClient client; +#ifdef Q_OS_SYMBIAN + client.showMaximized(); +#else client.show(); - return client.exec(); +#endif + return app.exec(); } diff --git a/examples/network/broadcastreceiver/broadcastreceiver.desktop b/examples/network/broadcastreceiver/broadcastreceiver.desktop new file mode 100644 index 0000000..29072ed --- /dev/null +++ b/examples/network/broadcastreceiver/broadcastreceiver.desktop @@ -0,0 +1,11 @@ +[Desktop Entry] +Encoding=UTF-8 +Version=1.0 +Type=Application +Terminal=false +Name=Broadcast Receiver +Exec=/opt/usr/bin/broadcastreceiver +Icon=broadcastreceiver +X-Window-Icon= +X-HildonDesk-ShowInToolbar=true +X-Osso-Type=application/x-executable diff --git a/examples/network/broadcastreceiver/broadcastreceiver.pro b/examples/network/broadcastreceiver/broadcastreceiver.pro index 0778f96..7819109 100644 --- a/examples/network/broadcastreceiver/broadcastreceiver.pro +++ b/examples/network/broadcastreceiver/broadcastreceiver.pro @@ -9,4 +9,8 @@ sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS broadcastreceiver.pro sources.path = $$[QT_INSTALL_EXAMPLES]/network/broadcastreceiver INSTALLS += target sources -symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) +symbian: { + TARGET.CAPABILITY = NetworkServices + include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) +} +maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) diff --git a/examples/network/broadcastreceiver/main.cpp b/examples/network/broadcastreceiver/main.cpp index 0411631..80d0bba 100644 --- a/examples/network/broadcastreceiver/main.cpp +++ b/examples/network/broadcastreceiver/main.cpp @@ -46,6 +46,10 @@ int main(int argc, char *argv[]) { QApplication app(argc, argv); Receiver receiver; +#ifdef Q_OS_SYMBIAN + receiver.showMaximized(); +#else receiver.show(); - return receiver.exec(); +#endif + return app.exec(); } diff --git a/examples/network/broadcastreceiver/receiver.cpp b/examples/network/broadcastreceiver/receiver.cpp index bd45a3c..04feffb 100644 --- a/examples/network/broadcastreceiver/receiver.cpp +++ b/examples/network/broadcastreceiver/receiver.cpp @@ -44,10 +44,18 @@ #include "receiver.h" Receiver::Receiver(QWidget *parent) - : QDialog(parent) + : QWidget(parent) { statusLabel = new QLabel(tr("Listening for broadcasted messages")); + statusLabel->setWordWrap(true); + +#ifdef Q_OS_SYMBIAN + quitAction = new QAction(tr("Exit"), this); + quitAction->setSoftKeyRole(QAction::NegativeSoftKey); + addAction(quitAction); +#else quitButton = new QPushButton(tr("&Quit")); +#endif //! [0] udpSocket = new QUdpSocket(this); @@ -58,6 +66,13 @@ Receiver::Receiver(QWidget *parent) connect(udpSocket, SIGNAL(readyRead()), this, SLOT(processPendingDatagrams())); //! [1] +#ifdef Q_OS_SYMBIAN + connect(quitAction, SIGNAL(triggered()), this, SLOT(close())); + + QVBoxLayout *mainLayout = new QVBoxLayout; + mainLayout->addWidget(statusLabel); + setLayout(mainLayout); +#else connect(quitButton, SIGNAL(clicked()), this, SLOT(close())); QHBoxLayout *buttonLayout = new QHBoxLayout; @@ -69,6 +84,7 @@ Receiver::Receiver(QWidget *parent) mainLayout->addWidget(statusLabel); mainLayout->addLayout(buttonLayout); setLayout(mainLayout); +#endif setWindowTitle(tr("Broadcast Receiver")); } diff --git a/examples/network/broadcastreceiver/receiver.h b/examples/network/broadcastreceiver/receiver.h index 80b35a5..3084da1 100644 --- a/examples/network/broadcastreceiver/receiver.h +++ b/examples/network/broadcastreceiver/receiver.h @@ -41,15 +41,16 @@ #ifndef RECEIVER_H #define RECEIVER_H -#include <QDialog> +#include <QWidget> QT_BEGIN_NAMESPACE class QLabel; class QPushButton; class QUdpSocket; +class QAction; QT_END_NAMESPACE -class Receiver : public QDialog +class Receiver : public QWidget { Q_OBJECT @@ -61,7 +62,11 @@ private slots: private: QLabel *statusLabel; +#ifdef Q_OS_SYMBIAN + QAction *quitAction; +#else QPushButton *quitButton; +#endif QUdpSocket *udpSocket; }; diff --git a/examples/network/broadcastsender/broadcastsender.desktop b/examples/network/broadcastsender/broadcastsender.desktop new file mode 100644 index 0000000..2690a15 --- /dev/null +++ b/examples/network/broadcastsender/broadcastsender.desktop @@ -0,0 +1,11 @@ +[Desktop Entry] +Encoding=UTF-8 +Version=1.0 +Type=Application +Terminal=false +Name=Broadcast Sender +Exec=/opt/usr/bin/broadcastsender +Icon=broadcastsender +X-Window-Icon= +X-HildonDesk-ShowInToolbar=true +X-Osso-Type=application/x-executable diff --git a/examples/network/broadcastsender/broadcastsender.pro b/examples/network/broadcastsender/broadcastsender.pro index 6415706..ef2d0cc 100644 --- a/examples/network/broadcastsender/broadcastsender.pro +++ b/examples/network/broadcastsender/broadcastsender.pro @@ -9,4 +9,9 @@ sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS broadcastsender.pro sources.path = $$[QT_INSTALL_EXAMPLES]/network/broadcastsender INSTALLS += target sources -symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) +symbian: { + TARGET.CAPABILITY = NetworkServices + include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) +} +maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) + diff --git a/examples/network/broadcastsender/main.cpp b/examples/network/broadcastsender/main.cpp index 56e35c9..88be21d 100644 --- a/examples/network/broadcastsender/main.cpp +++ b/examples/network/broadcastsender/main.cpp @@ -46,6 +46,10 @@ int main(int argc, char *argv[]) { QApplication app(argc, argv); Sender sender; +#ifdef Q_OS_SYMBIAN + sender.showMaximized(); +#else sender.show(); - return sender.exec(); +#endif + return app.exec(); } diff --git a/examples/network/broadcastsender/sender.cpp b/examples/network/broadcastsender/sender.cpp index d753094..7ce877d 100644 --- a/examples/network/broadcastsender/sender.cpp +++ b/examples/network/broadcastsender/sender.cpp @@ -44,9 +44,10 @@ #include "sender.h" Sender::Sender(QWidget *parent) - : QDialog(parent) + : QWidget(parent) { statusLabel = new QLabel(tr("Ready to broadcast datagrams on port 45454")); + statusLabel->setWordWrap(true); startButton = new QPushButton(tr("&Start")); quitButton = new QPushButton(tr("&Quit")); diff --git a/examples/network/broadcastsender/sender.h b/examples/network/broadcastsender/sender.h index d592051..666269f 100644 --- a/examples/network/broadcastsender/sender.h +++ b/examples/network/broadcastsender/sender.h @@ -41,7 +41,7 @@ #ifndef SENDER_H #define SENDER_H -#include <QDialog> +#include <QWidget> QT_BEGIN_NAMESPACE class QDialogButtonBox; @@ -51,7 +51,7 @@ class QTimer; class QUdpSocket; QT_END_NAMESPACE -class Sender : public QDialog +class Sender : public QWidget { Q_OBJECT diff --git a/examples/network/download/download.desktop b/examples/network/download/download.desktop new file mode 100644 index 0000000..8dbdfe8 --- /dev/null +++ b/examples/network/download/download.desktop @@ -0,0 +1,11 @@ +[Desktop Entry] +Encoding=UTF-8 +Version=1.0 +Type=Application +Terminal=false +Name=Network Download +Exec=/opt/usr/bin/download +Icon=download +X-Window-Icon= +X-HildonDesk-ShowInToolbar=true +X-Osso-Type=application/x-executable diff --git a/examples/network/download/download.pro b/examples/network/download/download.pro index 432998d..8b8b26f 100644 --- a/examples/network/download/download.pro +++ b/examples/network/download/download.pro @@ -3,7 +3,6 @@ ###################################################################### TEMPLATE = app -TARGET = DEPENDPATH += . INCLUDEPATH += . QT = core network @@ -19,3 +18,7 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/network/download INSTALLS += target sources symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) +maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) + +symbian: warning(This example might not fully work on Symbian platform) +simulator: warning(This example might not fully work on Simulator platform) diff --git a/examples/network/downloadmanager/downloadmanager.desktop b/examples/network/downloadmanager/downloadmanager.desktop new file mode 100644 index 0000000..d046340 --- /dev/null +++ b/examples/network/downloadmanager/downloadmanager.desktop @@ -0,0 +1,11 @@ +[Desktop Entry] +Encoding=UTF-8 +Version=1.0 +Type=Application +Terminal=false +Name=Network Download Manager +Exec=/opt/usr/bin/downloadmanager +Icon=downloadmanager +X-Window-Icon= +X-HildonDesk-ShowInToolbar=true +X-Osso-Type=application/x-executable diff --git a/examples/network/downloadmanager/downloadmanager.pro b/examples/network/downloadmanager/downloadmanager.pro index 8d91cf0..024ee2a 100644 --- a/examples/network/downloadmanager/downloadmanager.pro +++ b/examples/network/downloadmanager/downloadmanager.pro @@ -3,7 +3,6 @@ ###################################################################### TEMPLATE = app -TARGET = DEPENDPATH += . INCLUDEPATH += . QT = core network @@ -20,3 +19,14 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/network/downloadmanager INSTALLS += target sources symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) +maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) + +OTHER_FILES += \ + debian/changelog \ + debian/compat \ + debian/control \ + debian/copyright \ + debian/README \ + debian/rules +symbian: warning(This example might not fully work on Symbian platform) +simulator: warning(This example might not fully work on Simulator platform) diff --git a/examples/network/fortuneclient/fortuneclient.desktop b/examples/network/fortuneclient/fortuneclient.desktop new file mode 100644 index 0000000..dc801ed --- /dev/null +++ b/examples/network/fortuneclient/fortuneclient.desktop @@ -0,0 +1,11 @@ +[Desktop Entry] +Encoding=UTF-8 +Version=1.0 +Type=Application +Terminal=false +Name=Fortune Client +Exec=/opt/usr/bin/fortuneclient +Icon=fortuneclient +X-Window-Icon= +X-HildonDesk-ShowInToolbar=true +X-Osso-Type=application/x-executable diff --git a/examples/network/fortuneclient/fortuneclient.pro b/examples/network/fortuneclient/fortuneclient.pro index f79679d..c6ad332 100644 --- a/examples/network/fortuneclient/fortuneclient.pro +++ b/examples/network/fortuneclient/fortuneclient.pro @@ -14,3 +14,8 @@ symbian { TARGET.CAPABILITY = "NetworkServices ReadUserData WriteUserData" TARGET.EPOCHEAPSIZE = 0x20000 0x2000000 } +maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) + +symbian: warning(This example might not fully work on Symbian platform) +maemo5: warning(This example might not fully work on Maemo platform) +simulator: warning(This example might not fully work on Simulator platform) diff --git a/examples/network/fortuneserver/fortuneserver.desktop b/examples/network/fortuneserver/fortuneserver.desktop new file mode 100644 index 0000000..8c936e8 --- /dev/null +++ b/examples/network/fortuneserver/fortuneserver.desktop @@ -0,0 +1,11 @@ +[Desktop Entry] +Encoding=UTF-8 +Version=1.0 +Type=Application +Terminal=false +Name=Fortune Server +Exec=/opt/usr/bin/fortuneserver +Icon=fortuneserver +X-Window-Icon= +X-HildonDesk-ShowInToolbar=true +X-Osso-Type=application/x-executable diff --git a/examples/network/fortuneserver/fortuneserver.pro b/examples/network/fortuneserver/fortuneserver.pro index 0ef3e97..6da1f92 100644 --- a/examples/network/fortuneserver/fortuneserver.pro +++ b/examples/network/fortuneserver/fortuneserver.pro @@ -15,3 +15,8 @@ symbian { TARGET.CAPABILITY = "NetworkServices ReadUserData" TARGET.EPOCHEAPSIZE = 0x20000 0x2000000 } +maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) + +symbian: warning(This example might not fully work on Symbian platform) +maemo5: warning(This example might not fully work on Maemo platform) +simulator: warning(This example might not fully work on Simulator platform) diff --git a/examples/network/googlesuggest/googlesuggest.desktop b/examples/network/googlesuggest/googlesuggest.desktop new file mode 100644 index 0000000..5034e23 --- /dev/null +++ b/examples/network/googlesuggest/googlesuggest.desktop @@ -0,0 +1,11 @@ +[Desktop Entry] +Encoding=UTF-8 +Version=1.0 +Type=Application +Terminal=false +Name=Google Suggest +Exec=/opt/usr/bin/googlesuggest +Icon=googlesuggest +X-Window-Icon= +X-HildonDesk-ShowInToolbar=true +X-Osso-Type=application/x-executable diff --git a/examples/network/googlesuggest/googlesuggest.pro b/examples/network/googlesuggest/googlesuggest.pro index 33b79de..e6fb579 100644 --- a/examples/network/googlesuggest/googlesuggest.pro +++ b/examples/network/googlesuggest/googlesuggest.pro @@ -7,3 +7,10 @@ target.path = $$[QT_INSTALL_EXAMPLES]/network/googlesuggest sources.files = $$SOURCES $$HEADERS *.pro sources.path = $$[QT_INSTALL_EXAMPLES]/network/googlesuggest INSTALLS += target sources + +symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) +maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) + +symbian: warning(This example might not fully work on Symbian platform) +maemo5: warning(This example might not fully work on Maemo platform) +simulator: warning(This example might not fully work on Simulator platform) diff --git a/examples/network/http/http.desktop b/examples/network/http/http.desktop new file mode 100644 index 0000000..ce35e51 --- /dev/null +++ b/examples/network/http/http.desktop @@ -0,0 +1,11 @@ +[Desktop Entry] +Encoding=UTF-8 +Version=1.0 +Type=Application +Terminal=false +Name=HTTP +Exec=/opt/usr/bin/http +Icon=http +X-Window-Icon= +X-HildonDesk-ShowInToolbar=true +X-Osso-Type=application/x-executable diff --git a/examples/network/http/http.pro b/examples/network/http/http.pro index 2b702ea..dc035c1 100644 --- a/examples/network/http/http.pro +++ b/examples/network/http/http.pro @@ -10,4 +10,9 @@ sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS http.pro sources.path = $$[QT_INSTALL_EXAMPLES]/network/http INSTALLS += target sources -symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) +symbian: { + TARGET.CAPABILITY = NetworkServices + include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) +} +maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) + diff --git a/examples/network/http/httpwindow.cpp b/examples/network/http/httpwindow.cpp index 874994a..6497a33 100644 --- a/examples/network/http/httpwindow.cpp +++ b/examples/network/http/httpwindow.cpp @@ -45,7 +45,11 @@ #include "ui_authenticationdialog.h" HttpWindow::HttpWindow(QWidget *parent) +#ifdef Q_WS_MAEMO_5 + : QWidget(parent) +#else : QDialog(parent) +#endif { #ifndef QT_NO_OPENSSL urlLineEdit = new QLineEdit("https://qt.nokia.com/"); @@ -57,6 +61,7 @@ HttpWindow::HttpWindow(QWidget *parent) urlLabel->setBuddy(urlLineEdit); statusLabel = new QLabel(tr("Please enter the URL of a file you want to " "download.")); + statusLabel->setWordWrap(true); downloadButton = new QPushButton(tr("Download")); downloadButton->setDefault(true); @@ -67,7 +72,9 @@ HttpWindow::HttpWindow(QWidget *parent) buttonBox->addButton(downloadButton, QDialogButtonBox::ActionRole); buttonBox->addButton(quitButton, QDialogButtonBox::RejectRole); +#ifndef Q_WS_MAEMO_5 progressDialog = new QProgressDialog(this); +#endif connect(urlLineEdit, SIGNAL(textChanged(QString)), this, SLOT(enableDownloadButton())); @@ -78,7 +85,9 @@ HttpWindow::HttpWindow(QWidget *parent) connect(&qnam, SIGNAL(sslErrors(QNetworkReply*,QList<QSslError>)), this, SLOT(sslErrors(QNetworkReply*,QList<QSslError>))); #endif +#ifndef Q_WS_MAEMO_5 connect(progressDialog, SIGNAL(canceled()), this, SLOT(cancelDownload())); +#endif connect(downloadButton, SIGNAL(clicked()), this, SLOT(downloadFile())); connect(quitButton, SIGNAL(clicked()), this, SLOT(close())); @@ -117,7 +126,7 @@ void HttpWindow::downloadFile() fileName = "index.html"; if (QFile::exists(fileName)) { - if (QMessageBox::question(this, tr("HTTP"), + if (QMessageBox::question(this, tr("HTTP"), tr("There already exists a file called %1 in " "the current directory. Overwrite?").arg(fileName), QMessageBox::Yes|QMessageBox::No, QMessageBox::No) @@ -136,9 +145,10 @@ void HttpWindow::downloadFile() return; } - +#ifndef Q_WS_MAEMO_5 progressDialog->setWindowTitle(tr("HTTP")); progressDialog->setLabelText(tr("Downloading %1.").arg(fileName)); +#endif downloadButton->setEnabled(false); // schedule the request @@ -164,11 +174,15 @@ void HttpWindow::httpFinished() file = 0; } reply->deleteLater(); +#ifndef Q_WS_MAEMO_5 progressDialog->hide(); +#endif return; } +#ifndef Q_WS_MAEMO_5 progressDialog->hide(); +#endif file->flush(); file->close(); @@ -194,7 +208,7 @@ void HttpWindow::httpFinished() } } else { QString fileName = QFileInfo(QUrl(urlLineEdit->text()).path()).fileName(); - statusLabel->setText(tr("Downloaded %1 to current directory.").arg(fileName)); + statusLabel->setText(tr("Downloaded %1 to %2.").arg(fileName).arg(QDir::currentPath())); downloadButton->setEnabled(true); } @@ -219,8 +233,13 @@ void HttpWindow::updateDataReadProgress(qint64 bytesRead, qint64 totalBytes) if (httpRequestAborted) return; +#ifndef Q_WS_MAEMO_5 progressDialog->setMaximum(totalBytes); progressDialog->setValue(bytesRead); +#else + Q_UNUSED(bytesRead); + Q_UNUSED(totalBytes); +#endif } void HttpWindow::enableDownloadButton() diff --git a/examples/network/http/httpwindow.h b/examples/network/http/httpwindow.h index 0ec87af..8bbe1a2 100644 --- a/examples/network/http/httpwindow.h +++ b/examples/network/http/httpwindow.h @@ -41,7 +41,11 @@ #ifndef HTTPWINDOW_H #define HTTPWINDOW_H +#ifdef Q_WS_MAEMO_5 +#include <QWidget> +#else #include <QDialog> +#endif #include <QNetworkAccessManager> #include <QUrl> @@ -59,7 +63,11 @@ class QNetworkReply; QT_END_NAMESPACE +#ifdef Q_WS_MAEMO_5 +class HttpWindow : public QWidget +#else class HttpWindow : public QDialog +#endif { Q_OBJECT @@ -84,7 +92,9 @@ private: QLabel *statusLabel; QLabel *urlLabel; QLineEdit *urlLineEdit; +#ifndef Q_WS_MAEMO_5 QProgressDialog *progressDialog; +#endif QPushButton *downloadButton; QPushButton *quitButton; QDialogButtonBox *buttonBox; diff --git a/examples/network/http/main.cpp b/examples/network/http/main.cpp index 4c4f61c..e4f1574 100644 --- a/examples/network/http/main.cpp +++ b/examples/network/http/main.cpp @@ -39,13 +39,28 @@ ****************************************************************************/ #include <QApplication> +#include <QDir> #include "httpwindow.h" int main(int argc, char *argv[]) { QApplication app(argc, argv); + +#if defined(Q_OS_SYMBIAN) + // Change current directory from default private to c:\data + // in order that user can access the downloaded content + QDir::setCurrent("c:\\data"); +#elif defined(Q_WS_MAEMO_5) + QDir::setCurrent("/home/user"); +#endif + HttpWindow httpWin; + +#if defined(Q_OS_SYMBIAN) + httpWin.showMaximized(); +#else httpWin.show(); - return httpWin.exec(); +#endif + return app.exec(); } diff --git a/examples/network/loopback/dialog.cpp b/examples/network/loopback/dialog.cpp index 50a191e..14154b4 100644 --- a/examples/network/loopback/dialog.cpp +++ b/examples/network/loopback/dialog.cpp @@ -58,6 +58,22 @@ Dialog::Dialog(QWidget *parent) serverProgressBar = new QProgressBar; serverStatusLabel = new QLabel(tr("Server ready")); +#ifdef Q_OS_SYMBIAN + QMenu *menu = new QMenu(this); + + QAction *optionsAction = new QAction(tr("Options"), this); + optionsAction->setSoftKeyRole(QAction::PositiveSoftKey); + optionsAction->setMenu(menu); + addAction(optionsAction); + + startAction = menu->addAction(tr("Start"), this, SLOT(start())); + + quitAction = new QAction(tr("Exit"), this); + quitAction->setSoftKeyRole(QAction::NegativeSoftKey); + addAction(quitAction); + + connect(quitAction, SIGNAL(triggered()), this, SLOT(close())); +#else startButton = new QPushButton(tr("&Start")); quitButton = new QPushButton(tr("&Quit")); @@ -67,6 +83,7 @@ Dialog::Dialog(QWidget *parent) connect(startButton, SIGNAL(clicked()), this, SLOT(start())); connect(quitButton, SIGNAL(clicked()), this, SLOT(close())); +#endif connect(&tcpServer, SIGNAL(newConnection()), this, SLOT(acceptConnection())); connect(&tcpClient, SIGNAL(connected()), this, SLOT(startTransfer())); @@ -82,7 +99,9 @@ Dialog::Dialog(QWidget *parent) mainLayout->addWidget(serverStatusLabel); mainLayout->addStretch(1); mainLayout->addSpacing(10); +#ifndef Q_OS_SYMBIAN mainLayout->addWidget(buttonBox); +#endif setLayout(mainLayout); setWindowTitle(tr("Loopback")); @@ -90,7 +109,11 @@ Dialog::Dialog(QWidget *parent) void Dialog::start() { +#ifdef Q_OS_SYMBIAN + startAction->setVisible(false); +#else startButton->setEnabled(false); +#endif #ifndef QT_NO_CURSOR QApplication::setOverrideCursor(Qt::WaitCursor); @@ -146,7 +169,11 @@ void Dialog::updateServerProgress() if (bytesReceived == TotalBytes) { tcpServerConnection->close(); +#ifdef Q_OS_SYMBIAN + startAction->setVisible(true); +#else startButton->setEnabled(true); +#endif #ifndef QT_NO_CURSOR QApplication::restoreOverrideCursor(); #endif @@ -183,7 +210,11 @@ void Dialog::displayError(QAbstractSocket::SocketError socketError) serverProgressBar->reset(); clientStatusLabel->setText(tr("Client ready")); serverStatusLabel->setText(tr("Server ready")); +#ifdef Q_OS_SYMBIAN + startAction->setVisible(true); +#else startButton->setEnabled(true); +#endif #ifndef QT_NO_CURSOR QApplication::restoreOverrideCursor(); #endif diff --git a/examples/network/loopback/dialog.h b/examples/network/loopback/dialog.h index 09b4366..b48c090 100644 --- a/examples/network/loopback/dialog.h +++ b/examples/network/loopback/dialog.h @@ -52,6 +52,7 @@ class QProgressBar; class QPushButton; class QTcpServer; class QTcpSocket; +class QAction; QT_END_NAMESPACE class Dialog : public QDialog @@ -74,9 +75,15 @@ private: QProgressBar *serverProgressBar; QLabel *clientStatusLabel; QLabel *serverStatusLabel; + +#ifdef Q_OS_SYMBIAN + QAction *startAction; + QAction *quitAction; +#else QPushButton *startButton; QPushButton *quitButton; QDialogButtonBox *buttonBox; +#endif QTcpServer tcpServer; QTcpSocket tcpClient; diff --git a/examples/network/loopback/loopback.desktop b/examples/network/loopback/loopback.desktop new file mode 100644 index 0000000..ee98215 --- /dev/null +++ b/examples/network/loopback/loopback.desktop @@ -0,0 +1,11 @@ +[Desktop Entry] +Encoding=UTF-8 +Version=1.0 +Type=Application +Terminal=false +Name=Loopback +Exec=/opt/usr/bin/loopback +Icon=loopback +X-Window-Icon= +X-HildonDesk-ShowInToolbar=true +X-Osso-Type=application/x-executable diff --git a/examples/network/loopback/loopback.pro b/examples/network/loopback/loopback.pro index cf6a0f3..a696a6f 100644 --- a/examples/network/loopback/loopback.pro +++ b/examples/network/loopback/loopback.pro @@ -9,4 +9,9 @@ sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS loopback.pro sources.path = $$[QT_INSTALL_EXAMPLES]/network/loopback INSTALLS += target sources -symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) +symbian: { + TARGET.CAPABILITY = NetworkServices + include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) +} +maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) + diff --git a/examples/network/loopback/main.cpp b/examples/network/loopback/main.cpp index 6810b79..7f26fd4 100644 --- a/examples/network/loopback/main.cpp +++ b/examples/network/loopback/main.cpp @@ -46,6 +46,10 @@ int main(int argc, char *argv[]) { QApplication app(argc, argv); Dialog dialog; +#ifdef Q_OS_SYMBIAN + dialog.showMaximized(); +#else dialog.show(); - return dialog.exec(); +#endif + return app.exec(); } diff --git a/examples/network/network-chat/network-chat.desktop b/examples/network/network-chat/network-chat.desktop new file mode 100644 index 0000000..ba3eeb3 --- /dev/null +++ b/examples/network/network-chat/network-chat.desktop @@ -0,0 +1,11 @@ +[Desktop Entry] +Encoding=UTF-8 +Version=1.0 +Type=Application +Terminal=false +Name=Network Chat +Exec=/opt/usr/bin/network-chat +Icon=network-chat +X-Window-Icon= +X-HildonDesk-ShowInToolbar=true +X-Osso-Type=application/x-executable diff --git a/examples/network/network-chat/network-chat.pro b/examples/network/network-chat/network-chat.pro index b3d429e..c4f0d0e 100644 --- a/examples/network/network-chat/network-chat.pro +++ b/examples/network/network-chat/network-chat.pro @@ -24,3 +24,7 @@ symbian { TARGET.CAPABILITY = "NetworkServices ReadUserData WriteUserData" TARGET.EPOCHEAPSIZE = 0x20000 0x2000000 } +maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) + +symbian: warning(This example might not fully work on Symbian platform) +maemo5: warning(This example might not fully work on Maemo platform) diff --git a/examples/network/network.pro b/examples/network/network.pro index 0012a97..28c57ec 100644 --- a/examples/network/network.pro +++ b/examples/network/network.pro @@ -38,4 +38,3 @@ sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS network.pro README sources.path = $$[QT_INSTALL_EXAMPLES]/network INSTALLS += sources -symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) diff --git a/examples/network/qftp/ftpwindow.cpp b/examples/network/qftp/ftpwindow.cpp index c3e629f..c0a2b73 100644 --- a/examples/network/qftp/ftpwindow.cpp +++ b/examples/network/qftp/ftpwindow.cpp @@ -51,7 +51,7 @@ FtpWindow::FtpWindow(QWidget *parent) ftpServerLabel->setBuddy(ftpServerLineEdit); statusLabel = new QLabel(tr("Please enter the name of an FTP server.")); -#ifdef Q_OS_SYMBIAN +#if defined(Q_OS_SYMBIAN) || defined(Q_WS_MAEMO_5) || defined(Q_WS_SIMULATOR) // Use word wrapping to fit the text on screen statusLabel->setWordWrap( true ); #endif @@ -243,6 +243,12 @@ void FtpWindow::downloadFile() void FtpWindow::cancelDownload() { ftp->abort(); + + if (file->exists()) { + file->close(); + file->remove(); + } + delete file; } //![5] diff --git a/examples/network/qftp/qftp.desktop b/examples/network/qftp/qftp.desktop new file mode 100644 index 0000000..6149fe9 --- /dev/null +++ b/examples/network/qftp/qftp.desktop @@ -0,0 +1,11 @@ +[Desktop Entry] +Encoding=UTF-8 +Version=1.0 +Type=Application +Terminal=false +Name=FTP +Exec=/opt/usr/bin/qftp +Icon=qftp +X-Window-Icon= +X-HildonDesk-ShowInToolbar=true +X-Osso-Type=application/x-executable diff --git a/examples/network/qftp/qftp.pro b/examples/network/qftp/qftp.pro index 232e8eb..3968365 100644 --- a/examples/network/qftp/qftp.pro +++ b/examples/network/qftp/qftp.pro @@ -16,3 +16,7 @@ symbian { INCLUDEPATH += $$APP_LAYER_SYSTEMINCLUDE TARGET.CAPABILITY="NetworkServices ReadUserData WriteUserData" } +maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) + +symbian: warning(This example might not fully work on Symbian platform) +maemo5: warning(This example might not fully work on Maemo platform) 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> diff --git a/examples/network/threadedfortuneserver/dialog.cpp b/examples/network/threadedfortuneserver/dialog.cpp index b69f42c..27bf253 100644 --- a/examples/network/threadedfortuneserver/dialog.cpp +++ b/examples/network/threadedfortuneserver/dialog.cpp @@ -47,11 +47,18 @@ #include "fortuneserver.h" Dialog::Dialog(QWidget *parent) - : QDialog(parent) + : QWidget(parent) { statusLabel = new QLabel; + statusLabel->setWordWrap(true); +#ifdef Q_OS_SYMBIAN + QAction *quitAction = new QAction(tr("Exit"), this); + quitAction->setSoftKeyRole(QAction::NegativeSoftKey); + addAction(quitAction); +#else quitButton = new QPushButton(tr("Quit")); quitButton->setAutoDefault(false); +#endif if (!server.listen()) { QMessageBox::critical(this, tr("Threaded Fortune Server"), @@ -78,6 +85,13 @@ Dialog::Dialog(QWidget *parent) "Run the Fortune Client example now.") .arg(ipAddress).arg(server.serverPort())); +#ifdef Q_OS_SYMBIAN + connect(quitAction, SIGNAL(triggered()), this, SLOT(close())); + + QVBoxLayout *mainLayout = new QVBoxLayout; + mainLayout->addWidget(statusLabel); + setLayout(mainLayout); +#else connect(quitButton, SIGNAL(clicked()), this, SLOT(close())); QHBoxLayout *buttonLayout = new QHBoxLayout; @@ -89,6 +103,6 @@ Dialog::Dialog(QWidget *parent) mainLayout->addWidget(statusLabel); mainLayout->addLayout(buttonLayout); setLayout(mainLayout); - +#endif setWindowTitle(tr("Threaded Fortune Server")); } diff --git a/examples/network/threadedfortuneserver/dialog.h b/examples/network/threadedfortuneserver/dialog.h index 10ae3eb..19a6fc2 100644 --- a/examples/network/threadedfortuneserver/dialog.h +++ b/examples/network/threadedfortuneserver/dialog.h @@ -41,7 +41,7 @@ #ifndef DIALOG_H #define DIALOG_H -#include <QDialog> +#include <QWidget> #include "fortuneserver.h" QT_BEGIN_NAMESPACE @@ -49,7 +49,7 @@ class QLabel; class QPushButton; QT_END_NAMESPACE -class Dialog : public QDialog +class Dialog : public QWidget { Q_OBJECT diff --git a/examples/network/threadedfortuneserver/main.cpp b/examples/network/threadedfortuneserver/main.cpp index 396f924..1e245e9 100644 --- a/examples/network/threadedfortuneserver/main.cpp +++ b/examples/network/threadedfortuneserver/main.cpp @@ -49,7 +49,11 @@ int main(int argc, char *argv[]) { QApplication app(argc, argv); Dialog dialog; +#ifdef Q_OS_SYMBIAN + dialog.showMaximized(); +#else dialog.show(); +#endif qsrand(QTime(0,0,0).secsTo(QTime::currentTime())); - return dialog.exec(); + return app.exec(); } diff --git a/examples/network/threadedfortuneserver/threadedfortuneserver.desktop b/examples/network/threadedfortuneserver/threadedfortuneserver.desktop new file mode 100644 index 0000000..509e244 --- /dev/null +++ b/examples/network/threadedfortuneserver/threadedfortuneserver.desktop @@ -0,0 +1,11 @@ +[Desktop Entry] +Encoding=UTF-8 +Version=1.0 +Type=Application +Terminal=false +Name=Threaded Fortune Server +Exec=/opt/usr/bin/threadedfortuneserver +Icon=threadedfortuneserver +X-Window-Icon= +X-HildonDesk-ShowInToolbar=true +X-Osso-Type=application/x-executable diff --git a/examples/network/threadedfortuneserver/threadedfortuneserver.pro b/examples/network/threadedfortuneserver/threadedfortuneserver.pro index 7853d57..5eb178a 100644 --- a/examples/network/threadedfortuneserver/threadedfortuneserver.pro +++ b/examples/network/threadedfortuneserver/threadedfortuneserver.pro @@ -13,4 +13,11 @@ sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS threadedfortuneserver.pr sources.path = $$[QT_INSTALL_EXAMPLES]/network/threadedfortuneserver INSTALLS += target sources -symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) +symbian: { + TARGET.CAPABILITY = NetworkServices + include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) +} +maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) + +symbian: warning(This example might not fully work on Symbian platform) +maemo5: warning(This example might not fully work on Maemo platform) diff --git a/examples/network/torrent/torrent.desktop b/examples/network/torrent/torrent.desktop new file mode 100644 index 0000000..59db3d3 --- /dev/null +++ b/examples/network/torrent/torrent.desktop @@ -0,0 +1,11 @@ +[Desktop Entry] +Encoding=UTF-8 +Version=1.0 +Type=Application +Terminal=false +Name=Torrent +Exec=/opt/usr/bin/torrent +Icon=torrent +X-Window-Icon= +X-HildonDesk-ShowInToolbar=true +X-Osso-Type=application/x-executable diff --git a/examples/network/torrent/torrent.pro b/examples/network/torrent/torrent.pro index 44716fd..242c796 100644 --- a/examples/network/torrent/torrent.pro +++ b/examples/network/torrent/torrent.pro @@ -37,3 +37,8 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/network/torrent INSTALLS += target sources symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) +maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) + +symbian: warning(This example might not fully work on Symbian platform) +maemo5: warning(This example might not fully work on Maemo platform) +simulator: warning(This example might not fully work on Simulator platform) |