diff options
author | Aaron McCarthy <aaron.mccarthy@nokia.com> | 2010-04-14 06:23:22 (GMT) |
---|---|---|
committer | Aaron McCarthy <aaron.mccarthy@nokia.com> | 2010-04-14 06:23:22 (GMT) |
commit | 90de3e5c903b67b2e5f3d7dc14266fe24f1daa23 (patch) | |
tree | b2ec0c85f2455f738d6466f129a1f4d057caffa9 /examples/network/bearermonitor/bearermonitor.cpp | |
parent | 0def696a8d569f0895010706fb989e78b25c13c1 (diff) | |
download | Qt-90de3e5c903b67b2e5f3d7dc14266fe24f1daa23.zip Qt-90de3e5c903b67b2e5f3d7dc14266fe24f1daa23.tar.gz Qt-90de3e5c903b67b2e5f3d7dc14266fe24f1daa23.tar.bz2 |
Bearer management changes from Qt Mobility (7a5ff985)
7a5ff9859f5775915ae80c287f51c772599c2379
Diffstat (limited to 'examples/network/bearermonitor/bearermonitor.cpp')
-rw-r--r-- | examples/network/bearermonitor/bearermonitor.cpp | 28 |
1 files changed, 22 insertions, 6 deletions
diff --git a/examples/network/bearermonitor/bearermonitor.cpp b/examples/network/bearermonitor/bearermonitor.cpp index 5b2bad1..4a6c6ff 100644 --- a/examples/network/bearermonitor/bearermonitor.cpp +++ b/examples/network/bearermonitor/bearermonitor.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** @@ -43,7 +43,7 @@ #include "sessionwidget.h" #include <QDebug> - +#include <QMessageBox> #ifdef Q_OS_WIN #include <winsock2.h> #undef interface @@ -57,15 +57,20 @@ BearerMonitor::BearerMonitor(QWidget *parent) : QWidget(parent) { setupUi(this); +#if defined(Q_WS_MAEMO_5) || defined(Q_WS_MAEMO_6) + newSessionButton->hide(); + deleteSessionButton->hide(); +#else delete tabWidget->currentWidget(); sessionGroup->hide(); -#if defined (Q_OS_SYMBIAN) || defined(Q_OS_WINCE) +#endif +#if defined (Q_OS_SYMBIAN) || defined(Q_OS_WINCE) || defined(Q_WS_MAEMO_5) || defined(Q_WS_MAEMO_6) setWindowState(Qt::WindowMaximized); #endif updateConfigurations(); - +#if !defined(Q_WS_MAEMO_5) && !defined(Q_WS_MAEMO_6) onlineStateChanged(!manager.allConfigurations(QNetworkConfiguration::Active).isEmpty()); - +#endif QNetworkConfiguration defaultConfiguration = manager.defaultConfiguration(); for (int i = 0; i < treeWidget->topLevelItemCount(); ++i) { QTreeWidgetItem *item = treeWidget->topLevelItem(i); @@ -101,9 +106,10 @@ BearerMonitor::BearerMonitor(QWidget *parent) connect(newSessionButton, SIGNAL(clicked()), this, SLOT(createNewSession())); +#if !defined(Q_WS_MAEMO_5) && !defined(Q_WS_MAEMO_6) connect(deleteSessionButton, SIGNAL(clicked()), this, SLOT(deleteSession())); - +#endif connect(scanButton, SIGNAL(clicked()), this, SLOT(performScan())); } @@ -234,9 +240,15 @@ void BearerMonitor::updateConfigurations() void BearerMonitor::onlineStateChanged(bool isOnline) { if (isOnline) +#if defined(Q_WS_MAEMO_5) || defined(Q_WS_MAEMO_6) + QMessageBox::information(this, "Connection state changed", "Online", QMessageBox::Close); + else + QMessageBox::information(this, "Connection state changed", "Offline", QMessageBox::Close); +#else onlineState->setText(tr("Online")); else onlineState->setText(tr("Offline")); +#endif } #ifdef Q_OS_WIN @@ -362,7 +374,9 @@ void BearerMonitor::createSessionFor(QTreeWidgetItem *item) tabWidget->addTab(session, conf.name()); +#if !defined(Q_WS_MAEMO_5) && !defined(Q_WS_MAEMO_6) sessionGroup->show(); +#endif sessionWidgets.append(session); } @@ -374,6 +388,7 @@ void BearerMonitor::createNewSession() createSessionFor(item); } +#if !defined(Q_WS_MAEMO_5) && !defined(Q_WS_MAEMO_6) void BearerMonitor::deleteSession() { SessionWidget *session = qobject_cast<SessionWidget *>(tabWidget->currentWidget()); @@ -386,6 +401,7 @@ void BearerMonitor::deleteSession() sessionGroup->hide(); } } +#endif void BearerMonitor::performScan() { |