summaryrefslogtreecommitdiffstats
path: root/examples/network/bearermonitor/bearermonitor.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'examples/network/bearermonitor/bearermonitor.cpp')
-rw-r--r--examples/network/bearermonitor/bearermonitor.cpp28
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()
{