# HG changeset patch # User Dremov Kirill (Nokia-D-MSW/Tampere) # Date 1286147224 -10800 # Node ID b47b808de4819e38017c86e63462e972317c8df9 # Parent 301aeb18ae470e50e5d565e50a58032d3229c200 Revision: 201037 Kit: 201039 diff -r 301aeb18ae47 -r b47b808de481 hotspotfw/hsclient/NetCfgExtnHotSpot/inc/NetCfgExtnHotSpot.h --- a/hotspotfw/hsclient/NetCfgExtnHotSpot/inc/NetCfgExtnHotSpot.h Fri Sep 17 08:35:49 2010 +0300 +++ b/hotspotfw/hsclient/NetCfgExtnHotSpot/inc/NetCfgExtnHotSpot.h Mon Oct 04 02:07:04 2010 +0300 @@ -115,6 +115,10 @@ inline CNetworkConfigExtensionHotSpot::CNetworkConfigExtensionHotSpot( MNifIfNotify& aNifIfNotify ) : CNetworkConfigExtensionBase( aNifIfNotify ) { + iNotAuthenticated =false; + iNotDeregistered = false; + iIsStartLoginActive=false; + iHotspotConnect=0; } #endif diff -r 301aeb18ae47 -r b47b808de481 hotspotfw/hsclient/inc/hsssrvnotifications.h --- a/hotspotfw/hsclient/inc/hsssrvnotifications.h Fri Sep 17 08:35:49 2010 +0300 +++ b/hotspotfw/hsclient/inc/hsssrvnotifications.h Mon Oct 04 02:07:04 2010 +0300 @@ -19,7 +19,6 @@ #ifndef HSSSRVNOTIFICATIONS_H #define HSSSRVNOTIFICATIONS_H -#include "hssinterface.h" #include #include diff -r 301aeb18ae47 -r b47b808de481 hotspotfw/hsclient/src/hssiaphandler.cpp --- a/hotspotfw/hsclient/src/hssiaphandler.cpp Fri Sep 17 08:35:49 2010 +0300 +++ b/hotspotfw/hsclient/src/hssiaphandler.cpp Mon Oct 04 02:07:04 2010 +0300 @@ -45,6 +45,7 @@ // CHssIapHandler::CHssIapHandler( ) { + iWLANRecord = NULL; DEBUG("CHssIapHandler::CHssIapHandler"); } @@ -385,7 +386,7 @@ if (buffer.Compare( uidClient ) == 0) { iapId = dest.ConnectionMethodL(j).GetIntAttributeL( ECmIapId ); - aIapIdArray.Append( iapId ); + aIapIdArray.AppendL( iapId ); DEBUG("CHssIapSettingsHandler::GetClientsIapsL: UIDs matched"); DEBUG1("CHssIapSettingsHandler::Found IapId: %d", iapId); } diff -r 301aeb18ae47 -r b47b808de481 hotspotfw/hsclient/src/hssmgmtscaninfoimpl.cpp --- a/hotspotfw/hsclient/src/hssmgmtscaninfoimpl.cpp Fri Sep 17 08:35:49 2010 +0300 +++ b/hotspotfw/hsclient/src/hssmgmtscaninfoimpl.cpp Mon Oct 04 02:07:04 2010 +0300 @@ -32,6 +32,7 @@ // CHssMgmtScanInfoImpl::CHssMgmtScanInfoImpl() { + iScanInfo=NULL; DEBUG("CHssMgmtScanInfoImpl::CHssMgmtScanInfoImpl()"); } diff -r 301aeb18ae47 -r b47b808de481 hotspotfw/hsclient/src/hssscanhandler.cpp --- a/hotspotfw/hsclient/src/hssscanhandler.cpp Fri Sep 17 08:35:49 2010 +0300 +++ b/hotspotfw/hsclient/src/hssscanhandler.cpp Mon Oct 04 02:07:04 2010 +0300 @@ -37,9 +37,10 @@ // CHssScanHandler::CHssScanHandler( ) { - DEBUG("CHssScanHandler::CHssScanHandler"); - - } + iMgmtClient=NULL; + iScanInfo=NULL; + DEBUG("CHssScanHandler::CHssScanHandler"); + } // ----------------------------------------------------------------------------- // ConstructL diff -r 301aeb18ae47 -r b47b808de481 hotspotfw/hsserver/inc/am_debug.h --- a/hotspotfw/hsserver/inc/am_debug.h Fri Sep 17 08:35:49 2010 +0300 +++ b/hotspotfw/hsserver/inc/am_debug.h Mon Oct 04 02:07:04 2010 +0300 @@ -34,7 +34,6 @@ public: static inline void PrintBuffer( TUint aLength, const TUint8* aData ); static inline void PrintString( const TDesC& aString, TUint aLength, const TUint8* aData ); - static inline void PrintTimestamp( const TDesC& aString ); }; #define DEBUG(a) RDebug::Print(_L(a)) diff -r 301aeb18ae47 -r b47b808de481 hotspotfw/hsserver/inc/am_debug.inl --- a/hotspotfw/hsserver/inc/am_debug.inl Fri Sep 17 08:35:49 2010 +0300 +++ b/hotspotfw/hsserver/inc/am_debug.inl Mon Oct 04 02:07:04 2010 +0300 @@ -60,19 +60,3 @@ RDebug::Print( line ); } -// ----------------------------------------------------------------------------- -// Debug::PrintTimestamp -// ----------------------------------------------------------------------------- -// -inline void Debug::PrintTimestamp( const TDesC& aString ) - { - TBuf line; - TTime time; - time.HomeTime(); - - time.FormatL( line, _L( "%H:%T:%S:%C" ) ); - line.Append( _L( " " ) ); - line.Append( aString ); - - RDebug::Print( line ); - } diff -r 301aeb18ae47 -r b47b808de481 hotspotfw/hsserver/inc/hotspotserver.h --- a/hotspotfw/hsserver/inc/hotspotserver.h Fri Sep 17 08:35:49 2010 +0300 +++ b/hotspotfw/hsserver/inc/hotspotserver.h Mon Oct 04 02:07:04 2010 +0300 @@ -261,7 +261,7 @@ * @param aLoginTimerValue, set login timer value * @param aLogoutTimerValue, set logout timer value. */ - void SetTimerValues( + void SetTimerValuesL( TDes& aClientUid, TUint aLoginTimerValue, TUint aLogoutTimerValue ); @@ -280,7 +280,7 @@ * @param aIapId, IAP id * @param aUid, clients user id */ - void SetClientIap( TUint aIapId, TDes& aUid ); + void SetClientIapL( TUint aIapId, TDes& aUid ); /** * Removes client IAP from the array. diff -r 301aeb18ae47 -r b47b808de481 hotspotfw/hsserver/inc/hotspotsession.h --- a/hotspotfw/hsserver/inc/hotspotsession.h Fri Sep 17 08:35:49 2010 +0300 +++ b/hotspotfw/hsserver/inc/hotspotsession.h Mon Oct 04 02:07:04 2010 +0300 @@ -143,7 +143,7 @@ * @param aMessage, RMessage from client side * @return None */ - void ProcessRegister( const RMessage2& aMessage ); + void ProcessRegisterL( const RMessage2& aMessage ); /** * Starts client unregister procedures diff -r 301aeb18ae47 -r b47b808de481 hotspotfw/hsserver/inc/hssnotif.h --- a/hotspotfw/hsserver/inc/hssnotif.h Fri Sep 17 08:35:49 2010 +0300 +++ b/hotspotfw/hsserver/inc/hssnotif.h Mon Oct 04 02:07:04 2010 +0300 @@ -23,7 +23,6 @@ #include "hssinterface.h" #include #include -#include "hotspotsession.h" #include "hotspotclientserver.h" // FORWARD DECLARATIONS diff -r 301aeb18ae47 -r b47b808de481 hotspotfw/hsserver/src/hotspotserver.cpp --- a/hotspotfw/hsserver/src/hotspotserver.cpp Fri Sep 17 08:35:49 2010 +0300 +++ b/hotspotfw/hsserver/src/hotspotserver.cpp Mon Oct 04 02:07:04 2010 +0300 @@ -107,6 +107,12 @@ CHotSpotServer::CHotSpotServer() :CPolicyServer( EPriorityStandard, THotSpotServerPlatSecPolicy, ESharableSessions ) { + iAssociationValue=false; + iLogoutSent=false ; + iLoginValue=false; + iIapCheckValue=false; + iMgtClient=NULL; + iClientIapsChecked =0; } // ----------------------------------------------------------------------------- @@ -234,7 +240,7 @@ EWlanServiceExtensionTableName ); clientUid.Copy( client->Des() ); delete client; - SetClientIap( iapId, clientUid ); + SetClientIapL( iapId, clientUid ); DEBUG1("CHotSpotServer::FindClientIapsL() iapId: %d", iapId ); } } @@ -532,15 +538,15 @@ } // ----------------------------------------------------------------------------- -// SetTimerValues +// SetTimerValuesL // ----------------------------------------------------------------------------- // -void CHotSpotServer::SetTimerValues( +void CHotSpotServer::SetTimerValuesL( TDes& aClientUid, TUint aLoginTimerValue, // in seconds TUint aLogoutTimerValue ) // in seconds { - DEBUG("HotspotServer::SetTimerValues()"); + DEBUG("HotspotServer::SetTimerValuesL()"); TInt ret = FindClientUid( aClientUid ); TUint loginTimeMicroSecs = KHssDefaultLoginTimeMicroSecs ; TUint logoutTimeMicroSecs = KHssDefaultLogoutTimeMicroSecs ; @@ -560,20 +566,20 @@ if (ret != KErrNotFound) { - DEBUG("CHotSpotServer::SetTimerValues(): Existing client modified."); + DEBUG("CHotSpotServer::SetTimerValuesL(): Existing client modified."); // ret is the matching element's index. iLoginLogoutTimerArray[ret].iLoginTimeMicroSecs = loginTimeMicroSecs; iLoginLogoutTimerArray[ret].iLogoutTimeMicroSecs = logoutTimeMicroSecs; } else { - DEBUG("CHotSpotServer::SetTimerValues(): New Client added."); + DEBUG("CHotSpotServer::SetTimerValuesL(): New Client added."); // Create a new element and append it to the array. const SLoginLogoutTimers addedElement = { aClientUid, loginTimeMicroSecs, logoutTimeMicroSecs }; - iLoginLogoutTimerArray.Append( addedElement ); + iLoginLogoutTimerArray.AppendL( addedElement ); } } @@ -629,14 +635,14 @@ } // ----------------------------------------------------------------------------- -// SetClientIap +// SetClientIapL // ----------------------------------------------------------------------------- // -void CHotSpotServer::SetClientIap( TUint aIapId, TDes& aUid ) +void CHotSpotServer::SetClientIapL( TUint aIapId, TDes& aUid ) { DEBUG("CHotspotServer::SetClientIap()"); SClientIaps clientElement = { aIapId, aUid }; - iClientIaps.Append( clientElement ); + iClientIaps.AppendL( clientElement ); } // ----------------------------------------------------------------------------- diff -r 301aeb18ae47 -r b47b808de481 hotspotfw/hsserver/src/hotspotsession.cpp --- a/hotspotfw/hsserver/src/hotspotsession.cpp Fri Sep 17 08:35:49 2010 +0300 +++ b/hotspotfw/hsserver/src/hotspotsession.cpp Mon Oct 04 02:07:04 2010 +0300 @@ -45,7 +45,17 @@ iServer( aServer ), iClient( NULL ), iSrvNotifications ( NULL ), iNotificationHandle( NULL ), iAllowNotifications( ETrue ), iHotspotExtension( ETrue ) { - + iIapSettingsHandler=NULL; + iNotifications=NULL; + iLoginTimer=NULL; + iLogoutTimer=NULL; + iMgtClient=NULL; + iIapId=0; + iNetId=0; + iNotificationHandle=NULL; + iIsNotificationRequestPending =false; + iClientUid.iUid =0; + } // ----------------------------------------------------------------------------- @@ -172,7 +182,7 @@ HandleCancelNotifications( aMessage ); break; case EHssRegister : - ProcessRegister( aMessage ); + ProcessRegisterL( aMessage ); break; case EHssUnRegister : ProcessUnRegister( aMessage ); @@ -470,7 +480,7 @@ ModifyClientUid( uid ); TUint loginTimerValue = aMessage.Int1(); TUint logoutTimerValue = aMessage.Int2(); - iServer.SetTimerValues( uid, loginTimerValue, logoutTimerValue ); + iServer.SetTimerValuesL( uid, loginTimerValue, logoutTimerValue ); aMessage.Complete( KErrNone ); break; } @@ -635,9 +645,9 @@ // ProcessRegister // --------------------------------------------------------- // -void CHotSpotSession::ProcessRegister( const RMessage2& aMessage ) +void CHotSpotSession::ProcessRegisterL( const RMessage2& aMessage ) { - DEBUG("CHotSpotSession::ProcessRegister"); + DEBUG("CHotSpotSession::ProcessRegisterL"); iAllowNotifications = EFalse; TBufC< KIapNameLength > iapName; @@ -664,7 +674,7 @@ DEBUG1( "CHotSpotSession::EHssRegister ret: %d", ret ); if ( KErrNone == ret ) { - iServer.SetClientIap( iapId, bufUid ); + iServer.SetClientIapL( iapId, bufUid ); aMessage.Complete( iapId ); } diff -r 301aeb18ae47 -r b47b808de481 hotspotfw/hsserver/src/hssnotif.cpp --- a/hotspotfw/hsserver/src/hssnotif.cpp Fri Sep 17 08:35:49 2010 +0300 +++ b/hotspotfw/hsserver/src/hssnotif.cpp Mon Oct 04 02:07:04 2010 +0300 @@ -21,6 +21,7 @@ #include "hssnotif.h" #include "hssinterface.h" #include "am_debug.h" +#include "hotspotsession.h" // ============================ MEMBER FUNCTIONS =============================== diff -r 301aeb18ae47 -r b47b808de481 hotspotfw/internetconnectivitytestservice/src/ictsclientinterface.cpp --- a/hotspotfw/internetconnectivitytestservice/src/ictsclientinterface.cpp Fri Sep 17 08:35:49 2010 +0300 +++ b/hotspotfw/internetconnectivitytestservice/src/ictsclientinterface.cpp Mon Oct 04 02:07:04 2010 +0300 @@ -29,7 +29,7 @@ // CIctsClientInterface::CIctsClientInterface() { - + iEngine =NULL; } // --------------------------------------------------------------------------- diff -r 301aeb18ae47 -r b47b808de481 hotspotfw/internetconnectivitytestservice/src/ictsengine.cpp --- a/hotspotfw/internetconnectivitytestservice/src/ictsengine.cpp Fri Sep 17 08:35:49 2010 +0300 +++ b/hotspotfw/internetconnectivitytestservice/src/ictsengine.cpp Mon Oct 04 02:07:04 2010 +0300 @@ -41,7 +41,10 @@ iIapId( aIapId ), iNetworkId( aNetworkId ), iPollingStatus( EFalse ), iRepository( NULL ), iClient( aClient ) { - + iPollingIntervalTimer =NULL; + iPollingTimeTimer = NULL; + iHttpHandler =NULL; + iPollingInterval=0; } // --------------------------------------------------------------------------- diff -r 301aeb18ae47 -r b47b808de481 package_definition.xml --- a/package_definition.xml Fri Sep 17 08:35:49 2010 +0300 +++ b/package_definition.xml Mon Oct 04 02:07:04 2010 +0300 @@ -29,6 +29,9 @@ + + + @@ -41,9 +44,6 @@ - - - diff -r 301aeb18ae47 -r b47b808de481 wlanutilities/cpwlanentryplugin/.static_wa diff -r 301aeb18ae47 -r b47b808de481 wlanutilities/cpwlanentryplugin/cpwlanentryplugin.pro --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/wlanutilities/cpwlanentryplugin/cpwlanentryplugin.pro Mon Oct 04 02:07:04 2010 +0300 @@ -0,0 +1,71 @@ +# +# Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies). +# All rights reserved. +# This component and the accompanying materials are made available +# under the terms of "Eclipse Public License v1.0" +# which accompanies this distribution, and is available +# at the URL "http://www.eclipse.org/legal/epl-v10.html". +# +# Initial Contributors: +# Nokia Corporation - initial contribution. +# +# Contributors: +# +# Description: +# WLAN Entry Plugin Qt project file. +# + +TEMPLATE = lib +TARGET = cpwlanentryplugin +DEPENDPATH += . +INCLUDEPATH += . +INCLUDEPATH += traces +# wlanutilities Private API +INCLUDEPATH += ../inc +CONFIG += hb plugin +LIBS += -lwlanqtutilities -lcpframework -lxqservice -lxqserviceutil -lqtsysteminfo -lxqsettingsmanager + +# Temporary solution to fix tracecompiler +# When tracecompiler is fixed, this can be removed +symbian: { + MMP_RULES += "USERINCLUDE traces" +} + +#Store generated files to their own directory +MOC_DIR = build +RCC_DIR = build + +# Sources +HEADERS += \ + inc/cpwlanentryplugin.h \ + inc/cpwlanentryitemdata.h \ + inc/wlanstatusinfo.h \ + traces/OstTraceDefinitions.h +SOURCES += \ + src/cpwlanentryplugin.cpp \ + src/cpwlanentryitemdata.cpp \ + src/wlanstatusinfo.cpp + +TRANSLATIONS = wlanentryplugin.ts + +symbian: { + TARGET.EPOCALLOWDLLDATA = 1 + TARGET.UID3 = 0x2002BCE0 + BLD_INF_RULES.prj_exports += "rom/cpwlanentryplugin.iby CORE_MW_LAYER_IBY_EXPORT_PATH(cpwlanentryplugin.iby)" + BLD_INF_RULES.prj_exports += "rom/cpwlanentryplugin_resources.iby LANGUAGE_APP_LAYER_IBY_EXPORT_PATH(cpwlanentryplugin_resources.iby)" + + # Enable for QtHighway tracing + # DEFINES += WLANENTRYPLUGIN_SERVICETRACES +} +symbian { + deploy.path = C: + qtplugins.path = /resource/qt/plugins/controlpanel + qtplugins.sources += qmakepluginstubs/cpwlanentryplugin.qtplugin + + # This is for new exporting system coming in garden + for(qtplugin, qtplugins.sources):BLD_INF_RULES.prj_exports += "./$$qtplugin $$deploy.path$$qtplugins.path/$$basename(qtplugin)" +} +TARGET.CAPABILITY = CAP_GENERAL_DLL +plugin.sources = cpwlanentryplugin.dll xqservice.dll +plugin.path = /resource/qt/plugins/controlpanel +DEPLOYMENT += plugin diff -r 301aeb18ae47 -r b47b808de481 wlanutilities/cpwlanentryplugin/inc/cpwlanentryitemdata.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/wlanutilities/cpwlanentryplugin/inc/cpwlanentryitemdata.h Mon Oct 04 02:07:04 2010 +0300 @@ -0,0 +1,81 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* WLAN Entry plugin item data implementation. +*/ + +#ifndef CPWLANENTRYITEMDATA_H +#define CPWLANENTRYITEMDATA_H + +// System includes +#include + +// User includes +#include "cpsettingformentryitemdata.h" + +// Forward declarations + +class WlanStatusInfo; +class XQAiwRequest; + +// External data types + +// Constants + +// Class declaration + +class CpWlanEntryItemData : public CpSettingFormEntryItemData +{ + Q_OBJECT + +public: + + // Data types + + explicit CpWlanEntryItemData(CpItemDataHelper &itemDataHelper); + + virtual ~CpWlanEntryItemData(); + +signals: + +public slots: + +protected: + +protected slots: + +private: + + Q_DISABLE_COPY(CpWlanEntryItemData) + + virtual CpBaseSettingView *createSettingView() const; + +private slots: + + void statusUpdate(); + void handleOk(const QVariant &result); + void handleError(int errorCode, const QString& errorMessage); + +private: // data + + WlanStatusInfo *mWlanStatusInfo; //!< WLAN status info handler + mutable bool mProcessing; //used to mark if there is a request being processed + mutable XQAiwRequest *mRequest; + mutable XQApplicationManager mAiwMgr; + + // Friend classes + +}; + +#endif // CPWLANENTRYITEMDATA_H diff -r 301aeb18ae47 -r b47b808de481 wlanutilities/cpwlanentryplugin/inc/cpwlanentryplugin.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/wlanutilities/cpwlanentryplugin/inc/cpwlanentryplugin.h Mon Oct 04 02:07:04 2010 +0300 @@ -0,0 +1,79 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* WLAN Entry plugin implementation. +*/ + +#ifndef CPWLANENTRYPLUGIN_H +#define CPWLANENTRYPLUGIN_H + +// System includes + +#include +#include +#include + +// User includes + +// Forward declarations + +class HbTranslator; + +// External data types + +// Constants + +// Class declaration + +class CpWlanEntryPlugin : public QObject, public CpPluginInterface +{ + Q_OBJECT + Q_INTERFACES(CpPluginInterface) + +public: + + // Data types + + CpWlanEntryPlugin(); + + virtual ~CpWlanEntryPlugin(); + + virtual QList createSettingFormItemData( + CpItemDataHelper &itemDataHelper) const; + +signals: + +public slots: + +protected: + +protected slots: + +private: + + Q_DISABLE_COPY(CpWlanEntryPlugin) + +private slots: + +private: // data + + //! WLAN dynamic ON/OFF configuration + bool mWlanSupported; + //! Translator for text ID's used in this plugin + QSharedPointer mTranslator; + + // Friend classes +}; + +#endif // CPWLANENTRYPLUGIN_H diff -r 301aeb18ae47 -r b47b808de481 wlanutilities/cpwlanentryplugin/inc/wlanstatusinfo.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/wlanutilities/cpwlanentryplugin/inc/wlanstatusinfo.h Mon Oct 04 02:07:04 2010 +0300 @@ -0,0 +1,106 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* WLAN Status Info wrapper for WLAN entry plugin. +*/ + +#ifndef WLANSTATUSINFO_H +#define WLANSTATUSINFO_H + +// System includes + +#include + +// User includes + +// Forward declarations + +class WlanQtUtils; +class XQSettingsManager; + +// External data types + +// Constants + +// Class declaration + +class WlanStatusInfo : public QObject +{ + Q_OBJECT + +public: + + // Data types + + /*! + * WLAN Status value. + */ + enum { + //! WLAN is configured OFF. + WlanStatusOff = 0, + //! No WLAN connections. + WlanStatusIdle, + //! WLAN IAP is connected. + WlanStatusConnected, + }; + + explicit WlanStatusInfo(QObject *parent = 0); + + ~WlanStatusInfo(); + + int status() const; + + QString statusText() const; + +signals: + + /** + * Signal that informs that the WLAN status has changed. + */ + void statusUpdated(); + +public slots: + +protected: + +protected slots: + +private: + + Q_DISABLE_COPY(WlanStatusInfo) + + bool isWlanOn() const; + +private slots: + + void updateStatus(); + +private: // data + + //! WlanQtUtils instance. + WlanQtUtils *mWlanQtUtils; + + //! Settings manager for platform settings reading, writing & status changes. + XQSettingsManager *mSettingsManager; + + //! WLAN status text. + QString mStatusText; + + //! WLAN status value WlanStatus*. + int mStatus; + + // Friend classes +}; + +#endif // WLANSTATUSINFO_H diff -r 301aeb18ae47 -r b47b808de481 wlanutilities/cpwlanentryplugin/rom/cpwlanentryplugin.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/wlanutilities/cpwlanentryplugin/rom/cpwlanentryplugin.iby Mon Oct 04 02:07:04 2010 +0300 @@ -0,0 +1,31 @@ +/* +* Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* WLAN Entry Plugin iby file. +*/ + +#ifndef CPWLANENTRYPLUGIN_IBY +#define CPWLANENTRYPLUGIN_IBY + +#include +#include + +#ifdef __PROTOCOL_WLAN + +file=ABI_DIR/BUILD_DIR/cpwlanentryplugin.dll SHARED_LIB_DIR/cpwlanentryplugin.dll +data=/epoc32/data/c/resource/qt/plugins/controlpanel/cpwlanentryplugin.qtplugin resource/qt/plugins/controlpanel/cpwlanentryplugin.qtplugin + +#endif // __PROTOCOL_WLAN + +#endif // CPWLANENTRYPLUGIN_IBY diff -r 301aeb18ae47 -r b47b808de481 wlanutilities/cpwlanentryplugin/rom/cpwlanentryplugin_resources.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/wlanutilities/cpwlanentryplugin/rom/cpwlanentryplugin_resources.iby Mon Oct 04 02:07:04 2010 +0300 @@ -0,0 +1,30 @@ +/* +* Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* WLAN Entry Plugin resource iby file. +*/ + +#ifndef CPWLANENTRYPLUGIN_RESOURCES_IBY +#define CPWLANENTRYPLUGIN_RESOURCES_IBY + +#include +#include + +#ifdef __PROTOCOL_WLAN + +data=DATAZ_/QT_TRANSLATIONS_DIR/wlanentryplugin.qm QT_TRANSLATIONS_DIR/wlanentryplugin.qm + +#endif // __PROTOCOL_WLAN + +#endif // CPWLANENTRYPLUGIN_RESOURCES_IBY diff -r 301aeb18ae47 -r b47b808de481 wlanutilities/cpwlanentryplugin/src/cpwlanentryitemdata.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/wlanutilities/cpwlanentryplugin/src/cpwlanentryitemdata.cpp Mon Oct 04 02:07:04 2010 +0300 @@ -0,0 +1,219 @@ +/* +* Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* WLAN Entry plugin item data implementation. +*/ + +// System includes + +#include +#include +#include + +#ifdef WLANENTRYPLUGIN_SERVICETRACES +#include +#endif +#include +#include + +#include +#include + +// User includes + +#include "wlanstatusinfo.h" +#include "cpwlanentryitemdata.h" + +#include "OstTraceDefinitions.h" +#ifdef OST_TRACE_COMPILER_IN_USE +#include "cpwlanentryitemdataTraces.h" +#endif + +/*! + \class CpWlanEntryItemData + \brief Implementation of WLAN Status Plugin entry item data. + +*/ + +// External function prototypes + +// Local constants + +// ======== LOCAL FUNCTIONS ======== + +// ======== MEMBER FUNCTIONS ======== + +/*! + Constructor. + + @param[in,out] itemDataHelper Control Panel item data helper object. +*/ + +CpWlanEntryItemData::CpWlanEntryItemData(CpItemDataHelper &itemDataHelper) : + CpSettingFormEntryItemData(itemDataHelper, hbTrId("txt_occ_dblist_wireless_lan")), + mWlanStatusInfo(new WlanStatusInfo(this)), + mProcessing(false), + mRequest(0) +{ + OstTraceFunctionEntry0(CPWLANENTRYITEMDATA_CPWLANENTRYITEMDATA_ENTRY); + + // Listen for WLAN status updates + bool connectStatus = connect( + mWlanStatusInfo, + SIGNAL(statusUpdated()), + this, + SLOT(statusUpdate())); + Q_ASSERT(connectStatus); + + // Update to show initial WLAN status. + statusUpdate(); + + OstTraceFunctionExit0(CPWLANENTRYITEMDATA_CPWLANENTRYITEMDATA_EXIT); +} + +/*! + Destructor. +*/ + +CpWlanEntryItemData::~CpWlanEntryItemData() +{ + OstTraceFunctionEntry0(DUP1_CPWLANENTRYITEMDATA_CPWLANENTRYITEMDATA_ENTRY); + delete mRequest; + OstTraceFunctionExit0(DUP1_CPWLANENTRYITEMDATA_CPWLANENTRYITEMDATA_EXIT); +} + +void CpWlanEntryItemData::handleOk(const QVariant &result) +{ + OstTraceFunctionEntry0(CPWLANENTRYITEMDATA_HANDLEOK_ENTRY); + Q_UNUSED(result); + mProcessing = false; + + delete mRequest; + mRequest = NULL; + +#ifdef WLANENTRYPLUGIN_SERVICETRACES + XQSERVICE_DEBUG_PRINT("CpWlanEntryItemData::handleOk() service request completed OK"); +#endif + OstTraceFunctionExit0(CPWLANENTRYITEMDATA_HANDLEOK_EXIT); +} + + +void CpWlanEntryItemData::handleError(int errorCode, const QString& errorMessage) +{ + OstTraceFunctionEntry0(CPWLANENTRYITEMDATA_HANDLEERROR_ENTRY); + TPtrC tmp(errorMessage.utf16(),errorMessage.length()); + OstTraceExt2(TRACE_FLOW, CPWLANENTRYITEMDATA_HANDLEERROR, "CpWlanEntryItemData::handleError;errorCode=%d;errorMessage=%S", errorCode, tmp); + + mProcessing = false; + + delete mRequest; + mRequest = NULL; + + #ifdef WLANENTRYPLUGIN_SERVICETRACES + XQSERVICE_DEBUG_PRINT("CpWlanEntryItemData::handleOk() service request completed with error"); +#endif + OstTraceFunctionExit0(CPWLANENTRYITEMDATA_HANDLEERROR_EXIT); +} + + +/*! + Function for handling the entry item click. +*/ + +CpBaseSettingView *CpWlanEntryItemData::createSettingView() const +{ + OstTraceFunctionEntry0(CPWLANENTRYITEMDATA_CREATESETTINGVIEW_ENTRY); + + if (mProcessing) { + OstTrace0(TRACE_NORMAL, CPWLANENTRYITEMDATA_CREATESETTINGVIEW, "CpWlanEntryItemData::createSettingView:already processing, return"); + return 0; + } + mProcessing = true; + +#ifdef WLANENTRYPLUGIN_SERVICETRACES + qInstallMsgHandler(XQSERVICEMESSAGEHANDLER); + XQSERVICE_DEBUG_PRINT("CpWlanEntryItemData::createSettingView requesting listView()"); +#endif + + // Execute asynchronous WLAN Sniffer list view + mRequest = mAiwMgr.create( + "wlansniffer", + XQI_WLAN_SNIFFER, + XQOP_WLAN_SNIFFER, + true); + + // The WLAN Sniffer service must always exist + Q_ASSERT(mRequest); + + // The service is asynchronous & embedded + mRequest->setSynchronous(false); + + // Window title needs to be set to "Control Panel" + XQRequestInfo reqInfo; + reqInfo.setInfo(XQINFO_KEY_WINDOW_TITLE, hbTrId("txt_cp_title_control_panel")); + mRequest->setInfo(reqInfo); + + connect(mRequest, SIGNAL(requestOk(QVariant)), SLOT( handleOk(QVariant)), Qt::QueuedConnection); + connect(mRequest, SIGNAL(requestError(int, QString)), SLOT(handleError(int, QString))); + + bool status = mRequest->send(); +#ifdef WLANENTRYPLUGIN_SERVICETRACES + XQSERVICE_DEBUG_PRINT("CpWlanEntryItemData::createSettingView listView() service request sent"); +#endif + Q_ASSERT(status); + + OstTraceFunctionExit0(CPWLANENTRYITEMDATA_CREATESETTINGVIEW_EXIT); + return 0; +} + +/*! + Slot for updating the status shown by the plugin. + Updates both the text and icon. + */ +void CpWlanEntryItemData::statusUpdate() +{ + OstTraceFunctionEntry0(CPWLANENTRYITEMDATA_STATUSUPDATE_ENTRY); + + // Build icon with (possible) badge + HbIcon wlanIcon; + switch (mWlanStatusInfo->status()) { + case WlanStatusInfo::WlanStatusIdle: + wlanIcon = HbIcon("qtg_large_wlan"); + break; + + case WlanStatusInfo::WlanStatusOff: + wlanIcon = HbIcon("qtg_large_wlan_off"); + break; + + case WlanStatusInfo::WlanStatusConnected: + wlanIcon = HbIcon("qtg_large_wlan"); + wlanIcon.addBadge( + Qt::AlignBottom | Qt::AlignRight, + HbIcon("qtg_small_connection")); + break; + +#ifndef QT_NO_DEBUG + default: + // Unsupported status type detected + Q_ASSERT(0); + break; +#endif + } + + // Set the updated WLAN status + this->setEntryItemIcon(wlanIcon); + this->setDescription(mWlanStatusInfo->statusText()); + + OstTraceFunctionExit0(CPWLANENTRYITEMDATA_STATUSUPDATE_EXIT); +} diff -r 301aeb18ae47 -r b47b808de481 wlanutilities/cpwlanentryplugin/src/cpwlanentryplugin.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/wlanutilities/cpwlanentryplugin/src/cpwlanentryplugin.cpp Mon Oct 04 02:07:04 2010 +0300 @@ -0,0 +1,106 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* WLAN Entry plugin implementation. +*/ + +// System includes + +#include +#include +#include "qsysteminfo.h" + +// User includes + +#include "cpwlanentryitemdata.h" +#include "cpwlanentryplugin.h" + +#include "OstTraceDefinitions.h" +#ifdef OST_TRACE_COMPILER_IN_USE +#include "cpwlanentrypluginTraces.h" +#endif + +using namespace QtMobility; + +/*! + \class CpWlanEntryPlugin + \brief CpWlanEntryPlugin implements the WLAN Status Control Panel Plugin + that shows the current WLAN status. +*/ + +// External function prototypes + +// Local constants + +// ======== LOCAL FUNCTIONS ======== + +// ======== MEMBER FUNCTIONS ======== + +/*! + Constructor. +*/ + +CpWlanEntryPlugin::CpWlanEntryPlugin() : + QObject(), + mWlanSupported(false), + mTranslator() +{ + OstTraceFunctionEntry0(CPWLANENTRYPLUGIN_CPWLANENTRYPLUGIN_ENTRY); + + // Check & store WLAN dynamic configuration + QtMobility::QSystemInfo sysinfo; + mWlanSupported = sysinfo.hasFeatureSupported(QSystemInfo::WlanFeature); + + if (mWlanSupported) { + // Install localization + mTranslator = QSharedPointer( + new HbTranslator("wlanentryplugin")); + } + + OstTraceFunctionExit0(CPWLANENTRYPLUGIN_CPWLANENTRYPLUGIN_EXIT); +} + +/*! + Destructor. +*/ + +CpWlanEntryPlugin::~CpWlanEntryPlugin() +{ + OstTraceFunctionEntry0(DUP1_CPWLANENTRYPLUGIN_CPWLANENTRYPLUGIN_ENTRY); + OstTraceFunctionExit0(DUP1_CPWLANENTRYPLUGIN_CPWLANENTRYPLUGIN_EXIT); +} + +/*! + Plugin function for creating the entry plugin form item data. + + @param [in,out] itemDataHelper Control Panel item data helper. +*/ + +QList CpWlanEntryPlugin::createSettingFormItemData( + CpItemDataHelper &itemDataHelper) const +{ + OstTraceFunctionEntry0(CPWLANENTRYPLUGIN_CREATESETTINGFORMITEMDATA_ENTRY); + + QList settingFormData; + + // The plugin is disabled if WLAN is not supported by the product. + if (mWlanSupported) { + settingFormData.append(new CpWlanEntryItemData(itemDataHelper)); + } + + OstTraceFunctionExit0(CPWLANENTRYPLUGIN_CREATESETTINGFORMITEMDATA_EXIT); + return settingFormData; +} + +Q_EXPORT_PLUGIN2(cpwlanentryplugin, CpWlanEntryPlugin); diff -r 301aeb18ae47 -r b47b808de481 wlanutilities/cpwlanentryplugin/src/wlanstatusinfo.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/wlanutilities/cpwlanentryplugin/src/wlanstatusinfo.cpp Mon Oct 04 02:07:04 2010 +0300 @@ -0,0 +1,195 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* WLAN Status Info wrapper for WLAN entry plugin. +*/ + +// System includes + +#include +#include +#include + +// User includes + +#include "wlanqtutils.h" + +#include "wlanstatusinfo.h" + +#include "OstTraceDefinitions.h" +#ifdef OST_TRACE_COMPILER_IN_USE +#include "wlanstatusinfoTraces.h" +#endif + +/*! + \class WlanStatusInfo + \brief Class for maintaining and updating the WLAN status for the WLAN + Status Control Panel Plugin. +*/ + +// External function prototypes + +// Local constants + +//! Master WLAN ON/OFF setting key +static const XQSettingsKey masterWlanKey( + XQSettingsKey::TargetCentralRepository, + KCRUidWlanDeviceSettingsRegistryId.iUid, + KWlanOnOff); + +//! WLAN forced OFF setting key +static const XQSettingsKey wlanForceKey( + XQSettingsKey::TargetCentralRepository, + KCRUidWlanDeviceSettingsRegistryId.iUid, + KWlanForceDisable); + +// ======== LOCAL FUNCTIONS ======== + +// ======== MEMBER FUNCTIONS ======== + +/*! + Constructor. +*/ + +WlanStatusInfo::WlanStatusInfo(QObject *parent) : + QObject(parent), + mWlanQtUtils(new WlanQtUtils()), + mSettingsManager(new XQSettingsManager(this)), + mStatusText(""), + mStatus(WlanStatusOff) +{ + OstTraceFunctionEntry0(WLANSTATUSINFO_WLANSTATUSINFO_ENTRY); + + // Listen for WLAN ON/OFF switching + bool connectStatus = connect( + mSettingsManager, + SIGNAL(valueChanged(XQSettingsKey, QVariant)), + this, + SLOT(updateStatus())); + Q_ASSERT(connectStatus); + mSettingsManager->startMonitoring(masterWlanKey); + mSettingsManager->startMonitoring(wlanForceKey); + + // Listen for WLAN connection statuses + connectStatus = connect( + mWlanQtUtils, + SIGNAL(wlanNetworkOpened(int)), + this, + SLOT(updateStatus())); + Q_ASSERT(connectStatus == true); + connectStatus = connect( + mWlanQtUtils, + SIGNAL(wlanNetworkClosed(int, int)), + this, + SLOT(updateStatus())); + Q_ASSERT(connectStatus == true); + + // Set initial status + updateStatus(); + + OstTraceFunctionExit0(WLANSTATUSINFO_WLANSTATUSINFO_EXIT); +} + +/*! + Destructor. +*/ + +WlanStatusInfo::~WlanStatusInfo() +{ + OstTraceFunctionEntry0(DUP1_WLANSTATUSINFO_WLANSTATUSINFO_ENTRY); + + delete mWlanQtUtils; + + OstTraceFunctionExit0(DUP1_WLANSTATUSINFO_WLANSTATUSINFO_EXIT); +} + +/*! + Function for getting current WLAN status value (WlanStatusInfo::WlanStatus*). +*/ + +int WlanStatusInfo::status() const +{ + OstTraceFunctionEntry0(WLANSTATUSINFO_STATUS_ENTRY); + OstTraceFunctionExit0(WLANSTATUSINFO_STATUS_EXIT); + return mStatus; +} + +/*! + Returns the current WLAN status text. +*/ + +QString WlanStatusInfo::statusText() const +{ + OstTraceFunctionEntry0(WLANSTATUSINFO_STATUSTEXT_ENTRY); + OstTraceFunctionExit0(WLANSTATUSINFO_STATUSTEXT_EXIT); + return mStatusText; +} + +/*! + Function for checking if WLAN is ON. + WLAN is enabled if the WLAN OnOff key is true and the force disable + wlan key is false. + + @return Returns true if WLAN is ON. +*/ + +bool WlanStatusInfo::isWlanOn() const +{ + OstTraceFunctionEntry0(WLANSTATUSINFO_ISWLANON_ENTRY); + + bool wlanOn = mSettingsManager->readItemValue(masterWlanKey).toBool(); + bool forcedOff = mSettingsManager->readItemValue(wlanForceKey).toBool(); + + OstTraceExt2( + TRACE_NORMAL, + WLANSTATUSINFO_ISWLANON, + "WlanStatusInfo::isWlanOn;wlanOn=%hhu;forcedOff=%hhu", + wlanOn, + forcedOff); + + OstTraceFunctionExit0(WLANSTATUSINFO_ISWLANON_EXIT); + return wlanOn && !forcedOff; +} + +/*! + Slot used for updating the WLAN status. +*/ + +void WlanStatusInfo::updateStatus() +{ + OstTraceFunctionEntry0(WLANSTATUSINFO_UPDATESTATUS_ENTRY); + + // Backup old status to detect changes + QString oldStatusText = mStatusText; + + // Figure out current WLAN status + if (!isWlanOn()) { + // WLAN is switched OFF. + mStatus = WlanStatusOff; + mStatusText = hbTrId("txt_occ_dblist_wireless_lan_val_off"); + } else if (mWlanQtUtils->connectionStatus() == WlanQtUtils::ConnStatusConnected) { + mStatus = WlanStatusConnected; + mStatusText = mWlanQtUtils->iapName(mWlanQtUtils->activeIap()); + } else { + mStatus = WlanStatusIdle; + mStatusText = hbTrId("txt_occ_dblist_wireless_lan_val_wlan_is_on"); + } + + // Inform about update if the status really changed. + if (oldStatusText != mStatusText) { + emit statusUpdated(); + } + + OstTraceFunctionExit0(WLANSTATUSINFO_UPDATESTATUS_EXIT); +} diff -r 301aeb18ae47 -r b47b808de481 wlanutilities/cpwlanentryplugin/traces/OstTraceDefinitions.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/wlanutilities/cpwlanentryplugin/traces/OstTraceDefinitions.h Mon Oct 04 02:07:04 2010 +0300 @@ -0,0 +1,21 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* OST trace definition header. +*/ + +#ifndef __OSTTRACEDEFINITIONS_H__ +#define __OSTTRACEDEFINITIONS_H__ +#include +#endif diff -r 301aeb18ae47 -r b47b808de481 wlanutilities/cpwlansettingsplugin/src/wlansettings_s60.cpp --- a/wlanutilities/cpwlansettingsplugin/src/wlansettings_s60.cpp Fri Sep 17 08:35:49 2010 +0300 +++ b/wlanutilities/cpwlansettingsplugin/src/wlansettings_s60.cpp Mon Oct 04 02:07:04 2010 +0300 @@ -94,6 +94,14 @@ mScanInterval(KWlanSettingsDefaultScanNetwork) { OstTraceFunctionEntry0(CWLANSETINGPRIVATE_CWLANSETINGPRIVATE_ENTRY); + + mCmSettings.iCellularDataUsageHome = ECmCellularDataUsageConfirm; + mCmSettings.iCellularDataUsageVisitor = ECmCellularDataUsageConfirm; + mCmSettings.iUsageOfWlan = ECmUsageOfWlanKnown; + mJoinWlanType = EJoinWlanKnown; + mSession = NULL; + mWlanMgmtClient = NULL; + OstTraceFunctionExit0(CWLANSETINGPRIVATE_CWLANSETINGPRIVATE_EXIT); } diff -r 301aeb18ae47 -r b47b808de481 wlanutilities/wlanentryplugin/inc/cpwlanentryitemdata.h --- a/wlanutilities/wlanentryplugin/inc/cpwlanentryitemdata.h Fri Sep 17 08:35:49 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,75 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* WLAN Entry plugin item data implementation. -*/ - -#ifndef CPWLANENTRYITEMDATA_H -#define CPWLANENTRYITEMDATA_H - -// System includes - -#include "cpsettingformentryitemdata.h" - -// User includes - -// Forward declarations - -class WlanStatusInfo; - -// External data types - -// Constants - -// Class declaration - -class CpWlanEntryItemData : public CpSettingFormEntryItemData -{ - Q_OBJECT - -public: - - // Data types - - explicit CpWlanEntryItemData(CpItemDataHelper &itemDataHelper); - - virtual ~CpWlanEntryItemData(); - -signals: - -public slots: - -protected: - -protected slots: - -private: - - Q_DISABLE_COPY(CpWlanEntryItemData) - - virtual CpBaseSettingView *createSettingView() const; - -private slots: - - void statusUpdate(); - -private: // data - - WlanStatusInfo *mWlanStatusInfo; //!< WLAN status info handler - - // Friend classes - -}; - -#endif // CPWLANENTRYITEMDATA_H diff -r 301aeb18ae47 -r b47b808de481 wlanutilities/wlanentryplugin/inc/cpwlanentryplugin.h --- a/wlanutilities/wlanentryplugin/inc/cpwlanentryplugin.h Fri Sep 17 08:35:49 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,79 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* WLAN Entry plugin implementation. -*/ - -#ifndef CPWLANENTRYPLUGIN_H -#define CPWLANENTRYPLUGIN_H - -// System includes - -#include -#include -#include - -// User includes - -// Forward declarations - -class HbTranslator; - -// External data types - -// Constants - -// Class declaration - -class CpWlanEntryPlugin : public QObject, public CpPluginInterface -{ - Q_OBJECT - Q_INTERFACES(CpPluginInterface) - -public: - - // Data types - - CpWlanEntryPlugin(); - - virtual ~CpWlanEntryPlugin(); - - virtual QList createSettingFormItemData( - CpItemDataHelper &itemDataHelper) const; - -signals: - -public slots: - -protected: - -protected slots: - -private: - - Q_DISABLE_COPY(CpWlanEntryPlugin) - -private slots: - -private: // data - - //! WLAN dynamic ON/OFF configuration - bool mWlanSupported; - //! Translator for text ID's used in this plugin - QSharedPointer mTranslator; - - // Friend classes -}; - -#endif // CPWLANENTRYPLUGIN_H diff -r 301aeb18ae47 -r b47b808de481 wlanutilities/wlanentryplugin/inc/wlanstatusinfo.h --- a/wlanutilities/wlanentryplugin/inc/wlanstatusinfo.h Fri Sep 17 08:35:49 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,106 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* WLAN Status Info wrapper for WLAN entry plugin. -*/ - -#ifndef WLANSTATUSINFO_H -#define WLANSTATUSINFO_H - -// System includes - -#include - -// User includes - -// Forward declarations - -class WlanQtUtils; -class XQSettingsManager; - -// External data types - -// Constants - -// Class declaration - -class WlanStatusInfo : public QObject -{ - Q_OBJECT - -public: - - // Data types - - /*! - * WLAN Status value. - */ - enum { - //! WLAN is configured OFF. - WlanStatusOff = 0, - //! No WLAN connections. - WlanStatusIdle, - //! WLAN IAP is connected. - WlanStatusConnected, - }; - - explicit WlanStatusInfo(QObject *parent = 0); - - ~WlanStatusInfo(); - - int status() const; - - QString statusText() const; - -signals: - - /** - * Signal that informs that the WLAN status has changed. - */ - void statusUpdated(); - -public slots: - -protected: - -protected slots: - -private: - - Q_DISABLE_COPY(WlanStatusInfo) - - bool isWlanOn() const; - -private slots: - - void updateStatus(); - -private: // data - - //! WlanQtUtils instance. - WlanQtUtils *mWlanQtUtils; - - //! Settings manager for platform settings reading, writing & status changes. - XQSettingsManager *mSettingsManager; - - //! WLAN status text. - QString mStatusText; - - //! WLAN status value WlanStatus*. - int mStatus; - - // Friend classes -}; - -#endif // WLANSTATUSINFO_H diff -r 301aeb18ae47 -r b47b808de481 wlanutilities/wlanentryplugin/rom/wlanentryplugin.iby --- a/wlanutilities/wlanentryplugin/rom/wlanentryplugin.iby Fri Sep 17 08:35:49 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,31 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* WLAN Entry Plugin iby file. -*/ - -#ifndef WLANENTRYPLUGIN_IBY -#define WLANENTRYPLUGIN_IBY - -#include -#include - -#ifdef __PROTOCOL_WLAN - -file=ABI_DIR/BUILD_DIR/cpwlanentryplugin.dll SHARED_LIB_DIR/cpwlanentryplugin.dll -data=/epoc32/data/c/resource/qt/plugins/controlpanel/cpwlanentryplugin.qtplugin resource/qt/plugins/controlpanel/cpwlanentryplugin.qtplugin - -#endif // __PROTOCOL_WLAN - -#endif // WLANENTRYPLUGIN_IBY diff -r 301aeb18ae47 -r b47b808de481 wlanutilities/wlanentryplugin/rom/wlanentryplugin_resources.iby --- a/wlanutilities/wlanentryplugin/rom/wlanentryplugin_resources.iby Fri Sep 17 08:35:49 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,30 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* WLAN Entry Plugin resource iby file. -*/ - -#ifndef WLANENTRYPLUGIN_RESOURCES_IBY -#define WLANENTRYPLUGIN_RESOURCES_IBY - -#include -#include - -#ifdef __PROTOCOL_WLAN - -data=DATAZ_/QT_TRANSLATIONS_DIR/wlanentryplugin.qm QT_TRANSLATIONS_DIR/wlanentryplugin.qm - -#endif // __PROTOCOL_WLAN - -#endif // WLANENTRYPLUGIN_RESOURCES_IBY diff -r 301aeb18ae47 -r b47b808de481 wlanutilities/wlanentryplugin/src/cpwlanentryitemdata.cpp --- a/wlanutilities/wlanentryplugin/src/cpwlanentryitemdata.cpp Fri Sep 17 08:35:49 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,176 +0,0 @@ -/* -* Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* WLAN Entry plugin item data implementation. -*/ - -// System includes - -#include -#include -#include - -#ifdef WLANENTRYPLUGIN_SERVICETRACES -#include -#endif -#include -#include -#include - -#include -#include - -// User includes - -#include "wlanstatusinfo.h" -#include "cpwlanentryitemdata.h" - -#include "OstTraceDefinitions.h" -#ifdef OST_TRACE_COMPILER_IN_USE -#include "cpwlanentryitemdataTraces.h" -#endif - -/*! - \class CpWlanEntryItemData - \brief Implementation of WLAN Status Plugin entry item data. - -*/ - -// External function prototypes - -// Local constants - -// ======== LOCAL FUNCTIONS ======== - -// ======== MEMBER FUNCTIONS ======== - -/*! - Constructor. - - @param[in,out] itemDataHelper Control Panel item data helper object. -*/ - -CpWlanEntryItemData::CpWlanEntryItemData(CpItemDataHelper &itemDataHelper) : - CpSettingFormEntryItemData(itemDataHelper, hbTrId("txt_occ_dblist_wireless_lan")), - mWlanStatusInfo(new WlanStatusInfo(this)) -{ - OstTraceFunctionEntry0(CPWLANENTRYITEMDATA_CPWLANENTRYITEMDATA_ENTRY); - - // Listen for WLAN status updates - bool connectStatus = connect( - mWlanStatusInfo, - SIGNAL(statusUpdated()), - this, - SLOT(statusUpdate())); - Q_ASSERT(connectStatus); - - // Update to show initial WLAN status. - statusUpdate(); - - OstTraceFunctionExit0(CPWLANENTRYITEMDATA_CPWLANENTRYITEMDATA_EXIT); -} - -/*! - Destructor. -*/ - -CpWlanEntryItemData::~CpWlanEntryItemData() -{ - OstTraceFunctionEntry0(DUP1_CPWLANENTRYITEMDATA_CPWLANENTRYITEMDATA_ENTRY); - OstTraceFunctionExit0(DUP1_CPWLANENTRYITEMDATA_CPWLANENTRYITEMDATA_EXIT); -} - -/*! - Function for handling the entry item click. -*/ - -CpBaseSettingView *CpWlanEntryItemData::createSettingView() const -{ - OstTraceFunctionEntry0(CPWLANENTRYITEMDATA_CREATESETTINGVIEW_ENTRY); - -#ifdef WLANENTRYPLUGIN_SERVICETRACES - qInstallMsgHandler(XQSERVICEMESSAGEHANDLER); - XQSERVICE_DEBUG_PRINT("CpWlanEntryItemData::createSettingView requesting listView()"); -#endif - - // Execute synchronous WLAN Sniffer list view - XQApplicationManager aiwMgr; - XQAiwRequest *request = aiwMgr.create( - "wlansniffer", - XQI_WLAN_SNIFFER, - XQOP_WLAN_SNIFFER, - true); - - // The WLAN Sniffer service must always exist - Q_ASSERT(request); - - // The service is synchronous & embedded - request->setSynchronous(true); - - // Window title needs to be set to "Control Panel" - XQRequestInfo reqInfo; - reqInfo.setInfo(XQINFO_KEY_WINDOW_TITLE, hbTrId("txt_cp_title_control_panel")); - request->setInfo(reqInfo); - - bool status = request->send(); -#ifdef WLANENTRYPLUGIN_SERVICETRACES - XQSERVICE_DEBUG_PRINT("CpWlanEntryItemData::createSettingView listView() service request completed"); -#endif - Q_ASSERT(status); - delete request; - - OstTraceFunctionExit0(CPWLANENTRYITEMDATA_CREATESETTINGVIEW_EXIT); - return 0; -} - -/*! - Slot for updating the status shown by the plugin. - Updates both the text and icon. - */ -void CpWlanEntryItemData::statusUpdate() -{ - OstTraceFunctionEntry0(CPWLANENTRYITEMDATA_STATUSUPDATE_ENTRY); - - // Build icon with (possible) badge - HbIcon wlanIcon; - switch (mWlanStatusInfo->status()) { - case WlanStatusInfo::WlanStatusIdle: - wlanIcon = HbIcon("qtg_large_wlan"); - break; - - case WlanStatusInfo::WlanStatusOff: - wlanIcon = HbIcon("qtg_large_wlan_off"); - break; - - case WlanStatusInfo::WlanStatusConnected: - wlanIcon = HbIcon("qtg_large_wlan"); - wlanIcon.addBadge( - Qt::AlignBottom | Qt::AlignRight, - HbIcon("qtg_small_connection")); - break; - -#ifndef QT_NO_DEBUG - default: - // Unsupported status type detected - Q_ASSERT(0); - break; -#endif - } - - // Set the updated WLAN status - this->setEntryItemIcon(wlanIcon); - this->setDescription(mWlanStatusInfo->statusText()); - - OstTraceFunctionExit0(CPWLANENTRYITEMDATA_STATUSUPDATE_EXIT); -} diff -r 301aeb18ae47 -r b47b808de481 wlanutilities/wlanentryplugin/src/cpwlanentryplugin.cpp --- a/wlanutilities/wlanentryplugin/src/cpwlanentryplugin.cpp Fri Sep 17 08:35:49 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,106 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* WLAN Entry plugin implementation. -*/ - -// System includes - -#include -#include -#include "qsysteminfo.h" - -// User includes - -#include "cpwlanentryitemdata.h" -#include "cpwlanentryplugin.h" - -#include "OstTraceDefinitions.h" -#ifdef OST_TRACE_COMPILER_IN_USE -#include "cpwlanentrypluginTraces.h" -#endif - -using namespace QtMobility; - -/*! - \class CpWlanEntryPlugin - \brief CpWlanEntryPlugin implements the WLAN Status Control Panel Plugin - that shows the current WLAN status. -*/ - -// External function prototypes - -// Local constants - -// ======== LOCAL FUNCTIONS ======== - -// ======== MEMBER FUNCTIONS ======== - -/*! - Constructor. -*/ - -CpWlanEntryPlugin::CpWlanEntryPlugin() : - QObject(), - mWlanSupported(false), - mTranslator() -{ - OstTraceFunctionEntry0(CPWLANENTRYPLUGIN_CPWLANENTRYPLUGIN_ENTRY); - - // Check & store WLAN dynamic configuration - QtMobility::QSystemInfo sysinfo; - mWlanSupported = sysinfo.hasFeatureSupported(QSystemInfo::WlanFeature); - - if (mWlanSupported) { - // Install localization - mTranslator = QSharedPointer( - new HbTranslator("wlanentryplugin")); - } - - OstTraceFunctionExit0(CPWLANENTRYPLUGIN_CPWLANENTRYPLUGIN_EXIT); -} - -/*! - Destructor. -*/ - -CpWlanEntryPlugin::~CpWlanEntryPlugin() -{ - OstTraceFunctionEntry0(DUP1_CPWLANENTRYPLUGIN_CPWLANENTRYPLUGIN_ENTRY); - OstTraceFunctionExit0(DUP1_CPWLANENTRYPLUGIN_CPWLANENTRYPLUGIN_EXIT); -} - -/*! - Plugin function for creating the entry plugin form item data. - - @param [in,out] itemDataHelper Control Panel item data helper. -*/ - -QList CpWlanEntryPlugin::createSettingFormItemData( - CpItemDataHelper &itemDataHelper) const -{ - OstTraceFunctionEntry0(CPWLANENTRYPLUGIN_CREATESETTINGFORMITEMDATA_ENTRY); - - QList settingFormData; - - // The plugin is disabled if WLAN is not supported by the product. - if (mWlanSupported) { - settingFormData.append(new CpWlanEntryItemData(itemDataHelper)); - } - - OstTraceFunctionExit0(CPWLANENTRYPLUGIN_CREATESETTINGFORMITEMDATA_EXIT); - return settingFormData; -} - -Q_EXPORT_PLUGIN2(cpwlanentryplugin, CpWlanEntryPlugin); diff -r 301aeb18ae47 -r b47b808de481 wlanutilities/wlanentryplugin/src/wlanstatusinfo.cpp --- a/wlanutilities/wlanentryplugin/src/wlanstatusinfo.cpp Fri Sep 17 08:35:49 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,195 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* WLAN Status Info wrapper for WLAN entry plugin. -*/ - -// System includes - -#include -#include -#include - -// User includes - -#include "wlanqtutils.h" - -#include "wlanstatusinfo.h" - -#include "OstTraceDefinitions.h" -#ifdef OST_TRACE_COMPILER_IN_USE -#include "wlanstatusinfoTraces.h" -#endif - -/*! - \class WlanStatusInfo - \brief Class for maintaining and updating the WLAN status for the WLAN - Status Control Panel Plugin. -*/ - -// External function prototypes - -// Local constants - -//! Master WLAN ON/OFF setting key -static const XQSettingsKey masterWlanKey( - XQSettingsKey::TargetCentralRepository, - KCRUidWlanDeviceSettingsRegistryId.iUid, - KWlanOnOff); - -//! WLAN forced OFF setting key -static const XQSettingsKey wlanForceKey( - XQSettingsKey::TargetCentralRepository, - KCRUidWlanDeviceSettingsRegistryId.iUid, - KWlanForceDisable); - -// ======== LOCAL FUNCTIONS ======== - -// ======== MEMBER FUNCTIONS ======== - -/*! - Constructor. -*/ - -WlanStatusInfo::WlanStatusInfo(QObject *parent) : - QObject(parent), - mWlanQtUtils(new WlanQtUtils()), - mSettingsManager(new XQSettingsManager(this)), - mStatusText(""), - mStatus(WlanStatusOff) -{ - OstTraceFunctionEntry0(WLANSTATUSINFO_WLANSTATUSINFO_ENTRY); - - // Listen for WLAN ON/OFF switching - bool connectStatus = connect( - mSettingsManager, - SIGNAL(valueChanged(XQSettingsKey, QVariant)), - this, - SLOT(updateStatus())); - Q_ASSERT(connectStatus); - mSettingsManager->startMonitoring(masterWlanKey); - mSettingsManager->startMonitoring(wlanForceKey); - - // Listen for WLAN connection statuses - connectStatus = connect( - mWlanQtUtils, - SIGNAL(wlanNetworkOpened(int)), - this, - SLOT(updateStatus())); - Q_ASSERT(connectStatus == true); - connectStatus = connect( - mWlanQtUtils, - SIGNAL(wlanNetworkClosed(int, int)), - this, - SLOT(updateStatus())); - Q_ASSERT(connectStatus == true); - - // Set initial status - updateStatus(); - - OstTraceFunctionExit0(WLANSTATUSINFO_WLANSTATUSINFO_EXIT); -} - -/*! - Destructor. -*/ - -WlanStatusInfo::~WlanStatusInfo() -{ - OstTraceFunctionEntry0(DUP1_WLANSTATUSINFO_WLANSTATUSINFO_ENTRY); - - delete mWlanQtUtils; - - OstTraceFunctionExit0(DUP1_WLANSTATUSINFO_WLANSTATUSINFO_EXIT); -} - -/*! - Function for getting current WLAN status value (WlanStatusInfo::WlanStatus*). -*/ - -int WlanStatusInfo::status() const -{ - OstTraceFunctionEntry0(WLANSTATUSINFO_STATUS_ENTRY); - OstTraceFunctionExit0(WLANSTATUSINFO_STATUS_EXIT); - return mStatus; -} - -/*! - Returns the current WLAN status text. -*/ - -QString WlanStatusInfo::statusText() const -{ - OstTraceFunctionEntry0(WLANSTATUSINFO_STATUSTEXT_ENTRY); - OstTraceFunctionExit0(WLANSTATUSINFO_STATUSTEXT_EXIT); - return mStatusText; -} - -/*! - Function for checking if WLAN is ON. - WLAN is enabled if the WLAN OnOff key is true and the force disable - wlan key is false. - - @return Returns true if WLAN is ON. -*/ - -bool WlanStatusInfo::isWlanOn() const -{ - OstTraceFunctionEntry0(WLANSTATUSINFO_ISWLANON_ENTRY); - - bool wlanOn = mSettingsManager->readItemValue(masterWlanKey).toBool(); - bool forcedOff = mSettingsManager->readItemValue(wlanForceKey).toBool(); - - OstTraceExt2( - TRACE_NORMAL, - WLANSTATUSINFO_ISWLANON, - "WlanStatusInfo::isWlanOn;wlanOn=%hhu;forcedOff=%hhu", - wlanOn, - forcedOff); - - OstTraceFunctionExit0(WLANSTATUSINFO_ISWLANON_EXIT); - return wlanOn && !forcedOff; -} - -/*! - Slot used for updating the WLAN status. -*/ - -void WlanStatusInfo::updateStatus() -{ - OstTraceFunctionEntry0(WLANSTATUSINFO_UPDATESTATUS_ENTRY); - - // Backup old status to detect changes - QString oldStatusText = mStatusText; - - // Figure out current WLAN status - if (!isWlanOn()) { - // WLAN is switched OFF. - mStatus = WlanStatusOff; - mStatusText = hbTrId("txt_occ_dblist_wireless_lan_val_off"); - } else if (mWlanQtUtils->connectionStatus() == WlanQtUtils::ConnStatusConnected) { - mStatus = WlanStatusConnected; - mStatusText = mWlanQtUtils->iapName(mWlanQtUtils->activeIap()); - } else { - mStatus = WlanStatusIdle; - mStatusText = hbTrId("txt_occ_dblist_wireless_lan_val_wlan_is_on"); - } - - // Inform about update if the status really changed. - if (oldStatusText != mStatusText) { - emit statusUpdated(); - } - - OstTraceFunctionExit0(WLANSTATUSINFO_UPDATESTATUS_EXIT); -} diff -r 301aeb18ae47 -r b47b808de481 wlanutilities/wlanentryplugin/traces/OstTraceDefinitions.h --- a/wlanutilities/wlanentryplugin/traces/OstTraceDefinitions.h Fri Sep 17 08:35:49 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,21 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* OST trace definition header. -*/ - -#ifndef __OSTTRACEDEFINITIONS_H__ -#define __OSTTRACEDEFINITIONS_H__ -#include -#endif diff -r 301aeb18ae47 -r b47b808de481 wlanutilities/wlanentryplugin/wlanentryplugin.pro --- a/wlanutilities/wlanentryplugin/wlanentryplugin.pro Fri Sep 17 08:35:49 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,72 +0,0 @@ -# -# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -# All rights reserved. -# This component and the accompanying materials are made available -# under the terms of "Eclipse Public License v1.0" -# which accompanies this distribution, and is available -# at the URL "http://www.eclipse.org/legal/epl-v10.html". -# -# Initial Contributors: -# Nokia Corporation - initial contribution. -# -# Contributors: -# -# Description: -# WLAN Entry Plugin Qt project file. -# - -TEMPLATE = lib -TARGET = cpwlanentryplugin -DEPENDPATH += . -INCLUDEPATH += . -INCLUDEPATH += traces -# wlanutilities Private API -INCLUDEPATH += ../inc -CONFIG += hb plugin -LIBS += -lwlanqtutilities -lcpframework -lxqservice -lxqserviceutil -lqtsysteminfo -lxqsettingsmanager - -# Temporary solution to fix tracecompiler -# When tracecompiler is fixed, this can be removed -symbian: { - MMP_RULES += "USERINCLUDE traces" -} - -#Store generated files to their own directory -MOC_DIR = build -RCC_DIR = build - -# Sources -HEADERS += \ - inc/cpwlanentryplugin.h \ - inc/cpwlanentryitemdata.h \ - inc/wlanstatusinfo.h \ - traces/OstTraceDefinitions.h -SOURCES += \ - src/cpwlanentryplugin.cpp \ - src/cpwlanentryitemdata.cpp \ - src/wlanstatusinfo.cpp - -TRANSLATIONS = wlanentryplugin.ts - -symbian: { - TARGET.EPOCALLOWDLLDATA = 1 - TARGET.UID3 = 0x2002BCE0 - SYMBIAN_PLATFORMS = WINSCW ARMV5 - BLD_INF_RULES.prj_exports += "rom/wlanentryplugin.iby CORE_MW_LAYER_IBY_EXPORT_PATH(wlanentryplugin.iby)" - BLD_INF_RULES.prj_exports += "rom/wlanentryplugin_resources.iby LANGUAGE_APP_LAYER_IBY_EXPORT_PATH(wlanentryplugin_resources.iby)" - - # Enable for QtHighway tracing - # DEFINES += WLANENTRYPLUGIN_SERVICETRACES -} -symbian { - deploy.path = C: - qtplugins.path = /resource/qt/plugins/controlpanel - qtplugins.sources += qmakepluginstubs/cpwlanentryplugin.qtplugin - - # This is for new exporting system coming in garden - for(qtplugin, qtplugins.sources):BLD_INF_RULES.prj_exports += "./$$qtplugin $$deploy.path$$qtplugins.path/$$basename(qtplugin)" -} -TARGET.CAPABILITY = CAP_GENERAL_DLL -plugin.sources = cpwlanentryplugin.dll xqservice.dll -plugin.path = /resource/qt/plugins/controlpanel -DEPLOYMENT += plugin diff -r 301aeb18ae47 -r b47b808de481 wlanutilities/wlanindicatorplugin/tsrc/wlanindicatortest/inc/wlanindicatortest.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/wlanutilities/wlanindicatorplugin/tsrc/wlanindicatortest/inc/wlanindicatortest.h Mon Oct 04 02:07:04 2010 +0300 @@ -0,0 +1,42 @@ +/* + * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of "Eclipse Public License v1.0" + * which accompanies this distribution, and is available + * at the URL "http://www.eclipse.org/legal/epl-v10.html". + * + * Initial Contributors: + * Nokia Corporation - initial contribution. + * + * Contributors: + * + * Description: + * + */ + +#ifndef WLANINDICATORTEST_H +#define WLANINDICATORTEST_H + +#include + +class WlanIndicatorTestMainWindow; + + +class WlanIndicatorTest : public HbApplication +{ + Q_OBJECT + +public: + WlanIndicatorTest(int argc, char* argv[]); + virtual ~WlanIndicatorTest(); + +private slots: + void exitApplication(); + +private: + WlanIndicatorTestMainWindow *mMainWindow; +}; + +#endif // WLANINDICATORTEST_H + diff -r 301aeb18ae47 -r b47b808de481 wlanutilities/wlanindicatorplugin/tsrc/wlanindicatortest/inc/wlanindicatortestmainwindow.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/wlanutilities/wlanindicatorplugin/tsrc/wlanindicatortest/inc/wlanindicatortestmainwindow.h Mon Oct 04 02:07:04 2010 +0300 @@ -0,0 +1,48 @@ +/* + * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of "Eclipse Public License v1.0" + * which accompanies this distribution, and is available + * at the URL "http://www.eclipse.org/legal/epl-v10.html". + * + * Initial Contributors: + * Nokia Corporation - initial contribution. + * + * Contributors: + * + * Description: + * + */ + +#ifndef WLANINDICATORMAINWINDOW_H +#define WLANINDICATORMAINWINDOW_H + +#include +#include + +class HbAction; +class WlanIndicatorTestView; +class WlanIndicatorTest; + +class WlanIndicatorTestMainWindow : public HbMainWindow + { + Q_OBJECT + +public: + WlanIndicatorTestMainWindow(WlanIndicatorTest *appRef); + virtual ~WlanIndicatorTestMainWindow(); + +private: + void addTestView(); + +signals: + void exitTriggered(); + +private: + WlanIndicatorTest *mAppRef; + HbAction *mExitAction; + WlanIndicatorTestView *mTestView; + }; + +#endif diff -r 301aeb18ae47 -r b47b808de481 wlanutilities/wlanindicatorplugin/tsrc/wlanindicatortest/inc/wlanindicatortestview.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/wlanutilities/wlanindicatorplugin/tsrc/wlanindicatortest/inc/wlanindicatortestview.h Mon Oct 04 02:07:04 2010 +0300 @@ -0,0 +1,54 @@ +/* + * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of "Eclipse Public License v1.0" + * which accompanies this distribution, and is available + * at the URL "http://www.eclipse.org/legal/epl-v10.html". + * + * Initial Contributors: + * Nokia Corporation - initial contribution. + * + * Contributors: + * + * Description: + * + */ + +#ifndef WLANINDICATORTESTVIEW_H +#define WLANINDICATORTESTVIEW_H + +#include + +class HbPushButton; +class WlanIndicatorTest; + +class WlanIndicatorTestView : public HbView + { + Q_OBJECT + +public: + WlanIndicatorTestView(WlanIndicatorTest *appRef); + virtual ~WlanIndicatorTestView(); + + +signals: + void exitTriggered(); + +private slots: + void handleWlanPushButtonPressed(); + void handleGprsPushButtonPressed(); + +private: + HbPushButton *mTestButton2; + HbPushButton *mTestButton3; + HbPushButton *mTestButton4; + HbPushButton *mTestButton5; + HbPushButton *mTestButton6; + HbPushButton *mTestButton7; + HbPushButton *mTestButton8; + WlanIndicatorTest *mAppRef; + QString mWlanIap; + }; + +#endif diff -r 301aeb18ae47 -r b47b808de481 wlanutilities/wlanindicatorplugin/tsrc/wlanindicatortest/res/wlanindicatortest.qrc --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/wlanutilities/wlanindicatorplugin/tsrc/wlanindicatortest/res/wlanindicatortest.qrc Mon Oct 04 02:07:04 2010 +0300 @@ -0,0 +1,7 @@ + + + + wlanindicatortestview.docml.bin + wlanindicatortestview_portrait.docml.bin + + diff -r 301aeb18ae47 -r b47b808de481 wlanutilities/wlanindicatorplugin/tsrc/wlanindicatortest/res/wlanindicatortestview.docml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/wlanutilities/wlanindicatorplugin/tsrc/wlanindicatortest/res/wlanindicatortestview.docml Mon Oct 04 02:07:04 2010 +0300 @@ -0,0 +1,74 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 301aeb18ae47 -r b47b808de481 wlanutilities/wlanindicatorplugin/tsrc/wlanindicatortest/res/wlanindicatortestview_portrait.docml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/wlanutilities/wlanindicatorplugin/tsrc/wlanindicatortest/res/wlanindicatortestview_portrait.docml Mon Oct 04 02:07:04 2010 +0300 @@ -0,0 +1,74 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 301aeb18ae47 -r b47b808de481 wlanutilities/wlanindicatorplugin/tsrc/wlanindicatortest/src/main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/wlanutilities/wlanindicatorplugin/tsrc/wlanindicatortest/src/main.cpp Mon Oct 04 02:07:04 2010 +0300 @@ -0,0 +1,24 @@ +/* + * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of "Eclipse Public License v1.0" + * which accompanies this distribution, and is available + * at the URL "http://www.eclipse.org/legal/epl-v10.html". + * + * Initial Contributors: + * Nokia Corporation - initial contribution. + * + * Contributors: + * + * Description: + * + */ + +#include "wlanindicatortest.h" + +int main(int argc, char *argv[]) +{ + WlanIndicatorTest app(argc, argv); + return app.exec(); +} diff -r 301aeb18ae47 -r b47b808de481 wlanutilities/wlanindicatorplugin/tsrc/wlanindicatortest/src/wlanindicatortest.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/wlanutilities/wlanindicatorplugin/tsrc/wlanindicatortest/src/wlanindicatortest.cpp Mon Oct 04 02:07:04 2010 +0300 @@ -0,0 +1,48 @@ +/* +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +#include +#include +#include +#include +#include "wlanindicatortest.h" +#include "wlanindicatortestmainwindow.h" + + + +WlanIndicatorTest::WlanIndicatorTest(int argc, char* argv[]) + : HbApplication(argc, argv), + mMainWindow (new WlanIndicatorTestMainWindow(this)) +{ + + connect( + mMainWindow, + SIGNAL(exitTriggered()), + this, + SLOT(exitApplication())); +} + + +void WlanIndicatorTest::exitApplication() +{ +exit(); +} + +WlanIndicatorTest::~WlanIndicatorTest() +{ + +} diff -r 301aeb18ae47 -r b47b808de481 wlanutilities/wlanindicatorplugin/tsrc/wlanindicatortest/src/wlanindicatortestmainwindow.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/wlanutilities/wlanindicatorplugin/tsrc/wlanindicatortest/src/wlanindicatortestmainwindow.cpp Mon Oct 04 02:07:04 2010 +0300 @@ -0,0 +1,63 @@ +/* + * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of "Eclipse Public License v1.0" + * which accompanies this distribution, and is available + * at the URL "http://www.eclipse.org/legal/epl-v10.html". + * + * Initial Contributors: + * Nokia Corporation - initial contribution. + * + * Contributors: + * + * Description: + * + */ + +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include "wlanindicatortest.h" +#include "wlanindicatortestview.h" +#include "wlanindicatortestmainwindow.h" + + +WlanIndicatorTestMainWindow::WlanIndicatorTestMainWindow(WlanIndicatorTest *appRef) : + mAppRef(appRef), + mExitAction(0) +{ + addTestView(); + + mExitAction = softKeyAction(Hb::SecondarySoftKey); + + show(); +} + +WlanIndicatorTestMainWindow::~WlanIndicatorTestMainWindow() +{ +} + +void WlanIndicatorTestMainWindow::addTestView() +{ + mTestView = new WlanIndicatorTestView(mAppRef); + addView(mTestView); + + bool connectStatus = connect( + mTestView, + SIGNAL(exitTriggered()), + this, + SIGNAL(exitTriggered())); + Q_ASSERT(connectStatus == true); + +} + diff -r 301aeb18ae47 -r b47b808de481 wlanutilities/wlanindicatorplugin/tsrc/wlanindicatortest/src/wlanindicatortestview.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/wlanutilities/wlanindicatorplugin/tsrc/wlanindicatortest/src/wlanindicatortestview.cpp Mon Oct 04 02:07:04 2010 +0300 @@ -0,0 +1,215 @@ +/* + * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of "Eclipse Public License v1.0" + * which accompanies this distribution, and is available + * at the URL "http://www.eclipse.org/legal/epl-v10.html". + * + * Initial Contributors: + * Nokia Corporation - initial contribution. + * + * Contributors: + * + * Description: + * + */ + +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include "wlanindicatortest.h" +#include "wlanindicatortestview.h" + +WlanIndicatorTestView::WlanIndicatorTestView(WlanIndicatorTest *appRef) : + mAppRef(appRef) +{ + bool ok = false; + mWlanIap = "Access Point"; + HbDocumentLoader loader; + if (HbInstance::instance()->allMainWindows().value(0)->orientation() == Qt::Horizontal) { + loader.load(":/docml/wlanindicatortestview.docml", &ok); + } + else { + loader.load(":/docml/wlanindicatortestview_portrait.docml", &ok); + } + Q_ASSERT_X(ok, "Wlan Indicator Test", "Invalid docml file"); + + // Load the view by name from the xml file + QGraphicsWidget *widget = loader.findWidget("view"); + Q_ASSERT_X(widget != 0, "Wlan Indicator Test", "View not found"); + + setWidget(widget); + + HbMenu *viewMenu = qobject_cast(loader.findWidget("viewMenu")); + Q_ASSERT_X(viewMenu != 0, "Wlan Indicator Test", "Menu not found"); + setMenu(viewMenu); + + mTestButton2 = qobject_cast(loader.findWidget("pushButton_2")); + Q_ASSERT_X(mTestButton2 != 0, "Wlan Indicator Test", "Button2 not found"); + + mTestButton3 = qobject_cast(loader.findWidget("pushButton_3")); + Q_ASSERT_X(mTestButton3 != 0, "Wlan Indicator Test", "Button3 not found"); + + mTestButton4 = qobject_cast(loader.findWidget("pushButton_4")); + Q_ASSERT_X(mTestButton4 != 0, "Wlan Indicator Test", "Button4 not found"); + + mTestButton5 = qobject_cast(loader.findWidget("pushButton_5")); + Q_ASSERT_X(mTestButton5 != 0, "Wlan Indicator Test", "Button5 not found"); + + mTestButton6 = qobject_cast(loader.findWidget("pushButton_6")); + Q_ASSERT_X(mTestButton6 != 0, "Wlan Indicator Test", "Button6 not found"); + + mTestButton7 = qobject_cast(loader.findWidget("pushButton_7")); + Q_ASSERT_X(mTestButton7 != 0, "Wlan Indicator Test", "Button7 not found"); + + mTestButton8 = qobject_cast(loader.findWidget("pushButton_8")); + Q_ASSERT_X(mTestButton8 != 0, "Wlan Indicator Test", "Button8 not found"); + + HbAction *exitAction = qobject_cast(loader.findObject("exitAction")); + Q_ASSERT_X(exitAction != 0, "Wlan Indicator Test", "Exit action not found"); + + + bool connectStatus = connect( + mTestButton2, + SIGNAL(clicked()), + this, + SLOT(handleWlanPushButtonPressed())); + Q_ASSERT(connectStatus == true); + connectStatus = connect( + mTestButton3, + SIGNAL(clicked()), + this, + SLOT(handleWlanPushButtonPressed())); + Q_ASSERT(connectStatus == true); + connectStatus = connect( + mTestButton4, + SIGNAL(clicked()), + this, + SLOT(handleWlanPushButtonPressed())); + Q_ASSERT(connectStatus == true); + connectStatus = connect( + mTestButton5, + SIGNAL(clicked()), + this, + SLOT(handleWlanPushButtonPressed())); + Q_ASSERT(connectStatus == true); + connectStatus = connect( + mTestButton6, + SIGNAL(clicked()), + this, + SLOT(handleGprsPushButtonPressed())); + Q_ASSERT(connectStatus == true); + connectStatus = connect( + mTestButton7, + SIGNAL(clicked()), + this, + SLOT(handleGprsPushButtonPressed())); + Q_ASSERT(connectStatus == true); + connectStatus = connect( + mTestButton8, + SIGNAL(clicked()), + this, + SLOT(handleWlanPushButtonPressed())); + Q_ASSERT(connectStatus == true); + connectStatus = connect( + exitAction, + SIGNAL(triggered(bool)), + this, + SIGNAL(exitTriggered())); + Q_ASSERT(connectStatus == true); + + + // Set correct orientation when drawing view first time. Orientation change + // on the fly is not yet implemented + if (HbInstance::instance()->allMainWindows().value(0)->orientation() == Qt::Horizontal) { + bool loaded = false; + loader.load( ":/docml/wlanindicatortestview.docml", "landscape", &loaded ); + } + else { + bool loaded = false; + loader.load( ":/docml/wlanindicatortestview_portrait.docml", "portrait", &loaded ); + } +} + +WlanIndicatorTestView::~WlanIndicatorTestView() +{ +} + + + +void WlanIndicatorTestView::handleWlanPushButtonPressed() +{ + HbPushButton *item = (HbPushButton *)sender(); + + QList list; + QString test = item->text(); + + if (test == "No Wlan Networks") { + list.insert(0,0); + + } else if (test == "Wlan Connected") { + list.insert(0,1); + list.insert(1,"lahna"); + // list.insert(2,"lahna"); +/* + } else if (test == "Unknown Wlan Found") { + list.insert(0,4); + list.insert(1,12); + } else if (test == "WLAN connected") { + list.insert(0,5); + list.insert(1,0); //no. of networks not used but must be there + QString label("Connected to"); + bool ok = false; + mWlanIap = HbInputDialog::getText(label, mWlanIap, &ok, scene(), this); + list.insert(2,mWlanIap); +*/ + } + + HbIndicator indicator; + if (test == "WLAN disconnected") { + indicator.deactivate("com.nokia.hb.indicator.connectivity.wlanindicatorplugin/1.0"); + } + else { + indicator.activate("com.nokia.hb.indicator.connectivity.wlanindicatorplugin/1.0", list); + } + + int error = indicator.error(); + +} + +void WlanIndicatorTestView::handleGprsPushButtonPressed() +{ + HbPushButton *item = (HbPushButton *)sender(); + + QList list; + QString test = item->text(); + + HbIndicator indicator; + + if (test == "GPRS connected") { + + list.insert(0,"Sonera"); //dummy IAP name + list.insert(1,"12345678"); //dummy connection id + + indicator.activate("com.nokia.hb.indicator.connectivity.cellularindicatorplugin/1.0", list); + + } else if (test == "GPRS disconnected") { + + indicator.deactivate("com.nokia.hb.indicator.connectivity.cellularindicatorplugin/1.0"); + + } + + int error = indicator.error(); + +} + diff -r 301aeb18ae47 -r b47b808de481 wlanutilities/wlanindicatorplugin/tsrc/wlanindicatortest/wlanindicatortest.pro --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/wlanutilities/wlanindicatorplugin/tsrc/wlanindicatortest/wlanindicatortest.pro Mon Oct 04 02:07:04 2010 +0300 @@ -0,0 +1,53 @@ +# +# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +# All rights reserved. +# This component and the accompanying materials are made available +# under the terms of "Eclipse Public License v1.0" +# which accompanies this distribution, and is available +# at the URL "http://www.eclipse.org/legal/epl-v10.html". +# +# Initial Contributors: +# Nokia Corporation - initial contribution. +# +# Contributors: +# +# Description: +# + +TEMPLATE = app +TARGET = wlanindicatortest +TARGET.CAPABILITY = ALL -TCB + +DEPENDPATH += . + +INCLUDEPATH += ./inc + +CONFIG += hb +QT += core \ + gui + +INCLUDEPATH += ../inc + +HEADERS += inc/wlanindicatortestmainwindow.h\ + inc/wlanindicatortestview.h\ + inc/wlanindicatortest.h + +SOURCES += src/main.cpp\ + src/wlanindicatortest.cpp\ + src/wlanindicatortestview.cpp\ + src/wlanindicatortestmainwindow.cpp + +RESOURCES += res/wlanindicatortest.qrc + +DOCML += \ + res/wlanindicatortestview.docml \ + res/wlanindicatortestview_portrait.docml + +symbian*: { + TARGET.UID3 = 0xE4E6D7C8 + SYMBIAN_PLATFORMS = WINSCW ARMV5 + addFiles.path = /sys/bin + DEPLOYMENT += addFiles +} + +symbian*::LIBS += -HbCore -HbWidgets diff -r 301aeb18ae47 -r b47b808de481 wlanutilities/wlanindicatorplugin/tsrc/wlanindicatorut/wlanindicatorut.pro --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/wlanutilities/wlanindicatorplugin/tsrc/wlanindicatorut/wlanindicatorut.pro Mon Oct 04 02:07:04 2010 +0300 @@ -0,0 +1,35 @@ +# +# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +# All rights reserved. +# This component and the accompanying materials are made available +# under the terms of "Eclipse Public License v1.0" +# which accompanies this distribution, and is available +# at the URL "http://www.eclipse.org/legal/epl-v10.html". +# +# Initial Contributors: +# Nokia Corporation - initial contribution. +# +# Contributors: +# +# Description: +# + +TEMPLATE = app + +CONFIG += qtestlib console hb + +HEADERS += wlanindicatorutcases.h \ + ../../inc/wlanindicatorplugin.h \ + ../../traces/OstTraceDefinitions.h + +SOURCES += wlanindicatorutcases.cpp wlanindicatorutmain.cpp \ + ../../src/wlanindicatorplugin.cpp + + +symbian: { + TARGET.CAPABILITY = ALL -TCB + TARGET.EPOCALLOWDLLDATA = 1 + LIBS += -wlanindicatorplugin -HbCore -HbWidgets + # Enable UT for plugin + DEFINES += WLANINDICATOR_UT +} diff -r 301aeb18ae47 -r b47b808de481 wlanutilities/wlanindicatorplugin/tsrc/wlanindicatorut/wlanindicatorutcases.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/wlanutilities/wlanindicatorplugin/tsrc/wlanindicatorut/wlanindicatorutcases.cpp Mon Oct 04 02:07:04 2010 +0300 @@ -0,0 +1,298 @@ +/* + * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of "Eclipse Public License v1.0" + * which accompanies this distribution, and is available + * at the URL "http://www.eclipse.org/legal/epl-v10.html". + * + * Initial Contributors: + * Nokia Corporation - initial contribution. + * + * Contributors: + * + * Description: + * + */ + +#include +#include +#include +#include "wlanindicatorutcases.h" + +//static const char IndicatorType[] = +// {"com.nokia.hb.indicator.connectivity.wlanindicatorplugin/1.0"}; + +QString WLAN_not_connected(hbTrId("txt_occ_dblist_wireless_lan_val_not_connected")); +QString WLAN_connected(hbTrId("txt_occ_dblist_wireless_lan_val_1_connected")); +QString WLAN_menu(hbTrId("txt_occ_dblist_indi_menu_wireless_lan")); +QString Empty(""); +QString Icon(""); + +enum WlanStates{ + wlanIsNotConnected = 0, + wlanIsConnected = 1 +}; + +enum WlanIndicatorParameters{ + wlanState = 0, + wlanIapName = 1, +}; + +WlanIndicatorUtCases::WlanIndicatorUtCases() +{ +} + +WlanIndicatorUtCases::~WlanIndicatorUtCases() +{ +} + +void WlanIndicatorUtCases::initTestCase() +{ +} + +// Start of test cases +void WlanIndicatorUtCases::wlanNotConnected() +{ + qDebug("WLAN Not Connected"); + bool result(true); + QList params; + + params.insert(wlanState, wlanIsNotConnected ); + + result &= activateIndicator( &mWlanIndicatorPlugin ); + result &= clientParameterHandler( &mWlanIndicatorPlugin, + HbIndicatorInterface::RequestActivate, + params, true ); + result &= indicatorDataFeeder( &mWlanIndicatorPlugin, + HbIndicatorInterface::SecondaryTextRole, + WLAN_not_connected ); + QVERIFY(result == true); +} + +void WlanIndicatorUtCases::wlanConnected() +{ + qDebug("WLAN Connected"); + bool result(true); + QList params; + + params.insert(wlanState, wlanIsConnected); + params.insert(wlanIapName,"lahna"); + + result &= activateIndicator(&mWlanIndicatorPlugin); + result &= clientParameterHandler(&mWlanIndicatorPlugin, + HbIndicatorInterface::RequestActivate, + params, true ); + result &= indicatorDataFeeder( &mWlanIndicatorPlugin, + HbIndicatorInterface::SecondaryTextRole, + WLAN_connected); + result &= indicatorIconFeeder( &mWlanIndicatorPlugin, + HbIndicatorInterface::IconNameRole ); + QVERIFY(result == true); +} + +void WlanIndicatorUtCases::differentIndicatorData() +{ + qDebug("Different indicator data handling"); + bool result(true); + + result &= indicatorDataFeeder( &mWlanIndicatorPlugin, + HbIndicatorInterface::PrimaryTextRole, WLAN_menu); + + result &= indicatorDataFeeder( &mWlanIndicatorPlugin, + 255, Empty); + result &= indicatorIconFeeder( &mWlanIndicatorPlugin, + HbIndicatorInterface::IconNameRole ); + result &= indicatorIconFeeder( &mWlanIndicatorPlugin, + HbIndicatorInterface::DecorationNameRole ); + QVERIFY(result == true); +} + +void WlanIndicatorUtCases::errorHandling() +{ + qDebug("WLAN Indicator error handling"); + bool result(true); + + result &= error( &mWlanIndicatorPlugin, 0 ); + + QVERIFY(result == true); +} + +void WlanIndicatorUtCases::clientParamatersHandler() +{ + qDebug("Parameter handling"); + QList params; + bool result(true); + + // Step 1: Deliver parameters for mParameter + params.insert(wlanIapName, "lahna"); + result &= clientParameterHandler( &mWlanIndicatorPlugin, + HbIndicatorInterface::RequestActivate, + params, + true ); + // Step 2: Clear parameters for mParameter + result &= clientParameterHandler( &mWlanIndicatorPlugin, + HbIndicatorInterface::RequestDeactivate, + params, + false ); + // Step 3: Try to feed data with SecondaryTextRole. Data is not valid not because + // mParameter has been cleared in Step 2 + result &= indicatorDataFeeder( &mWlanIndicatorPlugin, + HbIndicatorInterface::SecondaryTextRole, + Empty ); + QVERIFY(result == true); +} + +void WlanIndicatorUtCases::handleInteractions() +{ + qDebug("Interaction handling"); + bool result(true); + + result &= handleInteraction( &mWlanIndicatorPlugin, + HbIndicatorInterface::NoInteraction, + false ); + result &= handleInteraction( &mWlanIndicatorPlugin, + HbIndicatorInterface::InteractionActivated, + true ); + + QVERIFY(result == true); +} + +void WlanIndicatorUtCases::processErrorHandling() +{ + qDebug("WLAN Indicator error handling"); + bool result(true); + + result &= processError( &mWlanIndicatorPlugin, QProcess::FailedToStart ); + result &= processError( &mWlanIndicatorPlugin, QProcess::Crashed ); + result &= processError( &mWlanIndicatorPlugin, QProcess::Timedout ); + result &= processError( &mWlanIndicatorPlugin, QProcess::ReadError ); + result &= processError( &mWlanIndicatorPlugin, QProcess::WriteError ); + result &= processError( &mWlanIndicatorPlugin, QProcess::UnknownError ); + + QVERIFY(result == true); +} +// End of test cases + +// Sub-test cases +bool WlanIndicatorUtCases::activateIndicator( WlanIndicatorPlugin* plugin ) +{ + QStringList indTypes("com.nokia.hb.indicator.connectivity.wlanindicatorplugin/1.0"); + QStringList resIndTypes(""); + QString indTypeString(""); + bool result(true); + HbIndicatorInterface* resPtr(NULL); + HbSecurityInfo* securityInfo = NULL; + bool resAllowed(false); + + resIndTypes = plugin->indicatorTypes(); + + if (resIndTypes != indTypes) { + qDebug("Indicator activation error: Erroneous IndicationType"); + result = false; + } + + resAllowed = plugin->accessAllowed( indTypeString, securityInfo ); + + if (resAllowed == false) { + qDebug("Indicator activation error: Erroneous allowance"); + result = false; + } + + resPtr = plugin->createIndicator(indTypeString); + + if (resPtr == NULL) { + qDebug("Indicator activation error: Indicator creation failed"); + result = false; + } + return result; +} + +bool WlanIndicatorUtCases::clientParameterHandler( WlanIndicatorPlugin* plugin, + HbIndicatorInterface::RequestType ReqType, + QVariant parameter, + bool expectedResult ) +{ + bool resHandled(false); + bool result(true); + + resHandled = plugin->handleClientRequest( ReqType, parameter ); + + if (resHandled != expectedResult) { + qDebug("Indicator error: Error in client request handling"); + result = false; + } + return result; +} + +bool WlanIndicatorUtCases::indicatorDataFeeder( WlanIndicatorPlugin* plugin, + int role, + QString expectedString ) +{ + QString resString; + bool result(true); + + resString = plugin->indicatorData(role).toString(); + int x = QString::compare(resString, expectedString, Qt::CaseInsensitive); + + if (x != 0) { + qDebug("Indicator error: Error in indicatorData"); + result = false; + } + return result; +} + +bool WlanIndicatorUtCases::indicatorIconFeeder( WlanIndicatorPlugin* plugin, + int role ) +{ + QVariant resIcon; + bool result(true); + + resIcon = plugin->indicatorData(role); + int x = 0; + + if (x != 0) { + qDebug("Indicator error: Error in indicatorData"); + result = false; + } + return result; +} + +bool WlanIndicatorUtCases::error( WlanIndicatorPlugin* plugin, + int expectedError ) +{ + int error; + bool result(true); + + error = plugin->error(); + + if (error != expectedError) { + qDebug("Indicator error: Error in error value"); + result = false; + } + return result; +} + +bool WlanIndicatorUtCases::handleInteraction( WlanIndicatorPlugin* plugin, + HbIndicatorInterface::InteractionType type, + bool handleValue ) +{ + bool resHandle(false); + bool result(true); + + resHandle = plugin->handleInteraction( type ); + + if (resHandle != handleValue) { + qDebug("Indicator error: Error in interaction handling"); + result = false; + } + return result; +} + +bool WlanIndicatorUtCases::processError( WlanIndicatorPlugin* plugin, + QProcess::ProcessError err ) +{ + bool result(true); + plugin->processError( err ); + return result; +} diff -r 301aeb18ae47 -r b47b808de481 wlanutilities/wlanindicatorplugin/tsrc/wlanindicatorut/wlanindicatorutcases.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/wlanutilities/wlanindicatorplugin/tsrc/wlanindicatorut/wlanindicatorutcases.h Mon Oct 04 02:07:04 2010 +0300 @@ -0,0 +1,71 @@ +/* + * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of "Eclipse Public License v1.0" + * which accompanies this distribution, and is available + * at the URL "http://www.eclipse.org/legal/epl-v10.html". + * + * Initial Contributors: + * Nokia Corporation - initial contribution. + * + * Contributors: + * + * Description: + * + */ + +#ifndef WLANINDICATORUTCASES_H +#define WLANINDICATORUTCASES_H + +#include +#include "wlanindicatorplugin.h" + + +class WlanIndicatorUtCases: public QObject +{ + Q_OBJECT + + public: + + WlanIndicatorUtCases(); + ~WlanIndicatorUtCases(); + + private slots: + + // Test cases + void initTestCase(); + void wlanNotConnected(); + void wlanConnected(); + void errorHandling(); + void differentIndicatorData(); + void handleInteractions(); + void clientParamatersHandler(); + void processErrorHandling(); + + private: + + // Sub-test cases + bool activateIndicator( WlanIndicatorPlugin* plugin ); + bool clientParameterHandler( WlanIndicatorPlugin* plugin, + HbIndicatorInterface::RequestType ReqType, + QVariant parameter, + bool expectedResult ); + + bool indicatorDataFeeder( WlanIndicatorPlugin* plugin, + int role, + QString expectedString ); + bool indicatorIconFeeder( WlanIndicatorPlugin* plugin, + int role ); + bool error( WlanIndicatorPlugin* plugin, int expectedError ); + + bool handleInteraction( WlanIndicatorPlugin* plugin, + HbIndicatorInterface::InteractionType type, + bool handleValue ); + + bool processError( WlanIndicatorPlugin* plugin, QProcess::ProcessError err ); + + WlanIndicatorPlugin mWlanIndicatorPlugin; +}; + +#endif // WLANINDICATORUTCASES_H diff -r 301aeb18ae47 -r b47b808de481 wlanutilities/wlanindicatorplugin/tsrc/wlanindicatorut/wlanindicatorutmain.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/wlanutilities/wlanindicatorplugin/tsrc/wlanindicatorut/wlanindicatorutmain.cpp Mon Oct 04 02:07:04 2010 +0300 @@ -0,0 +1,36 @@ +/* + * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of "Eclipse Public License v1.0" + * which accompanies this distribution, and is available + * at the URL "http://www.eclipse.org/legal/epl-v10.html". + * + * Initial Contributors: + * Nokia Corporation - initial contribution. + * + * Contributors: + * + * Description: + * + */ + +#include + +#include +#include "wlanindicatorplugin.h" +#include "wlanindicatorutcases.h" + +int main(int argc, char *argv[]) +{ + QApplication app(argc, argv); + + WlanIndicatorUtCases tc; + int ret = QTest::qExec(&tc, argc, argv); + + qDebug("Press any key...\n"); + + getchar(); + + return ret; +} diff -r 301aeb18ae47 -r b47b808de481 wlanutilities/wlanlogin/ictswlanlogininterface/src/ictswlanlogininterface.cpp --- a/wlanutilities/wlanlogin/ictswlanlogininterface/src/ictswlanlogininterface.cpp Fri Sep 17 08:35:49 2010 +0300 +++ b/wlanutilities/wlanlogin/ictswlanlogininterface/src/ictswlanlogininterface.cpp Mon Oct 04 02:07:04 2010 +0300 @@ -19,6 +19,7 @@ #include #include +#include // User includes @@ -42,6 +43,10 @@ // External function prototypes // Local constants + /*! + Service application name +*/ +static const QString wlanLoginServiceAppName = QString("wlanlogin"); // ======== LOCAL FUNCTIONS ======== @@ -122,9 +127,9 @@ // Execution of asynchronous and embedded Wlan Login start mAsyncRequest = mAiwMgr->create( - "wlanlogin", - "com.nokia.symbian.IWlanLogin", - "start(int,int,QUrl)", + wlanLoginServiceAppName, + XQI_WLAN_LOGIN, + XQOP1_WLAN_LOGIN, false); // The Wlan Login service must always exist @@ -256,9 +261,9 @@ // Execution of synchronous and embedded Wlan Login stop QScopedPointer syncRequest(mAiwMgr->create( - "wlanlogin", - "com.nokia.symbian.IWlanLogin", - "stop()", + wlanLoginServiceAppName, + XQI_WLAN_LOGIN, + XQOP2_WLAN_LOGIN, false)); // The Wlan Login service must always exist diff -r 301aeb18ae47 -r b47b808de481 wlanutilities/wlanlogin/ictswlanlogininterface/traces/OstTraceDefinitions.h --- a/wlanutilities/wlanlogin/ictswlanlogininterface/traces/OstTraceDefinitions.h Fri Sep 17 08:35:49 2010 +0300 +++ b/wlanutilities/wlanlogin/ictswlanlogininterface/traces/OstTraceDefinitions.h Mon Oct 04 02:07:04 2010 +0300 @@ -1,3 +1,20 @@ +/* +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* OST trace definition header. +*/ + #ifndef __OSTTRACEDEFINITIONS_H__ #define __OSTTRACEDEFINITIONS_H__ #include diff -r 301aeb18ae47 -r b47b808de481 wlanutilities/wlanlogin/wlanloginapp/inc/wlanloginengine.h --- a/wlanutilities/wlanlogin/wlanloginapp/inc/wlanloginengine.h Fri Sep 17 08:35:49 2010 +0300 +++ b/wlanutilities/wlanlogin/wlanloginapp/inc/wlanloginengine.h Mon Oct 04 02:07:04 2010 +0300 @@ -85,6 +85,7 @@ WlanLoginNetworkAccessManager* networkAccessManager() const; EngineState engineState(); void setEngineState(EngineState newState); + bool bringSnifferToForeground(); signals: void completeServiceRequest(int status); diff -r 301aeb18ae47 -r b47b808de481 wlanutilities/wlanlogin/wlanloginapp/src/wlanloginapplication.cpp --- a/wlanutilities/wlanlogin/wlanloginapp/src/wlanloginapplication.cpp Fri Sep 17 08:35:49 2010 +0300 +++ b/wlanutilities/wlanlogin/wlanloginapp/src/wlanloginapplication.cpp Mon Oct 04 02:07:04 2010 +0300 @@ -56,7 +56,7 @@ @param [in] argv Parameters. */ WlanLoginApplication::WlanLoginApplication(int argc, char* argv[]) : - HbApplication( argc, argv ), + HbApplication(argc, argv, Hb::NoSplash), mService(new WlanLoginService(this)), mTranslator(new HbTranslator()), mEngine(new WlanLoginEngine(this)), diff -r 301aeb18ae47 -r b47b808de481 wlanutilities/wlanlogin/wlanloginapp/src/wlanloginengine.cpp --- a/wlanutilities/wlanlogin/wlanloginapp/src/wlanloginengine.cpp Fri Sep 17 08:35:49 2010 +0300 +++ b/wlanutilities/wlanlogin/wlanloginapp/src/wlanloginengine.cpp Mon Oct 04 02:07:04 2010 +0300 @@ -25,6 +25,7 @@ #include #include #include +#include //User includes #include "wlanloginengine.h" @@ -144,6 +145,44 @@ OstTraceFunctionExit0(WLANLOGINENGINE_SETENGINESTATE_EXIT); } +/*! + Function that brings WLAN Sniffer to foreground + + @param [in] newState New state of the engine to be set + */ +bool WlanLoginEngine::bringSnifferToForeground() +{ + OstTraceFunctionEntry0(WLANLOGINENGINE_BRINGSNIFFERTOFOREGROUND_ENTRY); + + bool retVal = false; + RWsSession wsSession; + + if(KErrNone != wsSession.Connect()){ + OstTrace0(TRACE_NORMAL, + WLANLOGINENGINE_BRINGSNIFFERTOFOREGROUND_WS_SESSION_FAILED, + "WARNING: Session could not be opened to Window server"); + + } else { + TApaTaskList taskList(wsSession); + //Find WLAN Sniffer's task by using it's UID as reference + TApaTask task = taskList.FindApp(TUid::Uid(0x10281CAA)); + + if(task.Exists()) + { + task.BringToForeground(); + retVal = true; + } else { + OstTrace0(TRACE_NORMAL, + WLANLOGINENGINE_BRINGSNIFFERTOFOREGROUND_TASK_NOT_FOUND, + "WARNING: WLAN Sniffer was not found from the task list"); + } + wsSession.Close(); + } + OstTraceFunctionExit0(WLANLOGINENGINE_BRINGSNIFFERTOFOREGROUND_EXIT); + + return retVal; +} + /*! This slot handles startLogin signal from Qt Highway service provider @@ -465,8 +504,13 @@ OstTraceFunctionEntry0(WLANLOGINENGINE_HANDLECANCELTRIGGERED_ENTRY); //Check if Qt Highway request is completed - if (mStartRequestCompleted == false){ + if (mStartRequestCompleted == false) { + if (!bringSnifferToForeground()) { + //WLAN Sniffer was not found so make exit as there is nobody to close us + qApp->exit(); + } + switch (engineState()) { case UpdatingNetworkConfigurations: @@ -512,17 +556,21 @@ { OstTraceFunctionEntry0(WLANLOGINENGINE_HANDLENEXTTRIGGERED_ENTRY); - if (mStartRequestCompleted == false ) { - emitCompleteServiceRequest(WlanLoginService::WlanLoginStatusNext); + if (mStartRequestCompleted == false ) { + if (bringSnifferToForeground()) { + emitCompleteServiceRequest(WlanLoginService::WlanLoginStatusNext); + } else { + qApp->exit(); + } + } else { + //put application to background: + WlanLoginApplication* app = static_cast(this->parent()); + app->mainWindow()->lower(); } - - //put application to background: - WlanLoginApplication* app = static_cast(this->parent()); - app->mainWindow()->lower(); - OstTraceFunctionExit0(WLANLOGINENGINE_HANDLENEXTTRIGGERED_EXIT); } + /*! This function shows connection dropped message box to the user diff -r 301aeb18ae47 -r b47b808de481 wlanutilities/wlanlogin/wlanloginapp/src/wlanloginservice.cpp --- a/wlanutilities/wlanlogin/wlanloginapp/src/wlanloginservice.cpp Fri Sep 17 08:35:49 2010 +0300 +++ b/wlanutilities/wlanlogin/wlanloginapp/src/wlanloginservice.cpp Mon Oct 04 02:07:04 2010 +0300 @@ -17,6 +17,7 @@ // System includes #include +#include // User includes #include "wlanloginservice.h" @@ -34,13 +35,21 @@ Wlan login application. */ +// External function prototypes + +// Local constants + /*! + Full service name i.e "wlanlogin.com.nokia.symbian.IWlanLogin" +*/ +static const QString wlanLoginFullServiceName = QString("wlanlogin") + QString(".") + QString(XQI_WLAN_LOGIN); + /*! Constructor. @param[in] parent Object parent. */ WlanLoginService::WlanLoginService(QObject* parent) - : XQServiceProvider(QLatin1String("wlanlogin.com.nokia.symbian.IWlanLogin"), parent), + : XQServiceProvider(wlanLoginFullServiceName, parent), mReturnValue(WlanLoginStatusNone) { OstTraceFunctionEntry0(WLANLOGINSERVICE_WLANLOGINSERVICE_ENTRY); diff -r 301aeb18ae47 -r b47b808de481 wlanutilities/wlanlogin/wlanloginapp/wlanloginapp.pro --- a/wlanutilities/wlanlogin/wlanloginapp/wlanloginapp.pro Fri Sep 17 08:35:49 2010 +0300 +++ b/wlanutilities/wlanlogin/wlanloginapp/wlanloginapp.pro Mon Oct 04 02:07:04 2010 +0300 @@ -75,8 +75,8 @@ MMP_RULES += "USERINCLUDE traces" symbian*: { - LIBS += -lictsclientinterface - TARGET.UID3 = 0x2002E6D0 + LIBS += -lictsclientinterface -lapgrfx -lws32 + TARGET.UID3 = 0x2002E6D0 TARGET.CAPABILITY = CAP_APPLICATION NetworkControl BLD_INF_RULES.prj_exports += "rom/wlanlogin.iby CORE_MW_LAYER_IBY_EXPORT_PATH(wlanlogin.iby)" BLD_INF_RULES.prj_exports += "rom/wlanlogin_resources.iby LANGUAGE_APP_LAYER_IBY_EXPORT_PATH(wlanlogin_resources.iby)" diff -r 301aeb18ae47 -r b47b808de481 wlanutilities/wlansniffer/wlansnifferapplication/src/wlansniffer.cpp --- a/wlanutilities/wlansniffer/wlansnifferapplication/src/wlansniffer.cpp Fri Sep 17 08:35:49 2010 +0300 +++ b/wlanutilities/wlansniffer/wlansnifferapplication/src/wlansniffer.cpp Mon Oct 04 02:07:04 2010 +0300 @@ -57,7 +57,7 @@ */ WlanSniffer::WlanSniffer(int argc, char* argv[]) : - HbApplication(argc, argv), + HbApplication(argc, argv, Hb::NoSplash), mEngine(new WlanSnifferEngine(this)), mTranslator(), mMainWindow(0) diff -r 301aeb18ae47 -r b47b808de481 wlanutilities/wlansniffer/wlansnifferapplication/src/wlansnifferlistview.cpp --- a/wlanutilities/wlansniffer/wlansnifferapplication/src/wlansnifferlistview.cpp Fri Sep 17 08:35:49 2010 +0300 +++ b/wlanutilities/wlansniffer/wlansnifferapplication/src/wlansnifferlistview.cpp Mon Oct 04 02:07:04 2010 +0300 @@ -233,10 +233,6 @@ } Q_ASSERT(ok); - // Load the view by name from the xml file - QGraphicsWidget *widget = mDocLoader->findWidget(WlanSnifferListViewName); - Q_ASSERT(widget); - // Set view menu HbMenu *viewMenu = qobject_cast(mDocLoader->findWidget("viewMenu")); Q_ASSERT(viewMenu); @@ -630,7 +626,6 @@ // Show the dialog and wait for user input. mWlanEnableDialog = QSharedPointer( new HbMessageBox(HbMessageBox::MessageTypeQuestion)); - mWlanEnableDialog->setTimeout(HbPopup::StandardTimeout); mWlanEnableDialog->setText(hbTrId("txt_occ_info_activate_wlan_in_airplane_mode")); mWlanEnableDialog->setStandardButtons(HbMessageBox::Yes | HbMessageBox::No); // Open the dialog and connect the result to the handleWlanEnableDialogClosed slot diff -r 301aeb18ae47 -r b47b808de481 wlanutilities/wlansniffer/wlansnifferapplication/src/wlansniffermainwindow.cpp --- a/wlanutilities/wlansniffer/wlansnifferapplication/src/wlansniffermainwindow.cpp Fri Sep 17 08:35:49 2010 +0300 +++ b/wlanutilities/wlansniffer/wlansnifferapplication/src/wlansniffermainwindow.cpp Mon Oct 04 02:07:04 2010 +0300 @@ -136,42 +136,43 @@ { OstTraceFunctionEntry0(WLANSNIFFERMAINWINDOW_STARTWLANWIZARD_ENTRY); - Q_ASSERT(mWizard == NULL); - - // Stop WLAN scanning for the duration of WLAN Wizard - mEngine->stopWlanScanning(); - - mWizard = QSharedPointer(new WlanWizard(this)); - bool connectStatus = connect( - mWizard.data(), - SIGNAL(finished(int,bool)), - this, - SLOT(handleWlanWizardComplete(int,bool)), - Qt::QueuedConnection); - Q_ASSERT(connectStatus == true); + if (mWizard == NULL) { + // Stop WLAN scanning for the duration of WLAN Wizard + mEngine->stopWlanScanning(); + + mWizard = QSharedPointer(new WlanWizard(this)); + bool connectStatus = connect( + mWizard.data(), + SIGNAL(finished(int,bool)), + this, + SLOT(handleWlanWizardComplete(int,bool)), + Qt::QueuedConnection); + Q_ASSERT(connectStatus == true); + + connectStatus = connect( + mWizard.data(), + SIGNAL(cancelled()), + this, + SLOT(handleWlanWizardCancelled()), + Qt::QueuedConnection); + Q_ASSERT(connectStatus == true); + + // Create an IAP for a specific AP + if (ap) { + mWizard->setParameters( + ap->value(WlanQtUtilsAp::ConfIdName).toString(), + ap->value(WlanQtUtilsAp::ConfIdSsid).toByteArray(), + ap->value(WlanQtUtilsAp::ConfIdConnectionMode).toInt(), + ap->value(WlanQtUtilsAp::ConfIdSecurityMode).toInt(), + ap->value(WlanQtUtilsAp::ConfIdWpaPskUse).toInt(), + ap->value(WlanQtUtilsAp::ConfIdWpsSupported).toBool()); + } + // else: Add WLAN IAP manually + + mWizard->show(); + } + // else: already running Wizard, ignore this call - connectStatus = connect( - mWizard.data(), - SIGNAL(cancelled()), - this, - SLOT(handleWlanWizardCancelled()), - Qt::QueuedConnection); - Q_ASSERT(connectStatus == true); - - // Create an IAP for a specific AP - if (ap) { - mWizard->setParameters( - ap->value(WlanQtUtilsAp::ConfIdName).toString(), - ap->value(WlanQtUtilsAp::ConfIdSsid).toByteArray(), - ap->value(WlanQtUtilsAp::ConfIdConnectionMode).toInt(), - ap->value(WlanQtUtilsAp::ConfIdSecurityMode).toInt(), - ap->value(WlanQtUtilsAp::ConfIdWpaPskUse).toInt(), - ap->value(WlanQtUtilsAp::ConfIdWpsSupported).toBool()); - } - // else: Add WLAN IAP manually - - mWizard->show(); - OstTraceFunctionExit0(WLANSNIFFERMAINWINDOW_STARTWLANWIZARD_EXIT); } diff -r 301aeb18ae47 -r b47b808de481 wlanutilities/wlansniffer/wlansnifferkeepalive/inc/wsfkeepalivecmm.h --- a/wlanutilities/wlansniffer/wlansnifferkeepalive/inc/wsfkeepalivecmm.h Fri Sep 17 08:35:49 2010 +0300 +++ b/wlanutilities/wlansniffer/wlansnifferkeepalive/inc/wsfkeepalivecmm.h Mon Oct 04 02:07:04 2010 +0300 @@ -67,12 +67,12 @@ /** * Cm Manager Hotspot info getter. */ - TBool CWsfKeepaliveCmm::GetHotspotInfoL(TInt32 aIapId); + TBool GetHotspotInfoL(TInt32 aIapId); /** * Cm Manager Hotspot IAP deleter. */ - TBool CWsfKeepaliveCmm::DeleteHotspotIapL(TInt32 aIapId); + TBool DeleteHotspotIapL(TInt32 aIapId); protected: diff -r 301aeb18ae47 -r b47b808de481 wlanutilities/wlansniffer/wlansnifferkeepalive/src/wsfkeepalive.cpp --- a/wlanutilities/wlansniffer/wlansnifferkeepalive/src/wsfkeepalive.cpp Fri Sep 17 08:35:49 2010 +0300 +++ b/wlanutilities/wlansniffer/wlansnifferkeepalive/src/wsfkeepalive.cpp Mon Oct 04 02:07:04 2010 +0300 @@ -235,8 +235,13 @@ iState( EInactive ), iIapId( 0 ) { - OstTraceFunctionEntry0( CWSFKEEPALIVE_CWSFKEEPALIVE_ENTRY ); - OstTraceFunctionExit0( CWSFKEEPALIVE_CWSFKEEPALIVE_EXIT ); + OstTraceFunctionEntry0( CWSFKEEPALIVE_CWSFKEEPALIVE_ENTRY ); + iCmMgr = NULL; + iConnMon = NULL; + iConnMonDisc = NULL; + iEsock = NULL; + iTimer = NULL; + OstTraceFunctionExit0( CWSFKEEPALIVE_CWSFKEEPALIVE_EXIT ); } // --------------------------------------------------------------------------- diff -r 301aeb18ae47 -r b47b808de481 wlanutilities/wlanutilities.pro --- a/wlanutilities/wlanutilities.pro Fri Sep 17 08:35:49 2010 +0300 +++ b/wlanutilities/wlanutilities.pro Mon Oct 04 02:07:04 2010 +0300 @@ -19,11 +19,11 @@ SUBDIRS += \ wlanqtutilities \ + cpwlanentryplugin \ eapwizard \ wpswizard \ wlanwizard \ wlansniffer \ - wlanentryplugin \ wlanindicatorplugin \ cpwlansettingsplugin \ wlanlogin diff -r 301aeb18ae47 -r b47b808de481 wlanutilities/wlanwizard/inc/wlanwizard_p.h --- a/wlanutilities/wlanwizard/inc/wlanwizard_p.h Fri Sep 17 08:35:49 2010 +0300 +++ b/wlanutilities/wlanwizard/inc/wlanwizard_p.h Mon Oct 04 02:07:04 2010 +0300 @@ -128,6 +128,7 @@ void closeViews(); void updateFrame(int pageId); void loadDocml(); + void connectActions(); void disconnectActions(); private: diff -r 301aeb18ae47 -r b47b808de481 wlanutilities/wlanwizard/inc/wlanwizardpagenetworkmode.h --- a/wlanutilities/wlanwizard/inc/wlanwizardpagenetworkmode.h Fri Sep 17 08:35:49 2010 +0300 +++ b/wlanutilities/wlanwizard/inc/wlanwizardpagenetworkmode.h Mon Oct 04 02:07:04 2010 +0300 @@ -104,11 +104,6 @@ HbDocumentLoader *mLoader; /*! - * True, if a mode has been selected. False otherwise. - */ - bool mValid; - - /*! * List of network modes. This list is tied to the radio buttons during * the initialization of the page. */ diff -r 301aeb18ae47 -r b47b808de481 wlanutilities/wlanwizard/inc/wlanwizardpagesecuritymode.h --- a/wlanutilities/wlanwizard/inc/wlanwizardpagesecuritymode.h Fri Sep 17 08:35:49 2010 +0300 +++ b/wlanutilities/wlanwizard/inc/wlanwizardpagesecuritymode.h Mon Oct 04 02:07:04 2010 +0300 @@ -61,7 +61,7 @@ private: Q_DISABLE_COPY(WlanWizardPageSecurityMode) - void populateSecModeList(); + void populateSecModeList(QStringList &list); void addToList( QStringList &list, const QString &item, @@ -95,11 +95,6 @@ HbDocumentLoader *mLoader; /*! - * True, if a mode has been selected. False otherwise. - */ - bool mValid; - - /*! * List of sequrity modes. This list is tied to the radio buttons during * the initialization of the page. */ diff -r 301aeb18ae47 -r b47b808de481 wlanutilities/wlanwizard/src/wlanwizard_p.cpp --- a/wlanutilities/wlanwizard/src/wlanwizard_p.cpp Fri Sep 17 08:35:49 2010 +0300 +++ b/wlanutilities/wlanwizard/src/wlanwizard_p.cpp Mon Oct 04 02:07:04 2010 +0300 @@ -786,6 +786,10 @@ "WlanWizardPrivate::previousTriggered;this=%x", this); + // Disconnect signals from any actions until we are finished + // processing this one + disconnectActions(); + mPageTimer->stop(); int index = mStackedWidget->currentIndex(); @@ -810,6 +814,9 @@ // returned, in this case default value for int is 0 which means PageNone. updateFrame(mPages.key(page)); enableNextButton(page->showPage()); + + // Reconnect signals from actions + connectActions(); OstTrace1( TRACE_BORDER, @@ -834,6 +841,10 @@ "WlanWizardPrivate::nextTriggered;this=%x", this); + // Disconnect signals from any actions until we are finished + // processing this one + disconnectActions(); + mPageTimer->stop(); HbWidget *widget = qobject_cast(mStackedWidget->currentWidget()); @@ -843,6 +854,9 @@ int pageId = mPageMapper[widget]->nextId(removeFromStack); showPage(pageId, removeFromStack); + // Reconnect signals from actions + connectActions(); + OstTrace1( TRACE_BORDER, WLANWIZARDPRIVATE_NEXTTRIGGERED_DONE, @@ -1228,7 +1242,22 @@ ok = connect(mPageTimer, SIGNAL(timeout()), this, SLOT(onTimeOut())); Q_ASSERT(ok); - ok = connect( + connectActions(); + + ok = HbStyleLoader::registerFilePath(":/css/custom.css"); + Q_ASSERT(ok); + + OstTraceFunctionExit0(WLANWIZARDPRIVATE_LOADDOCML_EXIT); +} + +/*! + Connect triggered() signals from all toolbar actions. + */ +void WlanWizardPrivate::connectActions() +{ + OstTraceFunctionEntry0(WLANWIZARDPRIVATE_CONNECTACTIONS_ENTRY); + + bool ok = connect( mActionNext, SIGNAL(triggered()), this, @@ -1248,18 +1277,15 @@ this, SLOT(finishTriggered())); Q_ASSERT(ok); - - ok = connect( + + ok =connect( mActionCancel, SIGNAL(triggered()), this, SLOT(cancelTriggered())); Q_ASSERT(ok); - - ok = HbStyleLoader::registerFilePath(":/css/custom.css"); - Q_ASSERT(ok); - - OstTraceFunctionExit0(WLANWIZARDPRIVATE_LOADDOCML_EXIT); + + OstTraceFunctionExit0(WLANWIZARDPRIVATE_CONNECTACTIONS_EXIT); } /*! diff -r 301aeb18ae47 -r b47b808de481 wlanutilities/wlanwizard/src/wlanwizardpagenetworkmode.cpp --- a/wlanutilities/wlanwizard/src/wlanwizardpagenetworkmode.cpp Fri Sep 17 08:35:49 2010 +0300 +++ b/wlanutilities/wlanwizard/src/wlanwizardpagenetworkmode.cpp Mon Oct 04 02:07:04 2010 +0300 @@ -45,8 +45,7 @@ mWidget(NULL), mList(NULL), mLabel(NULL), - mLoader(NULL), - mValid(false) + mLoader(NULL) { OstTraceFunctionEntry0( WLANWIZARDPAGENETWORKMODE_WLANWIZARDPAGENETWORKMODE_ENTRY ); OstTraceFunctionExit0( WLANWIZARDPAGENETWORKMODE_WLANWIZARDPAGENETWORKMODE_EXIT ); @@ -94,13 +93,18 @@ Q_ASSERT(mLabel != NULL); // Connect document loading to main window orientation changes. - ok = connect(mWizard->mainWindow(), - SIGNAL(orientationChanged(Qt::Orientation)), this, + ok = connect( + mWizard->mainWindow(), + SIGNAL(orientationChanged(Qt::Orientation)), + this, SLOT(loadDocmlSection(Qt::Orientation))); Q_ASSERT(ok); // Connect a function to a radio button selection. - ok = connect(mList, SIGNAL(itemSelected(int)), this, + ok = connect( + mList, + SIGNAL(itemSelected(int)), + this, SLOT(itemSelected())); Q_ASSERT(ok); @@ -108,11 +112,14 @@ "txt_occ_dialog_select_network_mode_and_status")); } - QStringList items; - + QStringList items; populateRadioButtonList(items); - - mList->setItems(items); + + // Do not override the list, if it didn't change, because setItems() + // clears the possible selected item. + if (items != mList->items()) { + mList->setItems(items); + } OstTraceFunctionExit0( WLANWIZARDPAGENETWORKMODE_INITIALIZEPAGE_EXIT ); return mWidget; @@ -134,8 +141,7 @@ if (mWpsSupported.at(index)) { nextPage = WlanWizardPageInternal::PageWpsStart; - } - else { + } else { setting.mode = mNetworkModes.at(index); setting.hidden = mIsHidden.at(index); setting.wpsSupported = mWpsSupported.at(index); @@ -162,14 +168,15 @@ /*! * This method is overrides the default implementation from WlanWizardPage. - * It indicates whether the Next-button should be enabled or not. - * @return mValid, which is true if a radio button has been selected. + * @return Should the Next-button be enabled or not. */ bool WlanWizardPageNetworkMode::showPage() { OstTraceFunctionEntry0( WLANWIZARDPAGENETWORKMODE_SHOWPAGE_ENTRY ); OstTraceFunctionExit0( WLANWIZARDPAGENETWORKMODE_SHOWPAGE_EXIT ); - return mValid; + // Next-button is enabled whenever the radio button list has some value + // selected. + return mList->selected() != -1; } /*! @@ -182,8 +189,7 @@ OstTrace0( TRACE_BORDER, WLANWIZARDPAGENETWORKMODE_ITEMSELECTED, "WlanWizardPageNetworkMode::itemSelected" ); - mValid = true; - mWizard->enableNextButton(mValid); + mWizard->enableNextButton(true); OstTraceFunctionExit0( WLANWIZARDPAGENETWORKMODE_ITEMSELECTED_EXIT ); } @@ -247,8 +253,7 @@ mWpsSupported.append(wpsSupported); } } - } - else { + } else { list << item; mNetworkModes.append(mode); mIsHidden.append(isHidden); @@ -271,19 +276,26 @@ mIsHidden.clear(); mWpsSupported.clear(); - // A list is created. Since there is no practical way of knowing whether - // the new contents are different from the previous contents (if there - // even were any in the first place) the validity is always reset. - mValid = false; - - addToList(list, hbTrId("txt_occ_dblist_val_infrastructure_public"), - CMManagerShim::Infra, false, false); + addToList( + list, + hbTrId("txt_occ_dblist_val_infrastructure_public"), + CMManagerShim::Infra, + false, + false); - addToList(list, hbTrId("txt_occ_list_infrastructure_hidden"), - CMManagerShim::Infra, true, false); + addToList( + list, + hbTrId("txt_occ_list_infrastructure_hidden"), + CMManagerShim::Infra, + true, + false); - addToList(list, hbTrId("txt_occ_list_adhoc_1"), CMManagerShim::Adhoc, - false, false); + addToList( + list, + hbTrId("txt_occ_list_adhoc_1"), + CMManagerShim::Adhoc, + false, + false); if (mWizard->configurationExists(WlanWizardHelper::ConfAvailableNetworkOptions)) { // addToList with wpsSupported=true is only called, when there are available diff -r 301aeb18ae47 -r b47b808de481 wlanutilities/wlanwizard/src/wlanwizardpagesecuritymode.cpp --- a/wlanutilities/wlanwizard/src/wlanwizardpagesecuritymode.cpp Fri Sep 17 08:35:49 2010 +0300 +++ b/wlanutilities/wlanwizard/src/wlanwizardpagesecuritymode.cpp Mon Oct 04 02:07:04 2010 +0300 @@ -47,8 +47,7 @@ mWidget(NULL), mList(NULL), mLabel(NULL), - mLoader(NULL), - mValid(false) + mLoader(NULL) { OstTraceFunctionEntry0(WLANWIZARDPAGESECURITYMODE_WLANWIZARDPAGESECURITYMODE_ENTRY); OstTraceFunctionExit0(WLANWIZARDPAGESECURITYMODE_WLANWIZARDPAGESECURITYMODE_EXIT); @@ -119,17 +118,24 @@ } // Create contents to the security mode radio button list. - populateSecModeList(); + QStringList items; + populateSecModeList(items); + // Do not override the list, if it didn't change, because setItems() + // clears the possible selected item. + if (items != mList->items()) { + mList->setItems(items); + } + OstTraceFunctionExit0(WLANWIZARDPAGESECURITYMODE_INITIALIZEPAGE_EXIT); return mWidget; } /*! - * Validates the Sequrity more selection and sets the configuration in + * Validates the Security more selection and sets the configuration in * the wlanwizard. * @param [out] removeFromStack returns false. - * @return depending on the sequrity mode, returns the appropriate view + * @return depending on the security mode, returns the appropriate view * identifier. */ int WlanWizardPageSecurityMode::nextId(bool &removeFromStack) const @@ -151,19 +157,20 @@ mUsePsk.at(mList->selected())); OstTraceFunctionExit0(LANWIZARDPAGESECURITYMODE_NEXTID_EXIT); - return mPageIds.at( mList->selected() ); + return mPageIds.at(mList->selected()); } /*! * This method is overrides the default implementation from WlanWizardPage. - * It indicates whether the Next-button should be enabled or not. - * @return true, if a mode has been selected. + * @return Should the Next-button be enabled or not. */ bool WlanWizardPageSecurityMode::showPage() { OstTraceFunctionEntry0(WLANWIZARDPAGESECURITYMODE_SHOWPAGE_ENTRY); OstTraceFunctionExit0(WLANWIZARDPAGESECURITYMODE_SHOWPAGE_EXIT); - return mValid; + // Next-button is enabled whenever the radio button list has some value + // selected. + return mList->selected() != -1; } /*! @@ -178,9 +185,8 @@ TRACE_BORDER, WLANWIZARDPAGESECURITYMODE_ITEMSELECTED, "WlanWizardPageSecurityMode::itemSelected"); - - mValid = true; - mWizard->enableNextButton(mValid); + + mWizard->enableNextButton(true); OstTraceFunctionExit0(WLANWIZARDPAGESECURITYMODE_ITEMSELECTED_EXIT); } @@ -213,34 +219,28 @@ /*! * Support function that creates the contents of the security mode list. + * @param [out] list is the list of captions used for the radio buttons. */ -void WlanWizardPageSecurityMode::populateSecModeList() +void WlanWizardPageSecurityMode::populateSecModeList(QStringList &list) { OstTraceFunctionEntry0(WLANWIZARDPAGESECURITYMODE_POPULATESECMODELIST_ENTRY); - QStringList items; - mSecModes.clear(); mPageIds.clear(); mUsePsk.clear(); - // A list is created. Since there is no practical way of knowing whether - // the new contents are different from the previous contents (if there - // even were any in the first place) the validity is always reset. - mValid = false; - // Create the radio button list to correspond to correct security mode // identifiers and page identifiers. // Populate the list according to network mode selection. addToList( - items, + list, hbTrId("txt_occ_list_open"), CMManagerShim::WlanSecModeOpen, WlanWizardPage::PageProcessSettings, false); addToList( - items, + list, hbTrId("txt_occ_list_wep_1"), CMManagerShim::WlanSecModeWep, WlanWizardPageInternal::PageKeyQuery, @@ -251,29 +251,27 @@ != CMManagerShim::Adhoc) { addToList( - items, + list, hbTrId("txt_occ_list_wpa_with_password"), CMManagerShim::WlanSecModeWpa, WlanWizardPageInternal::PageKeyQuery, true); addToList( - items, + list, hbTrId("txt_occ_list_wpa_with_eap"), CMManagerShim::WlanSecModeWpa, WlanWizardPage::PageEapStart, false); addToList( - items, + list, hbTrId("txt_occ_list_8021x_1"), CMManagerShim::WlanSecMode802_1x, WlanWizardPage::PageEapStart, false); } - mList->setItems(items); - OstTraceFunctionExit0(WLANWIZARDPAGESECURITYMODE_POPULATESECMODELIST_EXIT); } diff -r 301aeb18ae47 -r b47b808de481 wlanutilities/wlanwizard/tsrc/stubs/eapqtconfiginterface_stub.cpp --- a/wlanutilities/wlanwizard/tsrc/stubs/eapqtconfiginterface_stub.cpp Fri Sep 17 08:35:49 2010 +0300 +++ b/wlanutilities/wlanwizard/tsrc/stubs/eapqtconfiginterface_stub.cpp Mon Oct 04 02:07:04 2010 +0300 @@ -17,7 +17,7 @@ */ /* - * %version: 6 % + * %version: 7 % */ #include @@ -35,7 +35,8 @@ { mCalledMethods.append("EapQtConfigInterface"); QCOMPARE(bearerType, EapQtConfigInterface::EapBearerTypeWlan); - QCOMPARE(iapId, EapQtConfigInterface::IapIdUndefined); + int tmp = EapQtConfigInterface::IapIdUndefined; + QCOMPARE(iapId, tmp); } EapQtConfigInterface::~EapQtConfigInterface() diff -r 301aeb18ae47 -r b47b808de481 wlanutilities/wlanwizard/tsrc/stubs/wlanmgmtclient.h --- a/wlanutilities/wlanwizard/tsrc/stubs/wlanmgmtclient.h Fri Sep 17 08:35:49 2010 +0300 +++ b/wlanutilities/wlanwizard/tsrc/stubs/wlanmgmtclient.h Mon Oct 04 02:07:04 2010 +0300 @@ -71,6 +71,7 @@ CArrayFixSeg *iResults; TWlanSsid iSsid; TInt iCompletionCode; + TBool iPushButtonMode; friend class WlanMgmtClientContext; }; diff -r 301aeb18ae47 -r b47b808de481 wlanutilities/wlanwizard/tsrc/stubs/wlanmgmtclient_context.cpp --- a/wlanutilities/wlanwizard/tsrc/stubs/wlanmgmtclient_context.cpp Fri Sep 17 08:35:49 2010 +0300 +++ b/wlanutilities/wlanwizard/tsrc/stubs/wlanmgmtclient_context.cpp Mon Oct 04 02:07:04 2010 +0300 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). + * Copyright (c) 2009 - 2010 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -32,10 +32,15 @@ } -void WlanMgmtClientContext::setRunProtectedSetup(const QString &ssid, int completionCode) +void WlanMgmtClientContext::setRunProtectedSetup( + const QString &ssid, + int completionCode, + bool pushButtonMode ) { + mWlanMgmtClient->iSsid.SetLength(0); mWlanMgmtClient->iSsid.Copy((unsigned char*)ssid.toAscii().constData()); mWlanMgmtClient->iCompletionCode = completionCode; + mWlanMgmtClient->iPushButtonMode = pushButtonMode ? ETrue : EFalse; } void WlanMgmtClientContext::appendResult( diff -r 301aeb18ae47 -r b47b808de481 wlanutilities/wlanwizard/tsrc/stubs/wlanmgmtclient_context.h --- a/wlanutilities/wlanwizard/tsrc/stubs/wlanmgmtclient_context.h Fri Sep 17 08:35:49 2010 +0300 +++ b/wlanutilities/wlanwizard/tsrc/stubs/wlanmgmtclient_context.h Mon Oct 04 02:07:04 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2009 - 2010 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -28,7 +28,11 @@ void setObject(CWlanMgmtClient *eapQtConfig); public: - void setRunProtectedSetup(const QString &ssid, int completionCode); + void setRunProtectedSetup( + const QString &ssid, + int completionCode, + bool pushButtonMode ); + void appendResult( const QString &ssid, int securityMode, diff -r 301aeb18ae47 -r b47b808de481 wlanutilities/wlanwizard/tsrc/stubs/wlanmgmtclient_stub.cpp --- a/wlanutilities/wlanwizard/tsrc/stubs/wlanmgmtclient_stub.cpp Fri Sep 17 08:35:49 2010 +0300 +++ b/wlanutilities/wlanwizard/tsrc/stubs/wlanmgmtclient_stub.cpp Mon Oct 04 02:07:04 2010 +0300 @@ -68,7 +68,14 @@ for (int i = 0 ; i < iResults->Count() ; ++i){ aCredentials.AppendL(iResults->At(i)); } - User::RequestComplete(&aStatus, iCompletionCode); + + TWlanWpsPin pinForPushButtonMode; + pinForPushButtonMode.AppendFill('0', 8); + QCOMPARE( pinForPushButtonMode == aWpsPin, iPushButtonMode ); + + // Complete the request immediately + TRequestStatus *status = &aStatus; + User::RequestComplete(status, iCompletionCode); } // --------------------------------------------------------- diff -r 301aeb18ae47 -r b47b808de481 wlanutilities/wlanwizard/tsrc/t_wlanwizard.pro --- a/wlanutilities/wlanwizard/tsrc/t_wlanwizard.pro Fri Sep 17 08:35:49 2010 +0300 +++ b/wlanutilities/wlanwizard/tsrc/t_wlanwizard.pro Mon Oct 04 02:07:04 2010 +0300 @@ -161,7 +161,7 @@ ../../wpswizard/src/wpswizardstepfive.cpp \ ../../wpswizard/src/cwpsactiverunner.cpp -LIBS += -leapqtplugininfo +LIBS += -leapqtplugininfo -lecom symbian: { TARGET.CAPABILITY = ALL -TCB diff -r 301aeb18ae47 -r b47b808de481 wlanutilities/wlanwizard/tsrc/ut/main.cpp --- a/wlanutilities/wlanwizard/tsrc/ut/main.cpp Fri Sep 17 08:35:49 2010 +0300 +++ b/wlanutilities/wlanwizard/tsrc/ut/main.cpp Mon Oct 04 02:07:04 2010 +0300 @@ -28,53 +28,101 @@ #include "testwlanwizardmanual.h" #include "testwlanwizardwps.h" +static bool match(int argc, char *argv[], const QString &tc); + // ======== LOCAL FUNCTIONS ======== int main(int argc, char *argv[]) { - qDebug("TestWlanWizard main start"); HbApplication app(argc, argv); int res = 0; char *pass[3]; pass[0] = argv[0]; pass[1] = "-o"; - // log folder: \epoc32\winscw\c\data + // log folder: + // - emulator: \epoc32\winscw\c\data + // - device: c:\data - app.setApplicationName("TestWlanWizardUtilities"); - pass[2] = "c:\\data\\TestWlanWizardUtilities.txt"; - TestWlanWizard *tcUtilities = new TestWlanWizard(); - res |= QTest::qExec(tcUtilities, 3, pass); - delete tcUtilities; - tcUtilities = NULL; - - app.setApplicationName("TestWlanWizardConnect"); - pass[2] = "c:\\data\\TestWlanWizardConnect.txt"; - TestWlanWizardConnect *tcConnect = new TestWlanWizardConnect(); - res |= QTest::qExec(tcConnect, 3, pass); - delete tcConnect; - tcConnect = NULL; + // By default all test cases are executed. + // Use following to limit the testcases as your needs: + // t_wlanwizard -t + // testcases utils connect manual eap wps + // e.g. t_wlanwizard -t connect wps + // runs only "connect" and "wps" test cases + + if (match(argc, argv, "utils")) { + app.setApplicationName("TestWlanWizardUtilities"); + pass[2] = "c:\\data\\TestWlanWizardUtilities.txt"; + TestWlanWizard *tcUtilities = new TestWlanWizard(); + res |= QTest::qExec(tcUtilities, 3, pass); + delete tcUtilities; + tcUtilities = NULL; + } - app.setApplicationName("TestWlanWizardManual"); - pass[2] = "c:\\data\\TestWlanWizardManual.txt"; - TestWlanWizardManual *tcManual = new TestWlanWizardManual(); - res |= QTest::qExec(tcManual, 3, pass); - delete tcManual; - tcManual = NULL; + if (match(argc, argv, "connect")) { + app.setApplicationName("TestWlanWizardConnect"); + pass[2] = "c:\\data\\TestWlanWizardConnect.txt"; + TestWlanWizardConnect *tcConnect = new TestWlanWizardConnect(); + res |= QTest::qExec(tcConnect, 3, pass); + delete tcConnect; + tcConnect = NULL; + } + + if (match(argc, argv, "manual")) { + app.setApplicationName("TestWlanWizardManual"); + pass[2] = "c:\\data\\TestWlanWizardManual.txt"; + TestWlanWizardManual *tcManual = new TestWlanWizardManual(); + res |= QTest::qExec(tcManual, 3, pass); + delete tcManual; + tcManual = NULL; + } + + if (match(argc, argv, "eap")) { + app.setApplicationName("TestWlanWizardEap"); + pass[2] = "c:\\data\\TestWlanWizardEap.txt"; + TestWlanWizardEap *tcEap = new TestWlanWizardEap(); + res |= QTest::qExec(tcEap, 3, pass); + delete tcEap; + tcEap = NULL; + } - app.setApplicationName("TestWlanWizardEap"); - pass[2] = "c:\\data\\TestWlanWizardEap.txt"; - TestWlanWizardEap *tcEap = new TestWlanWizardEap(); - res |= QTest::qExec(tcEap, 3, pass); - delete tcEap; - tcEap = NULL; - - app.setApplicationName("TestWlanWizardWps"); - pass[2] = "c:\\data\\TestWlanWizardWps.txt"; - TestWlanWizardWps *tcWps = new TestWlanWizardWps(); - res |= QTest::qExec(tcWps, 3, pass); - delete tcWps; - tcWps = NULL; + if (match(argc, argv, "wps")) { + app.setApplicationName("TestWlanWizardWps"); + pass[2] = "c:\\data\\TestWlanWizardWps.txt"; + TestWlanWizardWps *tcWps = new TestWlanWizardWps(); + res |= QTest::qExec(tcWps, 3, pass); + delete tcWps; + tcWps = NULL; + } - qDebug("TestWlanWizard main exit"); return res; } + +bool match(int argc, char *argv[], const QString &tc) +{ + bool testArgument = false; + bool testCase = false; + bool ret = true; + + int i = argc; + while( --i > 0) { + if (QString(argv[i]) == QString("-t")) { + testArgument = true; + break; + } + } + + i = argc; + while( --i > 0) { + if (QString(argv[i]) == tc) { + testCase = true; + break; + } + } + + if (testArgument && !testCase) { + ret = false; + } + + return ret; +} diff -r 301aeb18ae47 -r b47b808de481 wlanutilities/wlanwizard/tsrc/ut/testwlanwizardmanual.cpp --- a/wlanutilities/wlanwizard/tsrc/ut/testwlanwizardmanual.cpp Fri Sep 17 08:35:49 2010 +0300 +++ b/wlanutilities/wlanwizard/tsrc/ut/testwlanwizardmanual.cpp Mon Oct 04 02:07:04 2010 +0300 @@ -391,6 +391,15 @@ QCOMPARE( selectRadioButton( "list", 0 ), true ); QTest::qWait(WaitTimeForUi); QCOMPARE( verifyActionButtons(ButtonEnabled, ButtonEnabled, ButtonEnabled, ButtonHidden), true ); + + QCOMPARE( mouseClickPrevious(), true ); + QCOMPARE( verifyCurrentPageWithInfo(WlanWizardPageInternal::PageNetworkMode, "huuhaa3421"), true ); + QCOMPARE( verifyActionButtons(ButtonEnabled, ButtonEnabled, ButtonEnabled, ButtonHidden), true ); + QCOMPARE( mouseClickNext(), true ); + QCOMPARE( verifyCurrentPageWithInfo(WlanWizardPageInternal::PageNetworkSecurity, "huuhaa3421"), true ); + QCOMPARE( verifyActionButtons(ButtonEnabled, ButtonEnabled, ButtonEnabled, ButtonHidden), true ); + QCOMPARE( verifySelectedRadioButton("list"), 0 ); + QCOMPARE( mouseClickNext(), true ); QCOMPARE( verifyCurrentPage(WlanWizardPageInternal::PageSummary, 10, 500), true ); QCOMPARE( verifyActionButtons(ButtonHidden, ButtonEnabled, ButtonHidden, ButtonEnabled), true ); @@ -822,7 +831,7 @@ QCOMPARE( mouseClickNext(), true ); QCOMPARE( verifyCurrentPageWithInfo(WlanWizardPageInternal::PageScanning, "huuhaa3421"), true ); QCOMPARE( verifyCurrentPage(WlanWizardPageInternal::PageNetworkMode), true ); - QCOMPARE( verifySelectedRadioButton("list"), ListNoneSelected ); + QCOMPARE( verifySelectedRadioButton("list"), 2 ); QCOMPARE( selectRadioButton( "list", 2 ), true ); QTest::qWait(WaitTimeForUi); QCOMPARE( mouseClickNext(), true ); diff -r 301aeb18ae47 -r b47b808de481 wlanutilities/wlanwizard/tsrc/ut/testwlanwizardwps.cpp --- a/wlanutilities/wlanwizard/tsrc/ut/testwlanwizardwps.cpp Fri Sep 17 08:35:49 2010 +0300 +++ b/wlanutilities/wlanwizard/tsrc/ut/testwlanwizardwps.cpp Mon Oct 04 02:07:04 2010 +0300 @@ -360,10 +360,36 @@ #endif } -void TestWlanWizardWps::verifyModeSelection() +void TestWlanWizardWps::tcPinCode_BackToPushButtonMode() +{ +#ifdef tcPinCode_tcPinCode_BackToPushButtonMode + tcPinCode_failure( + KErrWlanProtectedSetupPBMethodNotSupported, + hbTrId("txt_occ_dialog_configuration_failed_authenticatio")); + + QCOMPARE( mouseClickPrevious(), true ); + QTest::qWait(WaitTimeForUi); + + tcPushButton( + "tcPinCode_failure", + EWlanIapSecurityModeAllowUnsecure, + CMManagerShim::WlanSecModeOpen, + EWlanOperatingModeInfrastructure, + CMManagerShim::Infra, + EWlanDefaultWepKey1, + CMManagerShim::WepKeyIndex1, + 1); +#endif +} + +void TestWlanWizardWps::verifyModeSelection( int index ) { QCOMPARE( verifyCurrentPage(WpsWizardPage::PageWpsWizardStep2 ), true ); - QCOMPARE( verifyActionButtons(ButtonHidden, ButtonEnabled, ButtonDisabled, ButtonHidden), true ); + if (index == -1) { + QCOMPARE( verifyActionButtons(ButtonHidden, ButtonEnabled, ButtonDisabled, ButtonHidden), true ); + } else { + QCOMPARE( verifyActionButtons(ButtonHidden, ButtonEnabled, ButtonEnabled, ButtonHidden), true ); + } QStringList list; list << hbTrId("txt_occ_list_use_pushbutton") @@ -371,6 +397,10 @@ << hbTrId("txt_occ_list_configure_manually"); QCOMPARE(verifyRadioButtons("radioButtonList"), list); + + if (index != -1) { + QCOMPARE(verifyRadioButtonState( "radioButtonList", index, list.at(index) ), true); + } } @@ -381,7 +411,8 @@ int operModeWlan, int operModeCmm, int defaultWepKeyIndexWlan, - int defaultWepKeyIndexCmm) + int defaultWepKeyIndexCmm, + int index) { mWlanQtUtilsContext->setCreateWlanIapResult(3); mWlanQtUtilsContext->setConnectionSuccessed(true); @@ -416,7 +447,7 @@ ap.setValue(WlanQtUtilsAp::ConfIdWpaPsk, "wpapsk"); } - mWlanMgmtClientContext->setRunProtectedSetup(ssid, KErrNone); + mWlanMgmtClientContext->setRunProtectedSetup(ssid, KErrNone, true); mWlanMgmtClientContext->appendResult( ssid, secModeWlan, @@ -427,17 +458,21 @@ "wepkey3", "wepkey4", "wpapsk"); + + // Wizard is already in Mode Selection Page + if (index == -1) { + mView->mWizard->setParameters( + ssid, + ssid.toUtf8(), + CMManagerShim::Adhoc, + CMManagerShim::WlanSecModeWep, + false, + true); - mView->mWizard->setParameters( - ssid, - ssid.toUtf8(), - CMManagerShim::Adhoc, - CMManagerShim::WlanSecModeWep, - false, - true); - - mView->showWizard(); - verifyModeSelection(); + mView->showWizard(); + } + + verifyModeSelection(index); QCOMPARE(selectRadioButton("radioButtonList", 0), true); QTest::qWait(WaitTimeForUi); @@ -470,7 +505,7 @@ mWlanQtUtilsContext->setSignalWlanNetworkOpened(3); mWlanQtUtilsContext->setSignalIctResult(3, WlanQtUtils::IctPassed); - mWlanMgmtClientContext->setRunProtectedSetup(ssid, errorCode); + mWlanMgmtClientContext->setRunProtectedSetup(ssid, errorCode, false); mView->mWizard->setParameters( ssid, diff -r 301aeb18ae47 -r b47b808de481 wlanutilities/wlanwizard/tsrc/ut/testwlanwizardwps.h --- a/wlanutilities/wlanwizard/tsrc/ut/testwlanwizardwps.h Fri Sep 17 08:35:49 2010 +0300 +++ b/wlanutilities/wlanwizard/tsrc/ut/testwlanwizardwps.h Mon Oct 04 02:07:04 2010 +0300 @@ -50,6 +50,7 @@ void tcPinCode_KErrWlanProtectedSetupDevicePasswordAuthFailure(); void tcPinCode_KErrWlanProtectedSetupPINMethodNotSupported(); void tcPinCode_KErrWlanProtectedSetupPBMethodNotSupported(); + void tcPinCode_BackToPushButtonMode(); /* void tcPushButton_KErrNone_back_forward_KErrNone(); void tcPinCodeMultipleResults(); @@ -57,7 +58,7 @@ */ private: // Helper methods - void verifyModeSelection(); + void verifyModeSelection(int index = -1); private: // Helper test cases void tcPushButton( @@ -67,7 +68,8 @@ int operModeWlan, int operModeCmm, int defaultWepKeyIndexWlan, - int defaultWepKeyIndexCmm); + int defaultWepKeyIndexCmm, + int index = -1); void tcPinCode_failure( int errorCode, diff -r 301aeb18ae47 -r b47b808de481 wlanutilities/wlanwizard/tsrc/ut/testwlanwizardwps_conf.h --- a/wlanutilities/wlanwizard/tsrc/ut/testwlanwizardwps_conf.h Fri Sep 17 08:35:49 2010 +0300 +++ b/wlanutilities/wlanwizard/tsrc/ut/testwlanwizardwps_conf.h Mon Oct 04 02:07:04 2010 +0300 @@ -48,4 +48,4 @@ #define tcPinCode_KErrWlanProtectedSetupDevicePasswordAuthFailure_enabled #define tcPinCode_KErrWlanProtectedSetupPINMethodNotSupported_enabled #define tcPinCode_KErrWlanProtectedSetupPBMethodNotSupported_enabled - +#define tcPinCode_tcPinCode_BackToPushButtonMode diff -r 301aeb18ae47 -r b47b808de481 wlanutilities/wpswizard/inc/cwpsactiverunner.h --- a/wlanutilities/wpswizard/inc/cwpsactiverunner.h Fri Sep 17 08:35:49 2010 +0300 +++ b/wlanutilities/wpswizard/inc/cwpsactiverunner.h Mon Oct 04 02:07:04 2010 +0300 @@ -39,8 +39,8 @@ public: static CWpsActiveRunner* NewL(MWpsActiveRunnerCallback& aObserver); virtual ~CWpsActiveRunner(); + public: - void RunL(); void DoCancel(); TInt RunError(TInt aError); @@ -51,7 +51,7 @@ private: explicit CWpsActiveRunner(MWpsActiveRunnerCallback& aObserver); void ConstructL(); - void InitializeL(); + private: //! observer for notification of WPS setup completion diff -r 301aeb18ae47 -r b47b808de481 wlanutilities/wpswizard/inc/wpswizard_p.h --- a/wlanutilities/wpswizard/inc/wpswizard_p.h Fri Sep 17 08:35:49 2010 +0300 +++ b/wlanutilities/wpswizard/inc/wpswizard_p.h Mon Oct 04 02:07:04 2010 +0300 @@ -115,7 +115,9 @@ TWlanProtectedSetupCredentialAttribute mWpsAttr; //! Array of objects containing WLAN credentials. QList mIapList; - //! Random number generated for Number entry mode + /*! Random number generated for Number entry mode. When the value is zero (0) + * Push-Button mode is used. + */ int mRandomNumber; friend class WpsWizard; diff -r 301aeb18ae47 -r b47b808de481 wlanutilities/wpswizard/inc/wpswizardstepthreenumber.h --- a/wlanutilities/wpswizard/inc/wpswizardstepthreenumber.h Fri Sep 17 08:35:49 2010 +0300 +++ b/wlanutilities/wpswizard/inc/wpswizardstepthreenumber.h Mon Oct 04 02:07:04 2010 +0300 @@ -55,8 +55,6 @@ int previousTriggered(); - void cancelTriggered(); - bool showPage(); private: diff -r 301aeb18ae47 -r b47b808de481 wlanutilities/wpswizard/src/cwpsactiverunner.cpp --- a/wlanutilities/wpswizard/src/cwpsactiverunner.cpp Fri Sep 17 08:35:49 2010 +0300 +++ b/wlanutilities/wpswizard/src/cwpsactiverunner.cpp Mon Oct 04 02:07:04 2010 +0300 @@ -91,23 +91,13 @@ OstTraceFunctionEntry1( CWPSACTIVERUNNER_CONSTRUCTL_ENTRY, this ); CActiveScheduler::Add(this); - InitializeL(); - OstTraceFunctionExit1( CWPSACTIVERUNNER_CONSTRUCTL_EXIT, this ); -} + + iWLANMgmtClient = CWlanMgmtClient::NewL(); -/*! - * Initializes the member variables for making the middleware calls - * - */ - -void CWpsActiveRunner::InitializeL() -{ - OstTraceFunctionEntry1( CWPSACTIVERUNNER_INITIALIZEL_ENTRY, this ); - iWLANMgmtClient = CWlanMgmtClient::NewL(); iIapParametersArray = new (ELeave) CArrayFixSeg< TWlanProtectedSetupCredentialAttribute> (KArrayGranularity); - OstTraceFunctionExit1( CWPSACTIVERUNNER_INITIALIZEL_EXIT, this ); + OstTraceFunctionExit1( CWPSACTIVERUNNER_CONSTRUCTL_EXIT, this ); } /*! @@ -139,10 +129,10 @@ ssid.Copy(aSsid); TBuf8 pinCode; + // When Pin is zero it means that push-button mode is used. if (aPin == 0) { pinCode.AppendFill('0', 8); - } - else { + } else { pinCode.AppendNum(aPin); } @@ -165,22 +155,19 @@ TInt completionCode = iStatus.Int(); QList credentials; - if(!isCancelTriggered) { + if (!isCancelTriggered) { if (completionCode < KErrNone) { //Raise Error - QT_TRYCATCH_LEAVING(iObserver.WpsActiveRunnerStopped(credentials, completionCode)); - } - else { + QT_TRYCATCH_LEAVING(iObserver.WpsActiveRunnerStopped(credentials, completionCode)); + } else { TInt len = iIapParametersArray->Length(); TInt count; - for(count=0;countCount();count++) - { + for (count = 0 ; count < iIapParametersArray->Count() ; count++) { TWlanProtectedSetupCredentialAttribute attr =(*iIapParametersArray)[count]; credentials.append(attr); - } + } QT_TRYCATCH_LEAVING(iObserver.WpsActiveRunnerStopped(credentials,completionCode)); - } } @@ -194,10 +181,9 @@ { OstTraceFunctionEntry1( CWPSACTIVERUNNER_DOCANCEL_ENTRY, this ); isCancelTriggered = true; - if(iWLANMgmtClient) - { - iWLANMgmtClient->CancelProtectedSetup(); - } + + iWLANMgmtClient->CancelProtectedSetup(); + OstTraceFunctionExit1( CWPSACTIVERUNNER_DOCANCEL_EXIT, this ); } @@ -211,13 +197,10 @@ OstTrace1( TRACE_ERROR, CWPSACTIVERUNNER_RUNERROR, "CWpsActiveRunner::RunError;aError=%d", aError ); QList credentials; - if(iWLANMgmtClient) - { - iWLANMgmtClient->CancelProtectedSetup(); - } - + iWLANMgmtClient->CancelProtectedSetup(); + QT_TRYCATCH_LEAVING(iObserver.WpsActiveRunnerStopped(credentials, aError)); - return 0; + return KErrNone; } diff -r 301aeb18ae47 -r b47b808de481 wlanutilities/wpswizard/src/wpswizardstepthreenumber.cpp --- a/wlanutilities/wpswizard/src/wpswizardstepthreenumber.cpp Fri Sep 17 08:35:49 2010 +0300 +++ b/wlanutilities/wpswizard/src/wpswizardstepthreenumber.cpp Mon Oct 04 02:07:04 2010 +0300 @@ -131,25 +131,11 @@ int WpsPageStepThreeNumber::previousTriggered() { OstTraceFunctionEntry1(WPSPAGESTEPTHREENUMBER_PREVIOUSTRIGGERED_ENTRY, this); - - mWizard->setPin(0); - OstTraceFunctionExit1(WPSPAGESTEPTHREENUMBER_PREVIOUSTRIGGERED_EXIT, this); return (PageWpsWizardStep3_Number - PageWpsWizardStep2) - 1; } /*! - CallBack when the cancel button is clicked - */ -void WpsPageStepThreeNumber::cancelTriggered() -{ - OstTraceFunctionEntry1(WPSPAGESTEPTHREENUMBER_CANCELTRIGGERED_ENTRY, this); - mWizard->setPin(0); - OstTraceFunctionExit1(WPSPAGESTEPTHREENUMBER_CANCELTRIGGERED_EXIT, this); -} - - -/*! Determines whether the Next action button should be enabled or not @return bool Indicating whether next button is enabled or not. diff -r 301aeb18ae47 -r b47b808de481 wlanutilities/wpswizard/src/wpswizardsteptwo.cpp --- a/wlanutilities/wpswizard/src/wpswizardsteptwo.cpp Fri Sep 17 08:35:49 2010 +0300 +++ b/wlanutilities/wpswizard/src/wpswizardsteptwo.cpp Mon Oct 04 02:07:04 2010 +0300 @@ -145,6 +145,8 @@ removeFromStack = false; if (mItemSelected == WpsPushButtonMode) { + // Reset Pin code, pin 0 means push-button mode + mWizard->setPin(0); id = WpsWizardPage::PageWpsWizardStep3_Button; } else if (mItemSelected == WpsPinCodeMode) {