# HG changeset patch # User hgs # Date 1284630753 -10800 # Node ID e1d68407ed06422ece0936ac4916c0830a2eed33 # Parent 822a45792fdd610e7869a47f3c531501e1e2c095 201037 diff -r 822a45792fdd -r e1d68407ed06 hotspotfw/hsclient/NetCfgExtnHotSpot/inc/NetCfgExtnHotSpot.h --- a/hotspotfw/hsclient/NetCfgExtnHotSpot/inc/NetCfgExtnHotSpot.h Fri Sep 03 09:37:37 2010 +0300 +++ b/hotspotfw/hsclient/NetCfgExtnHotSpot/inc/NetCfgExtnHotSpot.h Thu Sep 16 12:52:33 2010 +0300 @@ -115,6 +115,10 @@ inline CNetworkConfigExtensionHotSpot::CNetworkConfigExtensionHotSpot( MNifIfNotify& aNifIfNotify ) : CNetworkConfigExtensionBase( aNifIfNotify ) { + iNotAuthenticated =false; + iNotDeregistered = false; + iIsStartLoginActive=false; + iHotspotConnect=0; } #endif diff -r 822a45792fdd -r e1d68407ed06 hotspotfw/hsclient/inc/hsssrvnotifications.h --- a/hotspotfw/hsclient/inc/hsssrvnotifications.h Fri Sep 03 09:37:37 2010 +0300 +++ b/hotspotfw/hsclient/inc/hsssrvnotifications.h Thu Sep 16 12:52:33 2010 +0300 @@ -19,7 +19,6 @@ #ifndef HSSSRVNOTIFICATIONS_H #define HSSSRVNOTIFICATIONS_H -#include "hssinterface.h" #include #include diff -r 822a45792fdd -r e1d68407ed06 hotspotfw/hsclient/src/hssiaphandler.cpp --- a/hotspotfw/hsclient/src/hssiaphandler.cpp Fri Sep 03 09:37:37 2010 +0300 +++ b/hotspotfw/hsclient/src/hssiaphandler.cpp Thu Sep 16 12:52:33 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 822a45792fdd -r e1d68407ed06 hotspotfw/hsclient/src/hssmgmtscaninfoimpl.cpp --- a/hotspotfw/hsclient/src/hssmgmtscaninfoimpl.cpp Fri Sep 03 09:37:37 2010 +0300 +++ b/hotspotfw/hsclient/src/hssmgmtscaninfoimpl.cpp Thu Sep 16 12:52:33 2010 +0300 @@ -32,6 +32,7 @@ // CHssMgmtScanInfoImpl::CHssMgmtScanInfoImpl() { + iScanInfo=NULL; DEBUG("CHssMgmtScanInfoImpl::CHssMgmtScanInfoImpl()"); } diff -r 822a45792fdd -r e1d68407ed06 hotspotfw/hsclient/src/hssscanhandler.cpp --- a/hotspotfw/hsclient/src/hssscanhandler.cpp Fri Sep 03 09:37:37 2010 +0300 +++ b/hotspotfw/hsclient/src/hssscanhandler.cpp Thu Sep 16 12:52:33 2010 +0300 @@ -37,9 +37,10 @@ // CHssScanHandler::CHssScanHandler( ) { - DEBUG("CHssScanHandler::CHssScanHandler"); - - } + iMgmtClient=NULL; + iScanInfo=NULL; + DEBUG("CHssScanHandler::CHssScanHandler"); + } // ----------------------------------------------------------------------------- // ConstructL diff -r 822a45792fdd -r e1d68407ed06 hotspotfw/hsserver/inc/am_debug.h --- a/hotspotfw/hsserver/inc/am_debug.h Fri Sep 03 09:37:37 2010 +0300 +++ b/hotspotfw/hsserver/inc/am_debug.h Thu Sep 16 12:52:33 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 822a45792fdd -r e1d68407ed06 hotspotfw/hsserver/inc/am_debug.inl --- a/hotspotfw/hsserver/inc/am_debug.inl Fri Sep 03 09:37:37 2010 +0300 +++ b/hotspotfw/hsserver/inc/am_debug.inl Thu Sep 16 12:52:33 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 822a45792fdd -r e1d68407ed06 hotspotfw/hsserver/inc/hotspotserver.h --- a/hotspotfw/hsserver/inc/hotspotserver.h Fri Sep 03 09:37:37 2010 +0300 +++ b/hotspotfw/hsserver/inc/hotspotserver.h Thu Sep 16 12:52:33 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 822a45792fdd -r e1d68407ed06 hotspotfw/hsserver/inc/hotspotsession.h --- a/hotspotfw/hsserver/inc/hotspotsession.h Fri Sep 03 09:37:37 2010 +0300 +++ b/hotspotfw/hsserver/inc/hotspotsession.h Thu Sep 16 12:52:33 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 822a45792fdd -r e1d68407ed06 hotspotfw/hsserver/inc/hssnotif.h --- a/hotspotfw/hsserver/inc/hssnotif.h Fri Sep 03 09:37:37 2010 +0300 +++ b/hotspotfw/hsserver/inc/hssnotif.h Thu Sep 16 12:52:33 2010 +0300 @@ -23,7 +23,6 @@ #include "hssinterface.h" #include #include -#include "hotspotsession.h" #include "hotspotclientserver.h" // FORWARD DECLARATIONS diff -r 822a45792fdd -r e1d68407ed06 hotspotfw/hsserver/src/hotspotserver.cpp --- a/hotspotfw/hsserver/src/hotspotserver.cpp Fri Sep 03 09:37:37 2010 +0300 +++ b/hotspotfw/hsserver/src/hotspotserver.cpp Thu Sep 16 12:52:33 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 822a45792fdd -r e1d68407ed06 hotspotfw/hsserver/src/hotspotsession.cpp --- a/hotspotfw/hsserver/src/hotspotsession.cpp Fri Sep 03 09:37:37 2010 +0300 +++ b/hotspotfw/hsserver/src/hotspotsession.cpp Thu Sep 16 12:52:33 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 822a45792fdd -r e1d68407ed06 hotspotfw/hsserver/src/hssnotif.cpp --- a/hotspotfw/hsserver/src/hssnotif.cpp Fri Sep 03 09:37:37 2010 +0300 +++ b/hotspotfw/hsserver/src/hssnotif.cpp Thu Sep 16 12:52:33 2010 +0300 @@ -21,6 +21,7 @@ #include "hssnotif.h" #include "hssinterface.h" #include "am_debug.h" +#include "hotspotsession.h" // ============================ MEMBER FUNCTIONS =============================== diff -r 822a45792fdd -r e1d68407ed06 hotspotfw/internetconnectivitytestservice/src/ictsclientinterface.cpp --- a/hotspotfw/internetconnectivitytestservice/src/ictsclientinterface.cpp Fri Sep 03 09:37:37 2010 +0300 +++ b/hotspotfw/internetconnectivitytestservice/src/ictsclientinterface.cpp Thu Sep 16 12:52:33 2010 +0300 @@ -29,7 +29,7 @@ // CIctsClientInterface::CIctsClientInterface() { - + iEngine =NULL; } // --------------------------------------------------------------------------- diff -r 822a45792fdd -r e1d68407ed06 hotspotfw/internetconnectivitytestservice/src/ictsengine.cpp --- a/hotspotfw/internetconnectivitytestservice/src/ictsengine.cpp Fri Sep 03 09:37:37 2010 +0300 +++ b/hotspotfw/internetconnectivitytestservice/src/ictsengine.cpp Thu Sep 16 12:52:33 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 822a45792fdd -r e1d68407ed06 wlanutilities/cpwlansettingsplugin/src/wlansettings_s60.cpp --- a/wlanutilities/cpwlansettingsplugin/src/wlansettings_s60.cpp Fri Sep 03 09:37:37 2010 +0300 +++ b/wlanutilities/cpwlansettingsplugin/src/wlansettings_s60.cpp Thu Sep 16 12:52:33 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 822a45792fdd -r e1d68407ed06 wlanutilities/wlanentryplugin/inc/cpwlanentryitemdata.h --- a/wlanutilities/wlanentryplugin/inc/cpwlanentryitemdata.h Fri Sep 03 09:37:37 2010 +0300 +++ b/wlanutilities/wlanentryplugin/inc/cpwlanentryitemdata.h Thu Sep 16 12:52:33 2010 +0300 @@ -19,14 +19,15 @@ #define CPWLANENTRYITEMDATA_H // System includes - -#include "cpsettingformentryitemdata.h" +#include // User includes +#include "cpsettingformentryitemdata.h" // Forward declarations class WlanStatusInfo; +class XQAiwRequest; // External data types @@ -59,14 +60,19 @@ 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 diff -r 822a45792fdd -r e1d68407ed06 wlanutilities/wlanentryplugin/src/cpwlanentryitemdata.cpp --- a/wlanutilities/wlanentryplugin/src/cpwlanentryitemdata.cpp Fri Sep 03 09:37:37 2010 +0300 +++ b/wlanutilities/wlanentryplugin/src/cpwlanentryitemdata.cpp Thu Sep 16 12:52:33 2010 +0300 @@ -24,7 +24,6 @@ #ifdef WLANENTRYPLUGIN_SERVICETRACES #include #endif -#include #include #include @@ -63,7 +62,9 @@ CpWlanEntryItemData::CpWlanEntryItemData(CpItemDataHelper &itemDataHelper) : CpSettingFormEntryItemData(itemDataHelper, hbTrId("txt_occ_dblist_wireless_lan")), - mWlanStatusInfo(new WlanStatusInfo(this)) + mWlanStatusInfo(new WlanStatusInfo(this)), + mProcessing(false), + mRequest(0) { OstTraceFunctionEntry0(CPWLANENTRYITEMDATA_CPWLANENTRYITEMDATA_ENTRY); @@ -88,9 +89,44 @@ 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. */ @@ -99,36 +135,43 @@ { 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 synchronous WLAN Sniffer list view - XQApplicationManager aiwMgr; - XQAiwRequest *request = aiwMgr.create( + // 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(request); + Q_ASSERT(mRequest); - // The service is synchronous & embedded - request->setSynchronous(true); + // 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")); - request->setInfo(reqInfo); + 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 = request->send(); + bool status = mRequest->send(); #ifdef WLANENTRYPLUGIN_SERVICETRACES - XQSERVICE_DEBUG_PRINT("CpWlanEntryItemData::createSettingView listView() service request completed"); + XQSERVICE_DEBUG_PRINT("CpWlanEntryItemData::createSettingView listView() service request sent"); #endif Q_ASSERT(status); - delete request; OstTraceFunctionExit0(CPWLANENTRYITEMDATA_CREATESETTINGVIEW_EXIT); return 0; diff -r 822a45792fdd -r e1d68407ed06 wlanutilities/wlanlogin/ictswlanlogininterface/src/ictswlanlogininterface.cpp --- a/wlanutilities/wlanlogin/ictswlanlogininterface/src/ictswlanlogininterface.cpp Fri Sep 03 09:37:37 2010 +0300 +++ b/wlanutilities/wlanlogin/ictswlanlogininterface/src/ictswlanlogininterface.cpp Thu Sep 16 12:52:33 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 822a45792fdd -r e1d68407ed06 wlanutilities/wlanlogin/wlanloginapp/inc/wlanloginengine.h --- a/wlanutilities/wlanlogin/wlanloginapp/inc/wlanloginengine.h Fri Sep 03 09:37:37 2010 +0300 +++ b/wlanutilities/wlanlogin/wlanloginapp/inc/wlanloginengine.h Thu Sep 16 12:52:33 2010 +0300 @@ -85,6 +85,7 @@ WlanLoginNetworkAccessManager* networkAccessManager() const; EngineState engineState(); void setEngineState(EngineState newState); + bool bringSnifferToForeground(); signals: void completeServiceRequest(int status); diff -r 822a45792fdd -r e1d68407ed06 wlanutilities/wlanlogin/wlanloginapp/src/wlanloginapplication.cpp --- a/wlanutilities/wlanlogin/wlanloginapp/src/wlanloginapplication.cpp Fri Sep 03 09:37:37 2010 +0300 +++ b/wlanutilities/wlanlogin/wlanloginapp/src/wlanloginapplication.cpp Thu Sep 16 12:52:33 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 822a45792fdd -r e1d68407ed06 wlanutilities/wlanlogin/wlanloginapp/src/wlanloginengine.cpp --- a/wlanutilities/wlanlogin/wlanloginapp/src/wlanloginengine.cpp Fri Sep 03 09:37:37 2010 +0300 +++ b/wlanutilities/wlanlogin/wlanloginapp/src/wlanloginengine.cpp Thu Sep 16 12:52:33 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 822a45792fdd -r e1d68407ed06 wlanutilities/wlanlogin/wlanloginapp/src/wlanloginservice.cpp --- a/wlanutilities/wlanlogin/wlanloginapp/src/wlanloginservice.cpp Fri Sep 03 09:37:37 2010 +0300 +++ b/wlanutilities/wlanlogin/wlanloginapp/src/wlanloginservice.cpp Thu Sep 16 12:52:33 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 822a45792fdd -r e1d68407ed06 wlanutilities/wlanlogin/wlanloginapp/wlanloginapp.pro --- a/wlanutilities/wlanlogin/wlanloginapp/wlanloginapp.pro Fri Sep 03 09:37:37 2010 +0300 +++ b/wlanutilities/wlanlogin/wlanloginapp/wlanloginapp.pro Thu Sep 16 12:52:33 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 822a45792fdd -r e1d68407ed06 wlanutilities/wlansniffer/wlansnifferapplication/src/wlansnifferlistview.cpp --- a/wlanutilities/wlansniffer/wlansnifferapplication/src/wlansnifferlistview.cpp Fri Sep 03 09:37:37 2010 +0300 +++ b/wlanutilities/wlansniffer/wlansnifferapplication/src/wlansnifferlistview.cpp Thu Sep 16 12:52:33 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 822a45792fdd -r e1d68407ed06 wlanutilities/wlansniffer/wlansnifferapplication/src/wlansniffermainwindow.cpp --- a/wlanutilities/wlansniffer/wlansnifferapplication/src/wlansniffermainwindow.cpp Fri Sep 03 09:37:37 2010 +0300 +++ b/wlanutilities/wlansniffer/wlansnifferapplication/src/wlansniffermainwindow.cpp Thu Sep 16 12:52:33 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 822a45792fdd -r e1d68407ed06 wlanutilities/wlansniffer/wlansnifferkeepalive/inc/wsfkeepalivecmm.h --- a/wlanutilities/wlansniffer/wlansnifferkeepalive/inc/wsfkeepalivecmm.h Fri Sep 03 09:37:37 2010 +0300 +++ b/wlanutilities/wlansniffer/wlansnifferkeepalive/inc/wsfkeepalivecmm.h Thu Sep 16 12:52:33 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 822a45792fdd -r e1d68407ed06 wlanutilities/wlansniffer/wlansnifferkeepalive/src/wsfkeepalive.cpp --- a/wlanutilities/wlansniffer/wlansnifferkeepalive/src/wsfkeepalive.cpp Fri Sep 03 09:37:37 2010 +0300 +++ b/wlanutilities/wlansniffer/wlansnifferkeepalive/src/wsfkeepalive.cpp Thu Sep 16 12:52:33 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 822a45792fdd -r e1d68407ed06 wlanutilities/wlanwizard/inc/wlanwizard_p.h --- a/wlanutilities/wlanwizard/inc/wlanwizard_p.h Fri Sep 03 09:37:37 2010 +0300 +++ b/wlanutilities/wlanwizard/inc/wlanwizard_p.h Thu Sep 16 12:52:33 2010 +0300 @@ -128,6 +128,7 @@ void closeViews(); void updateFrame(int pageId); void loadDocml(); + void connectActions(); void disconnectActions(); private: diff -r 822a45792fdd -r e1d68407ed06 wlanutilities/wlanwizard/inc/wlanwizardpagenetworkmode.h --- a/wlanutilities/wlanwizard/inc/wlanwizardpagenetworkmode.h Fri Sep 03 09:37:37 2010 +0300 +++ b/wlanutilities/wlanwizard/inc/wlanwizardpagenetworkmode.h Thu Sep 16 12:52:33 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 822a45792fdd -r e1d68407ed06 wlanutilities/wlanwizard/inc/wlanwizardpagesecuritymode.h --- a/wlanutilities/wlanwizard/inc/wlanwizardpagesecuritymode.h Fri Sep 03 09:37:37 2010 +0300 +++ b/wlanutilities/wlanwizard/inc/wlanwizardpagesecuritymode.h Thu Sep 16 12:52:33 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 822a45792fdd -r e1d68407ed06 wlanutilities/wlanwizard/src/wlanwizard_p.cpp --- a/wlanutilities/wlanwizard/src/wlanwizard_p.cpp Fri Sep 03 09:37:37 2010 +0300 +++ b/wlanutilities/wlanwizard/src/wlanwizard_p.cpp Thu Sep 16 12:52:33 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 822a45792fdd -r e1d68407ed06 wlanutilities/wlanwizard/src/wlanwizardpagenetworkmode.cpp --- a/wlanutilities/wlanwizard/src/wlanwizardpagenetworkmode.cpp Fri Sep 03 09:37:37 2010 +0300 +++ b/wlanutilities/wlanwizard/src/wlanwizardpagenetworkmode.cpp Thu Sep 16 12:52:33 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 822a45792fdd -r e1d68407ed06 wlanutilities/wlanwizard/src/wlanwizardpagesecuritymode.cpp --- a/wlanutilities/wlanwizard/src/wlanwizardpagesecuritymode.cpp Fri Sep 03 09:37:37 2010 +0300 +++ b/wlanutilities/wlanwizard/src/wlanwizardpagesecuritymode.cpp Thu Sep 16 12:52:33 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 822a45792fdd -r e1d68407ed06 wlanutilities/wlanwizard/tsrc/stubs/eapqtconfiginterface_stub.cpp --- a/wlanutilities/wlanwizard/tsrc/stubs/eapqtconfiginterface_stub.cpp Fri Sep 03 09:37:37 2010 +0300 +++ b/wlanutilities/wlanwizard/tsrc/stubs/eapqtconfiginterface_stub.cpp Thu Sep 16 12:52:33 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 822a45792fdd -r e1d68407ed06 wlanutilities/wlanwizard/tsrc/stubs/wlanmgmtclient.h --- a/wlanutilities/wlanwizard/tsrc/stubs/wlanmgmtclient.h Fri Sep 03 09:37:37 2010 +0300 +++ b/wlanutilities/wlanwizard/tsrc/stubs/wlanmgmtclient.h Thu Sep 16 12:52:33 2010 +0300 @@ -71,6 +71,7 @@ CArrayFixSeg *iResults; TWlanSsid iSsid; TInt iCompletionCode; + TBool iPushButtonMode; friend class WlanMgmtClientContext; }; diff -r 822a45792fdd -r e1d68407ed06 wlanutilities/wlanwizard/tsrc/stubs/wlanmgmtclient_context.cpp --- a/wlanutilities/wlanwizard/tsrc/stubs/wlanmgmtclient_context.cpp Fri Sep 03 09:37:37 2010 +0300 +++ b/wlanutilities/wlanwizard/tsrc/stubs/wlanmgmtclient_context.cpp Thu Sep 16 12:52:33 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 822a45792fdd -r e1d68407ed06 wlanutilities/wlanwizard/tsrc/stubs/wlanmgmtclient_context.h --- a/wlanutilities/wlanwizard/tsrc/stubs/wlanmgmtclient_context.h Fri Sep 03 09:37:37 2010 +0300 +++ b/wlanutilities/wlanwizard/tsrc/stubs/wlanmgmtclient_context.h Thu Sep 16 12:52:33 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 822a45792fdd -r e1d68407ed06 wlanutilities/wlanwizard/tsrc/stubs/wlanmgmtclient_stub.cpp --- a/wlanutilities/wlanwizard/tsrc/stubs/wlanmgmtclient_stub.cpp Fri Sep 03 09:37:37 2010 +0300 +++ b/wlanutilities/wlanwizard/tsrc/stubs/wlanmgmtclient_stub.cpp Thu Sep 16 12:52:33 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 822a45792fdd -r e1d68407ed06 wlanutilities/wlanwizard/tsrc/t_wlanwizard.pro --- a/wlanutilities/wlanwizard/tsrc/t_wlanwizard.pro Fri Sep 03 09:37:37 2010 +0300 +++ b/wlanutilities/wlanwizard/tsrc/t_wlanwizard.pro Thu Sep 16 12:52:33 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 822a45792fdd -r e1d68407ed06 wlanutilities/wlanwizard/tsrc/ut/main.cpp --- a/wlanutilities/wlanwizard/tsrc/ut/main.cpp Fri Sep 03 09:37:37 2010 +0300 +++ b/wlanutilities/wlanwizard/tsrc/ut/main.cpp Thu Sep 16 12:52:33 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 822a45792fdd -r e1d68407ed06 wlanutilities/wlanwizard/tsrc/ut/testwlanwizardmanual.cpp --- a/wlanutilities/wlanwizard/tsrc/ut/testwlanwizardmanual.cpp Fri Sep 03 09:37:37 2010 +0300 +++ b/wlanutilities/wlanwizard/tsrc/ut/testwlanwizardmanual.cpp Thu Sep 16 12:52:33 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 822a45792fdd -r e1d68407ed06 wlanutilities/wlanwizard/tsrc/ut/testwlanwizardwps.cpp --- a/wlanutilities/wlanwizard/tsrc/ut/testwlanwizardwps.cpp Fri Sep 03 09:37:37 2010 +0300 +++ b/wlanutilities/wlanwizard/tsrc/ut/testwlanwizardwps.cpp Thu Sep 16 12:52:33 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 822a45792fdd -r e1d68407ed06 wlanutilities/wlanwizard/tsrc/ut/testwlanwizardwps.h --- a/wlanutilities/wlanwizard/tsrc/ut/testwlanwizardwps.h Fri Sep 03 09:37:37 2010 +0300 +++ b/wlanutilities/wlanwizard/tsrc/ut/testwlanwizardwps.h Thu Sep 16 12:52:33 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 822a45792fdd -r e1d68407ed06 wlanutilities/wlanwizard/tsrc/ut/testwlanwizardwps_conf.h --- a/wlanutilities/wlanwizard/tsrc/ut/testwlanwizardwps_conf.h Fri Sep 03 09:37:37 2010 +0300 +++ b/wlanutilities/wlanwizard/tsrc/ut/testwlanwizardwps_conf.h Thu Sep 16 12:52:33 2010 +0300 @@ -48,4 +48,4 @@ #define tcPinCode_KErrWlanProtectedSetupDevicePasswordAuthFailure_enabled #define tcPinCode_KErrWlanProtectedSetupPINMethodNotSupported_enabled #define tcPinCode_KErrWlanProtectedSetupPBMethodNotSupported_enabled - +#define tcPinCode_tcPinCode_BackToPushButtonMode diff -r 822a45792fdd -r e1d68407ed06 wlanutilities/wpswizard/inc/cwpsactiverunner.h --- a/wlanutilities/wpswizard/inc/cwpsactiverunner.h Fri Sep 03 09:37:37 2010 +0300 +++ b/wlanutilities/wpswizard/inc/cwpsactiverunner.h Thu Sep 16 12:52:33 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 822a45792fdd -r e1d68407ed06 wlanutilities/wpswizard/inc/wpswizard_p.h --- a/wlanutilities/wpswizard/inc/wpswizard_p.h Fri Sep 03 09:37:37 2010 +0300 +++ b/wlanutilities/wpswizard/inc/wpswizard_p.h Thu Sep 16 12:52:33 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 822a45792fdd -r e1d68407ed06 wlanutilities/wpswizard/inc/wpswizardstepthreenumber.h --- a/wlanutilities/wpswizard/inc/wpswizardstepthreenumber.h Fri Sep 03 09:37:37 2010 +0300 +++ b/wlanutilities/wpswizard/inc/wpswizardstepthreenumber.h Thu Sep 16 12:52:33 2010 +0300 @@ -55,8 +55,6 @@ int previousTriggered(); - void cancelTriggered(); - bool showPage(); private: diff -r 822a45792fdd -r e1d68407ed06 wlanutilities/wpswizard/src/cwpsactiverunner.cpp --- a/wlanutilities/wpswizard/src/cwpsactiverunner.cpp Fri Sep 03 09:37:37 2010 +0300 +++ b/wlanutilities/wpswizard/src/cwpsactiverunner.cpp Thu Sep 16 12:52:33 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 822a45792fdd -r e1d68407ed06 wlanutilities/wpswizard/src/wpswizardstepthreenumber.cpp --- a/wlanutilities/wpswizard/src/wpswizardstepthreenumber.cpp Fri Sep 03 09:37:37 2010 +0300 +++ b/wlanutilities/wpswizard/src/wpswizardstepthreenumber.cpp Thu Sep 16 12:52:33 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 822a45792fdd -r e1d68407ed06 wlanutilities/wpswizard/src/wpswizardsteptwo.cpp --- a/wlanutilities/wpswizard/src/wpswizardsteptwo.cpp Fri Sep 03 09:37:37 2010 +0300 +++ b/wlanutilities/wpswizard/src/wpswizardsteptwo.cpp Thu Sep 16 12:52:33 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) {