From 0748751c9f097d9d866605306bbdd4b96e2a5c4e Mon Sep 17 00:00:00 2001 From: David Boddie Date: Wed, 27 Apr 2011 19:16:41 +0200 Subject: Squashed commit of the changes from the mobile-examples repository (4.7-generated-declarative branch). --- examples/network/threadedfortuneserver/dialog.cpp | 18 ++++++++++++++++-- examples/network/threadedfortuneserver/dialog.h | 4 ++-- examples/network/threadedfortuneserver/main.cpp | 6 +++++- .../threadedfortuneserver/threadedfortuneserver.pro | 9 ++++++++- 4 files changed, 31 insertions(+), 6 deletions(-) (limited to 'examples/network/threadedfortuneserver') diff --git a/examples/network/threadedfortuneserver/dialog.cpp b/examples/network/threadedfortuneserver/dialog.cpp index b69f42cc85..27bf253b1a 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 10ae3ebaa2..19a6fc2f47 100644 --- a/examples/network/threadedfortuneserver/dialog.h +++ b/examples/network/threadedfortuneserver/dialog.h @@ -41,7 +41,7 @@ #ifndef DIALOG_H #define DIALOG_H -#include +#include #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 396f9244b6..1e245e9e01 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.pro b/examples/network/threadedfortuneserver/threadedfortuneserver.pro index a76974a57e..335666bd76 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]/qtbase/network/threadedfortuneserver INSTALLS += target sources -symbian: CONFIG += qt_example +symbian: { + CONFIG += qt_example + TARGET.CAPABILITY = NetworkServices +} +maemo5: CONFIG += qt_example + +symbian: warning(This example might not fully work on Symbian platform) +maemo5: warning(This example might not fully work on Maemo platform) -- cgit v1.2.3