# HG changeset patch # User hgs # Date 1278661099 -10800 # Node ID 72ebcbb6483495f803343a99738e2d7dc7ae5062 # Parent 7b3e49e4608a5bdbad90da9e4b5726e1ff334619 201027 diff -r 7b3e49e4608a -r 72ebcbb64834 wlanutilities/cpwlansettingsplugin/src/cpwlansettingsgroupitemdata.cpp --- a/wlanutilities/cpwlansettingsplugin/src/cpwlansettingsgroupitemdata.cpp Thu Jun 24 10:49:51 2010 +0300 +++ b/wlanutilities/cpwlansettingsplugin/src/cpwlansettingsgroupitemdata.cpp Fri Jul 09 10:38:19 2010 +0300 @@ -117,49 +117,54 @@ OstTraceFunctionEntry1(CPWLANSETTINGSGROUPITEMDATA_CREATEWLANSETTINITEMS_ENTRY, this); mJoinWlanItem = new CpSettingFormItemData( - HbDataFormModelItem::ComboBoxItem, hbTrId( - "txt_occ_setlabel_join_wlan_networks"), this); + HbDataFormModelItem::ComboBoxItem, + hbTrId("txt_occ_setlabel_join_wlan_networks")); // name the object for test automation purposes mJoinWlanItem->setObjectName("switchToWlan"); QStringList joinWlanItems; - joinWlanItems.append(hbTrId( - "txt_occ_setlabel_join_wlan_networks_val_known")); + joinWlanItems.append( + hbTrId("txt_occ_setlabel_join_wlan_networks_val_known")); - joinWlanItems.append(hbTrId( - "txt_occ_setlabel_join_wlan_networks_val_manual")); + joinWlanItems.append( + hbTrId("txt_occ_setlabel_join_wlan_networks_val_manual")); mJoinWlanItem->setContentWidgetData("items", joinWlanItems); - mItemDataHelper.addConnection(mJoinWlanItem, - SIGNAL(currentIndexChanged (int)), this, - SLOT(joinWlanItemChanged (int))); + mItemDataHelper.addConnection( + mJoinWlanItem, + SIGNAL(currentIndexChanged (int)), + this, + SLOT(joinWlanItemChanged (int))); - mJoinWlanItem->setContentWidgetData("currentIndex", - mWlanSettings->joinWlanMode()); + mJoinWlanItem->setContentWidgetData( + "currentIndex", + mWlanSettings->joinWlanMode()); this->appendChild(mJoinWlanItem); mScanNetworkItem = new CpSettingFormItemData( - HbDataFormModelItem::ComboBoxItem, hbTrId( - "txt_occ_setlabel_scan_for_networks"), this); + HbDataFormModelItem::ComboBoxItem, + hbTrId("txt_occ_setlabel_scan_for_networks")); // name the object for test automation purposes mScanNetworkItem->setObjectName("scanNetworkItem"); QStringList scanNetworkItems; - scanNetworkItems.append(hbTrId( - "txt_occ_setlabel_scan_for_networks_val_automatic")); + scanNetworkItems.append( + hbTrId("txt_occ_setlabel_scan_for_networks_val_automatic")); - scanNetworkItems.append(hbTrId( - "txt_occ_setlabel_scan_for_networks_val_userdefine")); + scanNetworkItems.append( + hbTrId("txt_occ_setlabel_scan_for_networks_val_userdefine")); mScanNetworkItem->setContentWidgetData("items", scanNetworkItems); - mItemDataHelper.addConnection(mScanNetworkItem, - SIGNAL(currentIndexChanged (const QString &)), this, - SLOT(scanItemChanged (const QString &))); + mItemDataHelper.addConnection( + mScanNetworkItem, + SIGNAL(currentIndexChanged (const QString &)), + this, + SLOT(scanItemChanged (const QString &))); this->appendChild(mScanNetworkItem); @@ -173,27 +178,30 @@ } mPowerSavingItem = new CpSettingFormItemData( - HbDataFormModelItem::ComboBoxItem, hbTrId( - "txt_occ_setlabel_power_saving"), this); + HbDataFormModelItem::ComboBoxItem, + hbTrId("txt_occ_setlabel_power_saving")); // name the object for test automation purposes mPowerSavingItem->setObjectName("powerSaving"); QStringList powerSavingItems; - powerSavingItems.append(hbTrId( - "txt_occ_setlabel_power_saving_val_disabled")); + powerSavingItems.append( + hbTrId("txt_occ_setlabel_power_saving_val_disabled")); - powerSavingItems.append(hbTrId( - "txt_occ_setlabel_power_saving_val_enabled")); + powerSavingItems.append( + hbTrId("txt_occ_setlabel_power_saving_val_enabled")); mPowerSavingItem->setContentWidgetData("items", powerSavingItems); - mPowerSavingItem->setContentWidgetData("currentIndex", - mWlanSettings->isPowerSavingEnabled()); + mPowerSavingItem->setContentWidgetData( + "currentIndex", + mWlanSettings->isPowerSavingEnabled()); - mItemDataHelper.addConnection(mPowerSavingItem, - SIGNAL(currentIndexChanged (int)), this, - SLOT(powerSavingItemChanged (int))); + mItemDataHelper.addConnection( + mPowerSavingItem, + SIGNAL(currentIndexChanged (int)), + this, + SLOT(powerSavingItemChanged (int))); this->appendChild(mPowerSavingItem); @@ -209,22 +217,31 @@ OstTraceFunctionEntry1(CPWLANSETTINGSGROUPITEMDATA_CREATESCANINTERVALITEM_ENTRY, this); mUserDefinedItem = new CpSettingFormItemData( - HbDataFormModelItem::SliderItem, hbTrId( - "txt_occ_setlabel_scan_interval_minutes"), this); + HbDataFormModelItem::SliderItem, + hbTrId("txt_occ_setlabel_scan_interval_minutes")); mUserDefinedItem->setContentWidgetData("maximum", KMaximumScanInterval); mUserDefinedItem->setContentWidgetData("minimum", KMinimumScanInterval); mUserDefinedItem->setContentWidgetData("toolTipVisible", KEnableOption); mUserDefinedItem->setContentWidgetData("tracking", KEnableOption); - mItemDataHelper.addConnection(mUserDefinedItem, - SIGNAL(valueChanged (int)), this, SLOT(scanValueChanged (int))); + mItemDataHelper.addConnection( + mUserDefinedItem, + SIGNAL(valueChanged (int)), + this, + SLOT(scanValueChanged (int))); - mItemDataHelper.addConnection(mUserDefinedItem, - SIGNAL(sliderReleased ()), this, SLOT(scanSliderReleased ())); + mItemDataHelper.addConnection( + mUserDefinedItem, + SIGNAL(sliderReleased ()), + this, + SLOT(scanSliderReleased ())); - mItemDataHelper.addConnection(mUserDefinedItem, SIGNAL(sliderPressed ()), - this, SLOT(scanSliderPressed ())); + mItemDataHelper.addConnection( + mUserDefinedItem, + SIGNAL(sliderPressed ()), + this, + SLOT(scanSliderPressed ())); mScanInterval = mWlanSettings->scanInterval(); diff -r 7b3e49e4608a -r 72ebcbb64834 wlanutilities/eapwizard/src/eapwizard_p.cpp --- a/wlanutilities/eapwizard/src/eapwizard_p.cpp Thu Jun 24 10:49:51 2010 +0300 +++ b/wlanutilities/eapwizard/src/eapwizard_p.cpp Fri Jul 09 10:38:19 2010 +0300 @@ -63,7 +63,7 @@ /*! Constructor of EAP Wizard. - + @param [in] wizardHelper pointer to the helper instance. */ EapWizardPrivate::EapWizardPrivate( @@ -74,8 +74,10 @@ EapQtConfigInterface::EapBearerTypeWlan, EapQtConfigInterface::IapIdUndefined)) { + OstTraceFunctionEntry0( EAPWIZARDPRIVATE_EAPWIZARDPRIVATE_ENTRY ); Q_ASSERT(wizardHelper); createPages(); + OstTraceFunctionExit0( EAPWIZARDPRIVATE_EAPWIZARDPRIVATE_EXIT ); } /*! @@ -83,6 +85,8 @@ */ EapWizardPrivate::~EapWizardPrivate() { + OstTraceFunctionEntry0( DUP1_EAPWIZARDPRIVATE_EAPWIZARDPRIVATE_ENTRY ); + OstTraceFunctionExit0( DUP1_EAPWIZARDPRIVATE_EAPWIZARDPRIVATE_EXIT ); } /*! @@ -93,6 +97,7 @@ QString &item, QString &value) { + OstTraceFunctionEntry0( EAPWIZARDPRIVATE_SUMMARY_ENTRY ); bool ret = false; int outerType = configurations(EapWizardPrivate::OuterType).toInt(); @@ -121,77 +126,81 @@ break; } + OstTraceFunctionExit0( EAPWIZARDPRIVATE_SUMMARY_EXIT ); return ret; } /*! See EapWizard::storeSettings(). - + @return true - ok, false - failed */ bool EapWizardPrivate::storeSettings() { + OstTraceFunctionEntry0( EAPWIZARDPRIVATE_STORESETTINGS_ENTRY ); bool ret = false; EapQtPluginHandle outerType(static_cast( configurations(OuterType).toInt())); - + int iapId = mWizardHelper->configuration(WlanWizardHelper::ConfIapId).toInt(); - + if (mEapConfIf->setConfigurationReference(iapId) && storeOuterTypeSettings(outerType) && storeInnerTypeSettings(outerType)) { ret = true; } + OstTraceFunctionExit0( EAPWIZARDPRIVATE_STORESETTINGS_EXIT ); return ret; } /*! See WlanWizardPlugin::errorString(). - + Returns EAP spesific error string. */ QString EapWizardPrivate::errorString(int errorCode) { + OstTraceFunctionEntry0( EAPWIZARDPRIVATE_ERRORSTRING_ENTRY ); char* textId = NULL; int eapType = EapQtPluginHandle::PluginUndefined; - + switch (errorCode){ case KErrWlanUserRejected: textId = "txt_occ_dialog_1_auth_failed_user_cert_rej"; eapType = configurations(OuterType).toInt(); break; - + case KErrWlanUserCertificateExpired: textId = "txt_occ_dialog_1_auth_failed_user_cert_exp"; eapType = configurations(OuterType).toInt(); break; - + case KErrWlanServerCertificateExpired: textId = "txt_occ_dialog_1_authentication_failed_server_ce"; eapType = configurations(OuterType).toInt(); break; - + case KErrWlanCerficateVerifyFailed: textId = "txt_occ_dialog_1_authentication_failed_could_not"; eapType = configurations(OuterType).toInt(); break; - + case KErrWlanNoCipherSuite: textId = "txt_occ_dialog_1_authentication_failed_cipher_su"; eapType = configurations(OuterType).toInt(); break; - + case KErrWlanSimNotInstalled: textId = "txt_occ_dialog_1_authentication_failed_check_sim"; eapType = configurations(OuterType).toInt(); break; - + case KErrWlanEapFastPacStoreCorrupted: textId = "txt_occ_dialog_1_authentication_failed_reset_pac"; eapType = EapQtPluginHandle::PluginEapFast; break; - + case KErrWlanEapSimFailed: case KErrWlanEapTlsFailed: case KErrWlanEapPeapFailed: @@ -207,13 +216,13 @@ textId = "txt_occ_dialog_1_authentication_failed"; eapType = configurations(OuterType).toInt(); break; - + case KErrWlanEapMsChapv2: case KErrWlanEapGtcFailed: textId = "txt_occ_dialog_1_authentication_failed"; eapType = configurations(InnerType).toInt(); break; - + case KErrWlanNotSubscribed: case KErrWlanAccessBarred: case KErrWlanPasswordExpired: @@ -227,65 +236,69 @@ eapType = configurations(OuterType).toInt(); } break; - + default: // Return empty string break; } - + QString string; if (textId) { string = HbParameterLengthLimiter(hbTrId(textId)).arg(eapTypeToString(eapType)); } - + + OstTraceFunctionExit0( EAPWIZARDPRIVATE_ERRORSTRING_EXIT ); return string; } /*! Reader method for eap configurations. - + See ConfigurationId for further details about the data types in QVariant. - + @param [in] confId Defines what configuration is read. - + @return configuration value. */ QVariant EapWizardPrivate::configurations(ConfigurationId confId) const { + OstTraceFunctionEntry0( EAPWIZARDPRIVATE_CONFIGURATIONS_ENTRY ); Q_ASSERT(mConfigurations.contains(confId)); - + #ifdef OST_TRACE_COMPILER_IN_USE QString tmp; QDebug tmpStream(&tmp ); tmpStream << mConfigurations[confId]; TPtrC16 string(tmp.utf16(), tmp.length() ); - + OstTraceExt2( TRACE_NORMAL, EAPWIZARDPRIVATE_CONFIGURATIONS, "EapWizardPrivate::configurations;confId=%{ConfigurationId};string=%S", (TUint)confId, string ); #endif - + + OstTraceFunctionExit0( EAPWIZARDPRIVATE_CONFIGURATIONS_EXIT ); return mConfigurations[confId]; } /*! Sets EAP configuration value for given configuration identifier. See ConfigurationId for further details about the data types in QVariant. - + @param [in] confId Configuration Identifier do to be set @param [in] value Value for configuration. */ void EapWizardPrivate::setConfigurations( ConfigurationId confId, const QVariant &value) { + OstTraceFunctionEntry0( EAPWIZARDPRIVATE_SETCONFIGURATIONS_ENTRY ); #ifdef OST_TRACE_COMPILER_IN_USE QString tmp; QDebug tmpStream(&tmp ); tmpStream << value; TPtrC16 string( tmp.utf16(), tmp.length() ); - + OstTraceExt2( TRACE_NORMAL, EAPWIZARDPRIVATE_SETCONFIGURATIONS, @@ -294,6 +307,7 @@ #endif mConfigurations[confId] = value; + OstTraceFunctionExit0( EAPWIZARDPRIVATE_SETCONFIGURATIONS_EXIT ); } /*! @@ -301,79 +315,85 @@ */ EapQtConfigInterface* EapWizardPrivate::eapConfigurationInterface() const { + OstTraceFunctionEntry0( EAPWIZARDPRIVATE_EAPCONFIGURATIONINTERFACE_ENTRY ); Q_ASSERT(mEapConfIf.data()); + OstTraceFunctionExit0( EAPWIZARDPRIVATE_EAPCONFIGURATIONINTERFACE_EXIT ); return mEapConfIf.data(); } /*! Maps given EAP Qt Plugin handle into string. - + @param [in] id EapQtPluginHandle::Handle, id to be mapped to string. - + @return EAP String. */ QString EapWizardPrivate::eapTypeToString(int id) const { + OstTraceFunctionEntry0( EAPWIZARDPRIVATE_EAPTYPETOSTRING_ENTRY ); QString locId; switch (id) { case EapQtPluginHandle::PluginEapAka: locId = EapWizardUiStrings::EapAka; break; - + case EapQtPluginHandle::PluginEapFast: locId = EapWizardUiStrings::EapFast; break; - + case EapQtPluginHandle::PluginLeap: locId = EapWizardUiStrings::Leap; break; - + case EapQtPluginHandle::PluginPeap: locId = EapWizardUiStrings::Peap; break; - + case EapQtPluginHandle::PluginEapSim: locId = EapWizardUiStrings::EapSim; break; - + case EapQtPluginHandle::PluginEapTls: locId = EapWizardUiStrings::EapTls; break; - + case EapQtPluginHandle::PluginEapTtls: locId = EapWizardUiStrings::EapTtls; break; - + case EapQtPluginHandle::PluginEapMschapv2: locId = EapWizardUiStrings::EapMschapv2; break; - + case EapQtPluginHandle::PluginEapGtc: locId = EapWizardUiStrings::EapGtc; break; - + case EapQtPluginHandle::PluginPap: locId = EapWizardUiStrings::Pap; break; - + default: // Invalid enum Q_ASSERT(EapQtPluginHandle::PluginPlainMschapv2 == id); locId = EapWizardUiStrings::Mschapv2; break; } - + + OstTraceFunctionExit0( EAPWIZARDPRIVATE_EAPTYPETOSTRING_EXIT ); return locId; } /*! Accessor to WLAN Wizard Helper objects. - + @return a pointer to helper object. */ WlanWizardHelper *EapWizardPrivate::wizardHelper() const { + OstTraceFunctionEntry0( EAPWIZARDPRIVATE_WIZARDHELPER_ENTRY ); Q_ASSERT(mWizardHelper); + OstTraceFunctionExit0( EAPWIZARDPRIVATE_WIZARDHELPER_EXIT ); return mWizardHelper; } @@ -382,74 +402,78 @@ */ void EapWizardPrivate::createPages() { + OstTraceFunctionEntry0( EAPWIZARDPRIVATE_CREATEPAGES_ENTRY ); mWizardHelper->addPage( EapWizardPage::PageOuterType, new EapWizardPageOuterType(this)); - + mWizardHelper->addPage( EapWizardPage::PageCertificateCa, new EapWizardPageCertCa(this)); - + mWizardHelper->addPage( EapWizardPage::PageCertificateUser, new EapWizardPageCertUser(this)); - + mWizardHelper->addPage( EapWizardPage::PageIdentity, new EapWizardPageIdentity(this)); - + mWizardHelper->addPage( EapWizardPage::PageInnerTypeEapTtls, new EapWizardPageInnerType( this, EapQtPluginHandle::PluginEapTtls)); - + mWizardHelper->addPage( EapWizardPage::PageInnerTypePeap, new EapWizardPageInnerType( this, EapQtPluginHandle::PluginPeap)); - + mWizardHelper->addPage( EapWizardPage::PageUsernamePassword, new EapWizardPageUsernamePassword(this)); - + mWizardHelper->addPage( EapWizardPage::PageNewPacStorePassword, new EapWizardPageNewPacStore(this)); - + mWizardHelper->addPage( EapWizardPage::PagePromptPacStorePassword, new EapWizardPagePacStorePasswordConfirm(this)); + OstTraceFunctionExit0( EAPWIZARDPRIVATE_CREATEPAGES_EXIT ); } /*! Check whether selected outer type has inner method. - + @return true if inner method exists, false otherwise. */ bool EapWizardPrivate::hasInnerMethod() const { + OstTraceFunctionEntry0( EAPWIZARDPRIVATE_HASINNERMETHOD_ENTRY ); int outerType = configurations(EapWizardPrivate::OuterType).toInt(); bool ret = false; - - switch (outerType){ + + switch (outerType) { case EapQtPluginHandle::PluginEapTtls: case EapQtPluginHandle::PluginPeap: case EapQtPluginHandle::PluginEapFast: ret = true; break; } - + + OstTraceFunctionExit0( EAPWIZARDPRIVATE_HASINNERMETHOD_EXIT ); return ret; } /* Handles TLS methods (PEAP, EAP-TLS and EAP-TTLS) settings. - + Stores configurations to eapConf - + @param [in,out] eapConf configuration is written to this object. @param [in] outerType Outer EAP method */ @@ -457,6 +481,7 @@ EapQtConfig &eapConf, EapQtPluginHandle &outerType) { + OstTraceFunctionEntry0( EAPWIZARDPRIVATE_HANDLETLSMETHODSSETTINGS_ENTRY ); // Common stuff for all tls methods eapConf.setValue(EapQtConfig::UseIdentityPrivacy, false); eapConf.setValue(EapQtConfig::VerifyServerRealm, false); @@ -465,9 +490,9 @@ eapConf.setValue(EapQtConfig::Username, configurations(TunnelUsername)); eapConf.setValue(EapQtConfig::RealmAutomatic, configurations(TunnelRealmAutomatic)); eapConf.setValue(EapQtConfig::Realm, configurations(TunnelRealm)); - + QVariant certVariant = configurations(CertificateCa); - + if (certVariant.canConvert ()) { QList caCerts; caCerts.append(certVariant); @@ -476,23 +501,23 @@ } else { eapConf.setValue(EapQtConfig::AuthorityCertificateAutomatic, true); } - + // type specific configurations if (outerType == EapQtPluginHandle::PluginEapTls) { QList userCerts; userCerts.append(configurations(CertificateUser)); eapConf.setValue(EapQtConfig::ClientAuthenticationRequired, true); eapConf.setValue(EapQtConfig::UserCertificate, userCerts); - + } else if (outerType == EapQtPluginHandle::PluginPeap) { - + switch (configurations(InnerType).toInt()) { case EapQtPluginHandle::PluginEapMschapv2: // EAP-MSCHAPv2: enable v0 only eapConf.setValue(EapQtConfig::PeapVersion0Allowed, true); eapConf.setValue(EapQtConfig::PeapVersion1Allowed, false); break; - + case EapQtPluginHandle::PluginEapGtc: // EAP-GTC: enable v1 only eapConf.setValue(EapQtConfig::PeapVersion0Allowed, false); @@ -501,20 +526,22 @@ } eapConf.setValue(EapQtConfig::PeapVersion2Allowed, false); } + OstTraceFunctionExit0( EAPWIZARDPRIVATE_HANDLETLSMETHODSSETTINGS_EXIT ); } /*! Handles configurations for EAP-FAST. - + @param [in,out] eapConf EAP Configuration - + @param false in case of failure. */ bool EapWizardPrivate::handleEapFastSettings(EapQtConfig &eapConf) { + OstTraceFunctionEntry0( EAPWIZARDPRIVATE_HANDLEEAPFASTSETTINGS_ENTRY ); bool ret = true; EapQtPacStoreConfig pacStoreConf; - + eapConf.setValue(EapQtConfig::ProvisioningModeAuthenticated, false); eapConf.setValue(EapQtConfig::ProvisioningModeUnauthenticated, true); eapConf.setValue(EapQtConfig::VerifyServerRealm, false); @@ -526,60 +553,66 @@ pacStoreConf.setValue( EapQtPacStoreConfig::PacStorePassword, configurations(PacStorePassword)); - + pacStoreConf.setValue( EapQtPacStoreConfig::PacStoreSavePassword, true); - + if (!mEapConfIf->savePacStoreConfiguration(pacStoreConf)) { // no cleaning required ret = false; } break; - + default: // Do nothing break; } - + + OstTraceFunctionExit0( EAPWIZARDPRIVATE_HANDLEEAPFASTSETTINGS_EXIT ); return ret; } /*! Handles configurations for EAP-AKA and EAP-SIM. - + @param [in,out] eapConf EAP Configuration */ void EapWizardPrivate::handleEapAkaSimSettings(EapQtConfig &eapConf) { + OstTraceFunctionEntry0( EAPWIZARDPRIVATE_HANDLEEAPAKASIMSETTINGS_ENTRY ); eapConf.setValue(EapQtConfig::UsernameAutomatic, true); eapConf.setValue(EapQtConfig::RealmAutomatic, true); + OstTraceFunctionExit0( EAPWIZARDPRIVATE_HANDLEEAPAKASIMSETTINGS_EXIT ); } /*! Handles configurations for LEAP. - + @param [in,out] eapConf EAP Configuration */ void EapWizardPrivate::handleLeapSettings(EapQtConfig &eapConf) { + OstTraceFunctionEntry0( EAPWIZARDPRIVATE_HANDLELEAPSETTINGS_ENTRY ); eapConf.setValue(EapQtConfig::UsernameAutomatic, false); eapConf.setValue(EapQtConfig::Username, configurations(Username)); eapConf.setValue(EapQtConfig::PasswordPrompt, false); eapConf.setValue(EapQtConfig::Password, configurations(Password)); + OstTraceFunctionExit0( EAPWIZARDPRIVATE_HANDLELEAPSETTINGS_EXIT ); } /*! Store outer type settings. - + @param outerType reference to outertype - + @return false in case of failure. */ bool EapWizardPrivate::storeOuterTypeSettings(EapQtPluginHandle &outerType) { + OstTraceFunctionEntry0( EAPWIZARDPRIVATE_STOREOUTERTYPESETTINGS_ENTRY ); EapQtConfig eapConf; - + // 1. Store outer type settings switch (outerType.pluginId()) { case EapQtPluginHandle::PluginEapTtls: @@ -587,65 +620,70 @@ case EapQtPluginHandle::PluginEapTls: handleTlsMethodsSettings(eapConf, outerType); break; - + case EapQtPluginHandle::PluginEapFast: if (!handleEapFastSettings(eapConf)) { + OstTraceFunctionExit0( EAPWIZARDPRIVATE_STOREOUTERTYPESETTINGS_EXIT ); return false; } break; - + case EapQtPluginHandle::PluginEapAka: case EapQtPluginHandle::PluginEapSim: handleEapAkaSimSettings(eapConf); break; - + default: Q_ASSERT(outerType == EapQtPluginHandle::PluginLeap); handleLeapSettings(eapConf); break; } - + if (hasInnerMethod()) { EapQtPluginHandle inner = static_cast( configurations(InnerType).toInt()); - + QList innerType; innerType.append(qVariantFromValue(inner)); eapConf.setValue(EapQtConfig::InnerType, innerType); } - + // store outer type configurations if (!mEapConfIf->saveConfiguration(outerType, eapConf)){ mEapConfIf->deleteConfiguration(); + OstTraceFunctionExit0( DUP1_EAPWIZARDPRIVATE_STOREOUTERTYPESETTINGS_EXIT ); return false; } - + QList selectedOuterTypes; selectedOuterTypes.append(outerType); if (!mEapConfIf->setSelectedOuterTypes(selectedOuterTypes)){ mEapConfIf->deleteConfiguration(); + OstTraceFunctionExit0( DUP2_EAPWIZARDPRIVATE_STOREOUTERTYPESETTINGS_EXIT ); return false; } - + + OstTraceFunctionExit0( DUP3_EAPWIZARDPRIVATE_STOREOUTERTYPESETTINGS_EXIT ); return true; } /*! Store inner type settings if exists. - + @param outerType reference to outertype - + @return false in case of failure. */ bool EapWizardPrivate::storeInnerTypeSettings(EapQtPluginHandle &outerType) { + OstTraceFunctionEntry0( EAPWIZARDPRIVATE_STOREINNERTYPESETTINGS_ENTRY ); bool ret = true; - + if (hasInnerMethod()) { EapQtPluginHandle inner = static_cast( configurations(InnerType).toInt()); - + // All inner methods supported by wizard use password / username. EapQtConfig eapConfInner; eapConfInner.setValue(EapQtConfig::OuterType, qVariantFromValue(outerType)); @@ -653,11 +691,12 @@ eapConfInner.setValue(EapQtConfig::Username, configurations(Username)); eapConfInner.setValue(EapQtConfig::PasswordPrompt, false); eapConfInner.setValue(EapQtConfig::Password, configurations(Password)); - + if (!mEapConfIf->saveConfiguration(inner, eapConfInner)){ mEapConfIf->deleteConfiguration(); ret = false; } } + OstTraceFunctionExit0( EAPWIZARDPRIVATE_STOREINNERTYPESETTINGS_EXIT ); return ret; } diff -r 7b3e49e4608a -r 72ebcbb64834 wlanutilities/eapwizard/src/eapwizardpage.cpp --- a/wlanutilities/eapwizard/src/eapwizardpage.cpp Thu Jun 24 10:49:51 2010 +0300 +++ b/wlanutilities/eapwizard/src/eapwizardpage.cpp Fri Jul 09 10:38:19 2010 +0300 @@ -24,6 +24,11 @@ // User includes #include "eapwizardpage.h" #include "eapwizard_p.h" +#include "OstTraceDefinitions.h" +#ifdef OST_TRACE_COMPILER_IN_USE +#include "eapwizardpageTraces.h" +#endif + /*! \class EapWizardPage @@ -51,13 +56,15 @@ /*! Constructor. - + @param [in] parent Pointer to EAP Wizard private implementation. */ EapWizardPage::EapWizardPage(EapWizardPrivate* parent) : QObject(parent), mWizard(parent) { + OstTraceFunctionEntry0( EAPWIZARDPAGE_EAPWIZARDPAGE_ENTRY ); + OstTraceFunctionExit0( EAPWIZARDPAGE_EAPWIZARDPAGE_EXIT ); } /*! @@ -65,7 +72,9 @@ */ EapWizardPage::~EapWizardPage() { + OstTraceFunctionEntry0( DUP1_EAPWIZARDPAGE_EAPWIZARDPAGE_ENTRY ); mWizard = NULL; + OstTraceFunctionExit0( DUP1_EAPWIZARDPAGE_EAPWIZARDPAGE_EXIT ); } /*! @@ -73,13 +82,15 @@ */ int EapWizardPage::nextId(bool &removeFromStack) const { + OstTraceFunctionEntry0( EAPWIZARDPAGE_NEXTID_ENTRY ); removeFromStack = false; + OstTraceFunctionExit0( EAPWIZARDPAGE_NEXTID_EXIT ); return nextId(); } /*! Loads requested section from given docml file. - + @param [in] loader Document loader for docml @param [in] orientation Orientation to be loaded @param [in] filename the name of docml filename @@ -93,8 +104,9 @@ const QString &portraitSection, const QString &landscapeSection) const { + OstTraceFunctionEntry0( EAPWIZARDPAGE_LOADDOCMLSECTION_ENTRY ); bool ok; - + // Then load the orientation specific section if (orientation == Qt::Horizontal) { loader->load(filename, landscapeSection, &ok); @@ -104,4 +116,5 @@ loader->load(filename, portraitSection, &ok); Q_ASSERT(ok); } + OstTraceFunctionExit0( EAPWIZARDPAGE_LOADDOCMLSECTION_EXIT ); } diff -r 7b3e49e4608a -r 72ebcbb64834 wlanutilities/eapwizard/src/eapwizardpagecertca.cpp --- a/wlanutilities/eapwizard/src/eapwizardpagecertca.cpp Thu Jun 24 10:49:51 2010 +0300 +++ b/wlanutilities/eapwizard/src/eapwizardpagecertca.cpp Fri Jul 09 10:38:19 2010 +0300 @@ -31,6 +31,11 @@ #include "wlanwizardhelper.h" #include "eapwizard_p.h" #include "eapwizardpagecertca.h" +#include "OstTraceDefinitions.h" +#ifdef OST_TRACE_COMPILER_IN_USE +#include "eapwizardpagecertcaTraces.h" +#endif + /*! \class EapWizardPageCertCa @@ -48,7 +53,7 @@ /*! Constructor. - + @param [in] parent Pointer to EAP Wizard private implementation. */ EapWizardPageCertCa::EapWizardPageCertCa(EapWizardPrivate* parent) : @@ -58,6 +63,8 @@ mTitle(NULL), mCertList(NULL) { + OstTraceFunctionEntry0( EAPWIZARDPAGECERTCA_EAPWIZARDPAGECERTCA_ENTRY ); + OstTraceFunctionExit0( EAPWIZARDPAGECERTCA_EAPWIZARDPAGECERTCA_EXIT ); } /*! @@ -65,6 +72,8 @@ */ EapWizardPageCertCa::~EapWizardPageCertCa() { + OstTraceFunctionEntry0( DUP1_EAPWIZARDPAGECERTCA_EAPWIZARDPAGECERTCA_ENTRY ); + OstTraceFunctionExit0( DUP1_EAPWIZARDPAGECERTCA_EAPWIZARDPAGECERTCA_EXIT ); } /*! @@ -72,16 +81,17 @@ */ HbWidget* EapWizardPageCertCa::initializePage() { + OstTraceFunctionEntry0( EAPWIZARDPAGECERTCA_INITIALIZEPAGE_ENTRY ); if (!mWidget) { mDocumentLoader.reset( new HbDocumentLoader( mWizard->wizardHelper()->mainWindow()) ); - + bool ok; mDocumentLoader->load(":/docml/occ_eap_wizard_01_02_04.docml", &ok); Q_ASSERT(ok); - + loadDocmlSection(mWizard->wizardHelper()->mainWindow()->orientation()); - + mWidget = qobject_cast ( mDocumentLoader->findWidget("occ_eap_wizard_01")); Q_ASSERT(mWidget); @@ -89,13 +99,13 @@ mCertList = qobject_cast ( mDocumentLoader->findWidget("list")); Q_ASSERT(mCertList); - + mTitle = qobject_cast (mDocumentLoader->findWidget("title")); Q_ASSERT(mTitle); - + mTitle->setPlainText( hbTrId("txt_occ_title_select_authority_certificate")); - + ok = connect( mWizard->wizardHelper()->mainWindow(), SIGNAL(orientationChanged(Qt::Orientation)), @@ -103,7 +113,7 @@ SLOT(loadDocmlSection(Qt::Orientation))); Q_ASSERT(ok); } - + EapQtConfigInterface* confIf = mWizard->eapConfigurationInterface(); // ignore return value confIf->updateCertificates(); @@ -112,15 +122,15 @@ QStringList list; list << hbTrId("txt_occ_setlabel_val_select_automatically"); - for (int i = 0; i < mCerts.count(); ++i) { - // TODO: workaround for BBHA-863EJN - // graphics memory runs out for long lists and items - QString tmp(mCerts.at(i).value( - EapQtCertificateInfo::CertificateLabel).toString()); - tmp.truncate(10); - list << tmp; + for (int i = 0; i < mCerts.count(); ++i) { + // TODO: workaround for BBHA-863EJN + // graphics memory runs out for long lists and items + QString tmp(mCerts.at(i).value( + EapQtCertificateInfo::CertificateLabel).toString()); + tmp.truncate(10); + list << tmp; } - + // If certificate list has been changed update the content otherwise do not // change it if (list != mCertList->items()) { @@ -128,33 +138,37 @@ // Automatic is selected by default mCertList->setSelected(IndexForAutomatic); } + OstTraceFunctionExit0( EAPWIZARDPAGECERTCA_INITIALIZEPAGE_EXIT ); return mWidget; } /*! Loads the required orientation of docml. - + @param [in] orientation Orientation to be loaded. */ void EapWizardPageCertCa::loadDocmlSection(Qt::Orientation orientation) { + OstTraceFunctionEntry0( EAPWIZARDPAGECERTCA_LOADDOCMLSECTION_ENTRY ); EapWizardPage::loadDocmlSection( mDocumentLoader.data(), orientation, ":/docml/occ_eap_wizard_01_02_04.docml", "portrait_section", "landscape_section"); + OstTraceFunctionExit0( EAPWIZARDPAGECERTCA_LOADDOCMLSECTION_EXIT ); } /*! See WlanWizardPage. - + @return next wizard page: - EapWizardPage::PageCertificateUser: For EAP-TLS - EapWizardPage::PageIdentity: For EAP-TTLS and PEAP */ int EapWizardPageCertCa::nextId() const { + OstTraceFunctionEntry0( EAPWIZARDPAGECERTCA_NEXTID_ENTRY ); int id = WlanWizardPage::PageNone; bool ok; int type = mWizard->configurations(EapWizardPrivate::OuterType).toInt(&ok); @@ -177,5 +191,6 @@ selected - AmountOfNonCertItems))); } + OstTraceFunctionExit0( EAPWIZARDPAGECERTCA_NEXTID_EXIT ); return id; } diff -r 7b3e49e4608a -r 72ebcbb64834 wlanutilities/eapwizard/src/eapwizardpagecertuser.cpp --- a/wlanutilities/eapwizard/src/eapwizardpagecertuser.cpp Thu Jun 24 10:49:51 2010 +0300 +++ b/wlanutilities/eapwizard/src/eapwizardpagecertuser.cpp Fri Jul 09 10:38:19 2010 +0300 @@ -30,6 +30,11 @@ #include "wlanwizardhelper.h" #include "eapwizardpagecertuser.h" #include "eapwizard_p.h" +#include "OstTraceDefinitions.h" +#ifdef OST_TRACE_COMPILER_IN_USE +#include "eapwizardpagecertuserTraces.h" +#endif + /*! \class EapWizardPageCertUser @@ -47,7 +52,7 @@ /*! Constructor. - + @param [in] parent Pointer to EAP Wizard private implementation. */ @@ -59,6 +64,8 @@ mDocumentLoader(NULL), mValid(false) { + OstTraceFunctionEntry0( EAPWIZARDPAGECERTUSER_EAPWIZARDPAGECERTUSER_ENTRY ); + OstTraceFunctionExit0( EAPWIZARDPAGECERTUSER_EAPWIZARDPAGECERTUSER_EXIT ); } /*! @@ -66,6 +73,8 @@ */ EapWizardPageCertUser::~EapWizardPageCertUser() { + OstTraceFunctionEntry0( DUP1_EAPWIZARDPAGECERTUSER_EAPWIZARDPAGECERTUSER_ENTRY ); + OstTraceFunctionExit0( DUP1_EAPWIZARDPAGECERTUSER_EAPWIZARDPAGECERTUSER_EXIT ); } /*! @@ -73,13 +82,14 @@ */ HbWidget* EapWizardPageCertUser::initializePage() { + OstTraceFunctionEntry0( EAPWIZARDPAGECERTUSER_INITIALIZEPAGE_ENTRY ); if (!mWidget) { bool ok; mDocumentLoader.reset(new HbDocumentLoader(mWizard->wizardHelper()->mainWindow())); mDocumentLoader->load(":/docml/occ_eap_wizard_06.docml", &ok); Q_ASSERT(ok); loadDocmlSection(mWizard->wizardHelper()->mainWindow()->orientation()); - + mWidget = qobject_cast (mDocumentLoader->findWidget("occ_eap_wizard_06")); Q_ASSERT(mWidget); @@ -97,7 +107,7 @@ this, SLOT(loadDocmlSection(Qt::Orientation))); Q_ASSERT(ok); - + ok = connect( mCertList, SIGNAL(itemSelected(int)), this, SLOT(itemSelected(int))); @@ -123,7 +133,7 @@ mCertList->setItems(list); mErrorLabel->setVisible(false); mCertList->setVisible(true); - + if (list.count() == 1) { mValid = true; mCertList->setSelected(0); @@ -131,60 +141,69 @@ mValid = false; } } + OstTraceFunctionExit0( EAPWIZARDPAGECERTUSER_INITIALIZEPAGE_EXIT ); return mWidget; } /*! Loads the required orientation of docml. - + @param [in] orientation Orientation to be loaded. */ void EapWizardPageCertUser::loadDocmlSection(Qt::Orientation orientation) { + OstTraceFunctionEntry0( EAPWIZARDPAGECERTUSER_LOADDOCMLSECTION_ENTRY ); EapWizardPage::loadDocmlSection( mDocumentLoader.data(), orientation, ":/docml/occ_eap_wizard_06.docml", "portrait_section", "landscape_section"); + OstTraceFunctionExit0( EAPWIZARDPAGECERTUSER_LOADDOCMLSECTION_EXIT ); } /*! See WlanWizardPage. - + @return next wizard page: EapWizardPage::PageIdentity */ int EapWizardPageCertUser::nextId() const { + OstTraceFunctionEntry0( EAPWIZARDPAGECERTUSER_NEXTID_ENTRY ); mWizard->setConfigurations( EapWizardPrivate::CertificateUser, qVariantFromValue( mCerts.at(mCertList->selected()))); + OstTraceFunctionExit0( EAPWIZARDPAGECERTUSER_NEXTID_EXIT ); return EapWizardPage::PageIdentity; } /*! See WlanWizardPage. - + Validates the content of the page. - + @return true if content is valid. */ bool EapWizardPageCertUser::showPage() { + OstTraceFunctionEntry0( EAPWIZARDPAGECERTUSER_SHOWPAGE_ENTRY ); + OstTraceFunctionExit0( EAPWIZARDPAGECERTUSER_SHOWPAGE_EXIT ); return mValid; } /*! Handler for itemsSelected() signal from HbRadioButtonList. - + @param [in] index NOT USED */ void EapWizardPageCertUser::itemSelected(int index) { + OstTraceFunctionEntry0( EAPWIZARDPAGECERTUSER_ITEMSELECTED_ENTRY ); Q_UNUSED(index); mValid = true; mWizard->wizardHelper()->enableNextButton(mValid); + OstTraceFunctionExit0( EAPWIZARDPAGECERTUSER_ITEMSELECTED_EXIT ); } diff -r 7b3e49e4608a -r 72ebcbb64834 wlanutilities/eapwizard/src/eapwizardpageidentity.cpp --- a/wlanutilities/eapwizard/src/eapwizardpageidentity.cpp Thu Jun 24 10:49:51 2010 +0300 +++ b/wlanutilities/eapwizard/src/eapwizardpageidentity.cpp Fri Jul 09 10:38:19 2010 +0300 @@ -35,6 +35,11 @@ #include "wlanwizardhelper.h" #include "eapwizardpageidentity.h" #include "eapwizard_p.h" +#include "OstTraceDefinitions.h" +#ifdef OST_TRACE_COMPILER_IN_USE +#include "eapwizardpageidentityTraces.h" +#endif + /*! \class EapWizardPageIdentity @@ -52,7 +57,7 @@ /*! Constructor. - + @param [in] parent Pointer to EAP Wizard private implementation. */ EapWizardPageIdentity::EapWizardPageIdentity(EapWizardPrivate* parent) : @@ -68,6 +73,8 @@ mLabelRealm(NULL), mLabelUsername(NULL) { + OstTraceFunctionEntry0( EAPWIZARDPAGEIDENTITY_EAPWIZARDPAGEIDENTITY_ENTRY ); + OstTraceFunctionExit0( EAPWIZARDPAGEIDENTITY_EAPWIZARDPAGEIDENTITY_EXIT ); } /*! @@ -75,6 +82,8 @@ */ EapWizardPageIdentity::~EapWizardPageIdentity() { + OstTraceFunctionEntry0( DUP1_EAPWIZARDPAGEIDENTITY_EAPWIZARDPAGEIDENTITY_ENTRY ); + OstTraceFunctionExit0( DUP1_EAPWIZARDPAGEIDENTITY_EAPWIZARDPAGEIDENTITY_EXIT ); } /*! @@ -82,6 +91,7 @@ */ HbWidget* EapWizardPageIdentity::initializePage() { + OstTraceFunctionEntry0( EAPWIZARDPAGEIDENTITY_INITIALIZEPAGE_ENTRY ); if (!mWidget) { bool ok = true; mDocumentLoader.reset( @@ -90,7 +100,7 @@ Q_ASSERT(ok); loadDocmlSection(mWizard->wizardHelper()->mainWindow()->orientation()); - + mWidget = qobject_cast (mDocumentLoader->findWidget("occ_eap_wizard_03")); Q_ASSERT(mWidget); @@ -105,35 +115,35 @@ mCheckRealm = qobject_cast (mDocumentLoader->findWidget("setlabel_54_val")); Q_ASSERT(mCheckRealm); - + mLabelUsername = qobject_cast (mDocumentLoader->findWidget("setlabel_53")); Q_ASSERT(mLabelUsername); - + mLabelRealm = qobject_cast (mDocumentLoader->findWidget("setlabel_54")); Q_ASSERT(mLabelRealm); - + ok = connect( mWizard->wizardHelper()->mainWindow(), SIGNAL(orientationChanged(Qt::Orientation)), this, SLOT(loadDocmlSection(Qt::Orientation))); Q_ASSERT(ok); - + ok = connect( mEditUsername, SIGNAL(textChanged(const QString &)), this, SLOT(textChanged(const QString &))); Q_ASSERT(ok); - + ok = connect( mEditRealm, SIGNAL(textChanged(const QString &)), this, SLOT(textChanged(const QString &))); Q_ASSERT(ok); - + ok = connect( mCheckUsername, SIGNAL(stateChanged(int)), this, SLOT(stateChanged(int))); Q_ASSERT(ok); - + ok = connect( mCheckRealm, SIGNAL(stateChanged(int)), this, SLOT(stateChanged(int))); @@ -147,7 +157,7 @@ HbParameterLengthLimiter( hbTrId("txt_occ_setlabel_user_name_for_1")).arg( mWizard->eapTypeToString(plugin.pluginId()))); - + // Configure editors properties mValidatorUsername.reset( mWizard->eapConfigurationInterface()->validatorEap( @@ -163,27 +173,30 @@ Q_ASSERT(mValidatorRealm.data()); mValidatorRealm->updateEditor(mEditRealm); + OstTraceFunctionExit0( EAPWIZARDPAGEIDENTITY_INITIALIZEPAGE_EXIT ); return mWidget; } /*! Loads the required orientation of docml. - + @param [in] orientation Orientation to be loaded. */ void EapWizardPageIdentity::loadDocmlSection(Qt::Orientation orientation) { + OstTraceFunctionEntry0( EAPWIZARDPAGEIDENTITY_LOADDOCMLSECTION_ENTRY ); EapWizardPage::loadDocmlSection( mDocumentLoader.data(), orientation, ":/docml/occ_eap_wizard_03.docml", "portrait_section", "landscape_section"); + OstTraceFunctionExit0( EAPWIZARDPAGEIDENTITY_LOADDOCMLSECTION_EXIT ); } /*! See WlanWizardPage. - + @return next wizard page: - WlanWizardPage::PageProcessSettings: For EAP-TLS - EapWizardPage::PageInnerTypeEapTtls: For EAP-TTLS @@ -191,6 +204,7 @@ */ int EapWizardPageIdentity::nextId() const { + OstTraceFunctionEntry0( EAPWIZARDPAGEIDENTITY_NEXTID_ENTRY ); int id = WlanWizardPage::PageNone; bool ok; int type = mWizard->configurations(EapWizardPrivate::OuterType).toInt(&ok); @@ -200,11 +214,11 @@ case EapQtPluginHandle::PluginEapTls: id = WlanWizardPage::PageProcessSettings; break; - + case EapQtPluginHandle::PluginEapTtls: id = EapWizardPage::PageInnerTypeEapTtls; break; - + case EapQtPluginHandle::PluginPeap: id = EapWizardPage::PageInnerTypePeap; break; @@ -212,27 +226,29 @@ mWizard->setConfigurations(EapWizardPrivate::TunnelUsernameAutomatic, mCheckUsername->isChecked()); - + mWizard->setConfigurations( EapWizardPrivate::TunnelUsername, mEditUsername->text()); - + mWizard->setConfigurations( EapWizardPrivate::TunnelRealmAutomatic, mCheckRealm->isChecked()); - + mWizard->setConfigurations(EapWizardPrivate::TunnelRealm, mEditRealm->text()); + OstTraceFunctionExit0( EAPWIZARDPAGEIDENTITY_NEXTID_EXIT ); return id; } /*! See WlanWizardPage. - + Validates the content of the page. - + @return true if content is valid. */ bool EapWizardPageIdentity::showPage() { + OstTraceFunctionEntry0( EAPWIZARDPAGEIDENTITY_SHOWPAGE_ENTRY ); bool valid = false; if (validateGroup(mEditUsername, mCheckUsername, mValidatorUsername.data()) && @@ -240,42 +256,47 @@ valid = true; } + OstTraceFunctionExit0( EAPWIZARDPAGEIDENTITY_SHOWPAGE_EXIT ); return valid; } /*! Slot for textChanged() signal from HbLineEdit. - + @param [in] text NOT USED. */ void EapWizardPageIdentity::textChanged(const QString & text) { + OstTraceFunctionEntry0( EAPWIZARDPAGEIDENTITY_TEXTCHANGED_ENTRY ); Q_UNUSED(text); mWizard->wizardHelper()->enableNextButton(showPage()); + OstTraceFunctionExit0( EAPWIZARDPAGEIDENTITY_TEXTCHANGED_EXIT ); } /*! Slot for stateChanged() signal from HbCheckBox. - + @param [in] state NOT USED. */ void EapWizardPageIdentity::stateChanged(int state ) { + OstTraceFunctionEntry0( EAPWIZARDPAGEIDENTITY_STATECHANGED_ENTRY ); Q_UNUSED(state); mEditUsername->setEnabled(!mCheckUsername->isChecked()); mEditRealm->setEnabled(!mCheckRealm->isChecked()); mWizard->wizardHelper()->enableNextButton(showPage()); + OstTraceFunctionExit0( EAPWIZARDPAGEIDENTITY_STATECHANGED_EXIT ); } /*! Validates the settings group, that is line edit and checkbox using given validator. - + @param [in] edit pointer to line edit to which content must be validated @param [in] checkBox pointer to checkbox @param [in] validator pointer to validator which is used to validate the content of the line editor. - + @return true if validation is ok, false otherwise. */ bool EapWizardPageIdentity::validateGroup( @@ -283,11 +304,13 @@ HbCheckBox *checkBox, EapQtValidator *validator) const { + OstTraceFunctionEntry0( EAPWIZARDPAGEIDENTITY_VALIDATEGROUP_ENTRY ); bool status = false; if (checkBox->isChecked() || checkBox->isChecked() == false && EapQtValidator::StatusOk == validator->validate(edit->text())) { status = true; } + OstTraceFunctionExit0( EAPWIZARDPAGEIDENTITY_VALIDATEGROUP_EXIT ); return status; } diff -r 7b3e49e4608a -r 72ebcbb64834 wlanutilities/eapwizard/src/eapwizardpageinnertype.cpp --- a/wlanutilities/eapwizard/src/eapwizardpageinnertype.cpp Thu Jun 24 10:49:51 2010 +0300 +++ b/wlanutilities/eapwizard/src/eapwizardpageinnertype.cpp Fri Jul 09 10:38:19 2010 +0300 @@ -31,6 +31,11 @@ #include "wlanwizardhelper.h" #include "eapwizardpageinnertype.h" #include "eapwizard_p.h" +#include "OstTraceDefinitions.h" +#ifdef OST_TRACE_COMPILER_IN_USE +#include "eapwizardpageinnertypeTraces.h" +#endif + /*! @@ -49,7 +54,7 @@ /*! Constructor. - + @param [in] parent Pointer to EAP Wizard private implementation. @param [in] outerType Identifies the outer type: Peap or EapTtls */ @@ -63,6 +68,8 @@ mOuterType(outerType), mValid(false) { + OstTraceFunctionEntry0( EAPWIZARDPAGEINNERTYPE_EAPWIZARDPAGEINNERTYPE_ENTRY ); + OstTraceFunctionExit0( EAPWIZARDPAGEINNERTYPE_EAPWIZARDPAGEINNERTYPE_EXIT ); } /*! @@ -70,6 +77,8 @@ */ EapWizardPageInnerType::~EapWizardPageInnerType() { + OstTraceFunctionEntry0( DUP1_EAPWIZARDPAGEINNERTYPE_EAPWIZARDPAGEINNERTYPE_ENTRY ); + OstTraceFunctionExit0( DUP1_EAPWIZARDPAGEINNERTYPE_EAPWIZARDPAGEINNERTYPE_EXIT ); } /*! @@ -77,6 +86,7 @@ */ HbWidget* EapWizardPageInnerType::initializePage() { + OstTraceFunctionEntry0( EAPWIZARDPAGEINNERTYPE_INITIALIZEPAGE_ENTRY ); if (!mWidget) { bool ok; mDocumentLoader.reset( @@ -85,7 +95,7 @@ Q_ASSERT(ok); loadDocmlSection(mWizard->wizardHelper()->mainWindow()->orientation()); - + mWidget = qobject_cast (mDocumentLoader->findWidget("occ_eap_wizard_01")); Q_ASSERT(mWidget); @@ -94,20 +104,20 @@ mRadio = qobject_cast (mDocumentLoader->findWidget("list")); Q_ASSERT(mRadio); - + ok = connect( mWizard->wizardHelper()->mainWindow(), SIGNAL(orientationChanged(Qt::Orientation)), this, SLOT(loadDocmlSection(Qt::Orientation))); Q_ASSERT(ok); - + QStringList list; switch (mOuterType){ case EapQtPluginHandle::PluginPeap: appendToList(list, EapQtPluginHandle::PluginEapMschapv2); break; - + default: Q_ASSERT(mOuterType == EapQtPluginHandle::PluginEapTtls); appendToList(list, EapQtPluginHandle::PluginPlainMschapv2); @@ -116,7 +126,7 @@ } appendToList(list, EapQtPluginHandle::PluginEapGtc); mRadio->setItems(list); - + ok = connect(mRadio, SIGNAL(itemSelected(int)), this, SLOT(itemSelected(int))); Q_ASSERT(ok); } @@ -128,65 +138,74 @@ mWizard->configurations( EapWizardPrivate::OuterType).toInt()))); + OstTraceFunctionExit0( EAPWIZARDPAGEINNERTYPE_INITIALIZEPAGE_EXIT ); return mWidget; } /*! Loads the required orientation of docml. - + @param [in] orientation Orientation to be loaded. */ void EapWizardPageInnerType::loadDocmlSection(Qt::Orientation orientation) { + OstTraceFunctionEntry0( EAPWIZARDPAGEINNERTYPE_LOADDOCMLSECTION_ENTRY ); EapWizardPage::loadDocmlSection( mDocumentLoader.data(), orientation, ":/docml/occ_eap_wizard_01_02_04.docml", "portrait_section", "landscape_section"); + OstTraceFunctionExit0( EAPWIZARDPAGEINNERTYPE_LOADDOCMLSECTION_EXIT ); } /*! See WlanWizardPage. - + @return next wizard page: EapWizardPage::PageUsernamePassword */ int EapWizardPageInnerType::nextId() const { + OstTraceFunctionEntry0( EAPWIZARDPAGEINNERTYPE_NEXTID_ENTRY ); mWizard->setConfigurations( EapWizardPrivate::InnerType, mEapTypes.at(mRadio->selected())); - + + OstTraceFunctionExit0( EAPWIZARDPAGEINNERTYPE_NEXTID_EXIT ); return EapWizardPage::PageUsernamePassword; } /*! See WlanWizardPage. - + Validates the content of the page. - + @return true if content is valid. */ bool EapWizardPageInnerType::showPage() { + OstTraceFunctionEntry0( EAPWIZARDPAGEINNERTYPE_SHOWPAGE_ENTRY ); + OstTraceFunctionExit0( EAPWIZARDPAGEINNERTYPE_SHOWPAGE_EXIT ); return mValid; } /*! Handler for itemsSelected() signal from HbRadioButtonList. - + @param [in] index NOT USED */ void EapWizardPageInnerType::itemSelected(int index ) { + OstTraceFunctionEntry0( EAPWIZARDPAGEINNERTYPE_ITEMSELECTED_ENTRY ); Q_UNUSED(index); mValid = true; mWizard->wizardHelper()->enableNextButton(mValid); + OstTraceFunctionExit0( EAPWIZARDPAGEINNERTYPE_ITEMSELECTED_EXIT ); } /*! Appends given method to radiobutton list if plugin (method) is supported - + @param [in,out] items the content of radiobutton list @param [in] pluginHandle EAP Type plugin handle to be added. */ @@ -194,9 +213,11 @@ QStringList &items, EapQtPluginHandle::Plugin innerType) { + OstTraceFunctionEntry0( EAPWIZARDPAGEINNERTYPE_APPENDTOLIST_ENTRY ); if (mWizard->eapConfigurationInterface()->isSupportedInnerType( static_cast(mOuterType), innerType)) { items << mWizard->eapTypeToString(innerType); mEapTypes.append(innerType); } + OstTraceFunctionExit0( EAPWIZARDPAGEINNERTYPE_APPENDTOLIST_EXIT ); } diff -r 7b3e49e4608a -r 72ebcbb64834 wlanutilities/eapwizard/src/eapwizardpagenewpacstore.cpp --- a/wlanutilities/eapwizard/src/eapwizardpagenewpacstore.cpp Thu Jun 24 10:49:51 2010 +0300 +++ b/wlanutilities/eapwizard/src/eapwizardpagenewpacstore.cpp Fri Jul 09 10:38:19 2010 +0300 @@ -31,6 +31,11 @@ #include "wlanwizardhelper.h" #include "eapwizardpagenewpacstore.h" #include "eapwizard_p.h" +#include "OstTraceDefinitions.h" +#ifdef OST_TRACE_COMPILER_IN_USE +#include "eapwizardpagenewpacstoreTraces.h" +#endif + /*! \class EapWizardPageNewPacStore @@ -62,6 +67,8 @@ mTitlePasswordNew(NULL), mTitlePasswordConfirm(NULL) { + OstTraceFunctionEntry0( EAPWIZARDPAGENEWPACSTORE_EAPWIZARDPAGENEWPACSTORE_ENTRY ); + OstTraceFunctionExit0( EAPWIZARDPAGENEWPACSTORE_EAPWIZARDPAGENEWPACSTORE_EXIT ); } /*! @@ -69,6 +76,8 @@ */ EapWizardPageNewPacStore::~EapWizardPageNewPacStore() { + OstTraceFunctionEntry0( DUP1_EAPWIZARDPAGENEWPACSTORE_EAPWIZARDPAGENEWPACSTORE_ENTRY ); + OstTraceFunctionExit0( DUP1_EAPWIZARDPAGENEWPACSTORE_EAPWIZARDPAGENEWPACSTORE_EXIT ); } /*! @@ -76,6 +85,7 @@ */ HbWidget* EapWizardPageNewPacStore::initializePage() { + OstTraceFunctionEntry0( EAPWIZARDPAGENEWPACSTORE_INITIALIZEPAGE_ENTRY ); if (!mWidget) { bool ok; mDocumentLoader.reset( @@ -129,6 +139,7 @@ this, SLOT(textChanged(const QString &))); Q_ASSERT(ok); } + OstTraceFunctionExit0( EAPWIZARDPAGENEWPACSTORE_INITIALIZEPAGE_EXIT ); return mWidget; } @@ -139,12 +150,14 @@ */ void EapWizardPageNewPacStore::loadDocmlSection(Qt::Orientation orientation) { + OstTraceFunctionEntry0( EAPWIZARDPAGENEWPACSTORE_LOADDOCMLSECTION_ENTRY ); EapWizardPage::loadDocmlSection( mDocumentLoader.data(), orientation, ":/docml/occ_eap_wizard_05_07.docml", "portrait_section", "landscape_section"); + OstTraceFunctionExit0( EAPWIZARDPAGENEWPACSTORE_LOADDOCMLSECTION_EXIT ); } /*! @@ -156,11 +169,13 @@ */ bool EapWizardPageNewPacStore::showPage() { + OstTraceFunctionEntry0( EAPWIZARDPAGENEWPACSTORE_SHOWPAGE_ENTRY ); bool valid = false; if (mValidator->validate(mEditPasswordNew->text()) == EapQtValidator::StatusOk && mEditPasswordNew->text() == mEditPasswordConfirm->text()) { valid = true; } + OstTraceFunctionExit0( EAPWIZARDPAGENEWPACSTORE_SHOWPAGE_EXIT ); return valid; } @@ -171,7 +186,9 @@ */ int EapWizardPageNewPacStore::nextId() const { + OstTraceFunctionEntry0( EAPWIZARDPAGENEWPACSTORE_NEXTID_ENTRY ); mWizard->setConfigurations(EapWizardPrivate::PacStorePassword, mEditPasswordNew->text()); + OstTraceFunctionExit0( EAPWIZARDPAGENEWPACSTORE_NEXTID_EXIT ); return EapWizardPage::PageUsernamePassword; } @@ -182,6 +199,8 @@ */ void EapWizardPageNewPacStore::textChanged(const QString &text) { + OstTraceFunctionEntry0( EAPWIZARDPAGENEWPACSTORE_TEXTCHANGED_ENTRY ); Q_UNUSED(text); mWizard->wizardHelper()->enableNextButton(showPage()); + OstTraceFunctionExit0( EAPWIZARDPAGENEWPACSTORE_TEXTCHANGED_EXIT ); } diff -r 7b3e49e4608a -r 72ebcbb64834 wlanutilities/eapwizard/src/eapwizardpageoutertype.cpp --- a/wlanutilities/eapwizard/src/eapwizardpageoutertype.cpp Thu Jun 24 10:49:51 2010 +0300 +++ b/wlanutilities/eapwizard/src/eapwizardpageoutertype.cpp Fri Jul 09 10:38:19 2010 +0300 @@ -32,6 +32,11 @@ #include "wlanwizardhelper.h" #include "eapwizard_p.h" #include "eapwizardpageoutertype.h" +#include "OstTraceDefinitions.h" +#ifdef OST_TRACE_COMPILER_IN_USE +#include "eapwizardpageoutertypeTraces.h" +#endif + /*! \class EapWizardPageOuterType @@ -60,6 +65,8 @@ mDocumentLoader(NULL), mValid(false) { + OstTraceFunctionEntry0( EAPWIZARDPAGEOUTERTYPE_EAPWIZARDPAGEOUTERTYPE_ENTRY ); + OstTraceFunctionExit0( EAPWIZARDPAGEOUTERTYPE_EAPWIZARDPAGEOUTERTYPE_EXIT ); } /*! @@ -67,6 +74,8 @@ */ EapWizardPageOuterType::~EapWizardPageOuterType() { + OstTraceFunctionEntry0( DUP1_EAPWIZARDPAGEOUTERTYPE_EAPWIZARDPAGEOUTERTYPE_ENTRY ); + OstTraceFunctionExit0( DUP1_EAPWIZARDPAGEOUTERTYPE_EAPWIZARDPAGEOUTERTYPE_EXIT ); } /*! @@ -74,6 +83,7 @@ */ HbWidget* EapWizardPageOuterType::initializePage() { + OstTraceFunctionEntry0( EAPWIZARDPAGEOUTERTYPE_INITIALIZEPAGE_ENTRY ); if (!mWidget) { bool ok; mDocumentLoader.reset( @@ -116,6 +126,7 @@ SLOT(loadDocmlSection(Qt::Orientation))); Q_ASSERT(ok); } + OstTraceFunctionExit0( EAPWIZARDPAGEOUTERTYPE_INITIALIZEPAGE_EXIT ); return mWidget; } @@ -126,12 +137,14 @@ */ void EapWizardPageOuterType::loadDocmlSection(Qt::Orientation orientation) { + OstTraceFunctionEntry0( EAPWIZARDPAGEOUTERTYPE_LOADDOCMLSECTION_ENTRY ); EapWizardPage::loadDocmlSection( mDocumentLoader.data(), orientation, ":/docml/occ_eap_wizard_01_02_04.docml", "portrait_section", "landscape_section"); + OstTraceFunctionExit0( EAPWIZARDPAGEOUTERTYPE_LOADDOCMLSECTION_EXIT ); } /*! @@ -146,6 +159,7 @@ */ int EapWizardPageOuterType::nextId() const { + OstTraceFunctionEntry0( EAPWIZARDPAGEOUTERTYPE_NEXTID_ENTRY ); int id = WlanWizardPage::PageNone; EapQtPluginHandle::Plugin handle = static_cast(mEapTypes.at(mRadio->selected())); @@ -173,6 +187,7 @@ mWizard->setConfigurations(EapWizardPrivate::OuterType, handle); + OstTraceFunctionExit0( EAPWIZARDPAGEOUTERTYPE_NEXTID_EXIT ); return id; } @@ -185,6 +200,8 @@ */ bool EapWizardPageOuterType::showPage() { + OstTraceFunctionEntry0( EAPWIZARDPAGEOUTERTYPE_SHOWPAGE_ENTRY ); + OstTraceFunctionExit0( EAPWIZARDPAGEOUTERTYPE_SHOWPAGE_EXIT ); return mValid; } @@ -195,9 +212,11 @@ */ void EapWizardPageOuterType::itemSelected(int index) { + OstTraceFunctionEntry0( EAPWIZARDPAGEOUTERTYPE_ITEMSELECTED_ENTRY ); Q_UNUSED(index); mValid = true; mWizard->wizardHelper()->enableNextButton(mValid); + OstTraceFunctionExit0( EAPWIZARDPAGEOUTERTYPE_ITEMSELECTED_EXIT ); } /*! @@ -209,11 +228,13 @@ void EapWizardPageOuterType::appendToList( QStringList &items, int pluginHandle) { + OstTraceFunctionEntry0( EAPWIZARDPAGEOUTERTYPE_APPENDTOLIST_ENTRY ); if (mWizard->eapConfigurationInterface()->isSupportedOuterType( (EapQtPluginHandle::Plugin)pluginHandle)) { items << mWizard->eapTypeToString(pluginHandle); mEapTypes.append(pluginHandle); } + OstTraceFunctionExit0( EAPWIZARDPAGEOUTERTYPE_APPENDTOLIST_EXIT ); } /* @@ -223,6 +244,7 @@ */ int EapWizardPageOuterType::nextIdForEapFast() const { + OstTraceFunctionEntry0( EAPWIZARDPAGEOUTERTYPE_NEXTIDFOREAPFAST_ENTRY ); int pageId; mWizard->setConfigurations(EapWizardPrivate::InnerType, @@ -256,5 +278,6 @@ break; } + OstTraceFunctionExit0( EAPWIZARDPAGEOUTERTYPE_NEXTIDFOREAPFAST_EXIT ); return pageId; } diff -r 7b3e49e4608a -r 72ebcbb64834 wlanutilities/eapwizard/src/eapwizardpagepacstorepasswordconfirm.cpp --- a/wlanutilities/eapwizard/src/eapwizardpagepacstorepasswordconfirm.cpp Thu Jun 24 10:49:51 2010 +0300 +++ b/wlanutilities/eapwizard/src/eapwizardpagepacstorepasswordconfirm.cpp Fri Jul 09 10:38:19 2010 +0300 @@ -31,6 +31,11 @@ #include "wlanwizardhelper.h" #include "eapwizardpagepacstorepasswordconfirm.h" #include "eapwizard_p.h" +#include "OstTraceDefinitions.h" +#ifdef OST_TRACE_COMPILER_IN_USE +#include "eapwizardpagepacstorepasswordconfirmTraces.h" +#endif + /*! \class EapWizardPagePacStorePasswordConfirm @@ -60,6 +65,8 @@ mEditPasswordConfirm(NULL), mLabelError(NULL) { + OstTraceFunctionEntry0( EAPWIZARDPAGEPACSTOREPASSWORDCONFIRM_EAPWIZARDPAGEPACSTOREPASSWORDCONFIRM_ENTRY ); + OstTraceFunctionExit0( EAPWIZARDPAGEPACSTOREPASSWORDCONFIRM_EAPWIZARDPAGEPACSTOREPASSWORDCONFIRM_EXIT ); } /*! @@ -67,6 +74,8 @@ */ EapWizardPagePacStorePasswordConfirm::~EapWizardPagePacStorePasswordConfirm() { + OstTraceFunctionEntry0( DUP1_EAPWIZARDPAGEPACSTOREPASSWORDCONFIRM_EAPWIZARDPAGEPACSTOREPASSWORDCONFIRM_ENTRY ); + OstTraceFunctionExit0( DUP1_EAPWIZARDPAGEPACSTOREPASSWORDCONFIRM_EAPWIZARDPAGEPACSTOREPASSWORDCONFIRM_EXIT ); } /*! @@ -74,6 +83,7 @@ */ HbWidget* EapWizardPagePacStorePasswordConfirm::initializePage() { + OstTraceFunctionEntry0( EAPWIZARDPAGEPACSTOREPASSWORDCONFIRM_INITIALIZEPAGE_ENTRY ); if (!mWidget) { bool ok; mDocumentLoader.reset( @@ -112,6 +122,7 @@ Q_ASSERT(ok); } + OstTraceFunctionExit0( EAPWIZARDPAGEPACSTOREPASSWORDCONFIRM_INITIALIZEPAGE_EXIT ); return mWidget; } @@ -123,12 +134,14 @@ */ void EapWizardPagePacStorePasswordConfirm::loadDocmlSection(Qt::Orientation orientation) { + OstTraceFunctionEntry0( EAPWIZARDPAGEPACSTOREPASSWORDCONFIRM_LOADDOCMLSECTION_ENTRY ); EapWizardPage::loadDocmlSection( mDocumentLoader.data(), orientation, ":/docml/occ_eap_wizard_08.docml", "portrait_section", "landscape_section"); + OstTraceFunctionExit0( EAPWIZARDPAGEPACSTOREPASSWORDCONFIRM_LOADDOCMLSECTION_EXIT ); } /*! @@ -140,6 +153,7 @@ */ int EapWizardPagePacStorePasswordConfirm::nextId() const { + OstTraceFunctionEntry0( EAPWIZARDPAGEPACSTOREPASSWORDCONFIRM_NEXTID_ENTRY ); int id; if (mValidator->validate(mEditPasswordConfirm->text()) == EapQtValidator::StatusOk) { @@ -154,6 +168,7 @@ mLabelError->setPlainText(hbTrId("txt_occ_info_incorrect_password")); } + OstTraceFunctionExit0( EAPWIZARDPAGEPACSTOREPASSWORDCONFIRM_NEXTID_EXIT ); return id; } @@ -166,7 +181,9 @@ */ bool EapWizardPagePacStorePasswordConfirm::showPage() { + OstTraceFunctionEntry0( EAPWIZARDPAGEPACSTOREPASSWORDCONFIRM_SHOWPAGE_ENTRY ); mEditPasswordConfirm->setFocus(); + OstTraceFunctionExit0( EAPWIZARDPAGEPACSTOREPASSWORDCONFIRM_SHOWPAGE_EXIT ); return true; } @@ -180,8 +197,10 @@ bool EapWizardPagePacStorePasswordConfirm::eventFilter( QObject *obj, QEvent *event) { + OstTraceFunctionEntry0( EAPWIZARDPAGEPACSTOREPASSWORDCONFIRM_EVENTFILTER_ENTRY ); if (obj == mEditPasswordConfirm && event->type() == QEvent::FocusIn) { mLabelError->setPlainText(""); } + OstTraceFunctionExit0( EAPWIZARDPAGEPACSTOREPASSWORDCONFIRM_EVENTFILTER_EXIT ); return false; } diff -r 7b3e49e4608a -r 72ebcbb64834 wlanutilities/eapwizard/src/eapwizardpageusernamepassword.cpp --- a/wlanutilities/eapwizard/src/eapwizardpageusernamepassword.cpp Thu Jun 24 10:49:51 2010 +0300 +++ b/wlanutilities/eapwizard/src/eapwizardpageusernamepassword.cpp Fri Jul 09 10:38:19 2010 +0300 @@ -33,6 +33,11 @@ #include "wlanwizardhelper.h" #include "eapwizardpageusernamepassword.h" #include "eapwizard_p.h" +#include "OstTraceDefinitions.h" +#ifdef OST_TRACE_COMPILER_IN_USE +#include "eapwizardpageusernamepasswordTraces.h" +#endif + /*! \class EapWizardPageUsernamePassword @@ -50,7 +55,7 @@ /*! Constructor. - + @param [in] parent Pointer to EAP Wizard private implementation. */ EapWizardPageUsernamePassword::EapWizardPageUsernamePassword( @@ -65,6 +70,8 @@ mTitleUsername(NULL), mTitlePassword(NULL) { + OstTraceFunctionEntry0( EAPWIZARDPAGEUSERNAMEPASSWORD_EAPWIZARDPAGEUSERNAMEPASSWORD_ENTRY ); + OstTraceFunctionExit0( EAPWIZARDPAGEUSERNAMEPASSWORD_EAPWIZARDPAGEUSERNAMEPASSWORD_EXIT ); } /*! @@ -72,6 +79,8 @@ */ EapWizardPageUsernamePassword::~EapWizardPageUsernamePassword() { + OstTraceFunctionEntry0( DUP1_EAPWIZARDPAGEUSERNAMEPASSWORD_EAPWIZARDPAGEUSERNAMEPASSWORD_ENTRY ); + OstTraceFunctionExit0( DUP1_EAPWIZARDPAGEUSERNAMEPASSWORD_EAPWIZARDPAGEUSERNAMEPASSWORD_EXIT ); } /*! @@ -79,6 +88,7 @@ */ HbWidget* EapWizardPageUsernamePassword::initializePage() { + OstTraceFunctionEntry0( EAPWIZARDPAGEUSERNAMEPASSWORD_INITIALIZEPAGE_ENTRY ); if (!mWidget) { bool ok = true; mDocumentLoader.reset( @@ -101,21 +111,21 @@ mEditPassword = qobject_cast (mDocumentLoader->findWidget("lineEditPassword")); Q_ASSERT(mEditPassword); - + mTitlePassword->setPlainText(hbTrId("txt_occ_setlabel_eap_password")); - + ok = connect( mWizard->wizardHelper()->mainWindow(), SIGNAL(orientationChanged(Qt::Orientation)), this, SLOT(loadDocmlSection(Qt::Orientation))); Q_ASSERT(ok); - + ok = connect( mEditUsername, SIGNAL(textChanged(const QString &)), this, SLOT(textChanged(const QString &))); Q_ASSERT(ok); - + ok = connect( mEditPassword, SIGNAL(textChanged(const QString &)), this, SLOT(textChanged(const QString &))); @@ -127,7 +137,7 @@ if (eapType != EapQtPluginHandle::PluginLeap) { eapType = mWizard->configurations(EapWizardPrivate::InnerType).toInt(); } - + EapQtPluginHandle plugin(static_cast(eapType)); mValidatorUsername.reset( @@ -143,68 +153,77 @@ EapQtConfig::Password)); Q_ASSERT(mValidatorPassword.data()); mValidatorPassword->updateEditor(mEditPassword); - + mTitleUsername->setPlainText( HbParameterLengthLimiter( hbTrId("txt_occ_setlabel_user_name_for_1")).arg( mWizard->eapTypeToString(eapType))); + OstTraceFunctionExit0( EAPWIZARDPAGEUSERNAMEPASSWORD_INITIALIZEPAGE_EXIT ); return mWidget; } /*! Loads the required orientation of docml. - + @param [in] orientation Orientation to be loaded. */ void EapWizardPageUsernamePassword::loadDocmlSection(Qt::Orientation orientation) { + OstTraceFunctionEntry0( EAPWIZARDPAGEUSERNAMEPASSWORD_LOADDOCMLSECTION_ENTRY ); EapWizardPage::loadDocmlSection( mDocumentLoader.data(), orientation, ":/docml/occ_eap_wizard_05_07.docml", "portrait_section", "landscape_section"); + OstTraceFunctionExit0( EAPWIZARDPAGEUSERNAMEPASSWORD_LOADDOCMLSECTION_EXIT ); } /*! See WlanWizardPage. - + Validates the content of the page. - + @return true if content is valid. */ bool EapWizardPageUsernamePassword::showPage() { + OstTraceFunctionEntry0( EAPWIZARDPAGEUSERNAMEPASSWORD_SHOWPAGE_ENTRY ); bool valid = false; if (mValidatorUsername->validate(mEditUsername->text()) == EapQtValidator::StatusOk && mValidatorPassword->validate(mEditPassword->text()) == - EapQtValidator::StatusOk) { + EapQtValidator::StatusOk) { valid = true; } + OstTraceFunctionExit0( EAPWIZARDPAGEUSERNAMEPASSWORD_SHOWPAGE_EXIT ); return valid; } /*! See WlanWizardPage. - + @return next wizard page: EapWizardPage::PageProcessSettings */ int EapWizardPageUsernamePassword::nextId() const { + OstTraceFunctionEntry0( EAPWIZARDPAGEUSERNAMEPASSWORD_NEXTID_ENTRY ); mWizard->setConfigurations(EapWizardPrivate::Username, mEditUsername->text()); mWizard->setConfigurations(EapWizardPrivate::Password, mEditPassword->text()); + OstTraceFunctionExit0( EAPWIZARDPAGEUSERNAMEPASSWORD_NEXTID_EXIT ); return EapWizardPage::PageProcessSettings; } /*! Slot for textChanged() signal from HbLineEdit. - + @param [in] text NOT USED. */ void EapWizardPageUsernamePassword::textChanged(const QString & text ) { + OstTraceFunctionEntry0( EAPWIZARDPAGEUSERNAMEPASSWORD_TEXTCHANGED_ENTRY ); Q_UNUSED(text); mWizard->wizardHelper()->enableNextButton(showPage()); + OstTraceFunctionExit0( EAPWIZARDPAGEUSERNAMEPASSWORD_TEXTCHANGED_EXIT ); } diff -r 7b3e49e4608a -r 72ebcbb64834 wlanutilities/wlanindicatorplugin/inc/wlanindicatorplugin.h --- a/wlanutilities/wlanindicatorplugin/inc/wlanindicatorplugin.h Thu Jun 24 10:49:51 2010 +0300 +++ b/wlanutilities/wlanindicatorplugin/inc/wlanindicatorplugin.h Fri Jul 09 10:38:19 2010 +0300 @@ -22,6 +22,10 @@ #include #include #include +#include + +// Forward declarations +class HbTranslator; const int wlanNotConnected = 0; const int wlanConnected = 1; @@ -51,7 +55,7 @@ bool handleClientRequest (RequestType type, const QVariant ¶meter); bool handleInteraction (InteractionType type); QVariant indicatorData(int role) const; - + private: Q_DISABLE_COPY(WlanIndicatorPlugin) @@ -59,5 +63,6 @@ int mError; // Indicator error QVariant mParameter; // Used to contain the status of wlan QProcess process; // Process to start external programs + QSharedPointer mTranslator; // Translator for the localisation Text Id's }; #endif //WLANINDICATORPLUGIN_H diff -r 7b3e49e4608a -r 72ebcbb64834 wlanutilities/wlanindicatorplugin/src/wlanindicatorplugin.cpp --- a/wlanutilities/wlanindicatorplugin/src/wlanindicatorplugin.cpp Thu Jun 24 10:49:51 2010 +0300 +++ b/wlanutilities/wlanindicatorplugin/src/wlanindicatorplugin.cpp Fri Jul 09 10:38:19 2010 +0300 @@ -96,8 +96,8 @@ Q_UNUSED(indicatorType) // Install localization - HbTranslator *translator(new HbTranslator("wlanindicatorplugin")); - + mTranslator = QSharedPointer(new HbTranslator("wlanindicatorplugin")); + OstTraceFunctionExit1(WLANINDICATORPLUGIN_CREATEINDICATOR_EXIT, this); return this; } diff -r 7b3e49e4608a -r 72ebcbb64834 wlanutilities/wlanlogin/wlanloginapp/src/wlanloginengine.cpp --- a/wlanutilities/wlanlogin/wlanloginapp/src/wlanloginengine.cpp Thu Jun 24 10:49:51 2010 +0300 +++ b/wlanutilities/wlanlogin/wlanloginapp/src/wlanloginengine.cpp Fri Jul 09 10:38:19 2010 +0300 @@ -46,6 +46,7 @@ // External function prototypes // Local constants +const QString iapIdentifierPrefix = "I_"; // ======== LOCAL FUNCTIONS ======== @@ -86,8 +87,10 @@ WlanLoginEngine::~WlanLoginEngine() { OstTraceFunctionEntry0(WLANLOGINENGINE_DESTRUCTOR_ENTRY); - - mNetworkSession->close(); + + if (mNetworkSession) { + mNetworkSession->close(); + } OstTraceFunctionExit0(WLANLOGINENGINE_DESTRUCTOR_EXIT); } @@ -228,7 +231,8 @@ setEngineState(WlanLoginEngine::OpeningNetworkSession); //Get configuration that matches the provided IAP - QNetworkConfiguration netConfiguration = mNetConfigurationManager->configurationFromIdentifier(QString::number(mIap)); + //Note that identifier must be given in format I_ + IAP ID + QNetworkConfiguration netConfiguration = mNetConfigurationManager->configurationFromIdentifier(iapIdentifierPrefix + QString::number(mIap)); OstTrace1( TRACE_NORMAL, diff -r 7b3e49e4608a -r 72ebcbb64834 wlanutilities/wlanqtutilities/tsrc/stubs/ictswlanlogininterface.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/wlanutilities/wlanqtutilities/tsrc/stubs/ictswlanlogininterface.h Fri Jul 09 10:38:19 2010 +0300 @@ -0,0 +1,68 @@ +/* +* 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: +* ICTS Wlan Login Interface stubbing for WLAN Qt Utilities. +*/ + +#ifndef ICTSWLANLOGININTERFACE_H +#define ICTSWLANLOGININTERFACE_H + +// System includes +#include + +// User includes + +// Forward declarations + +// External data types + +// Constants + +// Class declaration +class IctsWlanLoginInterface: public QObject +{ + Q_OBJECT + +public: + + // Data types + + /*! + Internet connectivity test result type + */ + enum ictsResultType { + IctsPassed = 0, //!< Internet connectivity test passed + IctsHotspotPassed, //!< Internet connectivity test passed against hotspot access point + IctsCanceled, //!< Internet connectivity test was cancelled due to user action + IctsFailed //!< internet connectivity test failed + }; + + IctsWlanLoginInterface(QObject *parent); + + ~IctsWlanLoginInterface(); + +public: + + void start(int iapId, int netId); + + void stop(); + +signals: + + void ictsResult(int ictsResult); + + void hotspotCase(); +}; + +#endif // ICTSWLANLOGININTERFACE_H diff -r 7b3e49e4608a -r 72ebcbb64834 wlanutilities/wlanqtutilities/tsrc/stubs/stub_ictswlanlogininterface.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/wlanutilities/wlanqtutilities/tsrc/stubs/stub_ictswlanlogininterface.cpp Fri Jul 09 10:38:19 2010 +0300 @@ -0,0 +1,56 @@ +/* +* 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: +* ICTS Wlan Login Interface stubbing for WLAN Qt Utilities. +*/ + +#include "ictswlanlogininterface.h" + +#include "wlanqtutilstestcontext.h" + +extern WlanQtUtilsTestContext testContext; + +/*! + Constructor. +*/ +IctsWlanLoginInterface::IctsWlanLoginInterface(QObject *parent) +{ + Q_UNUSED(parent); +} + +/*! + Destructor. +*/ +IctsWlanLoginInterface::~IctsWlanLoginInterface() +{ +} + +/*! + Function for launching Wlan login application. + + @param [in] iapId Internet accesspoint id to be tested + @param [in] netId network identifier of the connection to be used +*/ +void IctsWlanLoginInterface::start(int iapId, int netId) +{ + Q_UNUSED(iapId); + Q_UNUSED(netId); +} + +/*! + Function for stopping launched Wlan login application. +*/ +void IctsWlanLoginInterface::stop() +{ +} diff -r 7b3e49e4608a -r 72ebcbb64834 wlanutilities/wlanqtutilities/tsrc/testwlanqtutils.cpp --- a/wlanutilities/wlanqtutilities/tsrc/testwlanqtutils.cpp Thu Jun 24 10:49:51 2010 +0300 +++ b/wlanutilities/wlanqtutilities/tsrc/testwlanqtutils.cpp Fri Jul 09 10:38:19 2010 +0300 @@ -1183,14 +1183,11 @@ // Connection test automatically started at this point. Call result function explicitly // No interface exists that we could check that the IAP is moved to Internet SNAP correctly -#if 0 // TODO: Make this work with the new WLAN login interface - TBuf<5> string; - wlanQtUtils_->d_ptr->mConnTestWrapper->d_ptr_->ConnectivityObserver(EConnectionOk, string); + wlanQtUtils_->d_ptr->updateIctResult(IctsWlanLoginInterface::IctsPassed); - subTestSignalWaitAndTake(signalIctResult_, &arguments); + subTestSignalWaitAndTake(signalIctResult_, &arguments); QCOMPARE(arguments.at(0).toInt(), iapId); - QCOMPARE(arguments.at(1).toBool(), true); -#endif + QCOMPARE(arguments.at(1).toInt(), (int)WlanQtUtils::IctPassed); } /** @@ -1200,7 +1197,7 @@ { // Create and connect an IAP and request ICT to be run QScopedPointer wlanAp(subTestNewAp()); - wlanAp->setValue(WlanQtUtilsAp::ConfIdSsid, "testConnectionTestErr"); + wlanAp->setValue(WlanQtUtilsAp::ConfIdSsid, "testConnectionTestErr1"); wlanAp->setValue(WlanQtUtilsAp::ConfIdSecurityMode, CMManagerShim::WlanSecModeWpa); int iapId = wlanQtUtils_->createIap(wlanAp.data()); @@ -1225,14 +1222,109 @@ // Connection test automatically started at this point. Call result function explicitly // No interface exists that we could check that IAP is not moved to another SNAP -#if 0 // TODO: Make this work with the new WLAN login interface - TBuf<5> string; - wlanQtUtils_->d_ptr->mConnTestWrapper->d_ptr_->ConnectivityObserver(EHttpAuthenticationNeeded, string); + wlanQtUtils_->d_ptr->updateIctResult(IctsWlanLoginInterface::IctsFailed); + + subTestSignalWaitAndTake(signalIctResult_, &arguments); + QCOMPARE(arguments.at(0).toInt(), iapId); + QCOMPARE(arguments.at(1).toInt(), (int)WlanQtUtils::IctFailed); + + // Repeat with cancel status + // Send event for connection status change -> closed. + wlanQtUtils_->d_ptr->mConMonWrapper->d_ptrInfo->EventL(CConnMonConnectionStatusChange( + testContext.connMon_.activeConnections_.activeConnList_[0]->connectionId(), + 0, + KLinkLayerClosed)); + + // Send event for connection deletion. + wlanQtUtils_->d_ptr->mConMonWrapper->d_ptrInfo->EventL(CConnMonEventBase( + EConnMonDeleteConnection, + testContext.connMon_.activeConnections_.activeConnList_[0]->connectionId())); + + subTestSignalWaitAndTake(signalWlanNetworkClosed_, &arguments); + QCOMPARE(arguments.at(0).toInt(), iapId); + QCOMPARE(arguments.at(1).toInt(), KErrNone); + + wlanAp->setValue(WlanQtUtilsAp::ConfIdSsid, "testConnectionTestErr2"); + + iapId = wlanQtUtils_->createIap(wlanAp.data()); + wlanQtUtils_->connectIap(iapId, true); + + testContext.connMon_.activeConnections_.createDefaultActiveConnList(1, iapId); + wlanQtUtils_->d_ptr->mConMonWrapper->d_ptrInfo->EventL(CConnMonEventBase( + EConnMonCreateConnection, + testContext.connMon_.activeConnections_.activeConnList_[0]->connectionId())); + wlanQtUtils_->d_ptr->mConMonWrapper->d_ptrInfo->EventL(CConnMonConnectionStatusChange( + testContext.connMon_.activeConnections_.activeConnList_[0]->connectionId(), + 0, + KConnectionOpen)); + subTestSignalWaitAndTake(signalWlanNetworkOpened_, &arguments); + QCOMPARE(arguments.at(0).toInt(), iapId); + + wlanQtUtils_->d_ptr->mConMonWrapper->d_ptrInfo->EventL(CConnMonConnectionStatusChange( + testContext.connMon_.activeConnections_.activeConnList_[0]->connectionId(), + 0, + KLinkLayerOpen)); + + // Connection test automatically started at this point. Call result function explicitly + // No interface exists that we could check that IAP is not moved to another SNAP + wlanQtUtils_->d_ptr->updateIctResult(IctsWlanLoginInterface::IctsCanceled); + + subTestSignalWaitAndTake(signalIctResult_, &arguments); + QCOMPARE(arguments.at(0).toInt(), iapId); + QCOMPARE(arguments.at(1).toInt(), (int)WlanQtUtils::IctCancelled); +} - subTestSignalWaitAndTake(signalIctResult_, &arguments); +/** + * This function tests ICT when connection test passes in hotspot case. + */ +void TestWlanQtUtils::testConnectionTestHotspot() +{ + // Create new IAP to test + QScopedPointer wlanAp(subTestNewAp()); + wlanAp->setValue(WlanQtUtilsAp::ConfIdSsid, "testConnectionTestHotspot"); + int iapId = wlanQtUtils_->createIap(wlanAp.data()); + QVERIFY(iapId != WlanQtUtils::IapIdNone); + + testContext.esock_.startRetValue_ = KErrNone; + + // Esock stub completes connection creation immediately + wlanQtUtils_->connectIap(iapId, true); + + // Connection creation in ConnMon interface + testContext.connMon_.activeConnections_.createDefaultActiveConnList(1, iapId); + wlanQtUtils_->d_ptr->mConMonWrapper->d_ptrInfo->EventL(CConnMonEventBase( + EConnMonCreateConnection, + testContext.connMon_.activeConnections_.activeConnList_[0]->connectionId())); + + // Connection status change in ConnMon interface + wlanQtUtils_->d_ptr->mConMonWrapper->d_ptrInfo->EventL(CConnMonConnectionStatusChange( + testContext.connMon_.activeConnections_.activeConnList_[0]->connectionId(), + 0, + KConnectionOpen)); + + // Receive signal for connection opening (caused by connectIap, which completed immediately) + QList arguments; + subTestSignalWaitAndTake(signalWlanNetworkOpened_, &arguments); QCOMPARE(arguments.at(0).toInt(), iapId); - QCOMPARE(arguments.at(1).toBool(), false); -#endif + + // Connection status change to opened in ConnMon interface. Sub test cases between test + // cases check that no extra signals are sent + wlanQtUtils_->d_ptr->mConMonWrapper->d_ptrInfo->EventL(CConnMonConnectionStatusChange( + testContext.connMon_.activeConnections_.activeConnList_[0]->connectionId(), + 0, + KLinkLayerOpen)); + + // Connection test automatically started at this point. + // Call hotspot case slot explicitly + wlanQtUtils_->d_ptr->updateIctHotspotCase(); + + // Call result function explicitly + // No interface exists that we could check that the IAP is not moved to another SNAP + wlanQtUtils_->d_ptr->updateIctResult(IctsWlanLoginInterface::IctsHotspotPassed); + + subTestSignalWaitAndTake(signalIctResult_, &arguments); + QCOMPARE(arguments.at(0).toInt(), iapId); + QCOMPARE(arguments.at(1).toInt(), (int)WlanQtUtils::IctHotspotPassed); } /** diff -r 7b3e49e4608a -r 72ebcbb64834 wlanutilities/wlanqtutilities/tsrc/testwlanqtutils.h --- a/wlanutilities/wlanqtutilities/tsrc/testwlanqtutils.h Thu Jun 24 10:49:51 2010 +0300 +++ b/wlanutilities/wlanqtutilities/tsrc/testwlanqtutils.h Fri Jul 09 10:38:19 2010 +0300 @@ -99,6 +99,7 @@ // Test functions for private implementation (tested via public interface) void testConnectionTestOk(); void testConnectionTestErr(); + void testConnectionTestHotspot(); void testConnMonEventGprs(); void testConnMonEventCreatedBeforeConstructor(); diff -r 7b3e49e4608a -r 72ebcbb64834 wlanutilities/wlanqtutilities/tsrc/testwlanqtutils.pro --- a/wlanutilities/wlanqtutilities/tsrc/testwlanqtutils.pro Thu Jun 24 10:49:51 2010 +0300 +++ b/wlanutilities/wlanqtutilities/tsrc/testwlanqtutils.pro Fri Jul 09 10:38:19 2010 +0300 @@ -38,8 +38,8 @@ INCLUDEPATH += \ . \ + stubs \ ../../inc \ - stubs \ ../base/inc \ ../wrapper/inc \ ../traces @@ -78,6 +78,7 @@ ../wrapper/inc/wlanqtutilsconmonwrapperinfo_symbian.h \ ../wrapper/inc/wlanqtutilsesockwrapper_symbian.h \ ../wrapper/inc/wlanqtutilsscan_symbian.h \ + stubs/ictswlanlogininterface.h \ stubs/wlanmgmtclient.h \ stubs/wlanscaninfo.h @@ -88,8 +89,9 @@ ../wrapper/src/wlanqtutilsscan_symbian.cpp \ stubs/stub_connmon.cpp \ stubs/stub_esock.cpp \ + stubs/stub_ictswlanlogininterface.cpp \ stubs/stub_wlanmgmtclient.cpp \ stubs/stub_wlanscaninfo.cpp } -LIBS += -lconnmon -lconnection_settings_shim -lextendedconnpref -lnetmeta -lesock -lictswlanlogininterface +LIBS += -lconnmon -lconnection_settings_shim -lextendedconnpref -lnetmeta -lesock -lcharconv diff -r 7b3e49e4608a -r 72ebcbb64834 wlanutilities/wlanqtutilities/tsrc/tools/default.cre Binary file wlanutilities/wlanqtutilities/tsrc/tools/default.cre has changed diff -r 7b3e49e4608a -r 72ebcbb64834 wlanutilities/wlanqtutilities/tsrc/tools/variantdata_wlanqtutils.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/wlanutilities/wlanqtutilities/tsrc/tools/variantdata_wlanqtutils.xml Fri Jul 09 10:38:19 2010 +0300 @@ -0,0 +1,764 @@ + + + + + + whenneeded + 11 + 0 + 1 + 2 + 3 + 4 + 6 + 7 + 256 + 256 + 9 + 0 + 8 + 1 + 2 + 4 + 5 + 6 + 7 + Destination + Internet + Known + Confirm + Wlan only + -1 + 1 + -1 + -1 + 1 + -1 + -1 + 1 + 4 + 7 + 2347 + 100 + 1 + 0 + + + + packet data 1 + 1 + No + No + No + No + ConfirmFirst + IPv4 + packetdata1 + + No + + Normal + + http://www.nokia.com + On + Continuous + + + + + + + 0 + + Yes + 0 + + + + packet data 2 + 3 + No + No + No + No + ConfirmFirst + IPv4 + packetdata2 + + No + + Normal + + http://www.nokia.com + On + Continuous + + + + + + + 0 + + Yes + 0 + + + + packet data 3 + 4 + No + No + No + No + ConfirmFirst + IPv4 + packetdata3 + + No + + Normal + + http://www.nokia.com + On + Continuous + + + + + + + 0 + + Yes + 0 + + + + Streaming + 9 + No + No + No + No + ConfirmFirst + IPv4 + streaming + + No + + Normal + + http://www.nokia.com + On + Continuous + + + + + + + 0 + + Yes + 0 + + + + + + WLAN IAP 1 + 5 + No + No + No + No + ShowProgress + WLAN IAP 1 + + Infrastructure + Open + + + + + + + + + + No + + + key1 + Shared + 64 + ASCII + + 64 + ASCII + + 64 + ASCII + + 64 + ASCII + + + No + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + WLAN IAP 2 + 6 + No + No + No + No + ConfirmFirst + WLAN IAP 2 + http://themaximus.security.max + Ad-hoc + WEP + + + + + + + 192.168.100.200 + 8000 + + No + + + key1 + Open + 64 + ASCII + w2key + 64 + Hexadecimal + + 64 + ASCII + + 64 + ASCII + + + No + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + WLAN IAP 3 + 7 + No + No + No + No + ConfirmFirst + WLAN IAP 3 + + Infrastructure + WPA + + + + + + + + + + No + + + key1 + Shared + 64 + ASCII + + 64 + ASCII + + 64 + ASCII + + 64 + ASCII + + wlan3key + Yes + 8 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Home WLAN + 8 + No + No + No + No + ShowProgress + Home WLAN + + Infrastructure + Open + + + + + + + + + + No + + + key1 + Shared + 64 + ASCII + + 64 + ASCII + + 64 + ASCII + + 64 + ASCII + + + No + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Internet + 3 + Internet + 2 + No + No + Yes + 0 + + packet data 1 + packet data 2 + packet data 3 + WLAN IAP 1 + WLAN IAP 2 + WLAN IAP 3 + + + + + + + Multimedia msg. + 4 + MMS + 2 + No + Yes + No + 2 + + + + + + + + + + + + + + WAP services + 5 + Operator + 2 + No + No + No + 4 + + + + + + + + + + + + + + >My SNAP + 6 + + 2 + No + No + No + 3 + + Home WLAN + Streaming + + + + + + + + + + + \ No newline at end of file diff -r 7b3e49e4608a -r 72ebcbb64834 wlanutilities/wlanqtutilities/ut/context/commsdat_files/50_default.cre Binary file wlanutilities/wlanqtutilities/ut/context/commsdat_files/50_default.cre has changed diff -r 7b3e49e4608a -r 72ebcbb64834 wlanutilities/wlanqtutilities/ut/context/commsdat_files/default.cre Binary file wlanutilities/wlanqtutilities/ut/context/commsdat_files/default.cre has changed diff -r 7b3e49e4608a -r 72ebcbb64834 wlanutilities/wlanqtutilities/ut/context/wlanqtutilstestcontext.cpp --- a/wlanutilities/wlanqtutilities/ut/context/wlanqtutilstestcontext.cpp Thu Jun 24 10:49:51 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,237 +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: -* This is the source file for Connection Utilities test context. -*/ - -#include -#include -#include -#include -#include "wlanqtutilscommon.h" -#include "wlanqtutilstestcontext.h" -#include "wlanqtutilswlanap.h" -#include "wlanqtutilsactiveconn.h" - -// --------------------------------------------------------- -// class WlanQtUtilsCtxEsock -// --------------------------------------------------------- - -WlanQtUtilsCtxEsock::WlanQtUtilsCtxEsock() : startRetValue_(KErrNone) -{ -} - -WlanQtUtilsCtxEsock::~WlanQtUtilsCtxEsock() -{ -} - -void WlanQtUtilsCtxEsock::initialize() -{ - startRetValue_ = KErrNone; -} - -// --------------------------------------------------------- -// class WlanQtUtilsCtxActiveConn -// --------------------------------------------------------- - -WlanQtUtilsCtxActiveConn::WlanQtUtilsCtxActiveConn() : - WlanQtUtilsActiveConn(), - connMonBearerType_(EBearerUnknown), - connMonConnectionStatus_(KConnectionUninitialised), - connMonWlanConnectionMode_(-1), - connMonWlanSecurityMode_(-1), - applicationUids_() -{ -} - -WlanQtUtilsCtxActiveConn::~WlanQtUtilsCtxActiveConn() -{ -} - -// --------------------------------------------------------- -// class WlanQtUtilsCtxActiveConnections -// --------------------------------------------------------- - -WlanQtUtilsCtxActiveConnections::WlanQtUtilsCtxActiveConnections() : activeConnList_() -{ -} - -WlanQtUtilsCtxActiveConnections::~WlanQtUtilsCtxActiveConnections() -{ - clearActiveConnList(); -} - -void WlanQtUtilsCtxActiveConnections::initialize() -{ - clearActiveConnList(); -} - -void WlanQtUtilsCtxActiveConnections::createDefaultActiveConnList(int numberOfActiveConns, int firstIapId) -{ - clearActiveConnList(); - for (int i = 0; i < numberOfActiveConns; i++) { - WlanQtUtilsCtxActiveConn *activeConn = new WlanQtUtilsCtxActiveConn(); - - activeConn->setConnectionId((i + 1) * 100); - activeConn->setIapId(firstIapId + i); - activeConn->connMonConnectionStatus_ = KConnectionOpen; - activeConn->setConnectionStatus(WlanQtUtilsConnectionStatusConnected); - - // WLAN connection. - activeConn->connMonBearerType_ = EBearerWLAN; - activeConn->setBearerType(WlanQtUtilsBearerTypeWlan); - activeConn->connMonWlanSecurityMode_ = EConnMonSecurityOpen; - activeConn->connMonWlanConnectionMode_ = EConnMonInfraStructure; - activeConnList_.append(activeConn); - } -} - -void WlanQtUtilsCtxActiveConnections::clearActiveConnList() -{ - Q_FOREACH(WlanQtUtilsCtxActiveConn* activeConn, activeConnList_) { - delete activeConn; - } - activeConnList_.clear(); -} - -void WlanQtUtilsCtxActiveConnections::verifyActiveConnList(QList activeConnList) -{ - QCOMPARE(activeConnList.count(), activeConnList_.count()); - - for (int i = 0; i < activeConnList_.count(); i++) { - QCOMPARE(activeConnList[i]->connectionId(), activeConnList_[i]->connectionId()); - QCOMPARE(activeConnList[i]->iapId(), activeConnList_[i]->iapId()); - QCOMPARE(activeConnList[i]->connectionStatus(), activeConnList_[i]->connectionStatus()); - QCOMPARE(activeConnList[i]->bearerType(), activeConnList_[i]->bearerType()); - } -} - -WlanQtUtilsCtxActiveConn *WlanQtUtilsCtxActiveConnections::findActiveConn(uint connectionId) const -{ - WlanQtUtilsCtxActiveConn *activeConn = NULL; - for (int i = 0; i < activeConnList_.count(); i++) { - if (activeConnList_[i]->connectionId() == connectionId) { - activeConn = activeConnList_[i]; - } - } - Q_ASSERT(activeConn != NULL); - return activeConn; -} - -// --------------------------------------------------------- -// class WlanQtUtilsWlanScanResult -// --------------------------------------------------------- - -WlanQtUtilsWlanScanResult::WlanQtUtilsWlanScanResult() : wlanScanResultList_() -{ -} - -WlanQtUtilsWlanScanResult::~WlanQtUtilsWlanScanResult() -{ - clearWlanScanResultList(); -} - -void WlanQtUtilsWlanScanResult::initialize() -{ - clearWlanScanResultList(); -} - -void WlanQtUtilsWlanScanResult::createDefaultWlanScanResultList(int numberOfWlanAps) -{ - clearWlanScanResultList(); - for (int i = 0; i < numberOfWlanAps; i++) { - WlanQtUtilsWlanAp *ap = new WlanQtUtilsWlanAp(); - ap->setSsid("TestWlanAp" + QString::number(i+1)); - ap->setBssid("addMAC"); // TODO: Generate something when bssid retrieval works. - ap->setSignalStrength(20); - ap->setConnectionMode(EConnMonInfraStructure); - ap->setSecurityMode(WlanQtUtilsWlanSecModeOpen); - // TODO: Create constructor to WlanQtUtilsWlanAp which takes all member variables as parameter. - wlanScanResultList_.append(ap); - } -} - -void WlanQtUtilsWlanScanResult::clearWlanScanResultList() -{ - Q_FOREACH(WlanQtUtilsWlanAp* ap, wlanScanResultList_) { - delete ap; - } - wlanScanResultList_.clear(); -} - -void WlanQtUtilsWlanScanResult::verifyWlanScanResultList(QList wlanApList) -{ - QCOMPARE(wlanApList.count(), wlanScanResultList_.count()); - - for (int i = 0; i < wlanScanResultList_.count(); i++) { - QCOMPARE(wlanApList[i]->ssid(), wlanScanResultList_[i]->ssid()); - QCOMPARE(wlanApList[i]->bssid(), wlanScanResultList_[i]->bssid()); - QCOMPARE(wlanApList[i]->signalStrength(), wlanScanResultList_[i]->signalStrength()); - QCOMPARE(wlanApList[i]->connectionMode(), wlanScanResultList_[i]->connectionMode()); - QCOMPARE(wlanApList[i]->securityMode(), wlanScanResultList_[i]->securityMode()); - } -} - -// --------------------------------------------------------- -// class WlanQtUtilsCtxConnMon -// --------------------------------------------------------- - -WlanQtUtilsCtxConnMon::WlanQtUtilsCtxConnMon() : wlanScanResult_() -{ -} - -WlanQtUtilsCtxConnMon::~WlanQtUtilsCtxConnMon() -{ -} - -void WlanQtUtilsCtxConnMon::initialize() -{ - wlanScanResult_.initialize(); - activeConnections_.initialize(); -} - -// --------------------------------------------------------- -// class WlanQtUtilsCtxIct -// --------------------------------------------------------- - -WlanQtUtilsCtxIct::WlanQtUtilsCtxIct() -{ -} - -WlanQtUtilsCtxIct::~WlanQtUtilsCtxIct() -{ -} - -void WlanQtUtilsCtxIct::initialize() -{ -} - -// --------------------------------------------------------- -// class WlanQtUtilsTestContext -// --------------------------------------------------------- - -WlanQtUtilsTestContext::WlanQtUtilsTestContext() : esock_(), connMon_(), ict_() -{ -} - -WlanQtUtilsTestContext::~WlanQtUtilsTestContext() -{ -} - -void WlanQtUtilsTestContext::initialize() -{ - esock_.initialize(); - connMon_.initialize(); - ict_.initialize(); -} diff -r 7b3e49e4608a -r 72ebcbb64834 wlanutilities/wlanqtutilities/ut/context/wlanqtutilstestcontext.h --- a/wlanutilities/wlanqtutilities/ut/context/wlanqtutilstestcontext.h Thu Jun 24 10:49:51 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,250 +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: -* This is the header file for Wlan Qt Utilities test context. -*/ - -#ifndef WLANQTUTILSTESTCONTEXT_H -#define WLANQTUTILSTESTCONTEXT_H - -#include - -#include "wlanqtutilsactiveconn.h" - -class WlanQtUtilsWlanAp; - -/** - * This is context for esock library. - */ -class WlanQtUtilsCtxEsock : public QObject -{ - Q_OBJECT - -public: - WlanQtUtilsCtxEsock(); - ~WlanQtUtilsCtxEsock(); - - /** - * Initializes context. - */ - void initialize(); - - /** Return value of RConnection::Start(). */ - int startRetValue_; -}; - -/** - * This class is a helper class for testing purposes. It derives all properties of WlanQtUtilsActiveConn. - * In addition, this class contains member variables for setting some Connection Monitor specific - * values which cannot be easily generated from member variables of WlanQtUtilsActiveConn. - * E.g., connection status has different enum in Connection Monitor and Wlan Qt Utilities. This class - * enables setting both of those. Connmon version is set so that the stub can return it when - * requested, and Wlan Qt Utilities version is used for verifying that tested code returns right - * value. - */ -class WlanQtUtilsCtxActiveConn : public WlanQtUtilsActiveConn -{ -public: - WlanQtUtilsCtxActiveConn(); - ~WlanQtUtilsCtxActiveConn(); - - /** Bearer type in connmon format. */ - int connMonBearerType_; - /** Connection status in connmon format. */ - int connMonConnectionStatus_; - /** WLAN connection mode in connmon format. */ - int connMonWlanConnectionMode_; - /** WLAN security mode in connmon format. */ - int connMonWlanSecurityMode_; - /** Application UIDs that map to application strings. */ - QList applicationUids_; -}; - -/** - * This class represents active connections. - */ -class WlanQtUtilsCtxActiveConnections : public QObject -{ - Q_OBJECT - -public: - WlanQtUtilsCtxActiveConnections(); - ~WlanQtUtilsCtxActiveConnections(); - - /** - * Initializes context. - */ - void initialize(); - - /** - * Creates a list of active connections for scan results. - * - * @param[in] numberOfActiveConns Number of active connections that are created. - * @param[in] firstIapId IAP ID of the first connection to be created. - */ - void createDefaultActiveConnList(int numberOfActiveConns, int firstIapId); - - /** - * Verifies that the given active connection list returned by the real application matches - * with the one in the context. - * - * @param[in] activeConnList Active connections that are verified against the context. - */ - void verifyActiveConnList(QList activeConnList); - - /** - * Finds an active connection matching with the given connection ID from the context. - * Asserts if connection with given connection ID is not found. - * - * @param connectionId Connection ID. - * @return Active connection. - */ - WlanQtUtilsCtxActiveConn *findActiveConn(uint connectionId) const; - - /** - * List of active connections that RConnectionMonitor stub will return in response to - * RConnectionMonitor::Get*Attribute() functions. - */ - QList activeConnList_; - - // TODO: We need return values for all different RConnectionMonitor::Get*Attribute() functions - // to test error cases. - -private: - - /** - * Destroys and clears the list of WLAN APs. - */ - void clearActiveConnList(); -}; - -/** - * This class represents WLAN APs that represent the results of WLAN scanning triggered by - * RConnectionMonitor::GetPckgAttribute() - */ -class WlanQtUtilsWlanScanResult : public QObject -{ - Q_OBJECT - -public: - WlanQtUtilsWlanScanResult(); - ~WlanQtUtilsWlanScanResult(); - - /** - * Initializes context. - */ - void initialize(); - - /** - * Creates a list of WLAN APs for scan results. - * - * @param[in] numberOfWlanAps Number of WLAN APs that are created. - */ - void createDefaultWlanScanResultList(int numberOfWlanAps); - - /** - * Verifies that the given WLAN AP list returned by the real application matches - * with the one in the context. - * - * @param[in] wlanApList WLAN APs that are verified against the context. - */ - void verifyWlanScanResultList(QList wlanApList); // TODO: Maybe boolean return value - - /** - * List of WLAN access points that RConnectionMonitor stub will return in response to - * RConnectionMonitor::GetPckgAttribute(). - */ - QList wlanScanResultList_; - -private: - - /** - * Destroys and clears the list of WLAN APs. - */ - void clearWlanScanResultList(); -}; - -/** - * Test context for RConnectionMonitor. - */ -class WlanQtUtilsCtxConnMon : public QObject -{ - Q_OBJECT - -public: - WlanQtUtilsCtxConnMon(); - ~WlanQtUtilsCtxConnMon(); - - /** - * Initializes context. - */ - void initialize(); - - /** Results of WLAN scanning. */ - WlanQtUtilsWlanScanResult wlanScanResult_; - - /** List of active connections. */ - WlanQtUtilsCtxActiveConnections activeConnections_; -}; - -/** - * Test context for Internet connectivity test library. - */ -class WlanQtUtilsCtxIct : public QObject -{ - Q_OBJECT - -public: - WlanQtUtilsCtxIct(); - ~WlanQtUtilsCtxIct(); - - /** - * Initializes context. - */ - void initialize(); -}; - -/** - * Test context. The purpose of this context is to provide values that are used in stubs - * and in verification of outputs in test cases. - * - * In stubs, context is used to verify the inputs of parameters and to set output - * parameters into a specific value. - * - * In test cases, context is used to verify that the output parameters match with the once - * set in the stub. - */ -class WlanQtUtilsTestContext : public QObject -{ - Q_OBJECT - -public: - WlanQtUtilsTestContext(); - ~WlanQtUtilsTestContext(); - - /** - * Initializes context. - */ - void initialize(); - - /** Context for esock library. */ - WlanQtUtilsCtxEsock esock_; - /** Context for connmon library. */ - WlanQtUtilsCtxConnMon connMon_; - /** Context for ICTS library. */ - WlanQtUtilsCtxIct ict_; -}; - -#endif /* WLANQTUTILSTESTCONTEXT_H */ - diff -r 7b3e49e4608a -r 72ebcbb64834 wlanutilities/wlanqtutilities/ut/stubs/wlanqtutilsconnmonstub.cpp --- a/wlanutilities/wlanqtutilities/ut/stubs/wlanqtutilsconnmonstub.cpp Thu Jun 24 10:49:51 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,637 +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: -* This is a source file for connmon library stub functions -*/ - -#include -#include -#include -#include -#include "wlanqtutilswlanap.h" - -#ifdef __WINS__ - -// TODO: This function is copied from ConnMonWLANNetworksArrayPckg_v2.cpp because this -// function, although being in rconnmon.h, is not in the interface because IMPORT_C/EXPORT_C -// declarations are not used for this particular constructor. The only change that was made to -// this version was to remove traces and some empty lines. This function is needed when -// creating output in RConnectionMonitor::GetPckgAttribute() for WLAN scan results. -// This is needed for both UT and emulator compilation. -CConnMonWlanNetworksPtrArrayPckg::CConnMonWlanNetworksPtrArrayPckg( - const RPointerArray& aRef, - TUint aBufLen ) - { - RPointerArray items; - TUint len( 0 ); - - for ( TUint i( 0 ); i < aRef.Count(); ++i ) - { - const HBufC* item( aRef[i]->ToBuf() ); - if ( item ) - { - // Is there room in buffer - TUint countFields( 3 ); // aRef.Count(); items->Count(); item->Length() - if ( (countFields + len + item->Length()) > aBufLen ) - { - delete item; - item = NULL; - break; - } - items.Append( item ); - ++( len += item->Length() ); // ++ is for item's size - } - else - { - ; // There was a trace. - } - } - // Check that given buflen (aBufLen) is not smaller than one - // item (TConnMonWLANNetwork) + aRef count + items count - // + item length - if ( items.Count() == 0 && aRef.Count() > 0 ) - { - aBufLen = 2; // aRef.Count(), items.Count() - } - - iBuf = HBufC::New( aBufLen ); // Set size exactly to a buffer length - if ( !iBuf ) - { - items.ResetAndDestroy(); - items.Close(); - return; - } - iBuf->Des().Append( aRef.Count() ); // Total amount of data - iBuf->Des().Append( items.Count() ); // Amount of transferring data - for ( TUint i(0); iDes().Append( items[i]->Length() ); - iBuf->Des().Append( *items[i] ); - } - items.ResetAndDestroy(); - items.Close(); - } - -// ----------------------------------------------------------------------------- -// CConnMonEventBase::CConnMonEventBase -// ----------------------------------------------------------------------------- -// -CConnMonEventBase::CConnMonEventBase( const TInt aEventType, const TUint aConnectionId ) - { - iEventType = aEventType; - iConnectionId = aConnectionId; - } - -// Destructor -CConnMonEventBase::~CConnMonEventBase() - { - } - -// ----------------------------------------------------------------------------- -// CConnMonEventBase::EventType -// ----------------------------------------------------------------------------- -// -TInt CConnMonEventBase::EventType() const - { - return iEventType; - } - -// ----------------------------------------------------------------------------- -// CConnMonConnectionStatusChange::CConnMonConnectionStatusChange -// ----------------------------------------------------------------------------- -// -CConnMonConnectionStatusChange::CConnMonConnectionStatusChange( - const TUint aConnectionId, - const TUint aSubConnectionId, - const TInt aConnectionStatus ) : - CConnMonEventBase(EConnMonConnectionStatusChange, aConnectionId) - { - iSubConnectionId = aSubConnectionId; - iConnectionStatus = aConnectionStatus; - } - -// Destructor -CConnMonConnectionStatusChange::~CConnMonConnectionStatusChange() - { - } - -#ifdef WLANQTUTILS_T_WLANQTUTILS_UT_FLAG - -// ---------------------------------------------- -// Stub functions for connmon library, used in UT -// ---------------------------------------------- - -#include "wlanqtutilstestcontext.h" - -extern WlanQtUtilsTestContext testContext; - -EXPORT_C void RConnectionMonitor::GetConnectionCount( - TUint& aConnectionCount, - TRequestStatus& aStatus) -{ - aConnectionCount = testContext.connMon_.activeConnections_.activeConnList_.count(); - User::RequestComplete(&aStatus, KErrNone); -} - -EXPORT_C TInt RConnectionMonitor::GetConnectionInfo( - const TUint aIndex, - TUint& aConnectionId, - TUint& aSubConnectionCount ) const -{ - aConnectionId = testContext.connMon_.activeConnections_.activeConnList_[aIndex - 1]->connectionId(); - aSubConnectionCount = 0; - return KErrNone; // TODO: put return value into context. -} - -EXPORT_C void RConnectionMonitor::GetIntAttribute( - const TUint aConnectionId, - const TUint /* aSubConnectionId */, - const TUint aAttribute, - TInt& aValue, - TRequestStatus& aStatus ) -{ - WlanQtUtilsCtxActiveConn *activeConn = testContext.connMon_.activeConnections_.findActiveConn(aConnectionId); - if (aAttribute == KBearer) { - aValue = activeConn->connMonBearerType_; - } else if (aAttribute == KConnectionStatus) { - aValue = activeConn->connMonConnectionStatus_; - } else { - Q_ASSERT(false); - } - User::RequestComplete(&aStatus, KErrNone); // TODO: Take return value from the context. -} - -EXPORT_C void RConnectionMonitor::GetUintAttribute( - const TUint aConnectionId, - const TUint /* aSubConnectionId */, - const TUint aAttribute, - TUint& aValue, - TRequestStatus& aStatus ) -{ - WlanQtUtilsCtxActiveConn *activeConn = testContext.connMon_.activeConnections_.findActiveConn(aConnectionId); - if (aAttribute == KIAPId) { - aValue = activeConn->iapId(); - } else { - Q_ASSERT(false); - } - - User::RequestComplete(&aStatus, KErrNone); // TODO: Take return value from the context. -} - -EXPORT_C void RConnectionMonitor::GetPckgAttribute( - const TUint aConnectionId, - const TUint aSubConnectionId, - const TUint aAttribute, - TDes8& aValue, - TRequestStatus& aStatus ) const -{ - // This is copy-paste from real implementation and we'll use that for other requests. - TIpcArgs args(aConnectionId, aSubConnectionId, aAttribute, &aValue); - SendReceive(EReqGetPckgAttribute, args, aStatus); -} - -// --------------------------------------------------------- -// connUtils2ConnMonSecModeMap() -// Local function to map WlanQtUtilsWlanSecMode into Connection -// monitor's security mode. Currently for UT use only. -// --------------------------------------------------------- -// -static TUint connUtils2ConnMonSecModeMap(WlanQtUtilsWlanSecMode connUtilsWlanSecMode) -{ - TUint ret; - switch (connUtilsWlanSecMode) { - case WlanQtUtilsWlanSecModeWep: - ret = EConnMonSecurityWep; - break; - case WlanQtUtilsWlanSecMode802_1x: - ret = EConnMonSecurity802d1x; - break; - case WlanQtUtilsWlanSecModeWpa: - ret = EConnMonSecurityWpa; - break; - case WlanQtUtilsWlanSecModeWpa2: - ret = EConnMonSecurityWpaPsk; - break; - default: - ret = EConnMonSecurityOpen; - break; - } - return ret; -} - - - -EXPORT_C void RConnectionMonitor::GetPckgAttribute( - const TUint /* aConnectionId */, - const TUint /* aSubConnectionId */, - const TUint /* aAttribute */, - TDes16& aValue, - TRequestStatus& aStatus ) const - { - // TODO: verify input parameters, i.e., first three params... - - RConnMonWlanNetworksPtrArray wlanPtrArray; - RBuf vendorData; - - for (int i = 0; i < testContext.connMon_.wlanScanResult_.wlanScanResultList_.count(); i++) { - WlanQtUtilsWlanAp* ap = testContext.connMon_.wlanScanResult_.wlanScanResultList_[i]; - TBufC name(ap->ssid().utf16()); - - TBufC bssid16(QString("addMAC").utf16()); - TBuf8 bssid; - bssid.Copy(bssid16); - - CConnMonWlanNetwork* wlanAp = CConnMonWlanNetwork::NewL( - name, - ap->connectionMode(), - ap->signalStrength(), - connUtils2ConnMonSecModeMap(ap->securityMode()), - bssid, - vendorData ); - wlanPtrArray.Append(wlanAp); - } - - CConnMonWlanNetworksPtrArrayPckg wlanBuf(wlanPtrArray, 2560); - aValue.Copy(wlanBuf.Buf()->Des()); - - User::RequestComplete(&aStatus, KErrNone); // TODO: enable return value modification. - } - -#else // WLANQTUTILS_T_WLANQTUTILS_UT_FLAG - -// ---------------------------------------------------- -// Stub functions for connmon library, used in emulator -// ---------------------------------------------------- - -#if 0 -// In emulator, there are always two active connections. -// The following functions return different properties of these active connection -// so that it's easy to test in emulator. - -EXPORT_C void RConnectionMonitor::GetConnectionCount( - TUint& aConnectionCount, - TRequestStatus& aStatus) -{ - aConnectionCount = 2; - User::RequestComplete(&aStatus, KErrNone); -} - -EXPORT_C TInt RConnectionMonitor::GetConnectionInfo( - const TUint aIndex, - TUint& aConnectionId, - TUint& aSubConnectionCount ) const -{ - if (aIndex == 1) { - aConnectionId = 10; - } else if (aIndex == 2) { - aConnectionId = 20; - } else { - Q_ASSERT(false); - } - - aSubConnectionCount = 0; - return KErrNone; -} - -EXPORT_C void RConnectionMonitor::GetIntAttribute( - const TUint aConnectionId, - const TUint /* aSubConnectionId */, - const TUint aAttribute, - TInt& aValue, - TRequestStatus& aStatus ) -{ - if (aAttribute == KBearer) { - if (aConnectionId == 10) { - aValue = EBearerGPRS; - } else if (aConnectionId == 20) { - aValue = EBearerWLAN; - } else { - Q_ASSERT(false); - } - } else if (aAttribute == KConnectionStatus) { - if (aConnectionId == 10) { - aValue = KConnectionOpen; - } else if (aConnectionId == 20) { - aValue = KStartingConnection; - } else { - Q_ASSERT(false); - } - } else if (aAttribute == KSignalStrength) { - if (aConnectionId == 10) { - Q_ASSERT(false); - } else if (aConnectionId == 20) { - aValue = 78; - } else { - Q_ASSERT(false); - } - } else if (aAttribute == KNetworkMode) { - if (aConnectionId == 10) { - Q_ASSERT(false); - } else if (aConnectionId == 20) { - aValue = EConnMonInfraStructure; - } else { - Q_ASSERT(false); - } - } else if (aAttribute == KSecurityMode) { - if (aConnectionId == 10) { - Q_ASSERT(false); - } else if (aConnectionId == 20) { - aValue = EConnMonSecurityWpaPsk; - } else { - Q_ASSERT(false); - } - } else { - Q_ASSERT(false); - } - User::RequestComplete(&aStatus, KErrNone); -} - -EXPORT_C void RConnectionMonitor::GetUintAttribute( - const TUint aConnectionId, - const TUint /* aSubConnectionId */, - const TUint aAttribute, - TUint& aValue, - TRequestStatus& aStatus ) -{ - if (aAttribute == KIAPId) { - if (aConnectionId == 10) { - aValue = 1; - } else if (aConnectionId == 20) { - aValue = 10; - } else { - Q_ASSERT(false); - } - } else if (aAttribute == KDownlinkData) { - if (aConnectionId == 10) { - aValue = 123; - } else if (aConnectionId == 20) { - aValue = 12345; - } else { - Q_ASSERT(false); - } - } else if (aAttribute == KUplinkData) { - if (aConnectionId == 10) { - aValue = 987654321; - } else if (aConnectionId == 20) { - aValue = 1234567890; - } else { - Q_ASSERT(false); - } - } else if (aAttribute == KTransmitPower) { - if (aConnectionId == 10) { - Q_ASSERT(false); - } else if (aConnectionId == 20) { - aValue = 50; - } else { - Q_ASSERT(false); - } - } else { - Q_ASSERT(false); - } - - User::RequestComplete(&aStatus, KErrNone); -} - -EXPORT_C void RConnectionMonitor::GetBoolAttribute( - const TUint aConnectionId, - const TUint /* aSubConnectionId */, - const TUint aAttribute, - TBool& aValue, - TRequestStatus& aStatus ) -{ - if (aAttribute == KConnectionActive) { - if (aConnectionId == 10) { - aValue = EFalse; - } else if (aConnectionId == 20) { - aValue = ETrue; - } else { - Q_ASSERT(false); - } - } else { - Q_ASSERT(false); - } - - User::RequestComplete(&aStatus, KErrNone); -} - -EXPORT_C void RConnectionMonitor::GetStringAttribute( - const TUint aConnectionId, - const TUint /* aSubConnectionId */, - const TUint aAttribute, - TDes& aValue, - TRequestStatus& aStatus ) const -{ - if (aAttribute == KIAPName) { - if (aConnectionId == 10) { - _LIT(iapNameLit, "PACKET DATA 1"); - TBufC iapName(iapNameLit); - aValue = iapName.Des(); - } else if (aConnectionId == 20) { - _LIT(iapNameLit, "WLAN IAP 3"); - TBufC iapName(iapNameLit); - aValue = iapName.Des(); - } else { - Q_ASSERT(false); - } - } else if (aAttribute == KNetworkName) { - if (aConnectionId == 10) { - Q_ASSERT(false); - } else if (aConnectionId == 20) { - _LIT(ssidLit, "WLAN SSID 3"); - TBufC ssid(ssidLit); - aValue = ssid.Des(); - } else { - Q_ASSERT(false); - } - } else if (aAttribute == KAccessPointName) { - if (aConnectionId == 10) { - _LIT(iapNameLit, "PACKET DATA 1"); - TBufC iapName(iapNameLit); - aValue = iapName.Des(); - } else if (aConnectionId == 20) { - Q_ASSERT(false); - } else { - Q_ASSERT(false); - } - } else { - Q_ASSERT(false); - } - - User::RequestComplete(&aStatus, KErrNone); -} - -EXPORT_C void RConnectionMonitor::GetPckgAttribute( - const TUint aConnectionId, - const TUint aSubConnectionId, - const TUint aAttribute, - TDes8& aValue, - TRequestStatus& aStatus ) const -{ - if (aAttribute == KStartTime) { - if (aConnectionId == 10) { - TDateTime dateTime(2009, EMarch, 31-1, 15, 15, 15, 0); - TTime time(dateTime); - TConnMonTimeBuf timePckg(time); - aValue.Copy(timePckg); - } else if (aConnectionId == 20) { - TTime time; - time.UniversalTime(); - TConnMonTimeBuf timePckg(time); - aValue.Copy(timePckg); - } else { - Q_ASSERT(false); - } - User::RequestComplete(&aStatus, KErrNone); - } else if (aAttribute == KClientInfo) { - TConnMonClientEnum applications; - if (aConnectionId == 10) { - applications.iCount = 1; - applications.iUid[0].iUid = 0x10008D39; // Web - applications.iUid[1].iUid = 0; - applications.iUid[2].iUid = 0; - applications.iUid[3].iUid = 0; - applications.iUid[4].iUid = 0; - applications.iUid[5].iUid = 0; - applications.iUid[6].iUid = 0; - applications.iUid[7].iUid = 0; - applications.iUid[8].iUid = 0; - applications.iUid[9].iUid = 0; - } else if (aConnectionId == 20) { - applications.iCount = 7; - applications.iUid[0].iUid = 0x101fd9c5; // KBannedServerUID - applications.iUid[1].iUid = 0x1020728E; // KFeedsServerUid - applications.iUid[2].iUid = 0x10008D60; // KDownloadMgrServerUid - applications.iUid[3].iUid = 0x1000484b; // KMessagingServerUid - applications.iUid[4].iUid = 0x102033E6; // KJavaVMUid - applications.iUid[5].iUid = 0x102073CA; // KSUPLServerUid - applications.iUid[6].iUid = 0x200212F3; // Connect Screen - applications.iUid[7].iUid = 0; - applications.iUid[8].iUid = 0; - applications.iUid[9].iUid = 0; - } else { - Q_ASSERT(false); - } - TPckgBuf< TConnMonClientEnum > applicationsPckg( applications ); - aValue.Copy(applicationsPckg); - User::RequestComplete(&aStatus, KErrNone); - } else { - // This is copy-paste from real implementation and we'll use that for other requests. - TIpcArgs args( aConnectionId, aSubConnectionId, aAttribute, &aValue ); - SendReceive( EReqGetPckgAttribute, args, aStatus ); - } -} -#endif - -// This function returns WLAN scan results. -// Six results in every second scan and the others have two. -EXPORT_C void RConnectionMonitor::GetPckgAttribute( - const TUint /* aConnectionId */, - const TUint /* aSubConnectionId */, - const TUint aAttribute, - TDes16& aValue, - TRequestStatus& aStatus ) const { - - if (aAttribute == KWlanNetworks) { - RConnMonWlanNetworksPtrArray wlanPtrArray; - RBuf vendorData; - - TBufC bssid16(QString("addMAC").utf16()); - TBuf8 bssid; - bssid.Copy(bssid16); - - _LIT(wlanAp1Name, "Test AP 1"); - TBufC name1(wlanAp1Name); - CConnMonWlanNetwork* wlanAp1 = CConnMonWlanNetwork::NewL( - name1, - EConnMonInfraStructure, - 20, - EConnMonSecurityOpen, - bssid, - vendorData ); - wlanPtrArray.Append(wlanAp1); - - _LIT(wlanAp2Name, "Test AP 2"); - TBufC name2(wlanAp2Name); - CConnMonWlanNetwork* wlanAp2 = CConnMonWlanNetwork::NewL( - name2, - EConnMonAdHoc, - 20, - EConnMonSecurityOpen, - bssid, - vendorData ); - wlanPtrArray.Append(wlanAp2); - - static bool refresh = true; - - if (refresh) { - _LIT(wlanAp3Name, "Test AP 3"); - TBufC name3(wlanAp3Name); - CConnMonWlanNetwork* wlanAp3 = CConnMonWlanNetwork::NewL( - name3, - EConnMonInfraStructure, - 20, - EConnMonSecurityWep, - bssid, - vendorData ); - wlanPtrArray.Append(wlanAp3); - - _LIT(wlanAp4Name, "Test AP 4"); - TBufC name4(wlanAp4Name); - CConnMonWlanNetwork* wlanAp4 = CConnMonWlanNetwork::NewL( - name4, - EConnMonInfraStructure, - 20, - EConnMonSecurityOpen, - bssid, - vendorData ); - wlanPtrArray.Append(wlanAp4); - - _LIT(wlanAp5Name, "Test AP 5"); - TBufC name5(wlanAp5Name); - CConnMonWlanNetwork* wlanAp5 = CConnMonWlanNetwork::NewL( - name5, - EConnMonInfraStructure, - 20, - EConnMonSecurityWpa, - bssid, - vendorData ); - wlanPtrArray.Append(wlanAp5); - - _LIT(wlanAp6Name, "Test AP 6"); - TBufC name6(wlanAp6Name); - CConnMonWlanNetwork* wlanAp6 = CConnMonWlanNetwork::NewL( - name6, - EConnMonInfraStructure, - 20, - EConnMonSecurityWpaPsk, - bssid, - vendorData ); - wlanPtrArray.Append(wlanAp6); - - refresh = false; - } else { - refresh = true; - } - - CConnMonWlanNetworksPtrArrayPckg wlanBuf(wlanPtrArray, 2560); // TODO: buffer size to more dynamic or use constant - aValue.Copy(wlanBuf.Buf()->Des()); - } else { - Q_ASSERT(false); - } - - User::RequestComplete(&aStatus, KErrNone); -} - -#endif // WLANQTUTILS_T_WLANQTUTILS_UT_FLAG -#endif // __WINS__ diff -r 7b3e49e4608a -r 72ebcbb64834 wlanutilities/wlanqtutilities/ut/stubs/wlanqtutilsconnteststub.cpp --- a/wlanutilities/wlanqtutilities/ut/stubs/wlanqtutilsconnteststub.cpp Thu Jun 24 10:49:51 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,49 +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: -* This is a source file for connmon library stub functions -*/ - -#include - -#ifdef __WINS__ - -#ifdef WLANQTUTILS_T_WLANQTUTILS_UT_FLAG - -// ---------------------------------------------- -// Stub functions for ICT library, used in UT -// ---------------------------------------------- - -#include "wlanqtutilstestcontext.h" - -extern WlanQtUtilsTestContext testContext; - -// ---------------------------------------------------- -// NewL is not stubbed -> parameters are not checked at all -// ---------------------------------------------------- - -/** - * Empty implementation to prevent actual ICT from starting. Result callback is called directly - * in the test cases. - */ -EXPORT_C void CIctsClientInterface::StartL() - { - } - -#endif // WLANQTUTILS_T_WLANQTUTILS_UT_FLAG - -// ---------------------------------------------------- -// No stubs used in emulator -// ---------------------------------------------------- -#endif // __WINS__ diff -r 7b3e49e4608a -r 72ebcbb64834 wlanutilities/wlanqtutilities/ut/stubs/wlanqtutilsesockstub.cpp --- a/wlanutilities/wlanqtutilities/ut/stubs/wlanqtutilsesockstub.cpp Thu Jun 24 10:49:51 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,60 +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: -* This is a source file for esock library stub functions -*/ - -#include - -#ifdef __WINS__ - -#ifdef WLANQTUTILS_T_WLANQTUTILS_UT_FLAG - -// ---------------------------------------------- -// Stub functions for esock library, used in UT -// ---------------------------------------------- - -#include "wlanqtutilstestcontext.h" - -extern WlanQtUtilsTestContext testContext; - -/** - * Returns value from test context. - * - * TConnPref value cannot be verified easily because the real value passed to the function is - * TCommDbConnPref. Dynamic cast from TConnPref to TCommDbConnPref does not work because - * TConnPref does not have virtual functions which means that type information for the - * class hierarchy is not created by the compiler. - */ -void RConnection::Start(class TConnPref &, class TRequestStatus &aStatus) -{ - User::RequestComplete(&aStatus, testContext.esock_.startRetValue_); -} - -#else // WLANQTUTILS_T_WLANQTUTILS_UT_FLAG - -// ---------------------------------------------------- -// Stub functions for esock library, used in emulator -// ---------------------------------------------------- - -/** - * Return always success in emulator. - */ -void RConnection::Start(class TConnPref &, class TRequestStatus &aStatus) -{ - User::RequestComplete(&aStatus, KErrNone); -} - -#endif // WLANQTUTILS_T_WLANQTUTILS_UT_FLAG -#endif // __WINS__ diff -r 7b3e49e4608a -r 72ebcbb64834 wlanutilities/wlanqtutilities/ut/t_wlanqtutils/t_wlanqtutils.pro --- a/wlanutilities/wlanqtutilities/ut/t_wlanqtutils/t_wlanqtutils.pro Thu Jun 24 10:49:51 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,99 +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: -# - -QT += testlib - -TEMPLATE = app -TARGET = t_wlanqtutils - -TARGET.CAPABILITY = ALL -TCB - -DEPENDPATH += . - -#Store generated .moc files to their own directory -MOC_DIR = moc - -#BUILD_DLL macro is used to define export macro -DEFINES += BUILD_WLANQTUTILITIES_DLL - -#Following macros MW_LAYER_SYSTEMINCLUDE and OS_LAYER_SYSTEMINCLUDE are defined -#in X:\QT\mkspecs\features\symbian\platform_paths.prf that is always inluded in -#QT compilation - -INCLUDEPATH += $$MW_LAYER_SYSTEMINCLUDE \ - $$OS_LAYER_SYSTEMINCLUDE \ - . \ - ../../base/inc \ - ../../wrapper/inc \ - ../../traces \ - /epoc32/include/domain/osextensions - -# Input -HEADERS += testwlanqtutils.h \ - ../context/wlanqtutilstestcontext.h \ - ../../base/inc/wlanqtutils.h \ - ../../base/inc/wlanqtutils_p.h \ - ../../base/inc/wlanqtutilsiap.h \ - ../../base/inc/wlanqtutilswlaniap.h \ - ../../base/inc/wlanqtutilswlanap.h \ - ../../base/inc/wlanqtutilsactiveconn.h \ - ../../wrapper/inc/wlanqtutilscmmwrapper.h \ - ../../wrapper/inc/wlanqtutilsconmonwrapper.h \ - ../../wrapper/inc/wlanqtutilsconntestwrapper.h \ - ../../wrapper/inc/wlanqtutilsesockwrapper.h \ - ../../traces/OstTraceDefinitions.h - -SOURCES += testwlanqtutils.cpp \ - ../context/wlanqtutilstestcontext.cpp \ - ../../base/src/wlanqtutils.cpp \ - ../../base/src/wlanqtutils_p.cpp \ - ../../base/src/wlanqtutilsiap.cpp \ - ../../base/src/wlanqtutilswlaniap.cpp \ - ../../base/src/wlanqtutilswlanap.cpp \ - ../../base/src/wlanqtutilsactiveconn.cpp \ - ../../wrapper/src/wlanqtutilscmmwrapper.cpp \ - ../../wrapper/src/wlanqtutilsconmonwrapper.cpp \ - ../../wrapper/src/wlanqtutilsconntestwrapper.cpp \ - ../../wrapper/src/wlanqtutilsesockwrapper.cpp - -symbian: { - HEADERS += ../../wrapper/inc/wlanqtutilscmmwrapper_s60_p.h \ - ../../wrapper/inc/wlanqtutilsconmonwrapper_s60_p.h \ - ../../wrapper/inc/wlanqtutilsconntestwrapper_s60_p.h \ - ../../wrapper/inc/wlanqtutilsesockwrapper_s60_p.h - - SOURCES += ../../wrapper/src/wlanqtutilscmmwrapper_s60.cpp \ - ../../wrapper/src/wlanqtutilsconmonwrapper_s60.cpp \ - ../../wrapper/src/wlanqtutilsconntestwrapper_s60.cpp \ - ../../wrapper/src/wlanqtutilsesockwrapper_s60.cpp \ - ../stubs/wlanqtutilsconnmonstub.cpp \ - ../stubs/wlanqtutilsconnteststub.cpp \ - ../stubs/wlanqtutilsesockstub.cpp -} - -LIBS += -lcmmanager -lconnmon -lcommdb -lesock -lictsclientinterface - -#UT flag is set -DEFINES += WLANQTUTILS_T_WLANQTUTILS_UT_FLAG - -coverage_test: { -message(*** Coverage test mode build - no OST traces.) -#NO_OST_TRACES flag is set -DEFINES += WLANQTUTILS_NO_OST_TRACES_FLAG 'Q_ASSERT(test)=' -} -else { -message(*** Normal Symbian-mode build.) -} \ No newline at end of file diff -r 7b3e49e4608a -r 72ebcbb64834 wlanutilities/wlanqtutilities/ut/t_wlanqtutils/testwlanqtutils.cpp --- a/wlanutilities/wlanqtutilities/ut/t_wlanqtutils/testwlanqtutils.cpp Thu Jun 24 10:49:51 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,683 +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: -* This is the source file for testing Wlan Qt Utilities library. -*/ - -#include -#include -#include -#include -#include -#include "wlanqtutilscommon.h" -#include "wlanqtutilswlanap.h" -#include "wlanqtutilsiap.h" -#include "wlanqtutilswlaniap.h" -#include "wlanqtutils.h" -#include "wlanqtutils_p.h" -#include "wlanqtutilsconmonwrapper.h" -#include "wlanqtutilsconmonwrapper_s60_p.h" -#include "wlanqtutilsconntestwrapper.h" -#include "wlanqtutilsconntestwrapper_s60_p.h" -#include "testwlanqtutils.h" -#include "wlanqtutilstestcontext.h" - -WlanQtUtilsTestContext testContext; - -const QString TestWlanQtUtils::commsDatDefault_ = "default.cre"; - -// --------------------------------------------------------- -// FRAMEWORK FUNCTIONS -// --------------------------------------------------------- - -/** - * This function will be called before the first test function is executed. - */ -void TestWlanQtUtils::initTestCase() -{ - wlanQtUtils_ = NULL; - signalScanReady_ = NULL; - signalWlanNetworkOpened_ = NULL; - signalWlanNetworkClosed_ = NULL; - - //If Active scheduler exists then don't install a new one as it will cause panic - if (CActiveScheduler::Current() == NULL) { - CActiveScheduler *scheduler = new CActiveScheduler(); - CActiveScheduler::Install(scheduler); - } -} - -/** - * This function will be called after the last test function was executed. - */ -void TestWlanQtUtils::cleanupTestCase() -{ - // CommsDat file is initialized. - subTestLoadCommsDatFile(commsDatDefault_); - - // TODO: Can we get rid of this delay? - QWARN(": \n *********** \n * PASSED! * \n *********** \n\n\n"); - QWARN(": \n *** Window will be closed in 5s... \n\n\n"); - QTest::qSleep(5000); -} - -/** - * This function will be called before each test function is executed. - */ -void TestWlanQtUtils::init() -{ - // CommsDat file is initialized. - subTestLoadCommsDatFile(commsDatDefault_); - - testContext.initialize(); - - QVERIFY(wlanQtUtils_ == NULL); - QVERIFY(signalScanReady_ == NULL); - QVERIFY(signalWlanNetworkOpened_ == NULL); - QVERIFY(signalWlanNetworkClosed_ == NULL); - subTestNewWlanQtUtils(); -} - -/** - * This function will be called after each test function is executed. - */ -void TestWlanQtUtils::cleanup() -{ - delete wlanQtUtils_; - wlanQtUtils_ = NULL; - - QCOMPARE(signalScanReady_->count(), 0); - delete signalScanReady_; - signalScanReady_ = NULL; - - QCOMPARE(signalWlanNetworkOpened_->count(), 0); - delete signalWlanNetworkOpened_; - signalWlanNetworkOpened_ = NULL; - - QCOMPARE(signalWlanNetworkClosed_->count(), 0); - delete signalWlanNetworkClosed_; - signalWlanNetworkClosed_ = NULL; -} - -// --------------------------------------------------------- -// TEST CASES -// --------------------------------------------------------- - -/** - * Test available WLAN APs when scan is triggered by client. - * Two scan results have the same SSID and the latter one of those will be removed. - * Two scan results have the same SSID but different security mode - * and both are included in the results. - */ -void TestWlanQtUtils::testAvailableWlanAps() -{ - testContext.connMon_.wlanScanResult_.createDefaultWlanScanResultList(10); - testContext.connMon_.wlanScanResult_.wlanScanResultList_[0]->setSsid("Same SSID"); - testContext.connMon_.wlanScanResult_.wlanScanResultList_[2]->setSsid("Same SSID"); - testContext.connMon_.wlanScanResult_.wlanScanResultList_[5]->setSsid("Same SSID, different SecMode"); - testContext.connMon_.wlanScanResult_.wlanScanResultList_[5]->setSecurityMode(WlanQtUtilsWlanSecModeWpa); - testContext.connMon_.wlanScanResult_.wlanScanResultList_[8]->setSsid("Same SSID, different SecMode"); - testContext.connMon_.wlanScanResult_.wlanScanResultList_[8]->setSecurityMode(WlanQtUtilsWlanSecModeOpen); - - // Request a scan to get result signal - wlanQtUtils_->scanWlans(); - - // Let active object run and verify signal. - subTestSignalWaitAndTake(signalScanReady_, NULL); - - // Get and verify the list of available WLAN APs. - QList iaps; - QList aps; - wlanQtUtils_->availableWlanAps(iaps, aps); - - // First remove AP that has duplicate SSID. - // Then order APs alphabetically. - testContext.connMon_.wlanScanResult_.wlanScanResultList_.removeAt(2); - testContext.connMon_.wlanScanResult_.wlanScanResultList_.move(4, 1); - testContext.connMon_.wlanScanResult_.wlanScanResultList_.move(7, 1); - testContext.connMon_.wlanScanResult_.wlanScanResultList_.move(8, 3); - testContext.connMon_.wlanScanResult_.verifyWlanScanResultList(aps); - QCOMPARE(iaps.count(), 0); - aps.clear(); // TODO: Free AP pointers too. -} - -/** - * Test available WLAN APs when there are also WLAN IAPs available. - */ -void TestWlanQtUtils::testAvailableWlanApsWithIaps() -{ - testContext.connMon_.wlanScanResult_.createDefaultWlanScanResultList(7); - testContext.connMon_.wlanScanResult_.wlanScanResultList_[1]->setSsid("WLAN IAP 3"); - testContext.connMon_.wlanScanResult_.wlanScanResultList_[1]->setSecurityMode(WlanQtUtilsWlanSecModeWpa); - testContext.connMon_.wlanScanResult_.wlanScanResultList_[3]->setSsid(""); - testContext.connMon_.wlanScanResult_.wlanScanResultList_[5]->setSsid("WLAN IAP 1"); - // Todo: security mode not compared yet due to an issue with CMM vs ConnMon WLAN security - // modes under investigation - // SSID is found in Internet Snap, but security mode does not match: - // testContext.connMon_.wlanScanResult_.wlanScanResultList_[6]->setSsid("WLAN IAP 2"); - // testContext.connMon_.wlanScanResult_.wlanScanResultList_[6]->setSecurityMode(WlanQtUtilsWlanSecModeWpa); - - // Request a scan to get result signal - wlanQtUtils_->scanWlans(); - - // Let active object run and verify signal. - subTestSignalWaitAndTake(signalScanReady_, NULL); - - // Get and verify the list of available WLAN APs. - QList iaps; - QList aps; - wlanQtUtils_->availableWlanAps(iaps, aps); - - // Verify WLAN AP list. First, remove scan results that will not appear - // because they are hidden WLANs or WLAN IAPs. - testContext.connMon_.wlanScanResult_.wlanScanResultList_.removeAt(5); - testContext.connMon_.wlanScanResult_.wlanScanResultList_.removeAt(3); - testContext.connMon_.wlanScanResult_.wlanScanResultList_.removeAt(1); - testContext.connMon_.wlanScanResult_.verifyWlanScanResultList(aps); - - // Verify WLAN IAP list - QCOMPARE(iaps.count(), 2); - QCOMPARE(iaps[0]->id(), 5); - QCOMPARE(iaps[0]->name(), QString("WLAN IAP 1")); - QCOMPARE(iaps[0]->bearerType(), WlanQtUtilsBearerTypeWlan); - QCOMPARE(iaps[0]->ssid(), QString("WLAN IAP 1")); - QCOMPARE(iaps[1]->id(), 7); - QCOMPARE(iaps[1]->name(), QString("WLAN IAP 3")); - QCOMPARE(iaps[1]->bearerType(), WlanQtUtilsBearerTypeWlan); - QCOMPARE(iaps[1]->ssid(), QString("WLAN IAP 3")); - iaps.clear(); // TODO: Free IAP pointers too. - aps.clear(); // TODO: Free AP pointers too. -} - -/** - * Test refereshing of WLAN APs when client requests sequential scans. - */ -void TestWlanQtUtils::testAvailableWlanApsSequence() -{ - // **************** Before 1st scan ******************** - QList iaps; - QList aps; - wlanQtUtils_->availableWlanAps(iaps, aps); - // Verify we have no results - QCOMPARE(aps.count(), 0); - QCOMPARE(iaps.count(), 0); - - // **************** 1st scan ******************** - // 6 APs are required for this scan - testContext.connMon_.wlanScanResult_.createDefaultWlanScanResultList(6); - - wlanQtUtils_->scanWlans(); - subTestSignalWaitAndTake(signalScanReady_, NULL); - - // Get the results for the 1st scan - wlanQtUtils_->availableWlanAps(iaps, aps); - // Verify the results for the scan - testContext.connMon_.wlanScanResult_.verifyWlanScanResultList(aps); - QCOMPARE(iaps.count(), 0); - aps.clear(); // TODO: free memory of pointers too. - - // **************** 2nd scan ******************** - // 2 APs are required for this scan - testContext.connMon_.wlanScanResult_.createDefaultWlanScanResultList(2); - - wlanQtUtils_->scanWlans(); - subTestSignalWaitAndTake(signalScanReady_, NULL); - - // Get the results for the 2nd scan - wlanQtUtils_->availableWlanAps(iaps, aps); - // Verify the results for the scan - testContext.connMon_.wlanScanResult_.verifyWlanScanResultList(aps); - QCOMPARE(iaps.count(), 0); - aps.clear(); // TODO: Free memory - - // **************** 3rd scan ******************** - // 4 APs are required for the 3rd scan - testContext.connMon_.wlanScanResult_.createDefaultWlanScanResultList(4); - - wlanQtUtils_->scanWlans(); - subTestSignalWaitAndTake(signalScanReady_, NULL); - - // Get the results for the 3rd scan - wlanQtUtils_->availableWlanAps(iaps, aps); - // Verify the results for the scan - testContext.connMon_.wlanScanResult_.verifyWlanScanResultList(aps); - QCOMPARE(iaps.count(), 0); - aps.clear(); // TODO: Free memory -} - -/** - * This function tests creation of WLAN IAP in a succesful manner. - * - WLAN scan is made because otherwise we cannot verify that IAP creation is successful. - * - Check that there are no available WLAN IAPs. - * - Fetch SNAP list. - * - Create WLAN IAP. - * - Check that WLAN IAP has been created and that this IAP is not in WLAN AP scan results. - */ -void TestWlanQtUtils::testCreateWlanIapOk() -{ - testContext.connMon_.wlanScanResult_.createDefaultWlanScanResultList(1); - testContext.connMon_.wlanScanResult_.wlanScanResultList_[0]->setSsid("New WLAN IAP"); - testContext.connMon_.wlanScanResult_.wlanScanResultList_[0]->setSecurityMode(WlanQtUtilsWlanSecModeWpa2); - - // Create a new instance in order to test functionality triggered in constructor. - WlanQtUtils *utils = new WlanQtUtils(); - QSignalSpy spy(utils, SIGNAL(wlanScanReady())); - QVERIFY(spy.isValid() == true); - subTestSignalWaitAndTake(&spy, NULL); - - // Ensure there are no WLAN IAPs but there is one scan result. - QList iaps; - QList aps; - utils->availableWlanAps(iaps, aps); - - QCOMPARE(iaps.count(), 0); - testContext.connMon_.wlanScanResult_.verifyWlanScanResultList(aps); - - // Execute createWlanIap() function - WlanQtUtilsWlanAp wlanAp("New WLAN IAP", "abcdef", 90, EConnMonInfraStructure, WlanQtUtilsWlanSecModeWpa2); - int iapId = utils->createWlanIap(&wlanAp); - - // Verify that created IAP is in the IAP list and AP list is empty. - utils->availableWlanAps(iaps, aps); - QCOMPARE(iaps.count(), 1); - QCOMPARE(iaps[0]->id(), iapId); - QCOMPARE(iaps[0]->name(), QString("New WLAN IAP")); - QCOMPARE(iaps[0]->bearerType(), WlanQtUtilsBearerTypeWlan); - QCOMPARE(iaps[0]->ssid(), QString("New WLAN IAP")); - // Todo: should be Wpa2, CMM vs ConnMon WLAN security modes under investigation - QCOMPARE(iaps[0]->securityMode(), WlanQtUtilsWlanSecModeWpa); - QCOMPARE(aps.count(), 0); - iaps.clear(); // TODO: memory leak. - delete utils; -} - -/** - * This function tests connecting to IAP in a succesful manner. - */ -void TestWlanQtUtils::testConnectIapOk() -{ - testContext.esock_.startRetValue_ = KErrNone; - - // Esock stub completes connection creation immediately - wlanQtUtils_->connectIap(5); - - // Connection creation in ConnMon interface - testContext.connMon_.activeConnections_.createDefaultActiveConnList(1, 5); - wlanQtUtils_->d_ptr->conMonWrapper_->d_ptrConnInfo->EventL(CConnMonEventBase( - EConnMonCreateConnection, - testContext.connMon_.activeConnections_.activeConnList_[0]->connectionId())); - - // Connection status change in ConnMon interface - wlanQtUtils_->d_ptr->conMonWrapper_->d_ptrConnInfo->EventL(CConnMonConnectionStatusChange( - testContext.connMon_.activeConnections_.activeConnList_[0]->connectionId(), - 0, - KConnectionOpen)); - - // Receive signal for connection opening (caused by connectIap, which completed immediately) - QList arguments; - subTestSignalWaitAndTake(signalWlanNetworkOpened_, &arguments); - QCOMPARE(arguments.at(0).toInt(), 5); - - // Connection status change to opened in ConnMon interface. Sub test cases between test - // cases check that no extra signals are sent - wlanQtUtils_->d_ptr->conMonWrapper_->d_ptrConnInfo->EventL(CConnMonConnectionStatusChange( - testContext.connMon_.activeConnections_.activeConnList_[0]->connectionId(), - 0, - KLinkLayerOpen)); -} - -/** - * This function tests connecting to IAP in unsuccesful manner. - */ -void TestWlanQtUtils::testConnectIapErr() -{ - testContext.esock_.startRetValue_ = KErrGeneral; - - wlanQtUtils_->connectIap(7); - - testContext.connMon_.activeConnections_.createDefaultActiveConnList(1, 7); - wlanQtUtils_->d_ptr->conMonWrapper_->d_ptrConnInfo->EventL(CConnMonEventBase( - EConnMonCreateConnection, - testContext.connMon_.activeConnections_.activeConnList_[0]->connectionId())); - wlanQtUtils_->d_ptr->conMonWrapper_->d_ptrConnInfo->EventL(CConnMonConnectionStatusChange( - testContext.connMon_.activeConnections_.activeConnList_[0]->connectionId(), - 0, - KConnectionOpen)); - - wlanQtUtils_->d_ptr->conMonWrapper_->d_ptrConnInfo->EventL(CConnMonEventBase( - EConnMonDeleteConnection, - testContext.connMon_.activeConnections_.activeConnList_[0]->connectionId())); - - QList arguments; - subTestSignalWaitAndTake(signalWlanNetworkClosed_, &arguments); - QCOMPARE(arguments.at(0).toInt(), 7); -} - -// TODO: testDisconnectFail cases are needed when fail branches are -// implemented into the connmon wrapper -/** - * This function tests IAP disconnecting functionality. - */ -void TestWlanQtUtils::testDisconnectIapOk() -{ - // Create and connect an IAP we can then disconnect - WlanQtUtilsWlanAp wlanAp("Disconnect IAP", "abcdef", 90, EConnMonInfraStructure, WlanQtUtilsWlanSecModeWpa2); - int iapId = wlanQtUtils_->createWlanIap(&wlanAp); - testContext.esock_.startRetValue_ = KErrNone; - wlanQtUtils_->connectIap(iapId); - QList arguments; - subTestSignalWaitAndTake(signalWlanNetworkOpened_, &arguments); - QCOMPARE(arguments.at(0).toInt(), iapId); - - // The disconnect function does not have any return values or - // signals related to the disconnection, thus plain - // function call is done for the test. - wlanQtUtils_->disconnectIap(iapId); -} - -/** - * This function tests IAP getter with existing IAP ID. - */ -void TestWlanQtUtils::testIapFound() -{ - // Create the IAP we want to find with the getter - WlanQtUtilsWlanAp wlanAp("testIapFound", "abcdef", 90, EConnMonInfraStructure, WlanQtUtilsWlanSecModeWpa2); - int iapId = wlanQtUtils_->createWlanIap(&wlanAp); - - // Execute the function under test and check that we got the correct IAP - WlanQtUtilsIap *iap = wlanQtUtils_->iap(iapId); - QVERIFY(iap != NULL); - QCOMPARE(iap->id(), iapId); - QCOMPARE(iap->name(), QString("testIapFound")); - QCOMPARE(iap->bearerType(), WlanQtUtilsBearerTypeWlan); -} - -/** - * This function tests IAP getter with non-existing IAP ID. - */ -void TestWlanQtUtils::testIapNotFound() -{ - // Execute the function under test and check that we get no IAP as result - WlanQtUtilsIap *iap = wlanQtUtils_->iap(1000); - QVERIFY(iap == NULL); -} - -/** - * This function tests connected WLAN IAP getter with existing connection. - */ -void TestWlanQtUtils::testConnectedWlanIdFound() -{ - // Create the IAP we want to find with the getter - WlanQtUtilsWlanAp wlanAp("testConnectedWlanIdFound", "abcdef", 90, EConnMonInfraStructure, WlanQtUtilsWlanSecModeWpa2); - int iapId = wlanQtUtils_->createWlanIap(&wlanAp); - - testContext.connMon_.activeConnections_.createDefaultActiveConnList(1, iapId); - - // Send event for connection creation. - wlanQtUtils_->d_ptr->conMonWrapper_->d_ptrConnInfo->EventL(CConnMonEventBase( - EConnMonCreateConnection, - testContext.connMon_.activeConnections_.activeConnList_[0]->connectionId())); - - // Send events for connection status change -> opened. - wlanQtUtils_->d_ptr->conMonWrapper_->d_ptrConnInfo->EventL(CConnMonConnectionStatusChange( - testContext.connMon_.activeConnections_.activeConnList_[0]->connectionId(), - 0, - KStartingConnection)); - wlanQtUtils_->d_ptr->conMonWrapper_->d_ptrConnInfo->EventL(CConnMonConnectionStatusChange( - testContext.connMon_.activeConnections_.activeConnList_[0]->connectionId(), - 0, - KLinkLayerOpen)); - - QList arguments; - subTestSignalWaitAndTake(signalWlanNetworkOpened_, &arguments); - QCOMPARE(arguments.at(0).toInt(), iapId); - - // Execute the function under test and check that we get valid ID as result - int id = wlanQtUtils_->connectedWlanId(); - QCOMPARE(id, iapId); -} - -/** - * This function tests connected WLAN IAP getter with connection existing already during dll construction. - */ -void TestWlanQtUtils::testConnectedWlanIdFoundConstructor() -{ - // IAP ID 5 exists in default commsdat file - testContext.connMon_.activeConnections_.createDefaultActiveConnList(1, 5); - - // Create a new instance in order to test functionality triggered in constructor. - WlanQtUtils *utils = new WlanQtUtils(); - - // Execute the function under test and check that we get valid ID as result - int id = utils->connectedWlanId(); - QCOMPARE(id, 5); - - delete utils; -} - -/** - * This function tests connected WLAN IAP getter without existing connection. - */ -void TestWlanQtUtils::testConnectedWlanIdNotFound() -{ - // Execute the function under test and check that we get invalid ID as result - int id = wlanQtUtils_->connectedWlanId(); - QCOMPARE(id, WlanQtUtilsInvalidIapId); -} - -/** - * Test WLAN scan triggering interface. - */ -void TestWlanQtUtils::testScanWlans() -{ - // Execute function under test - wlanQtUtils_->scanWlans(); - - // No need to verify scan results here, testAvailableWlanAps* test cases - // are for that. Just make sure the result signal is received. - subTestSignalWaitAndTake(signalScanReady_, NULL); -} - -/** - * This function tests Wlan network opening signal when network is not opened by the dll. - */ -void TestWlanQtUtils::testWlanNetworkOpened() -{ - testContext.connMon_.activeConnections_.createDefaultActiveConnList(1, 5); - - // Send event for connection creation. - wlanQtUtils_->d_ptr->conMonWrapper_->d_ptrConnInfo->EventL(CConnMonEventBase( - EConnMonCreateConnection, - testContext.connMon_.activeConnections_.activeConnList_[0]->connectionId())); - - // Send events for connection status change -> opened. - wlanQtUtils_->d_ptr->conMonWrapper_->d_ptrConnInfo->EventL(CConnMonConnectionStatusChange( - testContext.connMon_.activeConnections_.activeConnList_[0]->connectionId(), - 0, - KConnectionOpen)); - wlanQtUtils_->d_ptr->conMonWrapper_->d_ptrConnInfo->EventL(CConnMonConnectionStatusChange( - testContext.connMon_.activeConnections_.activeConnList_[0]->connectionId(), - 0, - KLinkLayerOpen)); - - QList arguments; - subTestSignalWaitAndTake(signalWlanNetworkOpened_, &arguments); - QCOMPARE(arguments.at(0).toInt(), 5); -} - -/** - * This function tests Wlan network closing signal when network is not closed by the dll. - */ -void TestWlanQtUtils::testWlanNetworkClosed() -{ - // First create a connection - testContext.connMon_.activeConnections_.createDefaultActiveConnList(1, 5); - - // Send event for connection creation. - wlanQtUtils_->d_ptr->conMonWrapper_->d_ptrConnInfo->EventL(CConnMonEventBase( - EConnMonCreateConnection, - testContext.connMon_.activeConnections_.activeConnList_[0]->connectionId())); - - // Send events for connection status change -> opened. - wlanQtUtils_->d_ptr->conMonWrapper_->d_ptrConnInfo->EventL(CConnMonConnectionStatusChange( - testContext.connMon_.activeConnections_.activeConnList_[0]->connectionId(), - 0, - KConnectionOpen)); - wlanQtUtils_->d_ptr->conMonWrapper_->d_ptrConnInfo->EventL(CConnMonConnectionStatusChange( - testContext.connMon_.activeConnections_.activeConnList_[0]->connectionId(), - 0, - KLinkLayerOpen)); - - QList arguments; - subTestSignalWaitAndTake(signalWlanNetworkOpened_, &arguments); - QCOMPARE(arguments.at(0).toInt(), 5); - - // Send event for connection status change -> closed. - wlanQtUtils_->d_ptr->conMonWrapper_->d_ptrConnInfo->EventL(CConnMonConnectionStatusChange( - testContext.connMon_.activeConnections_.activeConnList_[0]->connectionId(), - 0, - KLinkLayerClosed)); - - // Send event for connection deletion. - wlanQtUtils_->d_ptr->conMonWrapper_->d_ptrConnInfo->EventL(CConnMonEventBase( - EConnMonDeleteConnection, - testContext.connMon_.activeConnections_.activeConnList_[0]->connectionId())); - - subTestSignalWaitAndTake(signalWlanNetworkClosed_, &arguments); - QCOMPARE(arguments.at(0).toInt(), 5); -} - -/** - * This function tests ICT when connection test passes. - */ -void TestWlanQtUtils::testConnectionTestPass() -{ - // Create and connect an IAP we can then test - WlanQtUtilsWlanAp wlanAp("Connection test IAP", "abcdef", 90, EConnMonInfraStructure, WlanQtUtilsWlanSecModeWpa2); - int iapId = wlanQtUtils_->createWlanIap(&wlanAp); - testContext.esock_.startRetValue_ = KErrNone; - wlanQtUtils_->connectIap(iapId); - QList arguments; - subTestSignalWaitAndTake(signalWlanNetworkOpened_, &arguments); - QCOMPARE(arguments.at(0).toInt(), iapId); - - // Connection test automatically started at this point. Call result function explicitly - // No interface exists that we could check that the IAP is moved to Internet SNAP correctly - TBuf<5> string; - wlanQtUtils_->d_ptr->connTestWrapper_->d_ptr_->ConnectivityObserver(EConnectionOk, string); -} - -/** - * This function tests ICT when connection test fails. - */ -void TestWlanQtUtils::testConnectionTestFail() -{ - // Create and connect an IAP we can then test - WlanQtUtilsWlanAp wlanAp("Connection test IAP", "abcdef", 90, EConnMonInfraStructure, WlanQtUtilsWlanSecModeWpa2); - int iapId = wlanQtUtils_->createWlanIap(&wlanAp); - testContext.esock_.startRetValue_ = KErrNone; - wlanQtUtils_->connectIap(iapId); - QList arguments; - subTestSignalWaitAndTake(signalWlanNetworkOpened_, &arguments); - QCOMPARE(arguments.at(0).toInt(), iapId); - - // Connection test automatically started at this point. Call result function explicitly - // No interface exists that we could check that IAP is not moved to another SNAP - // Todo: Repeat for all possible error codes to gain coverage - TBuf<5> string; - wlanQtUtils_->d_ptr->connTestWrapper_->d_ptr_->ConnectivityObserver(EHttpAuthenticationNeeded, string); -} - -// --------------------------------------------------------- -// SUB TEST CASES -// --------------------------------------------------------- - -/** - * This function waits for active objects to get time to run, takes the arguments of the - * first signal and returns them from the given signal spy. - * This function also verifies that the number of signals is 1. - * - * @param[in] spy Signal spy. - * @param[out] arguments Arguments of the first signal in the given signal spy. NULL if arguments not needed. - */ -void TestWlanQtUtils::subTestSignalWaitAndTake(QSignalSpy* spy, QList* arguments) -{ - QTest::qWait(1); - QCOMPARE(spy->count(), 1); - QList arguments_tmp = spy->takeFirst(); - if (arguments != NULL) { - *arguments = arguments_tmp; - } -} - -/** - * This function loads given CommsDat file, replacing current one. - * If CommsDat file doesn't exist, it can be re-created by commanding WST script. - * Using help switch is a quick way: - * run_wst HELP - * - * @param newCommsdatFilename Filename of the new CommsDat to be loaded. - */ -void TestWlanQtUtils::subTestLoadCommsDatFile(QString newCommsdatFilename) -{ - // EPOC's CommsDat filename - const QString epocCommsdatFilename("cccccc00.cre"); - // EPOC's directory for CommsDat file - const QString commsdatDir("c:\\private\\10202be9\\persists\\"); - // Created backup directory under EPOC for CommsDat files - const QString storeDir("c:\\private\\10202be9\\persists\\backup\\"); - QString nameOld = commsdatDir + epocCommsdatFilename; - QString nameDefault = storeDir + newCommsdatFilename; - - // First remove the old CommsDat file. - Q_ASSERT(QFile::remove(nameOld) == TRUE); - - // Copy the stored default CommsDat file. - Q_ASSERT(QFile::copy(nameDefault, nameOld) == TRUE); -} - -/** - * - */ -void TestWlanQtUtils::subTestNewWlanQtUtils() -{ - if (wlanQtUtils_ != NULL) { - delete wlanQtUtils_; - } - wlanQtUtils_ = new WlanQtUtils(); - - if (signalScanReady_ != NULL) { - delete signalScanReady_; - } - signalScanReady_ = new QSignalSpy(wlanQtUtils_, SIGNAL(wlanScanReady())); - QVERIFY(signalScanReady_->isValid() == true); - - if (signalWlanNetworkOpened_ != NULL) { - delete signalWlanNetworkOpened_; - } - signalWlanNetworkOpened_ = new QSignalSpy(wlanQtUtils_, SIGNAL(wlanNetworkOpened(int))); - QVERIFY(signalWlanNetworkOpened_->isValid() == true); - - if (signalWlanNetworkClosed_ != NULL) { - delete signalWlanNetworkClosed_; - } - signalWlanNetworkClosed_ = new QSignalSpy(wlanQtUtils_, SIGNAL(wlanNetworkClosed(int))); - QVERIFY(signalWlanNetworkClosed_->isValid() == true); - - // Let first active objects to run. First WLAN scan is done in engine contructor. - subTestSignalWaitAndTake(signalScanReady_, NULL); -} - -// Create main function using QTest marco. -QTEST_MAIN(TestWlanQtUtils) diff -r 7b3e49e4608a -r 72ebcbb64834 wlanutilities/wlanqtutilities/ut/t_wlanqtutils/testwlanqtutils.h --- a/wlanutilities/wlanqtutilities/ut/t_wlanqtutils/testwlanqtutils.h Thu Jun 24 10:49:51 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,97 +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: -* This is the header file for testing Wlan Qt Utilities library. -*/ - -#ifndef TESTWLANQTUTILS_H_ -#define TESTWLANQTUTILS_H_ - -#include - -class QSignalSpy; -class WlanQtUtils; - -class TestWlanQtUtils: public QObject -{ - Q_OBJECT - -private slots: - - // Functions from QTest framework. - void initTestCase(); - void cleanupTestCase(); - void init(); - void cleanup(); - - // Test functions for public interface. - void testAvailableWlanAps(); - void testAvailableWlanApsWithIaps(); - void testAvailableWlanApsSequence(); - - void testCreateWlanIapOk(); - - void testConnectIapOk(); - void testConnectIapErr(); - - void testDisconnectIapOk(); - - void testIapFound(); - void testIapNotFound(); - - void testConnectedWlanIdFound(); - void testConnectedWlanIdFoundConstructor(); - void testConnectedWlanIdNotFound(); - - void testScanWlans(); - - void testWlanNetworkOpened(); - void testWlanNetworkClosed(); - - // Test functions for private implementation (tested via public interface) - void testConnectionTestPass(); - void testConnectionTestFail(); - -private: - - // Helper functions, that is, sub test cases. - void subTestSignalWaitAndTake(QSignalSpy *spy, QList *arguments); - void subTestLoadCommsDatFile(QString newCommsdatFilename); - void subTestNewWlanQtUtils(); - - // Member variables. - WlanQtUtils *wlanQtUtils_; - QSignalSpy *signalScanReady_; - QSignalSpy *signalWlanNetworkOpened_; - QSignalSpy *signalWlanNetworkClosed_; - - /* Default CommsDat file name - SNAP ID=3: Internet: - IAP ID = 1: packet data 1 - IAP ID = 3: packet data 2 - IAP ID = 4: packet data 3 - IAP ID = 5: WLAN IAP 1, EWlanSecModeOpen - IAP ID = 6: WLAN IAP 2, EWlanSecModeWep, w2key - IAP ID = 7: WLAN IAP 3, EWlanSecModeWpa, wlan3key - SNAP ID = 4: Multimedia msg. - SNAP ID = 5: WAP services - SNAP ID = 6: My Snap: - IAP ID = 8: Home WLAN, EWlanSecModeOpen - IAP ID = 9: Streaming - */ - static const QString commsDatDefault_; -}; - -#endif /* TESTWLANQTUTILS_H_ */ - diff -r 7b3e49e4608a -r 72ebcbb64834 wlanutilities/wlanqtutilities/wst/run_wst.bat --- a/wlanutilities/wlanqtutilities/wst/run_wst.bat Thu Jun 24 10:49:51 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,173 +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: -:: -::============================================================================= - -:: Script(s) uses following environment settings: -:: - CD -:: - DATE -:: - TIME -:: - TEMP - - -::----------------------------------------------------------------------------- -:: Do the preparations: -:: - Don't show the commands -:: - Use local parameters -- don't pollute the global one -:: - Dim the lights for time of script execution -:: - Store the current working directory -::----------------------------------------------------------------------------- - -@echo off -echo *** RUN_WST: START: -setlocal -color 08 -pushd . -if not exist run_wst.bat goto INVALID_DIR - - -::----------------------------------------------------------------------------- -:: Set the local variables -::----------------------------------------------------------------------------- - -echo *** RUN_WST: SET VARIABLES: -set wst_root_dir=%cd% -set wst_log_dir=%wst_root_dir%\wst_log -set wst_report_dir=%wst_root_dir%\wst_report -set log_file=%wst_log_dir%\wst_log.txt -set build_script=%wst_root_dir%\wst_script\wst_make.bat -set epoc_commsdat_dir=\epoc32\winscw\c\private\10202be9\persists -if not exist %epoc_commsdat_dir% goto INVALID_DIR -set epoc_backup_dir=%epoc_commsdat_dir%\backup -set ut_commsdat_dir=%wst_root_dir%\..\ut\context\commsdat_files -if not exist %ut_commsdat_dir% goto INVALID_DIR -set ut_commsdat_file_default=%ut_commsdat_dir%\default.cre -if not exist %ut_commsdat_file_default% goto INVALID_DIR -set ut_commsdat_files=%ut_commsdat_dir%\*.cre -if not exist %ut_commsdat_files% goto INVALID_DIR - - -::----------------------------------------------------------------------------- -:: Copy commsdat file to emulator directory and also to backup directory -::----------------------------------------------------------------------------- - -echo *** RUN_WST: COPY FILES: -copy %ut_commsdat_file_default% %epoc_commsdat_dir%\cccccc00.cre /y -if not exist %epoc_backup_dir% mkdir %epoc_backup_dir% -copy %ut_commsdat_files% %epoc_backup_dir% /y - - -::----------------------------------------------------------------------------- -:: Check that script exists -::----------------------------------------------------------------------------- - -echo *** RUN_WST: SOME CHECKS: -if not exist %build_script% goto INVALID_DIR -:: Create output directory if it does not exist -if not exist %wst_log_dir% mkdir %wst_log_dir% -if not exist %wst_report_dir% mkdir %wst_report_dir% -:: Create log file -echo *** WST_LOG: BEGIN *** > %log_file% - - -::----------------------------------------------------------------------------- -:: Check parameters -::----------------------------------------------------------------------------- - -set command=ERROR -if [%1]==[] set command=CLEAN_OLD_FILES COMPILE_WLANQTUTILS COMPILE_TEST_CASES RUN_TEST_CASES GENERATE_REPORTS SHOW_RESULTS -if [%1]==[CLEAN_OLD] set command=CLEAN_OLD_FILES -if [%1]==[WLANQTUTILS] set command=COMPILE_WLANQTUTILS -if [%1]==[CASES] set command=COMPILE_TEST_CASES -if [%1]==[RUN] set command=RUN_TEST_CASES -if [%1]==[REPORTS] set command=GENERATE_REPORTS -if [%1]==[RESULTS] set command=SHOW_RESULTS -if [%1]==[BROWSE] set command=START_BROWSER -if [%1]==[/?] goto HELP -if [%1]==[HELP] goto HELP -if [%1]==[/h] goto HELP -if [%1]==[-h] goto HELP - -::----------------------------------------------------------------------------- -:PARSE_COMMANDS -::----------------------------------------------------------------------------- - -echo *** RUN_WST: COMMAND: %command% -echo *** RUN_WST: CALL SCRIPT: -for %%i IN ( %command% ) DO ( - call %build_script% %wst_root_dir% wst_log.txt %%i - for /f "tokens=3 delims= " %%x in ('find /C " Error " %log_file%') do ( - if not [%%x]==[0] goto ERROR - ) -) - -goto THE_END - - -::----------------------------------------------------------------------------- -:INVALID_DIR -::----------------------------------------------------------------------------- - -echo *** RUN_WST: INVALID DIR: -echo *** Test script sub-script not found! -echo *** Please be sure to run the script in same directory, -echo *** i.e. .\run_wst.bat , and NOT .\wst\run_wst.bat - -goto THE_END - - -::----------------------------------------------------------------------------- -:ERROR -::----------------------------------------------------------------------------- - -echo *** RUN_WST: ERROR: -color 48 -echo Error in compilation: -findstr /C:" Error " < %log_file% -echo. -Echo Quitting WST. - -goto THE_END - - -::----------------------------------------------------------------------------- -:HELP -::----------------------------------------------------------------------------- - -echo *** RUN_WST: HELP: -echo Run Wlan Qt Utilities Workstation Testing -echo. -echo RUN_WST [param] -echo. -echo param -echo [none] - Do all, from CLEAN_OLD to RESULTS -echo. -echo CLEAN_OLD - Clean metrics and other generated files -echo WLANQTUTILS - Build only Wlan Qt Utilities components -echo CASES - Build only Tester components -echo RUN - Run Tester -echo REPORTS - Generate reports -echo RESULTS - Show results -echo BROWSE - Start browser -echo. - - -::----------------------------------------------------------------------------- -:THE_END -::----------------------------------------------------------------------------- - -echo *** RUN_WST: END: -color -popd diff -r 7b3e49e4608a -r 72ebcbb64834 wlanutilities/wlanqtutilities/wst/wst_script/wst_make.bat --- a/wlanutilities/wlanqtutilities/wst/wst_script/wst_make.bat Thu Jun 24 10:49:51 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,199 +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: -:: -::============================================================================= -:: -:: Following commands are implemented: -:: - CLEAN_OLD_FILES -:: - COMPILE_WLANQTUTILS -:: - COMPILE_TEST_CASES -:: - RUN_TEST_CASES -:: - GENERATE_REPORTS -:: - SHOW_RESULTS -:: - START_BROWSER -::============================================================================= - -::----------------------------------------------------------------------------- -:: Do the preparations: -:: - Don't show the commands -:: - Use local parameters -- don't pollute the global one -::----------------------------------------------------------------------------- -@echo off - -echo *** WST_MAKE: START: -setlocal - -::----------------------------------------------------------------------------- -:: Check input -:: -:: Parameters that are required: -:: 1) wst_root_dir -:: 2) log_file_name -:: 3) the command -::----------------------------------------------------------------------------- - -:: (1) -if not exist %1 goto ERROR -if [%1]==[] goto ERROR -set wst_root_dir=%1 -set wst_log_dir=%1\wst_log -set wst_report_dir=%1\wst_report -set wlanqtutils_root_dir=%1\.. -set wlanqtutils_test_dir=%1\..\ut\t_wlanqtutils - -:: (2) -if [%2]==[] goto ERROR -set log_file_name=%2 -set log_file=%wst_log_dir%\%log_file_name% -if not exist %log_file% goto ERROR -echo *** DATE AND TIME: %date%, %time% >> %log_file% -echo *** WST_MAKE: INFO: Wlan Qt Utilities root dir: %wlanqtutils_root_dir% -echo *** WST_MAKE: INFO: Wlan Qt Utilities test dir: %wlanqtutils_test_dir% -echo *** WST_MAKE: INFO: WST log dir: %wst_log_dir% -echo *** WST_MAKE: INFO: WST log file: %log_file% - -:: (3) -if [%3]==[] goto ERROR -goto %3 - -:: Error if label not found. -goto ERROR - -::----------------------------------------------------------------------------- -:CLEAN_OLD_FILES -::----------------------------------------------------------------------------- - -echo *** WST_MAKE: CLEAN_OLD_FILES: -echo *** WST_LOG: CLEAN_OLD_FILES >> %log_file% - -move %wst_log_dir%\%log_file_name% %wst_root_dir% -del /F /S /Q %wst_log_dir%\* -del /F /S /Q %wst_report_dir%\* -rmdir /S /Q %wst_log_dir%\CMTHTML -rmdir /S /Q %wst_log_dir%\CTCHTML -move %wst_root_dir%\%log_file_name% %wst_log_dir% -del \epoc32\winscw\c\data\wlanqtutils_qtest_log.txt - -goto THE_END - -::----------------------------------------------------------------------------- -:COMPILE_WLANQTUTILS -::----------------------------------------------------------------------------- - -echo *** WST_MAKE: COMPILE_WLANQTUTILS: -echo *** WST_LOG: COMPILE_WLANQTUTILS >> %log_file% - -cd %wlanqtutils_root_dir% -call qmake >> %log_file% 2>&1 -call bldmake bldfiles >> %log_file% 2>&1 -call abld reallyclean winscw >> %log_file% 2>&1 -call abld build winscw udeb >> %log_file% 2>&1 - -goto THE_END - -::----------------------------------------------------------------------------- -:COMPILE_TEST_CASES -::----------------------------------------------------------------------------- - -echo *** WST_MAKE: COMPILE_TEST_CASES: -echo *** WST_LOG: COMPILE_TEST_CASES >> %log_file% - -cd %wlanqtutils_test_dir% -call qmake "CONFIG += coverage_test" >> %log_file% 2>&1 -call bldmake bldfiles >> %log_file% 2>&1 -call abld reallyclean winscw >> %log_file% 2>&1 -:: Call CTC instrumentation script. Source directories hard coded, because NO_EXCLUDE does not like % characters... -call ctcwrap -C EXCLUDE=* -C NO_EXCLUDE+..\..\base\src\*.cpp,..\..\wrapper\src\*.cpp -n %wst_log_dir%\MON.sym -i m -v abld build winscw udeb >> %log_file% 2>&1 - -goto THE_END - -::----------------------------------------------------------------------------- -:RUN_TEST_CASES -::----------------------------------------------------------------------------- - -echo *** WST_MAKE: RUN_TEST_CASES: -echo *** WST_LOG: RUN_TEST_CASES >> %log_file% - -call \epoc32\release\winscw\udeb\t_wlanqtutils.exe -o c:\data\wlanqtutils_qtest_log.txt - -goto THE_END - -::----------------------------------------------------------------------------- -:GENERATE_REPORTS -::----------------------------------------------------------------------------- - -echo *** WST_MAKE: GENERATE_REPORTS: -echo *** WST_LOG: GENERATE_REPORTS >> %log_file% - -cd %wst_log_dir% - -call ctcpost -p %wst_log_dir%\ctc_coverage.txt -call ctc2html -nsb -i %wst_log_dir%\ctc_coverage.txt - -call dir /s /b %wlanqtutils_root_dir%\*.cpp > %wst_log_dir%\raw_filelist.txt - -call findstr /I /V "moc_" %wst_log_dir%\raw_filelist.txt > %wst_log_dir%\filelist.txt -call cmt -f %wst_log_dir%\filelist.txt -o cmt_metrics.txt >> %log_file% -call cmt2html -nsb -i cmt_metrics.txt - -:: Clean up temp files -call del %wst_log_dir%\*filelist.txt - -echo *** WST_MAKE: COPY LOGS: -call copy %TEMP%\epocwind.out %wst_log_dir%\epocwind.txt - -goto THE_END - -::----------------------------------------------------------------------------- -:SHOW_RESULTS -::----------------------------------------------------------------------------- - -echo *** WST_MAKE: SHOW_RESULTS: -echo *** WST_LOG: SHOW_RESULTS >> %log_file% -echo *** Module tests: -call findstr /C:"Totals: " \epoc32\winscw\c\data\wlanqtutils_qtest_log.txt -echo *** Coverage: -call findstr /C:"Number of " %wst_log_dir%\ctc_coverage.txt -call findstr /C:"TER " %wst_log_dir%\ctc_coverage.txt - -goto THE_END - -::----------------------------------------------------------------------------- -:START_BROWSER -::----------------------------------------------------------------------------- - -echo *** WST_MAKE: START_BROWSER: -echo *** WST_LOG: START_BROWSER >> %log_file% -echo. -echo Starting up browser to show the results - -start %wst_root_dir%\wst_report\coverage.html - -goto THE_END - -::----------------------------------------------------------------------------- -:ERROR -::----------------------------------------------------------------------------- - -echo *** WST_MAKE: ERROR: -endlocal -echo wst_make *** Error (unknown parameter) >> %log_file% - -goto THE_END - -::----------------------------------------------------------------------------- -:THE_END -::----------------------------------------------------------------------------- -echo *** WST_MAKE: END: diff -r 7b3e49e4608a -r 72ebcbb64834 wlanutilities/wlansettingsui/group/bld.inf --- a/wlanutilities/wlansettingsui/group/bld.inf Thu Jun 24 10:49:51 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,28 +0,0 @@ -/* -* Copyright (c) 2001-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: Build information for the wlansettingsui -* -*/ - - -#include - -PRJ_EXPORTS - -PRJ_PLATFORMS -DEFAULT - -PRJ_EXPORTS - -PRJ_MMPFILES diff -r 7b3e49e4608a -r 72ebcbb64834 wlanutilities/wlansniffer/inc/wlansniffer.h --- a/wlanutilities/wlansniffer/inc/wlansniffer.h Thu Jun 24 10:49:51 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,57 +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: - * - */ - -#ifndef WLANSNIFFER_H -#define WLANSNIFFER_H - -#include - -class QTranslator; -class WlanSnifferMainWindow; -class WlanQtUtils; - -class WlanSniffer : public HbApplication - { - Q_OBJECT - -public: - WlanSniffer(int argc, char* argv[]); - virtual ~WlanSniffer(); - - /** - * This function (from QObject) handles timers. Initiates a new WLAN scan. - * - * @param Unused. - */ - void timerEvent(QTimerEvent *event); - - WlanQtUtils *wlanQtUtils() const; - -private slots: - void exitApplication(); - -private: - QTranslator* mTranslator; - WlanQtUtils *mWlanQtUtils; - // Todo: why does the example use QSharedPointer for these? - WlanSnifferMainWindow *mMainWindow; // owned - int mScanTimerId; - }; - -#endif - -// End of File diff -r 7b3e49e4608a -r 72ebcbb64834 wlanutilities/wlansniffer/inc/wlansnifferlistview.h --- a/wlanutilities/wlansniffer/inc/wlansnifferlistview.h Thu Jun 24 10:49:51 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,74 +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: - * - */ - -#ifndef WLANSNIFFERLISTVIEW_H -#define WLANSNIFFERLISTVIEW_H - -#include -#include "wlanqtutilscommon.h" - -class HbListWidget; -class HbListWidgetItem; -class HbLabel; -class WlanSniffer; -class WlanQtUtilsWlanIap; -class WlanQtUtilsWlanAp; - -class WlanSnifferListView : public HbView - { - Q_OBJECT - -public: - WlanSnifferListView(WlanSniffer *appRef); - virtual ~WlanSnifferListView(); - - void update(); - void updateConnectionOpened(int iapId); - void updateConnectionClosed(int iapId); - -signals: - void detailsTriggered(int); - void completeServiceTriggered(); - -public slots: - void handleContextMenuClosed(); - -private slots: - void handleListItemActivated(HbListWidgetItem *item); - void handleListItemLongPressed(HbListWidgetItem *item, const QPointF &coords); - void handleListItemDisconnect(); - void handleDisconnect(); - -private: - QString signalStrengthIconChoose(int signalStrength, WlanQtUtilsWlanSecMode secMode); - HbListWidgetItem *wlanListItemIapCreate(const WlanQtUtilsWlanIap *iap); - HbListWidgetItem *wlanListItemApCreate(const WlanQtUtilsWlanAp *ap); - -private: - HbListWidget *mWlanList; - HbLabel *mStatusLabel; - WlanSniffer *mAppRef; - int mConnectingIapId; - /*! - * Data identifying the network for which the context menu has been - * opened: WlanQtUtilsAp class, or int IAP ID - */ - QVariant mContextMenuData; - HbMenu *mContextMenu; //!< Context menu reference, if one is open - }; - -#endif diff -r 7b3e49e4608a -r 72ebcbb64834 wlanutilities/wlansniffer/inc/wlansniffermainwindow.h --- a/wlanutilities/wlansniffer/inc/wlansniffermainwindow.h Thu Jun 24 10:49:51 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,62 +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: - * - */ - -#ifndef WLANSNIFFERMAINWINDOW_H -#define WLANSNIFFERMAINWINDOW_H - -#include - -#include - -class HbAction; -class WlanSnifferListView; -class WlanSniffer; -class WlanSnifferService; - -class WlanSnifferMainWindow : public HbMainWindow - { - Q_OBJECT - -public: - WlanSnifferMainWindow(WlanSniffer *appRef); - virtual ~WlanSnifferMainWindow(); - -public slots: - void toListView(); - void toDetailsView(int iapId); - - void updateListView(); - void updateListViewConnectionOpened(int iapId); - void updateListViewConnectionClosed(int iapId); - -signals: - void exitTriggered(); - -private slots: - void completeService(); - -private: - // Methods to add views to the main window - void addListView(); - -private: - WlanSniffer *mAppRef; - WlanSnifferListView *mListView; - WlanSnifferService* mService; - }; - -#endif diff -r 7b3e49e4608a -r 72ebcbb64834 wlanutilities/wlansniffer/inc/wlansnifferservice.h --- a/wlanutilities/wlansniffer/inc/wlansnifferservice.h Thu Jun 24 10:49:51 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,43 +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: -* -*/ - -#ifndef WLANSNIFFERSERVICE_H -#define WLANSNIFFERSERVICE_H - -#include - -class WlanSnifferService: public XQServiceProvider -{ - Q_OBJECT - -public: - WlanSnifferService( QObject *parent = 0 ); - ~WlanSnifferService(); - void complete(); - -signals: - void toListView(); - void exitTriggered(); - -public slots: - void listView(); - -private: - int mAsyncRequestIndex; -}; - -#endif // WLANSNIFFERSERVICE_H diff -r 7b3e49e4608a -r 72ebcbb64834 wlanutilities/wlansniffer/res/qgn_indi_wifi_protected_add.svg --- a/wlanutilities/wlansniffer/res/qgn_indi_wifi_protected_add.svg Thu Jun 24 10:49:51 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,10 +0,0 @@ - - - - - - - - - - diff -r 7b3e49e4608a -r 72ebcbb64834 wlanutilities/wlansniffer/res/qgn_indi_wlan_secure_network_add.svg --- a/wlanutilities/wlansniffer/res/qgn_indi_wlan_secure_network_add.svg Thu Jun 24 10:49:51 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,13 +0,0 @@ - - - - - - - - - - - - - diff -r 7b3e49e4608a -r 72ebcbb64834 wlanutilities/wlansniffer/res/qgn_indi_wlan_signal_good_add.svg --- a/wlanutilities/wlansniffer/res/qgn_indi_wlan_signal_good_add.svg Thu Jun 24 10:49:51 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,10 +0,0 @@ - - - - - - - - - - diff -r 7b3e49e4608a -r 72ebcbb64834 wlanutilities/wlansniffer/res/qgn_indi_wlan_signal_low_add.svg --- a/wlanutilities/wlansniffer/res/qgn_indi_wlan_signal_low_add.svg Thu Jun 24 10:49:51 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,15 +0,0 @@ - - - - - - - - - - - - - - - diff -r 7b3e49e4608a -r 72ebcbb64834 wlanutilities/wlansniffer/res/qgn_indi_wlan_signal_med_add.svg --- a/wlanutilities/wlansniffer/res/qgn_indi_wlan_signal_med_add.svg Thu Jun 24 10:49:51 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,13 +0,0 @@ - - - - - - - - - - - - - diff -r 7b3e49e4608a -r 72ebcbb64834 wlanutilities/wlansniffer/res/qgn_prop_cmon_wlan_conn.svg --- a/wlanutilities/wlansniffer/res/qgn_prop_cmon_wlan_conn.svg Thu Jun 24 10:49:51 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,22 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - diff -r 7b3e49e4608a -r 72ebcbb64834 wlanutilities/wlansniffer/res/qgn_prop_wlan_bearer.svg --- a/wlanutilities/wlansniffer/res/qgn_prop_wlan_bearer.svg Thu Jun 24 10:49:51 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,19 +0,0 @@ - - - - - - - - - - - - - - - - - - - diff -r 7b3e49e4608a -r 72ebcbb64834 wlanutilities/wlansniffer/res/service_conf.xml --- a/wlanutilities/wlansniffer/res/service_conf.xml Thu Jun 24 10:49:51 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,7 +0,0 @@ - - - WLAN Sniffer - - List View - - diff -r 7b3e49e4608a -r 72ebcbb64834 wlanutilities/wlansniffer/res/wlansniffer.qrc --- a/wlanutilities/wlansniffer/res/wlansniffer.qrc Thu Jun 24 10:49:51 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,15 +0,0 @@ - - - wlansnifferlistview.docml - - - - qgn_indi_wifi_protected_add.svg - qgn_indi_wlan_secure_network_add.svg - qgn_indi_wlan_signal_good_add.svg - qgn_indi_wlan_signal_low_add.svg - qgn_indi_wlan_signal_med_add.svg - qgn_prop_cmon_wlan_conn.svg - qgn_prop_wlan_bearer.svg - - diff -r 7b3e49e4608a -r 72ebcbb64834 wlanutilities/wlansniffer/res/wlansnifferlistview.docml --- a/wlanutilities/wlansniffer/res/wlansnifferlistview.docml Thu Jun 24 10:49:51 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,106 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - -
-
- - - -
- - - - - -
diff -r 7b3e49e4608a -r 72ebcbb64834 wlanutilities/wlansniffer/rom/wlansniffer.iby --- a/wlanutilities/wlansniffer/rom/wlansniffer.iby Thu Jun 24 10:49:51 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: - * - */ - -#ifndef WLANSNIFFER_IBY -#define WLANSNIFFER_IBY - -#include - -#ifdef __PROTOCOL_WLAN - -file=ABI_DIR\BUILD_DIR\wlansniffer.exe PROGRAMS_DIR\wlansniffer.exe -data=\epoc32\data\z\private\10003a3f\import\Apps\wlansniffer_reg.rsc \private\10003a3f\import\apps\wlansniffer_reg.rsc -data=\epoc32\data\z\resource\apps\wlansniffer.rsc \resource\apps\wlansniffer.rsc - -#endif // __PROTOCOL_WLAN - -#endif // WLANSNIFFER_IBY diff -r 7b3e49e4608a -r 72ebcbb64834 wlanutilities/wlansniffer/rom/wlansniffer_resources.iby --- a/wlanutilities/wlansniffer/rom/wlansniffer_resources.iby Thu Jun 24 10:49:51 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: - * - */ - -#ifndef WLANSNIFFER_RESOURCES_IBY -#define WLANSNIFFER_RESOURCES_IBY - -#include -#include - -#ifdef __PROTOCOL_WLAN - -data=DATAZ_/QT_TRANSLATIONS_DIR/wlansniffer.qm QT_TRANSLATIONS_DIR/wlansniffer.qm - -#endif // __PROTOCOL_WLAN - -#endif // WLANSNIFFER_RESOURCES_IBY diff -r 7b3e49e4608a -r 72ebcbb64834 wlanutilities/wlansniffer/src/main.cpp --- a/wlanutilities/wlansniffer/src/main.cpp Thu Jun 24 10:49:51 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,45 +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: - * - */ - -#ifdef WLANSNIFFER_SERVICETRACES -#include "xqservicelog.h" -#endif - -#include "qsysteminfo.h" - -#include "wlansniffer.h" - -using namespace QtMobility; - -int main(int argc, char *argv[]) -{ - // Check WLAN dynamic configuration & exit if WLAN is not enabled - QSystemInfo sysinfo; - if (!sysinfo.hasFeatureSupported(QSystemInfo::WlanFeature)) { - return -1; - } - -#ifdef WLANSNIFFER_SERVICETRACES - qInstallMsgHandler(XQSERVICEMESSAGEHANDLER); -#endif - - WlanSniffer app(argc, argv); - - return app.exec(); -} - -// End of File diff -r 7b3e49e4608a -r 72ebcbb64834 wlanutilities/wlansniffer/src/wlansniffer.cpp --- a/wlanutilities/wlansniffer/src/wlansniffer.cpp Thu Jun 24 10:49:51 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,117 +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: - * - */ - -#include -#include - -#include "wlanqtutils.h" - -#include "wlansniffer.h" -#include "wlansniffermainwindow.h" -#include "OstTraceDefinitions.h" -#ifdef OST_TRACE_COMPILER_IN_USE -#include "wlansnifferTraces.h" -#endif - -// Scan interval is 10 seconds -const int scanTimerInterval = 10000; - -WlanSniffer::WlanSniffer(int argc, char* argv[]) : - HbApplication(argc, argv), - mWlanQtUtils(new WlanQtUtils()) -{ - OstTraceFunctionEntry0( WLANSNIFFER_WLANSNIFFER_ENTRY ); - - // Start the first scan immediately so that results are available as - // soon as possible. Start also the timer for periodic scanning. - mWlanQtUtils->scanWlans(); - mScanTimerId = startTimer(scanTimerInterval); - - // Install localization - mTranslator = new QTranslator(this); - QString lang = QLocale::system().name(); - QString path = "Z:/resource/qt/translations/"; - mTranslator->load("wlansniffer_" + lang, path); - qApp->installTranslator(mTranslator); - - mMainWindow = new WlanSnifferMainWindow(this); - - connect( - mWlanQtUtils, - SIGNAL(wlanScanReady()), - mMainWindow, - SLOT(updateListView())); - - connect( - mWlanQtUtils, - SIGNAL(wlanNetworkOpened(int)), - mMainWindow, - SLOT(updateListViewConnectionOpened(int))); - - connect( - mWlanQtUtils, - SIGNAL(wlanNetworkClosed(int)), - mMainWindow, - SLOT(updateListViewConnectionClosed(int))); - - connect( - mMainWindow, - SIGNAL(exitTriggered()), - this, - SLOT(exitApplication())); - - OstTraceFunctionExit0( WLANSNIFFER_WLANSNIFFER_EXIT ); -} - -WlanSniffer::~WlanSniffer() -{ - OstTraceFunctionEntry0( WLANSNIFFER_WLANSNIFFERDESTR_ENTRY ); - - killTimer(mScanTimerId); - - delete mMainWindow; - delete mWlanQtUtils; - - OstTraceFunctionExit0( WLANSNIFFER_WLANSNIFFERDESTR_EXIT ); -} - -void WlanSniffer::timerEvent(QTimerEvent *event) -{ - OstTraceFunctionEntry0( WLANSNIFFER_TIMEREVENT_ENTRY ); - - Q_UNUSED(event); - // Request a new scan. Timer events come periodically. - mWlanQtUtils->scanWlans(); - - OstTraceFunctionExit0( WLANSNIFFER_TIMEREVENT_EXIT ); -} - -WlanQtUtils *WlanSniffer::wlanQtUtils() const -{ - OstTraceFunctionEntry0( WLANSNIFFER_WLANQTUTILS_ENTRY ); - OstTraceFunctionExit0( WLANSNIFFER_WLANQTUTILS_EXIT ); - return mWlanQtUtils; -} - -void WlanSniffer::exitApplication() -{ - OstTraceFunctionEntry0( WLANSNIFFER_EXITAPPLICATION_ENTRY ); - - exit(); - - OstTraceFunctionExit0( WLANSNIFFER_EXITAPPLICATION_EXIT ); -} diff -r 7b3e49e4608a -r 72ebcbb64834 wlanutilities/wlansniffer/src/wlansnifferlistview.cpp --- a/wlanutilities/wlansniffer/src/wlansnifferlistview.cpp Thu Jun 24 10:49:51 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,330 +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: - * - */ - -#include - -#include -#include -#include -#include -#include -#include -#include - -#include - -#include "wlanqtutils.h" -#include "wlanqtutilswlanap.h" -#include "wlanqtutilswlaniap.h" -#include "wlanqtutilscommon.h" - -#include "wlansniffer.h" -#include "wlansnifferlistview.h" -#include "OstTraceDefinitions.h" -#ifdef OST_TRACE_COMPILER_IN_USE -#include "wlansnifferlistviewTraces.h" -#endif - -WlanSnifferListView::WlanSnifferListView(WlanSniffer *appRef) : - mWlanList(NULL), - mStatusLabel(NULL), - mAppRef(appRef), - mConnectingIapId(0), - mContextMenu(NULL) -{ - OstTraceFunctionEntry0( WLANSNIFFERLISTVIEW_WLANSNIFFERLISTVIEW_ENTRY ); - - bool ok = false; - HbDocumentLoader loader; - loader.load(":/docml/wlansnifferlistview.docml", &ok); - Q_ASSERT_X(ok, "Wlan Sniffer", "Invalid docml file"); - - // Load the view by name from the xml file - QGraphicsWidget *widget = loader.findWidget("occ_list"); - Q_ASSERT_X(widget != 0, "Wlan Sniffer", "View not found"); - // Set the WlanListView view to be the widget that was loaded from the xml - setWidget(widget); - - HbMenu *viewMenu = qobject_cast(loader.findWidget("viewMenu")); - Q_ASSERT_X(viewMenu != 0, "Wlan Sniffer", "Menu not found"); - setMenu(viewMenu); - - mWlanList = qobject_cast(loader.findWidget("listWidget")); - Q_ASSERT_X(mWlanList != 0, "Wlan Sniffer", "List not found"); - - mStatusLabel = qobject_cast(loader.findWidget("statusLabel")); - Q_ASSERT_X(mStatusLabel != 0, "Wlan Sniffer", "Label not found"); - - connect( - mWlanList, - SIGNAL(activated(HbListWidgetItem *)), - this, - SLOT(handleListItemActivated(HbListWidgetItem *))); - connect( - mWlanList, - SIGNAL(longPressed(HbListWidgetItem *, const QPointF &)), - this, - SLOT(handleListItemLongPressed(HbListWidgetItem *, const QPointF &))); - - // 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/wlansnifferlistview.docml", "landscape", &loaded ); - } // else: portrait is ok by default - - // We need to create a custom navigation action in case the application was - // launched as embedded via QtHighway - if (XQServiceUtil::isEmbedded()) { - HbAction *completeAction = new HbAction(Hb::BackNaviAction, this); - setNavigationAction(completeAction); - connect( - completeAction, - SIGNAL(triggered(bool)), - this, - SIGNAL(completeServiceTriggered())); - // TODO: What to do when exit action is ran? Should we close whole control panel? - } - - OstTraceFunctionExit0( WLANSNIFFERLISTVIEW_WLANSNIFFERLISTVIEW_EXIT ); -} - -WlanSnifferListView::~WlanSnifferListView() -{ - OstTraceFunctionEntry0( WLANSNIFFERLISTVIEW_WLANSNIFFERLISTVIEWDESTR_ENTRY ); - OstTraceFunctionExit0( WLANSNIFFERLISTVIEW_WLANSNIFFERLISTVIEWDESTR_EXIT ); -} - -void WlanSnifferListView::update() -{ - OstTraceFunctionEntry0( WLANSNIFFERLISTVIEW_UPDATE_ENTRY ); - - // Do not update list while the context menu is open - if (mContextMenu == NULL) { - QList aps; - QList iaps; - - mAppRef->wlanQtUtils()->availableWlanAps(iaps, aps); - - mWlanList->clear(); - - // Loop the IAPs and APs and create the list items (lists are ordered already by Wlan Qt Utilities) - foreach (WlanQtUtilsWlanIap *iap, iaps) { - mWlanList->addItem(wlanListItemIapCreate(iap)); - } - // Loop the AP's and create the list items - foreach (WlanQtUtilsWlanAp *ap, aps) { - mWlanList->addItem(wlanListItemApCreate(ap)); - } - } - - OstTraceFunctionExit0( WLANSNIFFERLISTVIEW_UPDATE_EXIT ); -} - -void WlanSnifferListView::updateConnectionOpened(int iapId) -{ - OstTraceFunctionEntry0( WLANSNIFFERLISTVIEW_UPDATECONNECTIONOPENED_ENTRY ); - - mStatusLabel->setPlainText( - hbTrId("txt_occ_grid_connected_to_1").arg(mAppRef->wlanQtUtils()->iap(iapId)->name())); - // Redraw the list so that the connected network moves on top - update(); - mConnectingIapId = 0; - - OstTraceFunctionExit0( WLANSNIFFERLISTVIEW_UPDATECONNECTIONOPENED_EXIT ); -} - -void WlanSnifferListView::updateConnectionClosed(int iapId) -{ - OstTraceFunctionEntry0( WLANSNIFFERLISTVIEW_UPDATECONNECTIONCLOSED_ENTRY ); - - (void)iapId; - mStatusLabel->setPlainText(hbTrId("txt_occ_grid_not_connected")); - mConnectingIapId = 0; - - OstTraceFunctionExit0( WLANSNIFFERLISTVIEW_UPDATECONNECTIONCLOSED_EXIT ); -} - -void WlanSnifferListView::handleContextMenuClosed() -{ - OstTraceFunctionEntry0( WLANSNIFFERLISTVIEW_HANDLECONTEXTMENUCLOSED_ENTRY ); - - // Menu deletes itself, but we need to cleanup the member variable - // in order to enable list updating again - mContextMenu = NULL; - - OstTraceFunctionExit0( WLANSNIFFERLISTVIEW_HANDLECONTEXTMENUCLOSED_EXIT ); -} - -void WlanSnifferListView::handleListItemActivated(HbListWidgetItem *item) -{ - OstTraceFunctionEntry0( WLANSNIFFERLISTVIEW_HANDLELISTITEMACTIVATED_ENTRY ); - - QVariant data = item->data(); - if (data.canConvert()) { - // Item was an IAP. Connect the IAP or show details view depending on connection state - WlanQtUtilsIap *iap = mAppRef->wlanQtUtils()->iap(data.toInt()); - if (iap->connectionStatus() == WlanQtUtilsConnectionStatusConnected) { - // Switch to details view - emit detailsTriggered(data.toInt()); - } else { - // Connect the IAP - mConnectingIapId = iap->id(); - mStatusLabel->setPlainText(hbTrId("txt_occ_grid_connecting_to_1").arg(iap->name())); - mAppRef->wlanQtUtils()->connectIap(mConnectingIapId); - } - } else { - // Item has to be a WLAN AP, which can't already be connected. Create an IAP and connect it. - Q_ASSERT(data.canConvert()); - WlanQtUtilsWlanAp ap = data.value(); - mConnectingIapId = mAppRef->wlanQtUtils()->createWlanIap(&ap); - WlanQtUtilsIap *iap = mAppRef->wlanQtUtils()->iap(mConnectingIapId); - Q_ASSERT(iap); - mStatusLabel->setPlainText(hbTrId("txt_occ_grid_connecting_to_1").arg(iap->name())); - mAppRef->wlanQtUtils()->connectIap(mConnectingIapId); - } - - OstTraceFunctionExit0( WLANSNIFFERLISTVIEW_HANDLELISTITEMACTIVATED_EXIT ); -} - -void WlanSnifferListView::handleListItemLongPressed(HbListWidgetItem *item, const QPointF &coords) -{ - OstTraceFunctionEntry0( WLANSNIFFERLISTVIEW_HANDLELISTITEMLONGPRESSED_ENTRY ); - - Q_ASSERT(mContextMenu == NULL); - - if (item->data().canConvert() && item->data().toInt() == - mAppRef->wlanQtUtils()->connectedWlanId()) { - // Connected IAP, add "Disconnect" action - mContextMenu = new HbMenu(); - // Remember the item that was long pressed - mContextMenuData = item->data(); - mContextMenu->addAction( - hbTrId("txt_common_menu_disconnect"), - this, - SLOT(handleListItemDisconnect())); - // Show the menu and connect closure signal (to re-enable list refreshing) - bool connectStatus = connect( - mContextMenu, - SIGNAL(aboutToClose()), - this, - SLOT(handleContextMenuClosed())); - Q_ASSERT(connectStatus); - mContextMenu->setAttribute(Qt::WA_DeleteOnClose); - mContextMenu->setTimeout(HbPopup::ContextMenuTimeout); - mContextMenu->setPreferredPos(coords); - mContextMenu->show(); - } - - OstTraceFunctionExit0( WLANSNIFFERLISTVIEW_HANDLELISTITEMLONGPRESSED_EXIT ); -} - -/*! - Handles a "Disconnect" action selected from the context menu for a list item. - */ -void WlanSnifferListView::handleListItemDisconnect() -{ - OstTraceFunctionEntry0( WLANSNIFFERLISTVIEW_HANDLELISTITEMDISCONNECT_ENTRY ); - - // "Disconnect" was only added, if the item was an IAP and data was - // the IAP ID - Q_ASSERT(mContextMenuData.canConvert()); - mAppRef->wlanQtUtils()->disconnectIap(mContextMenuData.toInt()); - - OstTraceFunctionExit0( WLANSNIFFERLISTVIEW_HANDLELISTITEMDISCONNECT_EXIT ); -} - -// Todo: This is a temporary solution - real WLAN status indication & listening -// is implemented later on. -void WlanSnifferListView::handleDisconnect() -{ - OstTraceFunctionEntry0( WLANSNIFFERLISTVIEW_HANDLEDISCONNECT_ENTRY ); - - mStatusLabel->setPlainText(hbTrId("txt_occ_grid_not_connected")); - // Redraw the list so that disconnected network is not shown anymore - update(); - - OstTraceFunctionExit0( WLANSNIFFERLISTVIEW_HANDLEDISCONNECT_EXIT ); -} - -// Todo: no place for separate secure WLAN icon in the widget -> custom layout needed? -// Todo: check the signal strength values -QString WlanSnifferListView::signalStrengthIconChoose(int signalStrength, WlanQtUtilsWlanSecMode secMode) -{ - (void)secMode; - QString iconName; - if (signalStrength <= WlanQtUtilsWlanSignalStrengthGood) { - iconName = "qtg_small_signal_good"; - } else if (signalStrength <= WlanQtUtilsWlanSignalStrengthLow) { - iconName = "qtg_small_signal_medium"; - } else { - iconName = "qtg_small_signal_low"; - } - - return iconName; -} - -HbListWidgetItem *WlanSnifferListView::wlanListItemIapCreate(const WlanQtUtilsWlanIap *iap) -{ - OstTraceFunctionEntry0( WLANSNIFFERLISTVIEW_WLANLISTITEMIAPCREATE_ENTRY ); - - HbListWidgetItem* item = new HbListWidgetItem(); - item->setText(iap->name()); -#if 1 // TODO: How to show secure/open network info?? - if (iap->securityMode() == WlanQtUtilsWlanSecModeOpen) { - item->setSecondaryText("Open"); - } else { - item->setSecondaryText("Secure"); - } -#endif - - if (iap->connectionStatus() == WlanQtUtilsConnectionStatusConnected) { - item->setIcon(HbIcon("qtg_small_online")); - } else { - item->setIcon(HbIcon("qtg_small_wlan")); - } - item->setSecondaryIcon(HbIcon(signalStrengthIconChoose(iap->signalStrength(), iap->securityMode()))); - QVariant data(iap->id()); - item->setData(data); - - OstTraceFunctionExit0( WLANSNIFFERLISTVIEW_WLANLISTITEMIAPCREATE_EXIT ); - return item; -} - -HbListWidgetItem *WlanSnifferListView::wlanListItemApCreate(const WlanQtUtilsWlanAp *ap) -{ - OstTraceFunctionEntry0( WLANSNIFFERLISTVIEW_WLANLISTITEMAPCREATE_ENTRY ); - - HbListWidgetItem* item = new HbListWidgetItem(); - item->setText(ap->ssid()); -#if 1 // TODO: How to show secure/open network info?? - if (ap->securityMode() == WlanQtUtilsWlanSecModeOpen) { - item->setSecondaryText("Open"); - } else { - item->setSecondaryText("Secure"); - } -#endif - item->setSecondaryIcon(HbIcon(signalStrengthIconChoose(ap->signalStrength(), ap->securityMode()))); - QVariant data; - data.setValue(*ap); - item->setData(data); - - OstTraceFunctionExit0( WLANSNIFFERLISTVIEW_WLANLISTITEMAPCREATE_EXIT ); - return item; -} - -// End of File diff -r 7b3e49e4608a -r 72ebcbb64834 wlanutilities/wlansniffer/src/wlansniffermainwindow.cpp --- a/wlanutilities/wlansniffer/src/wlansniffermainwindow.cpp Thu Jun 24 10:49:51 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,134 +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: - * - */ - -#include - -#include "wlansniffermainwindow.h" -#include "wlansnifferlistview.h" -#include "wlansnifferservice.h" -#include "OstTraceDefinitions.h" -#ifdef OST_TRACE_COMPILER_IN_USE -#include "wlansniffermainwindowTraces.h" -#endif - - -WlanSnifferMainWindow::WlanSnifferMainWindow(WlanSniffer *appRef) : - mAppRef(appRef), - mService(0) -{ - OstTraceFunctionEntry0( WLANSNIFFERMAINWINDOW_WLANSNIFFERMAINWINDOW_ENTRY ); - - mService = new WlanSnifferService(this); - connect(mService,SIGNAL(toListView()),this,SLOT(toListView())); - connect(mService,SIGNAL(returnValueDelivered()),this,SIGNAL(exitTriggered())); - - // Add the views to the main window - addListView(); - - // Check if sniffer is used via a service - if (!XQServiceUtil::isEmbedded()) { - // Show the main window (which will display the first view that was added) - show(); - } - - OstTraceFunctionExit0( WLANSNIFFERMAINWINDOW_WLANSNIFFERMAINWINDOW_EXIT ); -} - -WlanSnifferMainWindow::~WlanSnifferMainWindow() -{ - OstTraceFunctionEntry0( WLANSNIFFERMAINWINDOW_WLANSNIFFERMAINWINDOWDESTR_ENTRY ); - OstTraceFunctionExit0( WLANSNIFFERMAINWINDOW_WLANSNIFFERMAINWINDOWDESTR_EXIT ); -} - -void WlanSnifferMainWindow::toListView() -{ - OstTraceFunctionEntry0( WLANSNIFFERMAINWINDOW_TOLISTVIEW_ENTRY ); - - setCurrentView(mListView); - show(); - - OstTraceFunctionExit0( WLANSNIFFERMAINWINDOW_TOLISTVIEW_EXIT ); -} - -void WlanSnifferMainWindow::toDetailsView(int iapId) -{ - OstTraceFunctionEntry0( WLANSNIFFERMAINWINDOW_TODETAILSVIEW_ENTRY ); - - // TODO: Launch details view via QtHighway?? - (void)iapId; - - OstTraceFunctionExit0( WLANSNIFFERMAINWINDOW_TODETAILSVIEW_EXIT ); -} - -void WlanSnifferMainWindow::updateListView() -{ - OstTraceFunctionEntry0( WLANSNIFFERMAINWINDOW_UPDATELISTVIEW_ENTRY ); - - mListView->update(); - - OstTraceFunctionExit0( WLANSNIFFERMAINWINDOW_UPDATELISTVIEW_EXIT ); -} - -void WlanSnifferMainWindow::updateListViewConnectionOpened(int iapId) -{ - OstTraceFunctionEntry0( WLANSNIFFERMAINWINDOW_UPDATELISTVIEWCONNECTIONOPENED_ENTRY ); - - mListView->updateConnectionOpened(iapId); - - OstTraceFunctionExit0( WLANSNIFFERMAINWINDOW_UPDATELISTVIEWCONNECTIONOPENED_EXIT ); -} - -void WlanSnifferMainWindow::updateListViewConnectionClosed(int iapId) -{ - OstTraceFunctionEntry0( WLANSNIFFERMAINWINDOW_UPDATELISTVIEWCONNECTIONCLOSED_ENTRY ); - - mListView->updateConnectionClosed(iapId); - - OstTraceFunctionExit0( WLANSNIFFERMAINWINDOW_UPDATELISTVIEWCONNECTIONCLOSED_EXIT ); -} - -void WlanSnifferMainWindow::completeService() -{ - OstTraceFunctionEntry0( WLANSNIFFERMAINWINDOW_COMPLETESERVICE_ENTRY ); - - mService->complete(); - - OstTraceFunctionExit0( WLANSNIFFERMAINWINDOW_COMPLETESERVICE_EXIT ); -} - -void WlanSnifferMainWindow::addListView() -{ - OstTraceFunctionEntry0( WLANSNIFFERMAINWINDOW_ADDLISTVIEW_ENTRY ); - - mListView = new WlanSnifferListView(mAppRef); - addView(mListView); - - bool connectStatus = connect( - mListView, - SIGNAL(detailsTriggered(int)), - this, - SLOT(toDetailsView(int))); - Q_ASSERT(connectStatus == true); - connectStatus = connect( - mListView, - SIGNAL(completeServiceTriggered()), - this, - SLOT(completeService())); - Q_ASSERT(connectStatus == true); - - OstTraceFunctionExit0( WLANSNIFFERMAINWINDOW_ADDLISTVIEW_EXIT ); -} diff -r 7b3e49e4608a -r 72ebcbb64834 wlanutilities/wlansniffer/src/wlansnifferservice.cpp --- a/wlanutilities/wlansniffer/src/wlansnifferservice.cpp Thu Jun 24 10:49:51 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,60 +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: - * - */ - -#include "wlansnifferservice.h" -#include "OstTraceDefinitions.h" -#ifdef OST_TRACE_COMPILER_IN_USE -#include "wlansnifferserviceTraces.h" -#endif - - -WlanSnifferService::WlanSnifferService(QObject* parent) - : XQServiceProvider("com.nokia.services.wlansniffer.list", parent) -{ - OstTraceFunctionEntry0( WLANSNIFFERSERVICE_WLANSNIFFERSERVICE_ENTRY ); - - publishAll(); - - OstTraceFunctionExit0( WLANSNIFFERSERVICE_WLANSNIFFERSERVICE_EXIT ); -} - -WlanSnifferService::~WlanSnifferService() -{ - OstTraceFunctionEntry0( WLANSNIFFERSERVICE_WLANSNIFFERSERVICEDESTR_ENTRY ); - OstTraceFunctionExit0( WLANSNIFFERSERVICE_WLANSNIFFERSERVICEDESTR_EXIT ); -} - -void WlanSnifferService::complete() -{ - OstTraceFunctionEntry0( WLANSNIFFERSERVICE_COMPLETE_ENTRY ); - - QVariant returnValue(true); - bool status = completeRequest(mAsyncRequestIndex, returnValue); - Q_ASSERT(status); - - OstTraceFunctionExit0( WLANSNIFFERSERVICE_COMPLETE_EXIT ); -} - -void WlanSnifferService::listView() -{ - OstTraceFunctionEntry0( WLANSNIFFERSERVICE_LISTVIEW_ENTRY ); - - mAsyncRequestIndex = setCurrentRequestAsync(); - emit toListView(); - - OstTraceFunctionExit0( WLANSNIFFERSERVICE_LISTVIEW_EXIT ); -} diff -r 7b3e49e4608a -r 72ebcbb64834 wlanutilities/wlansniffer/traces/OstTraceDefinitions.h --- a/wlanutilities/wlansniffer/traces/OstTraceDefinitions.h Thu Jun 24 10:49:51 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,20 +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: - */ - -#ifndef __OSTTRACEDEFINITIONS_H__ -#define __OSTTRACEDEFINITIONS_H__ -#include -#endif diff -r 7b3e49e4608a -r 72ebcbb64834 wlanutilities/wlanwizard/inc/wlanwizardpagenetworkmode.h --- a/wlanutilities/wlanwizard/inc/wlanwizardpagenetworkmode.h Thu Jun 24 10:49:51 2010 +0300 +++ b/wlanutilities/wlanwizard/inc/wlanwizardpagenetworkmode.h Fri Jul 09 10:38:19 2010 +0300 @@ -65,13 +65,24 @@ private: Q_DISABLE_COPY(WlanWizardPageNetworkMode) - void addToList(QStringList &list, const QString &item, int mode, bool isHidden); + void addToList( + QStringList &list, + const QString &item, + int mode, + bool isHidden, + bool wpsSupported); void populateRadioButtonList(QStringList &list); int selectNextPage(const WlanNetworkSetting &setting) const; private slots: private: + + /*! + * Internal network mode value constant. Used when wps used. + */ + static const int NetworkModeNone = -1; + /*! * Pointer to the view. */ @@ -108,6 +119,12 @@ * the initialization of the page. */ QList mIsHidden; + + /*! + * List of wps support. This list is tied to the radio buttons during + * the initialization of the page. + */ + QList mWpsSupported; }; /*! @} */ diff -r 7b3e49e4608a -r 72ebcbb64834 wlanutilities/wlanwizard/inc/wlanwizardscanlist.h --- a/wlanutilities/wlanwizard/inc/wlanwizardscanlist.h Thu Jun 24 10:49:51 2010 +0300 +++ b/wlanutilities/wlanwizard/inc/wlanwizardscanlist.h Fri Jul 09 10:38:19 2010 +0300 @@ -54,8 +54,16 @@ class WlanSecuritySetting { public: + //! Enumerated value defined by CMManagerShim::WlanSecMode int mode; + + //! true, if passkey is required, false otherwise bool usePsk; + + /*! + * Identifier of the next page associated with this security mode. + * Page ids are defined in WlanWizardPageInternal::WlanPageIds + */ int nextPageId; bool operator==(const WlanSecuritySetting& setting) const { @@ -72,8 +80,13 @@ class WlanNetworkSetting { public: + //! Enumerated value defined by CMManagerShim::WlanConnMode int mode; + + //! true, if hidden, false otherwise bool hidden; + + //! true, if supported, false otherwise bool wpsSupported; bool operator==(const WlanNetworkSetting& setting) const { @@ -110,6 +123,7 @@ int netModes() const; int secModes(WlanNetworkSetting netMode) const; QList getNetModes() const; + bool wpsSelected() const; private: // Disabling implicit assignment operator @@ -117,6 +131,7 @@ private: QHash > mOpenOptions; + bool mWpsSelected; }; /*! diff -r 7b3e49e4608a -r 72ebcbb64834 wlanutilities/wlanwizard/src/wlanwizard_p.cpp --- a/wlanutilities/wlanwizard/src/wlanwizard_p.cpp Thu Jun 24 10:49:51 2010 +0300 +++ b/wlanutilities/wlanwizard/src/wlanwizard_p.cpp Fri Jul 09 10:38:19 2010 +0300 @@ -100,6 +100,7 @@ mPageFinished(false), mClosed(false) { + OstTraceFunctionEntry0( WLANWIZARDPRIVATE_WLANWIZARDPRIVATE_ENTRY ); OstTrace1( TRACE_BORDER, WLANWIZARDPRIVATE_WLANWIZARDPRIVATE, "WlanWizardPrivate::WlanWizardPrivate;this=%x", this ); @@ -136,6 +137,7 @@ "WlanWizardPrivate::WlanWizardPrivate - done;" "this=%x;mFirstPageId=%{PageIds}", ( unsigned )this, mFirstPageId ); + OstTraceFunctionExit0( WLANWIZARDPRIVATE_WLANWIZARDPRIVATE_EXIT ); } /*! @@ -143,6 +145,7 @@ */ WlanWizardPrivate::~WlanWizardPrivate() { + OstTraceFunctionEntry0( DUP1_WLANWIZARDPRIVATE_WLANWIZARDPRIVATE_ENTRY ); OstTrace1( TRACE_BORDER, WLANWIZARDPRIVATE_DWLANWIZARDPRIVATE, "WlanWizardPrivate::~WlanWizardPrivate;this=%x", this ); @@ -178,6 +181,7 @@ OstTrace1( TRACE_BORDER, WLANWIZARDPRIVATE_DWLANWIZARDPRIVATE_DONE, "WlanWizardPrivate::~WlanWizardPrivate-Done;this=%x", this ); + OstTraceFunctionExit0( DUP1_WLANWIZARDPRIVATE_WLANWIZARDPRIVATE_EXIT ); } /*! @@ -191,6 +195,7 @@ bool hidden, bool wps) { + OstTraceFunctionEntry0( WLANWIZARDPRIVATE_SETPARAMETERS_ENTRY ); OstTrace1( TRACE_BORDER, WLANWIZARDPRIVATE_SETPARAMETERS, "WlanWizardPrivate::setParameters;this=%x", this ); @@ -201,6 +206,7 @@ OstTrace1( TRACE_BORDER, WLANWIZARDPRIVATE_SETPARAMETERS_DONE, "WlanWizardPrivate::setParameters - Done;this=%x", this ); + OstTraceFunctionExit0( WLANWIZARDPRIVATE_SETPARAMETERS_EXIT ); } /*! @@ -208,6 +214,7 @@ */ void WlanWizardPrivate::show() { + OstTraceFunctionEntry0( WLANWIZARDPRIVATE_SHOW_ENTRY ); OstTraceExt2( TRACE_BORDER, WLANWIZARDPRIVATE_SHOW, "WlanWizardPrivate::show;this=%x;mFirstPageId=%{PageIds}", ( unsigned )this, mFirstPageId ); @@ -219,6 +226,7 @@ OstTrace1( TRACE_BORDER, WLANWIZARDPRIVATE_SHOW_DONE, "WlanWizardPrivate::show - Done;this=%x;", (unsigned)this ); + OstTraceFunctionExit0( WLANWIZARDPRIVATE_SHOW_EXIT ); } /*! @@ -236,6 +244,7 @@ bool hidden, bool wps) { + OstTraceFunctionEntry0( WLANWIZARDPRIVATE_GETNEXTPAGEID_ENTRY ); setConfiguration(ConfProcessSettings, true); setConfiguration(ConfSsid, ssid); setConfiguration(ConfNetworkMode, networkMode); @@ -246,7 +255,7 @@ OstTrace1( TRACE_NORMAL, WLANWIZARDPRIVATE_GETNEXTPAGEID, "WlanWizardPrivate::getNextPageId;wps=%u", wps ); - + OstTraceFunctionExit0( WLANWIZARDPRIVATE_GETNEXTPAGEID_EXIT ); return nextPageId(wps); } @@ -257,7 +266,9 @@ */ WlanQtUtils* WlanWizardPrivate::wlanQtUtils() const { - Q_ASSERT(mWlanQtUtils); + OstTraceFunctionEntry0( WLANWIZARDPRIVATE_WLANQTUTILS_ENTRY ); + Q_ASSERT(mWlanQtUtils.data()); + OstTraceFunctionExit0( WLANWIZARDPRIVATE_WLANQTUTILS_EXIT ); return mWlanQtUtils.data(); } @@ -268,6 +279,7 @@ */ WlanWizardPlugin* WlanWizardPrivate::wlanWizardPlugin() const { + OstTraceFunctionEntry0( WLANWIZARDPRIVATE_WLANWIZARDPLUGIN_ENTRY ); WlanWizardPlugin* plugin = NULL; if (isEapEnabled()) { @@ -279,6 +291,7 @@ "WlanWizardPrivate::wlanWizardPlugin;plugin=%x", plugin ); + OstTraceFunctionExit0( WLANWIZARDPRIVATE_WLANWIZARDPLUGIN_EXIT ); return plugin; } @@ -290,6 +303,7 @@ */ bool WlanWizardPrivate::isEapEnabled() const { + OstTraceFunctionEntry0( WLANWIZARDPRIVATE_ISEAPENABLED_ENTRY ); bool ret = false; int secMode = configuration(ConfSecurityMode).toInt(); @@ -304,6 +318,7 @@ "WlanWizardPrivate::isEapEnabled;ret=%u", ret ); + OstTraceFunctionExit0( WLANWIZARDPRIVATE_ISEAPENABLED_EXIT ); return ret; } @@ -314,6 +329,7 @@ */ bool WlanWizardPrivate::handleIap() { + OstTraceFunctionEntry0( WLANWIZARDPRIVATE_HANDLEIAP_ENTRY ); OstTrace0( TRACE_FLOW, WLANWIZARDPRIVATE_HANDLEIAP, "WlanWizardPrivate::handleIap" ); @@ -399,6 +415,7 @@ "WlanWizardPrivate::handleIap: Done;ret=%d", ret ); + OstTraceFunctionExit0( WLANWIZARDPRIVATE_HANDLEIAP_EXIT ); return ret; } @@ -407,6 +424,7 @@ */ QVariant WlanWizardPrivate::configuration(ConfigurationId confId) const { + OstTraceFunctionEntry0( WLANWIZARDPRIVATE_CONFIGURATION_ENTRY ); Q_ASSERT(mConfigurations.contains(confId)); #ifdef OST_TRACE_COMPILER_IN_USE @@ -420,6 +438,7 @@ (uint)confId, string ); #endif + OstTraceFunctionExit0( WLANWIZARDPRIVATE_CONFIGURATION_EXIT ); return mConfigurations[confId]; } @@ -430,6 +449,7 @@ ConfigurationId confId, const QVariant &value) { +OstTraceFunctionEntry0( WLANWIZARDPRIVATE_SETCONFIGURATION_ENTRY ); #ifdef OST_TRACE_COMPILER_IN_USE QString tmp; QDebug tmpStream(&tmp); @@ -443,6 +463,7 @@ #endif mConfigurations[confId] = value; + OstTraceFunctionExit0( WLANWIZARDPRIVATE_SETCONFIGURATION_EXIT ); } /*! @@ -450,11 +471,13 @@ */ void WlanWizardPrivate::clearConfiguration(ConfigurationId confId) { + OstTraceFunctionEntry0( WLANWIZARDPRIVATE_CLEARCONFIGURATION_ENTRY ); OstTrace1( TRACE_FLOW, WLANWIZARDPRIVATE_CLEARCONFIGURATION, "WlanWizardPrivate::clearConfiguration;confId=%{ConfigurationId}", (uint)confId ); mConfigurations.remove(confId); + OstTraceFunctionExit0( WLANWIZARDPRIVATE_CLEARCONFIGURATION_EXIT ); } /*! @@ -462,10 +485,11 @@ */ bool WlanWizardPrivate::configurationExists(ConfigurationId confId) { + OstTraceFunctionEntry0( WLANWIZARDPRIVATE_CONFIGURATIONEXISTS_ENTRY ); OstTrace1( TRACE_DUMP, WLANWIZARDPRIVATE_CONFIGURATIONEXISTS, "WlanWizardPrivate::configurationExists;confId=%{ConfigurationId}", (uint)confId ); - + OstTraceFunctionExit0( WLANWIZARDPRIVATE_CONFIGURATIONEXISTS_EXIT ); return mConfigurations[confId].isValid(); } @@ -474,10 +498,12 @@ */ void WlanWizardPrivate::enableNextButton(bool enable) { + OstTraceFunctionEntry0( WLANWIZARDPRIVATE_ENABLENEXTBUTTON_ENTRY ); OstTraceExt2( TRACE_FLOW, WLANWIZARDPRIVATE_ENABLENEXTBUTTON, "WlanWizardPrivate::enableNextButton;this=%x;enable=%x", (unsigned)this, (uint)enable ); mActionNext->setEnabled(enable); + OstTraceFunctionExit0( WLANWIZARDPRIVATE_ENABLENEXTBUTTON_EXIT ); } /*! @@ -485,12 +511,14 @@ */ void WlanWizardPrivate::addPage(int pageId, WlanWizardPage *page) { + OstTraceFunctionEntry0( WLANWIZARDPRIVATE_ADDPAGE_ENTRY ); OstTraceExt3( TRACE_FLOW, WLANWIZARDPRIVATE_ADDPAGE, "WlanWizardPrivate::addPage;this=%x;pageId=%{PageIds};page=%x", (unsigned)this, pageId, (uint)(page) ); Q_ASSERT(!mPages.contains(pageId)); mPages[pageId] = page; + OstTraceFunctionExit0( WLANWIZARDPRIVATE_ADDPAGE_EXIT ); } /*! @@ -498,12 +526,14 @@ */ void WlanWizardPrivate::nextPage() { + OstTraceFunctionEntry0( WLANWIZARDPRIVATE_NEXTPAGE_ENTRY ); OstTrace1( TRACE_FLOW, WLANWIZARDPRIVATE_NEXTPAGE, "WlanWizardPrivate::nextPage;this=%x", this ); mPageFinished = true; toNextPage(); + OstTraceFunctionExit0( WLANWIZARDPRIVATE_NEXTPAGE_EXIT ); } /*! @@ -511,6 +541,8 @@ */ HbMainWindow* WlanWizardPrivate::mainWindow() const { + OstTraceFunctionEntry0( WLANWIZARDPRIVATE_MAINWINDOW_ENTRY ); + OstTraceFunctionExit0( WLANWIZARDPRIVATE_MAINWINDOW_EXIT ); return mMainWindow; } @@ -519,6 +551,7 @@ */ bool WlanWizardPrivate::isCurrentPage(const HbWidget *page) const { + OstTraceFunctionEntry0( WLANWIZARDPRIVATE_ISCURRENTPAGE_ENTRY ); bool ret = false; if (mStackedWidget->currentWidget() == page) { ret = true; @@ -528,6 +561,7 @@ "WlanWizardPrivate::isCurrentPage;page=%x;ret=%d", (uint)page, ret); + OstTraceFunctionExit0( WLANWIZARDPRIVATE_ISCURRENTPAGE_EXIT ); return ret; } @@ -536,6 +570,7 @@ */ int WlanWizardPrivate::nextPageId(bool useWps) { + OstTraceFunctionEntry0( WLANWIZARDPRIVATE_NEXTPAGEID_ENTRY ); int ret; if (useWps) { ret = WlanWizardPage::PageWpsStart; @@ -574,6 +609,7 @@ "WlanWizardPrivate::nextPageId;this=%x;useWps=%x;ret=%{PageIds}", ( unsigned )this, ( TUint )( useWps ), ret ); + OstTraceFunctionExit0( WLANWIZARDPRIVATE_NEXTPAGEID_EXIT ); return ret; } @@ -586,6 +622,7 @@ */ void WlanWizardPrivate::cancelTriggered() { + OstTraceFunctionEntry0( WLANWIZARDPRIVATE_CANCELTRIGGERED_ENTRY ); OstTrace1( TRACE_BORDER, WLANWIZARDPRIVATE_CANCELTRIGGERED, "WlanWizardPrivate::cancelTriggered;this=%x", this ); @@ -620,6 +657,7 @@ OstTrace1( TRACE_BORDER, WLANWIZARDPRIVATE_CANCELTRIGGERED_DONE, "WlanWizardPrivate::cancelTriggered - Done;this=%x", this ); + OstTraceFunctionExit0( WLANWIZARDPRIVATE_CANCELTRIGGERED_EXIT ); } /*! @@ -629,6 +667,7 @@ */ void WlanWizardPrivate::previousTriggered() { + OstTraceFunctionEntry0( WLANWIZARDPRIVATE_PREVIOUSTRIGGERED_ENTRY ); OstTrace1( TRACE_BORDER, WLANWIZARDPRIVATE_PREVIOUSTRIGGERED, "WlanWizardPrivate::previousTriggered;this=%x", this ); @@ -661,6 +700,7 @@ OstTrace1( TRACE_BORDER, WLANWIZARDPRIVATE_PREVIOUSTRIGGERED_DONE, "WlanWizardPrivate::previousTriggered - Done;this=%x", this ); + OstTraceFunctionExit0( WLANWIZARDPRIVATE_PREVIOUSTRIGGERED_EXIT ); } /*! @@ -669,6 +709,7 @@ */ void WlanWizardPrivate::nextTriggered() { + OstTraceFunctionEntry0( WLANWIZARDPRIVATE_NEXTTRIGGERED_ENTRY ); OstTrace1( TRACE_BORDER, WLANWIZARDPRIVATE_NEXTTRIGGERED, "WlanWizardPrivate::nextTriggered;this=%x", this ); @@ -685,6 +726,7 @@ OstTrace1( TRACE_BORDER, WLANWIZARDPRIVATE_NEXTTRIGGERED_DONE, "WlanWizardPrivate::nextTriggered - Done;this=%x", this ); + OstTraceFunctionExit0( WLANWIZARDPRIVATE_NEXTTRIGGERED_EXIT ); } /*! @@ -693,6 +735,7 @@ */ void WlanWizardPrivate::finishTriggered() { + OstTraceFunctionEntry0( WLANWIZARDPRIVATE_FINISHTRIGGERED_ENTRY ); OstTrace1( TRACE_BORDER, WLANWIZARDPRIVATE_FINISHTRIGGERED, "WlanWizardPrivate::finishTriggered;this=%x", this ); @@ -711,6 +754,7 @@ OstTrace1( TRACE_BORDER, WLANWIZARDPRIVATE_FINISHTRIGGERED_DONE, "WlanWizardPrivate::finishTriggered - Done;this=%x", this ); + OstTraceFunctionExit0( WLANWIZARDPRIVATE_FINISHTRIGGERED_EXIT ); } /*! @@ -719,6 +763,7 @@ */ void WlanWizardPrivate::onTimeOut() { + OstTraceFunctionEntry0( WLANWIZARDPRIVATE_ONTIMEOUT_ENTRY ); OstTrace1( TRACE_BORDER, WLANWIZARDPRIVATE_ONTIMEOUT, "WlanWizardPrivate::onTimeOut;this=%x", this ); @@ -728,6 +773,7 @@ OstTrace1( TRACE_BORDER, WLANWIZARDPRIVATE_ONTIMEOUT_DONE, "WlanWizardPrivate::onTimeOut - Done;this=%x", this ); + OstTraceFunctionExit0( WLANWIZARDPRIVATE_ONTIMEOUT_EXIT ); } /*! @@ -736,6 +782,7 @@ */ void WlanWizardPrivate::startPageOperation() { + OstTraceFunctionEntry0( WLANWIZARDPRIVATE_STARTPAGEOPERATION_ENTRY ); // Process this if wizard has not been closed if (mClosed == false) { OstTrace1( TRACE_BORDER, WLANWIZARDPRIVATE_STARTPAGEOPERATION, @@ -753,6 +800,7 @@ "WlanWizardPrivate::startPageOperation - DONE;this=%x", this ); } + OstTraceFunctionExit0( WLANWIZARDPRIVATE_STARTPAGEOPERATION_EXIT ); } /*! @@ -761,6 +809,7 @@ */ void WlanWizardPrivate::toNextPage() { + OstTraceFunctionEntry0( WLANWIZARDPRIVATE_TONEXTPAGE_ENTRY ); if (mPageFinished && !(mPageTimer->isActive())) { OstTrace1( TRACE_FLOW, WLANWIZARDPRIVATE_TONEXTPAGE, "WlanWizardPrivate::toNextPage;this=%x", @@ -770,6 +819,7 @@ // call stack and process the page change using new call stack QMetaObject::invokeMethod(this, "nextTriggered", Qt::QueuedConnection); } + OstTraceFunctionExit0( WLANWIZARDPRIVATE_TONEXTPAGE_EXIT ); } /*! @@ -784,6 +834,7 @@ */ void WlanWizardPrivate::showPage(int pageId, bool removeFromStack) { + OstTraceFunctionEntry0( WLANWIZARDPRIVATE_SHOWPAGE_ENTRY ); OstTraceExt3( TRACE_FLOW, WLANWIZARDPRIVATE_SHOWPAGE, "WlanWizardPrivate::showPage;this=%x;" "pageId=%{PageIds};removeFromStack=%x", @@ -792,6 +843,7 @@ // PageNone is returned by wizard pages when some validation of page content // has not passed and the page does not want to process wizard to next page if (pageId == WlanWizardPage::PageNone) { + OstTraceFunctionExit0( WLANWIZARDPRIVATE_SHOWPAGE_EXIT ); return; } @@ -854,6 +906,7 @@ QMetaObject::invokeMethod(this, "startPageOperation", Qt::QueuedConnection); } + OstTraceFunctionExit0( DUP1_WLANWIZARDPRIVATE_SHOWPAGE_EXIT ); } /*! @@ -862,6 +915,7 @@ */ void WlanWizardPrivate::createPages() { + OstTraceFunctionEntry0( WLANWIZARDPRIVATE_CREATEPAGES_ENTRY ); OstTrace0( TRACE_NORMAL, WLANWIZARDPRIVATE_CREATEPAGES, @@ -898,6 +952,7 @@ addPage( WlanWizardPageInternal::PageNetworkSecurity, new WlanWizardPageSecurityMode(this)); + OstTraceFunctionExit0( WLANWIZARDPRIVATE_CREATEPAGES_EXIT ); } /*! @@ -907,8 +962,10 @@ */ void WlanWizardPrivate::closeViews() { + OstTraceFunctionEntry0( WLANWIZARDPRIVATE_CLOSEVIEWS_ENTRY ); mDialog->hide(); mClosed = true; + OstTraceFunctionExit0( WLANWIZARDPRIVATE_CLOSEVIEWS_EXIT ); } /*! @@ -920,6 +977,7 @@ */ void WlanWizardPrivate::updateFrame(int pageId) { + OstTraceFunctionEntry0( WLANWIZARDPRIVATE_UPDATEFRAME_ENTRY ); int currentIndex = mStackedWidget->currentIndex(); OstTraceExt3( TRACE_FLOW, WLANWIZARDPRIVATE_UPDATEFRAME, @@ -952,6 +1010,7 @@ } } } + OstTraceFunctionExit0( WLANWIZARDPRIVATE_UPDATEFRAME_EXIT ); } /*! @@ -959,6 +1018,7 @@ */ void WlanWizardPrivate::loadDocml() { + OstTraceFunctionEntry0( WLANWIZARDPRIVATE_LOADDOCML_ENTRY ); bool ok = true; mDocLoader->load(":/docml/occ_wlan_wizard_main.docml", &ok); @@ -1030,6 +1090,7 @@ // is changed. See TSW Error: MTAA-854DK8 ok = HbStyleLoader::registerFilePath(":/css/custom.css"); Q_ASSERT(ok); + OstTraceFunctionExit0( WLANWIZARDPRIVATE_LOADDOCML_EXIT ); } /*! @@ -1037,6 +1098,7 @@ */ void WlanWizardPrivate::disconnectActions() { + OstTraceFunctionEntry0( WLANWIZARDPRIVATE_DISCONNECTACTIONS_ENTRY ); disconnect( mActionNext, SIGNAL(triggered()), this, SLOT(nextTriggered())); @@ -1052,4 +1114,5 @@ disconnect( mActionCancel, SIGNAL(triggered()), this, SLOT(cancelTriggered())); + OstTraceFunctionExit0( WLANWIZARDPRIVATE_DISCONNECTACTIONS_EXIT ); } diff -r 7b3e49e4608a -r 72ebcbb64834 wlanutilities/wlanwizard/src/wlanwizardpagegenericerror.cpp --- a/wlanutilities/wlanwizard/src/wlanwizardpagegenericerror.cpp Thu Jun 24 10:49:51 2010 +0300 +++ b/wlanutilities/wlanwizard/src/wlanwizardpagegenericerror.cpp Fri Jul 09 10:38:19 2010 +0300 @@ -28,6 +28,11 @@ #include "OstTraceDefinitions.h" #ifdef OST_TRACE_COMPILER_IN_USE #include "wlanwizardpageprocessingsettingsTraces.h" +#include "OstTraceDefinitions.h" +#ifdef OST_TRACE_COMPILER_IN_USE +#include "wlanwizardpagegenericerrorTraces.h" +#endif + #endif /*! @@ -58,6 +63,8 @@ mWidget(NULL), mLabel(NULL) { + OstTraceFunctionEntry0( WLANWIZARDPAGEGENERICERROR_WLANWIZARDPAGEGENERICERROR_ENTRY ); + OstTraceFunctionExit0( WLANWIZARDPAGEGENERICERROR_WLANWIZARDPAGEGENERICERROR_EXIT ); } /*! @@ -65,7 +72,9 @@ */ WlanWizardPageGenericError::~WlanWizardPageGenericError() { + OstTraceFunctionEntry0( DUP1_WLANWIZARDPAGEGENERICERROR_WLANWIZARDPAGEGENERICERROR_ENTRY ); // signals are automatically disconnected + OstTraceFunctionExit0( DUP1_WLANWIZARDPAGEGENERICERROR_WLANWIZARDPAGEGENERICERROR_EXIT ); } /*! @@ -73,6 +82,7 @@ */ HbWidget* WlanWizardPageGenericError::initializePage() { + OstTraceFunctionEntry0( WLANWIZARDPAGEGENERICERROR_INITIALIZEPAGE_ENTRY ); // Create the visualization at the first time if (!mWidget) { HbDocumentLoader docLoader(mWizard->mainWindow()); @@ -93,6 +103,7 @@ mWizard->configuration( WlanWizardHelper::ConfGenericErrorString).toString()); + OstTraceFunctionExit0( WLANWIZARDPAGEGENERICERROR_INITIALIZEPAGE_EXIT ); return mWidget; } @@ -103,6 +114,8 @@ */ bool WlanWizardPageGenericError::showPage() { + OstTraceFunctionEntry0( WLANWIZARDPAGEGENERICERROR_SHOWPAGE_ENTRY ); + OstTraceFunctionExit0( WLANWIZARDPAGEGENERICERROR_SHOWPAGE_EXIT ); return false; } @@ -113,6 +126,8 @@ */ int WlanWizardPageGenericError::previousTriggered() { + OstTraceFunctionEntry0( WLANWIZARDPAGEGENERICERROR_PREVIOUSTRIGGERED_ENTRY ); + OstTraceFunctionExit0( WLANWIZARDPAGEGENERICERROR_PREVIOUSTRIGGERED_EXIT ); return mWizard->configuration( WlanWizardHelper::ConfGenericErrorPageStepsBackwards).toInt(); } diff -r 7b3e49e4608a -r 72ebcbb64834 wlanutilities/wlanwizard/src/wlanwizardpageinternal.cpp --- a/wlanutilities/wlanwizard/src/wlanwizardpageinternal.cpp Thu Jun 24 10:49:51 2010 +0300 +++ b/wlanutilities/wlanwizard/src/wlanwizardpageinternal.cpp Fri Jul 09 10:38:19 2010 +0300 @@ -24,6 +24,11 @@ // User includes #include "wlanwizard_p.h" #include "wlanwizardpageinternal.h" +#include "OstTraceDefinitions.h" +#ifdef OST_TRACE_COMPILER_IN_USE +#include "wlanwizardpageinternalTraces.h" +#endif + /*! \class WlanWizardPageInternal @@ -48,6 +53,8 @@ QObject(wizard), mWizard(wizard) { + OstTraceFunctionEntry0( WLANWIZARDPAGEINTERNAL_WLANWIZARDPAGEINTERNAL_ENTRY ); + OstTraceFunctionExit0( WLANWIZARDPAGEINTERNAL_WLANWIZARDPAGEINTERNAL_EXIT ); } /*! @@ -55,6 +62,8 @@ */ WlanWizardPageInternal::~WlanWizardPageInternal() { + OstTraceFunctionEntry0( DUP1_WLANWIZARDPAGEINTERNAL_WLANWIZARDPAGEINTERNAL_ENTRY ); + OstTraceFunctionExit0( DUP1_WLANWIZARDPAGEINTERNAL_WLANWIZARDPAGEINTERNAL_EXIT ); } @@ -74,6 +83,7 @@ const QString &portraitSection, const QString &landscapeSection) const { + OstTraceFunctionEntry0( WLANWIZARDPAGEINTERNAL_LOADDOCMLSECTION_ENTRY ); bool ok; // Then load the orientation specific section @@ -85,4 +95,5 @@ loader->load(filename, portraitSection, &ok); Q_ASSERT(ok); } + OstTraceFunctionExit0( WLANWIZARDPAGEINTERNAL_LOADDOCMLSECTION_EXIT ); } diff -r 7b3e49e4608a -r 72ebcbb64834 wlanutilities/wlanwizard/src/wlanwizardpagekeyquery.cpp --- a/wlanutilities/wlanwizard/src/wlanwizardpagekeyquery.cpp Thu Jun 24 10:49:51 2010 +0300 +++ b/wlanutilities/wlanwizard/src/wlanwizardpagekeyquery.cpp Fri Jul 09 10:38:19 2010 +0300 @@ -30,6 +30,11 @@ #include "wlanwizard_p.h" #include "wlanwizardpagekeyquery.h" #include "wlanwizardutils.h" +#include "OstTraceDefinitions.h" +#ifdef OST_TRACE_COMPILER_IN_USE +#include "wlanwizardpagekeyqueryTraces.h" +#endif + /*! \class WlanWizardPageKeyQuery @@ -58,6 +63,8 @@ mLabelError(NULL), mDocLoader(NULL) { + OstTraceFunctionEntry0( WLANWIZARDPAGEKEYQUERY_WLANWIZARDPAGEKEYQUERY_ENTRY ); + OstTraceFunctionExit0( WLANWIZARDPAGEKEYQUERY_WLANWIZARDPAGEKEYQUERY_EXIT ); } /*! @@ -65,9 +72,11 @@ */ WlanWizardPageKeyQuery::~WlanWizardPageKeyQuery() { + OstTraceFunctionEntry0( DUP1_WLANWIZARDPAGEKEYQUERY_WLANWIZARDPAGEKEYQUERY_ENTRY ); delete mDocLoader; // Wizard framework deletes the visualization (owns mWidget). + OstTraceFunctionExit0( DUP1_WLANWIZARDPAGEKEYQUERY_WLANWIZARDPAGEKEYQUERY_EXIT ); } /*! @@ -78,6 +87,7 @@ */ HbWidget* WlanWizardPageKeyQuery::initializePage() { + OstTraceFunctionEntry0( WLANWIZARDPAGEKEYQUERY_INITIALIZEPAGE_ENTRY ); if (!mWidget) { bool ok; @@ -130,6 +140,7 @@ hbTrId("txt_occ_dialog_enter_key_for_1")).arg( mWizard->configuration(WlanWizardPrivate::ConfSsid).toString())); + OstTraceFunctionExit0( WLANWIZARDPAGEKEYQUERY_INITIALIZEPAGE_EXIT ); return mWidget; } @@ -141,12 +152,14 @@ */ void WlanWizardPageKeyQuery::loadDocmlSection(Qt::Orientation orientation) { + OstTraceFunctionEntry0( WLANWIZARDPAGEKEYQUERY_LOADDOCMLSECTION_ENTRY ); WlanWizardPageInternal::loadDocmlSection( mDocLoader, orientation, ":/docml/occ_add_wlan_01_04.docml", "portrait_section", "landscape_section"); + OstTraceFunctionExit0( WLANWIZARDPAGEKEYQUERY_LOADDOCMLSECTION_EXIT ); } /*! @@ -163,6 +176,7 @@ */ int WlanWizardPageKeyQuery::nextId(bool &removeFromStack) const { + OstTraceFunctionEntry0( WLANWIZARDPAGEKEYQUERY_NEXTID_ENTRY ); WlanWizardUtils::KeyStatus status(WlanWizardUtils::KeyStatusOk); int pageId = WlanWizardPage::nextId(removeFromStack); int secMode = mWizard->configuration( @@ -198,6 +212,7 @@ } removeFromStack = false; + OstTraceFunctionExit0( WLANWIZARDPAGEKEYQUERY_NEXTID_EXIT ); return pageId; } @@ -206,9 +221,11 @@ */ bool WlanWizardPageKeyQuery::showPage() { + OstTraceFunctionEntry0( WLANWIZARDPAGEKEYQUERY_SHOWPAGE_ENTRY ); // Open virtual keyboard by setting focus to line edit mLineEdit->setFocus(); + OstTraceFunctionExit0( WLANWIZARDPAGEKEYQUERY_SHOWPAGE_EXIT ); return true; } @@ -223,9 +240,11 @@ */ bool WlanWizardPageKeyQuery::eventFilter(QObject *obj, QEvent *event) { + OstTraceFunctionEntry0( WLANWIZARDPAGEKEYQUERY_EVENTFILTER_ENTRY ); if (obj == mLineEdit && event->type() == QEvent::FocusIn) { mLabelError->setPlainText(""); } + OstTraceFunctionExit0( WLANWIZARDPAGEKEYQUERY_EVENTFILTER_EXIT ); return false; } @@ -240,6 +259,7 @@ QString WlanWizardPageKeyQuery::keyStatusToErrorString( WlanWizardUtils::KeyStatus status) const { + OstTraceFunctionEntry0( WLANWIZARDPAGEKEYQUERY_KEYSTATUSTOERRORSTRING_ENTRY ); QString errorString; switch (status) { case WlanWizardUtils::KeyStatusIllegalCharacters: @@ -259,5 +279,6 @@ // nothing to do here. break; } + OstTraceFunctionExit0( WLANWIZARDPAGEKEYQUERY_KEYSTATUSTOERRORSTRING_EXIT ); return errorString; } diff -r 7b3e49e4608a -r 72ebcbb64834 wlanutilities/wlanwizard/src/wlanwizardpagenetworkmode.cpp --- a/wlanutilities/wlanwizard/src/wlanwizardpagenetworkmode.cpp Thu Jun 24 10:49:51 2010 +0300 +++ b/wlanutilities/wlanwizard/src/wlanwizardpagenetworkmode.cpp Fri Jul 09 10:38:19 2010 +0300 @@ -49,6 +49,8 @@ mLoader(NULL), mValid(false) { + OstTraceFunctionEntry0( WLANWIZARDPAGENETWORKMODE_WLANWIZARDPAGENETWORKMODE_ENTRY ); + OstTraceFunctionExit0( WLANWIZARDPAGENETWORKMODE_WLANWIZARDPAGENETWORKMODE_EXIT ); } /*! @@ -57,7 +59,9 @@ */ WlanWizardPageNetworkMode::~WlanWizardPageNetworkMode() { + OstTraceFunctionEntry0( DUP1_WLANWIZARDPAGENETWORKMODE_WLANWIZARDPAGENETWORKMODE_ENTRY ); delete mLoader; + OstTraceFunctionExit0( DUP1_WLANWIZARDPAGENETWORKMODE_WLANWIZARDPAGENETWORKMODE_EXIT ); } /*! @@ -66,6 +70,7 @@ */ HbWidget* WlanWizardPageNetworkMode::initializePage() { + OstTraceFunctionEntry0( WLANWIZARDPAGENETWORKMODE_INITIALIZEPAGE_ENTRY ); OstTrace0( TRACE_NORMAL, WLANWIZARDPAGENETWORKMODE_INITIALIZEPAGE, "WlanWizardPageNetworkMode::initializePage" ); @@ -110,6 +115,7 @@ mList->setItems(items); + OstTraceFunctionExit0( WLANWIZARDPAGENETWORKMODE_INITIALIZEPAGE_EXIT ); return mWidget; } @@ -121,25 +127,35 @@ */ int WlanWizardPageNetworkMode::nextId(bool &removeFromStack) const { + OstTraceFunctionEntry0( WLANWIZARDPAGENETWORKMODE_NEXTID_ENTRY ); removeFromStack = false; WlanNetworkSetting setting; - setting.mode = mNetworkModes.at(mList->selected()); - setting.hidden = mIsHidden.at(mList->selected()); - - // TODO: Still no wps handling. - setting.wpsSupported = false; - - mWizard->setConfiguration(WlanWizardPrivate::ConfNetworkMode, - setting.mode); + int index = mList->selected(); + int nextPage = WlanWizardPageInternal::PageNetworkSecurity; - mWizard->setConfiguration(WlanWizardPrivate::ConfHiddenWlan, - setting.hidden); + if (mWpsSupported.at(index)) { + nextPage = WlanWizardPageInternal::PageWpsStart; + } + else { + setting.mode = mNetworkModes.at(index); + setting.hidden = mIsHidden.at(index); + setting.wpsSupported = mWpsSupported.at(index); + + mWizard->setConfiguration(WlanWizardPrivate::ConfNetworkMode, + setting.mode); - if (mWizard->configurationExists(WlanWizardPrivate::ConfAvailableNetworkOptions)) { - return selectNextPage(setting); + mWizard->setConfiguration(WlanWizardPrivate::ConfHiddenWlan, + setting.hidden); + + mWizard->setConfiguration(WlanWizardPrivate::ConfWpsSupported, + setting.wpsSupported); + + if (mWizard->configurationExists(WlanWizardPrivate::ConfAvailableNetworkOptions)) { + nextPage = selectNextPage(setting); + } } - - return WlanWizardPageInternal::PageNetworkSecurity; + OstTraceFunctionExit0( WLANWIZARDPAGENETWORKMODE_NEXTID_EXIT ); + return nextPage; } /*! @@ -149,6 +165,8 @@ */ bool WlanWizardPageNetworkMode::showPage() { + OstTraceFunctionEntry0( WLANWIZARDPAGENETWORKMODE_SHOWPAGE_ENTRY ); + OstTraceFunctionExit0( WLANWIZARDPAGENETWORKMODE_SHOWPAGE_EXIT ); return mValid; } @@ -158,11 +176,13 @@ */ void WlanWizardPageNetworkMode::itemSelected() { + OstTraceFunctionEntry0( WLANWIZARDPAGENETWORKMODE_ITEMSELECTED_ENTRY ); OstTrace0( TRACE_BORDER, WLANWIZARDPAGENETWORKMODE_ITEMSELECTED, "WlanWizardPageNetworkMode::itemSelected" ); mValid = true; mWizard->enableNextButton(mValid); + OstTraceFunctionExit0( WLANWIZARDPAGENETWORKMODE_ITEMSELECTED_EXIT ); } /*! @@ -173,6 +193,7 @@ */ void WlanWizardPageNetworkMode::loadDocmlSection(Qt::Orientation orientation) { + OstTraceFunctionEntry0( WLANWIZARDPAGENETWORKMODE_LOADDOCMLSECTION_ENTRY ); OstTrace1( TRACE_NORMAL, WLANWIZARDPAGENETWORKMODE_LOADDOCML, "WlanWizardPageNetworkMode::loadDocml - Orientation;orientation=%x", ( TUint )( orientation ) ); @@ -183,6 +204,7 @@ ":/docml/occ_add_wlan_02_03.docml", "portrait_section", "landscape_section"); + OstTraceFunctionExit0( WLANWIZARDPAGENETWORKMODE_LOADDOCMLSECTION_EXIT ); } /*! @@ -195,10 +217,16 @@ * @param [in] item is the caption to be added. * @param [in] mode is the network mode to be added. * @param [in] isHidden is the visibility status of the network. + * @param [in] wpsSupported is the possibility for wps support. */ -void WlanWizardPageNetworkMode::addToList(QStringList &list, - const QString &item, int mode, bool isHidden) +void WlanWizardPageNetworkMode::addToList( + QStringList &list, + const QString &item, + int mode, + bool isHidden, + bool wpsSupported) { + OstTraceFunctionEntry0( WLANWIZARDPAGENETWORKMODE_ADDTOLIST_ENTRY ); if (mWizard->configurationExists(WlanWizardHelper::ConfAvailableNetworkOptions)) { WlanWizardScanList networkOptions = mWizard->configuration( @@ -207,18 +235,26 @@ QList modes = networkOptions.getNetModes(); for (int i = 0; i < modes.size(); i++) { - if (modes[i].mode == mode && modes[i].hidden == isHidden) { + if ( (modes[i].mode == mode + && modes[i].hidden == isHidden + && modes[i].wpsSupported == wpsSupported) + || (modes[i].wpsSupported && wpsSupported) ) { list << item; mNetworkModes.append(mode); mIsHidden.append(isHidden); + mWpsSupported.append(wpsSupported); } } } - else { + else { list << item; mNetworkModes.append(mode); mIsHidden.append(isHidden); + // If there are no known network options, WPS is not allowed to be + // selected. + mWpsSupported.append(false); } + OstTraceFunctionExit0( WLANWIZARDPAGENETWORKMODE_ADDTOLIST_EXIT ); } /*! @@ -227,9 +263,11 @@ */ void WlanWizardPageNetworkMode::populateRadioButtonList(QStringList &list) { + OstTraceFunctionEntry0( WLANWIZARDPAGENETWORKMODE_POPULATERADIOBUTTONLIST_ENTRY ); list.clear(); mNetworkModes.clear(); 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 @@ -237,13 +275,21 @@ mValid = false; addToList(list, hbTrId("txt_occ_dblist_val_infrastructure_public"), - CMManagerShim::Infra, false); + CMManagerShim::Infra, false, false); addToList(list, hbTrId("txt_occ_list_infrastructure_hidden"), - CMManagerShim::Infra, true); + CMManagerShim::Infra, true, false); addToList(list, hbTrId("txt_occ_list_adhoc_1"), CMManagerShim::Adhoc, - false); + false, false); + + if (mWizard->configurationExists(WlanWizardHelper::ConfAvailableNetworkOptions)) { + // addToList with wpsSupported=true is only called, when there are available + // scan result options. If no network options exist, the user can not get to + // wps wizard from this view. Also, mode and isHidden are "don't care". + addToList(list, hbTrId("txt_occ_list_wifi_protected_setup"), NetworkModeNone, false, true); + } + OstTraceFunctionExit0( WLANWIZARDPAGENETWORKMODE_POPULATERADIOBUTTONLIST_EXIT ); } /*! @@ -254,17 +300,21 @@ */ int WlanWizardPageNetworkMode::selectNextPage(const WlanNetworkSetting &setting) const { + OstTraceFunctionEntry0( WLANWIZARDPAGENETWORKMODE_SELECTNEXTPAGE_ENTRY ); + + int nextPage = WlanWizardPageInternal::PageNetworkSecurity; + WlanWizardScanList networkOptions = mWizard->configuration( WlanWizardHelper::ConfAvailableNetworkOptions).value(); - + if (networkOptions.secModes(setting) == SingleResult) { WlanSecuritySetting secMode = networkOptions.getSecMode(setting); - mWizard->setConfiguration(WlanWizardHelper::ConfSecurityMode, secMode.mode); mWizard->setConfiguration(WlanWizardHelper::ConfUsePsk, secMode.usePsk); - return secMode.nextPageId; + nextPage = secMode.nextPageId; } - return WlanWizardPageInternal::PageNetworkSecurity; + OstTraceFunctionExit0( DUP1_WLANWIZARDPAGENETWORKMODE_SELECTNEXTPAGE_EXIT ); + return nextPage; } diff -r 7b3e49e4608a -r 72ebcbb64834 wlanutilities/wlanwizard/src/wlanwizardpageprocessingsettings.cpp --- a/wlanutilities/wlanwizard/src/wlanwizardpageprocessingsettings.cpp Thu Jun 24 10:49:51 2010 +0300 +++ b/wlanutilities/wlanwizard/src/wlanwizardpageprocessingsettings.cpp Fri Jul 09 10:38:19 2010 +0300 @@ -66,6 +66,7 @@ mLabel(NULL), mNextPageId(WlanWizardPageInternal::PageSummary) { + OstTraceFunctionEntry0( WLANWIZARDPAGEPROCESSINGSETTINGS_WLANWIZARDPAGEPROCESSINGSETTINGS_ENTRY ); WlanQtUtils* utils = mWizard->wlanQtUtils(); bool ok; @@ -92,6 +93,7 @@ Q_UNUSED(ok); Q_ASSERT(ok); + OstTraceFunctionExit0( WLANWIZARDPAGEPROCESSINGSETTINGS_WLANWIZARDPAGEPROCESSINGSETTINGS_EXIT ); } /*! @@ -99,10 +101,12 @@ */ WlanWizardPageProcessingSettings::~WlanWizardPageProcessingSettings() { + OstTraceFunctionEntry0( DUP1_WLANWIZARDPAGEPROCESSINGSETTINGS_WLANWIZARDPAGEPROCESSINGSETTINGS_ENTRY ); // signals are automatically disconnected delete mDocLoader; // Wizard framework deletes the visualization (owns mWidget). + OstTraceFunctionExit0( DUP1_WLANWIZARDPAGEPROCESSINGSETTINGS_WLANWIZARDPAGEPROCESSINGSETTINGS_EXIT ); } /*! @@ -110,6 +114,7 @@ */ HbWidget* WlanWizardPageProcessingSettings::initializePage() { + OstTraceFunctionEntry0( WLANWIZARDPAGEPROCESSINGSETTINGS_INITIALIZEPAGE_ENTRY ); if (!mWidget) { mDocLoader = new HbDocumentLoader(mWizard->mainWindow()); @@ -135,6 +140,7 @@ hbTrId("txt_occ_dialog_checking_connection_to_1")).arg( mWizard->configuration(WlanWizardPrivate::ConfSsid).toString())); + OstTraceFunctionExit0( WLANWIZARDPAGEPROCESSINGSETTINGS_INITIALIZEPAGE_EXIT ); return mWidget; } @@ -147,7 +153,9 @@ */ int WlanWizardPageProcessingSettings::nextId(bool &removeFromStack) const { + OstTraceFunctionEntry0( WLANWIZARDPAGEPROCESSINGSETTINGS_NEXTID_ENTRY ); removeFromStack = true; + OstTraceFunctionExit0( WLANWIZARDPAGEPROCESSINGSETTINGS_NEXTID_EXIT ); return mNextPageId; } @@ -159,6 +167,8 @@ */ bool WlanWizardPageProcessingSettings::showPage() { + OstTraceFunctionEntry0( WLANWIZARDPAGEPROCESSINGSETTINGS_SHOWPAGE_ENTRY ); + OstTraceFunctionExit0( WLANWIZARDPAGEPROCESSINGSETTINGS_SHOWPAGE_EXIT ); return false; } @@ -170,12 +180,14 @@ */ void WlanWizardPageProcessingSettings::loadDocmlSection(Qt::Orientation orientation) { + OstTraceFunctionEntry0( WLANWIZARDPAGEPROCESSINGSETTINGS_LOADDOCMLSECTION_ENTRY ); WlanWizardPageInternal::loadDocmlSection( mDocLoader, orientation, ":/docml/occ_add_wlan_06.docml", "portrait_section", "landscape_section"); + OstTraceFunctionExit0( WLANWIZARDPAGEPROCESSINGSETTINGS_LOADDOCMLSECTION_EXIT ); } /*! @@ -189,12 +201,14 @@ */ void WlanWizardPageProcessingSettings::wlanNetworkClosed(int iapId, int reason) { + OstTraceFunctionEntry0( WLANWIZARDPAGEPROCESSINGSETTINGS_WLANNETWORKCLOSED_ENTRY ); OstTraceExt2( TRACE_BORDER, WLANWIZARDPAGEPROCESSINGSETTINGS_WLANNETWORKCLOSED, "WlanWizardPageProcessingSettings::wlanNetworkClosed;iapId=%d;reason=%d", iapId, reason ); if (iapId != mWizard->configuration(WlanWizardHelper::ConfIapId).toInt()) { + OstTraceFunctionExit0( WLANWIZARDPAGEPROCESSINGSETTINGS_WLANNETWORKCLOSED_EXIT ); return; } @@ -250,6 +264,7 @@ OstTrace0( TRACE_BORDER, WLANWIZARDPAGEPROCESSINGSETTINGS_WLANNETWORKCLOSED_DONE, "WlanWizardPageProcessingSettings::wlanNetworkClosed - Done" ); + OstTraceFunctionExit0( DUP1_WLANWIZARDPAGEPROCESSINGSETTINGS_WLANNETWORKCLOSED_EXIT ); } /*! @@ -261,6 +276,7 @@ */ void WlanWizardPageProcessingSettings::ictResult(int iapId, int reason) { + OstTraceFunctionEntry0( WLANWIZARDPAGEPROCESSINGSETTINGS_ICTRESULT_ENTRY ); OstTraceExt2( TRACE_BORDER, WLANWIZARDPAGEPROCESSINGSETTINGS_ICTRESULT, @@ -268,6 +284,7 @@ iapId, reason ); if (iapId != mWizard->configuration(WlanWizardHelper::ConfIapId).toInt()) { + OstTraceFunctionExit0( WLANWIZARDPAGEPROCESSINGSETTINGS_ICTRESULT_EXIT ); return; } @@ -289,6 +306,7 @@ OstTrace0( TRACE_BORDER, WLANWIZARDPAGEPROCESSINGSETTINGS_ICTRESULT_DONE, "WlanWizardPageProcessingSettings::ictResult - Done" ); + OstTraceFunctionExit0( DUP1_WLANWIZARDPAGEPROCESSINGSETTINGS_ICTRESULT_EXIT ); } /*! @@ -298,12 +316,14 @@ */ void WlanWizardPageProcessingSettings::wlanNetworkOpened(int iapId) { + OstTraceFunctionEntry0( WLANWIZARDPAGEPROCESSINGSETTINGS_WLANNETWORKOPENED_ENTRY ); Q_UNUSED(iapId); OstTrace1( TRACE_BORDER, WLANWIZARDPAGEPROCESSINGSETTINGS_WLANNETWORKOPENED, "WlanWizardPageProcessingSettings::wlanNetworkOpened;iapId=%d", iapId); + OstTraceFunctionExit0( WLANWIZARDPAGEPROCESSINGSETTINGS_WLANNETWORKOPENED_EXIT ); } /*! @@ -313,6 +333,8 @@ */ bool WlanWizardPageProcessingSettings::requiresStartOperation() { + OstTraceFunctionEntry0( WLANWIZARDPAGEPROCESSINGSETTINGS_REQUIRESSTARTOPERATION_ENTRY ); + OstTraceFunctionExit0( WLANWIZARDPAGEPROCESSINGSETTINGS_REQUIRESSTARTOPERATION_EXIT ); return true; } @@ -323,6 +345,7 @@ */ void WlanWizardPageProcessingSettings::startOperation() { + OstTraceFunctionEntry0( WLANWIZARDPAGEPROCESSINGSETTINGS_STARTOPERATION_ENTRY ); if (mWizard->handleIap()) { mNextPageId = WlanWizardPageInternal::PageSummary; @@ -347,4 +370,5 @@ WlanWizardPage::OneStepBackwards); mWizard->nextPage(); } + OstTraceFunctionExit0( WLANWIZARDPAGEPROCESSINGSETTINGS_STARTOPERATION_EXIT ); } diff -r 7b3e49e4608a -r 72ebcbb64834 wlanutilities/wlanwizard/src/wlanwizardpagescanning.cpp --- a/wlanutilities/wlanwizard/src/wlanwizardpagescanning.cpp Thu Jun 24 10:49:51 2010 +0300 +++ b/wlanutilities/wlanwizard/src/wlanwizardpagescanning.cpp Fri Jul 09 10:38:19 2010 +0300 @@ -49,6 +49,7 @@ mScanResultsAvailable(false), mScanStatus(WlanQtUtils::ScanStatusOk) { + OstTraceFunctionEntry0( WLANWIZARDPAGESCANNING_WLANWIZARDPAGESCANNING_ENTRY ); WlanQtUtils* utils = mWizard->wlanQtUtils(); // Connect normal scan completion signal from wlanQtUtils to result @@ -61,6 +62,7 @@ SLOT(wlanScanResultPreCheck(int))); Q_ASSERT(ok); + OstTraceFunctionExit0( WLANWIZARDPAGESCANNING_WLANWIZARDPAGESCANNING_EXIT ); } /*! @@ -69,7 +71,9 @@ */ WlanWizardPageScanning::~WlanWizardPageScanning() { + OstTraceFunctionEntry0( DUP1_WLANWIZARDPAGESCANNING_WLANWIZARDPAGESCANNING_ENTRY ); delete mLoader; + OstTraceFunctionExit0( DUP1_WLANWIZARDPAGESCANNING_WLANWIZARDPAGESCANNING_EXIT ); } /*! @@ -79,6 +83,7 @@ */ HbWidget* WlanWizardPageScanning::initializePage() { + OstTraceFunctionEntry0( WLANWIZARDPAGESCANNING_INITIALIZEPAGE_ENTRY ); OstTrace0( TRACE_NORMAL, WLANWIZARDPAGESCANNING_INITIALIZEPAGE, @@ -132,6 +137,7 @@ WlanWizardPrivate::ConfSsid).toString())); + OstTraceFunctionExit0( WLANWIZARDPAGESCANNING_INITIALIZEPAGE_EXIT ); return mWidget; } @@ -143,8 +149,10 @@ */ int WlanWizardPageScanning::nextId(bool &removeFromStack) const { + OstTraceFunctionEntry0( WLANWIZARDPAGESCANNING_NEXTID_ENTRY ); removeFromStack = true; + OstTraceFunctionExit0( WLANWIZARDPAGESCANNING_NEXTID_EXIT ); return mNextPageId; } @@ -158,6 +166,7 @@ */ int WlanWizardPageScanning::previousTriggered() { + OstTraceFunctionEntry0( WLANWIZARDPAGESCANNING_PREVIOUSTRIGGERED_ENTRY ); disconnect(this, SLOT(wlanScanDirectReady(int))); disconnect(this, SLOT(wlanScanResultPreCheck(int))); @@ -179,6 +188,7 @@ SLOT(wlanScanDirectReady(int))); Q_ASSERT(ok); + OstTraceFunctionExit0( WLANWIZARDPAGESCANNING_PREVIOUSTRIGGERED_EXIT ); return OneStepBackwards; } @@ -193,7 +203,9 @@ */ bool WlanWizardPageScanning::showPage() { + OstTraceFunctionEntry0( WLANWIZARDPAGESCANNING_SHOWPAGE_ENTRY ); mWizard->setConfiguration(WlanWizardHelper::ConfProcessSettings, false); + OstTraceFunctionExit0( WLANWIZARDPAGESCANNING_SHOWPAGE_EXIT ); return false; } @@ -205,6 +217,8 @@ */ bool WlanWizardPageScanning::requiresStartOperation() { + OstTraceFunctionEntry0( WLANWIZARDPAGESCANNING_REQUIRESSTARTOPERATION_ENTRY ); + OstTraceFunctionExit0( WLANWIZARDPAGESCANNING_REQUIRESSTARTOPERATION_EXIT ); return true; } @@ -214,6 +228,7 @@ */ void WlanWizardPageScanning::startOperation() { + OstTraceFunctionEntry0( WLANWIZARDPAGESCANNING_STARTOPERATION_ENTRY ); OstTrace0( TRACE_NORMAL, WLANWIZARDPAGESCANNING_STARTOPERATION, "WlanWizardPageScanning::startOperation - start AP scan if results" " are available." ); @@ -222,6 +237,7 @@ mScanResultsAvailable = false; wlanScanApReady(); } + OstTraceFunctionExit0( WLANWIZARDPAGESCANNING_STARTOPERATION_EXIT ); } /*! @@ -232,6 +248,7 @@ */ void WlanWizardPageScanning::loadDocmlSection(Qt::Orientation orientation) { + OstTraceFunctionEntry0( WLANWIZARDPAGESCANNING_LOADDOCMLSECTION_ENTRY ); OstTrace1( TRACE_NORMAL, WLANWIZARDPAGESCANNING_LOADDOCML, "WlanWizardPageScanning::loadDocml - orientation ;orientation=%x", ( TUint )( orientation ) ); @@ -242,6 +259,7 @@ ":/docml/occ_add_wlan_06.docml", "portrait_section", "landscape_section"); + OstTraceFunctionExit0( WLANWIZARDPAGESCANNING_LOADDOCMLSECTION_EXIT ); } /*! @@ -252,6 +270,7 @@ */ void WlanWizardPageScanning::wlanScanResultPreCheck(int scanStatus) { + OstTraceFunctionEntry0( WLANWIZARDPAGESCANNING_WLANSCANRESULTPRECHECK_ENTRY ); mScanStatus = scanStatus; if (!mWidget) { @@ -276,6 +295,7 @@ mScanResultsAvailable = true; } } + OstTraceFunctionExit0( WLANWIZARDPAGESCANNING_WLANSCANRESULTPRECHECK_EXIT ); } /*! @@ -285,6 +305,7 @@ */ void WlanWizardPageScanning::wlanScanDirectReady(int scanStatus) { + OstTraceFunctionEntry0( WLANWIZARDPAGESCANNING_WLANSCANDIRECTREADY_ENTRY ); OstTrace0( TRACE_NORMAL, WLANWIZARDPAGESCANNING_WLANSCANDIRECTREADY, "WlanWizardPageScanning::wlanScanDirectReady" ); @@ -306,6 +327,7 @@ // Process the scan results. If scan status is not ok, feed an empty // result table to the selection function. selectNextPageActions(filteredResults); + OstTraceFunctionExit0( WLANWIZARDPAGESCANNING_WLANSCANDIRECTREADY_EXIT ); } /*! @@ -316,6 +338,7 @@ */ void WlanWizardPageScanning::wlanScanApReady() { + OstTraceFunctionEntry0( WLANWIZARDPAGESCANNING_WLANSCANAPREADY_ENTRY ); OstTrace0( TRACE_NORMAL, WLANWIZARDPAGESCANNING_WLANSCANAPREADY, "WlanWizardPageScanning::wlanScanApReady" ); @@ -343,6 +366,7 @@ mNextPageId = WlanWizardPageInternal::PageNetworkMode; mWizard->nextPage(); } + OstTraceFunctionExit0( WLANWIZARDPAGESCANNING_WLANSCANAPREADY_EXIT ); } /*! @@ -355,6 +379,7 @@ QString ssid, const QList > &matchList) { + OstTraceFunctionEntry0( WLANWIZARDPAGESCANNING_GETSSIDMATCHLIST_ENTRY ); mWlanApList.clear(); QSharedPointer item; @@ -364,6 +389,7 @@ mWlanApList.append(item); } } + OstTraceFunctionExit0( WLANWIZARDPAGESCANNING_GETSSIDMATCHLIST_EXIT ); } /* @@ -378,6 +404,7 @@ const QList > &openScanResults, QList &finalResults) { + OstTraceFunctionEntry0( WLANWIZARDPAGESCANNING_GETFINALSCANRESULTS_ENTRY ); finalResults.clear(); // The key assumption of this algorithm is that both direct and public scan @@ -404,6 +431,7 @@ finalResults.append(resultItem); } + OstTraceFunctionExit0( WLANWIZARDPAGESCANNING_GETFINALSCANRESULTS_EXIT ); } /*! @@ -415,6 +443,7 @@ int WlanWizardPageScanning::processMultipleScanResults( const QList &finalResults) { + OstTraceFunctionEntry0( WLANWIZARDPAGESCANNING_PROCESSMULTIPLESCANRESULTS_ENTRY ); WlanWizardScanList networkOptions; int nextPage; @@ -427,9 +456,13 @@ mWizard->setConfiguration( WlanWizardHelper::ConfAvailableNetworkOptions, tmp); - // If there are more than one network mode choices, go to manual selection - // of network mode. - if (networkOptions.netModes() > SingleResult) { + if (networkOptions.wpsSelected()) { + // In case all available network mode options support wps, go directly + // to wps-wizard. + nextPage = WlanWizardPageInternal::PageWpsStart; + } else if (networkOptions.netModes() > SingleResult) { + // If there are more than one network mode choices, go to manual selection + // of network mode. nextPage = WlanWizardPageInternal::PageNetworkMode; } else { // if only a single network mode option is available, the mode query @@ -437,9 +470,11 @@ WlanNetworkSetting setting = networkOptions.getNetModes().at(0); mWizard->setConfiguration(WlanWizardHelper::ConfNetworkMode, setting.mode); mWizard->setConfiguration(WlanWizardHelper::ConfHiddenWlan, setting.hidden); + mWizard->setConfiguration(WlanWizardHelper::ConfWpsSupported, setting.wpsSupported); nextPage = WlanWizardPageInternal::PageNetworkSecurity; } + OstTraceFunctionExit0( WLANWIZARDPAGESCANNING_PROCESSMULTIPLESCANRESULTS_EXIT ); return nextPage; } @@ -450,6 +485,7 @@ void WlanWizardPageScanning::selectNextPageActions( const QList &finalResults) { + OstTraceFunctionEntry0( WLANWIZARDPAGESCANNING_SELECTNEXTPAGEACTIONS_ENTRY ); mWizard->clearConfiguration(WlanWizardHelper::ConfAvailableNetworkOptions); if (finalResults.isEmpty()) { @@ -472,4 +508,5 @@ } mWizard->nextPage(); + OstTraceFunctionExit0( WLANWIZARDPAGESCANNING_SELECTNEXTPAGEACTIONS_EXIT ); } diff -r 7b3e49e4608a -r 72ebcbb64834 wlanutilities/wlanwizard/src/wlanwizardpagesecuritymode.cpp --- a/wlanutilities/wlanwizard/src/wlanwizardpagesecuritymode.cpp Thu Jun 24 10:49:51 2010 +0300 +++ b/wlanutilities/wlanwizard/src/wlanwizardpagesecuritymode.cpp Fri Jul 09 10:38:19 2010 +0300 @@ -47,6 +47,8 @@ mLoader(NULL), mValid(false) { + OstTraceFunctionEntry0( WLANWIZARDPAGESECURITYMODE_WLANWIZARDPAGESECURITYMODE_ENTRY ); + OstTraceFunctionExit0( WLANWIZARDPAGESECURITYMODE_WLANWIZARDPAGESECURITYMODE_EXIT ); } /*! @@ -55,7 +57,9 @@ */ WlanWizardPageSecurityMode::~WlanWizardPageSecurityMode() { + OstTraceFunctionEntry0( DUP1_WLANWIZARDPAGESECURITYMODE_WLANWIZARDPAGESECURITYMODE_ENTRY ); delete mLoader; + OstTraceFunctionExit0( DUP1_WLANWIZARDPAGESECURITYMODE_WLANWIZARDPAGESECURITYMODE_EXIT ); } /*! @@ -64,6 +68,7 @@ */ HbWidget* WlanWizardPageSecurityMode::initializePage() { + OstTraceFunctionEntry0( WLANWIZARDPAGESECURITYMODE_INITIALIZEPAGE_ENTRY ); OstTrace0( TRACE_NORMAL, WLANWIZARDPAGESECURITYMODE_INITIALIZEPAGE, "WlanWizardPageSecurityMode::initializePage" ); @@ -108,6 +113,7 @@ // Create contents to the security mode radio button list. populateSecModeList(); + OstTraceFunctionExit0( WLANWIZARDPAGESECURITYMODE_INITIALIZEPAGE_EXIT ); return mWidget; } @@ -120,6 +126,7 @@ */ int WlanWizardPageSecurityMode::nextId(bool &removeFromStack) const { + OstTraceFunctionEntry0( WLANWIZARDPAGESECURITYMODE_NEXTID_ENTRY ); removeFromStack = false; // The configuration is selected from the mSecModes list, which is ordered @@ -131,7 +138,7 @@ // during the page initialization. mWizard->setConfiguration( WlanWizardPrivate::ConfUsePsk, mUsePsk.at( mList->selected() ) ); - + OstTraceFunctionExit0( LANWIZARDPAGESECURITYMODE_NEXTID_EXIT ); return mPageIds.at( mList->selected() ); } @@ -142,6 +149,8 @@ */ bool WlanWizardPageSecurityMode::showPage() { + OstTraceFunctionEntry0( WLANWIZARDPAGESECURITYMODE_SHOWPAGE_ENTRY ); + OstTraceFunctionExit0( WLANWIZARDPAGESECURITYMODE_SHOWPAGE_EXIT ); return mValid; } @@ -151,11 +160,13 @@ */ void WlanWizardPageSecurityMode::itemSelected() { + OstTraceFunctionEntry0( WLANWIZARDPAGESECURITYMODE_ITEMSELECTED_ENTRY ); OstTrace0( TRACE_BORDER, WLANWIZARDPAGESECURITYMODE_ITEMSELECTED, "WlanWizardPageSecurityMode::itemSelected" ); mValid = true; mWizard->enableNextButton(mValid); + OstTraceFunctionExit0( WLANWIZARDPAGESECURITYMODE_ITEMSELECTED_EXIT ); } /*! @@ -166,6 +177,7 @@ */ void WlanWizardPageSecurityMode::loadDocmlSection(Qt::Orientation orientation) { + OstTraceFunctionEntry0( WLANWIZARDPAGESECURITYMODE_LOADDOCMLSECTION_ENTRY ); OstTrace1( TRACE_NORMAL, WLANWIZARDPAGESECURITYMODE_LOADDOCML, "WlanWizardPageSecurityMode::loadDocml - orientation;orientation=%x", ( TUint )( orientation ) ); @@ -176,6 +188,7 @@ ":/docml/occ_add_wlan_02_03.docml", "portrait_section", "landscape_section"); + OstTraceFunctionExit0( WLANWIZARDPAGESECURITYMODE_LOADDOCMLSECTION_EXIT ); } /*! @@ -183,8 +196,9 @@ */ void WlanWizardPageSecurityMode::populateSecModeList() { + OstTraceFunctionEntry0( WLANWIZARDPAGESECURITYMODE_POPULATESECMODELIST_ENTRY ); QStringList items; - + mSecModes.clear(); mPageIds.clear(); mUsePsk.clear(); @@ -228,6 +242,8 @@ } mList->setItems(items); + + OstTraceFunctionExit0( WLANWIZARDPAGESECURITYMODE_POPULATESECMODELIST_EXIT ); } /*! @@ -245,20 +261,18 @@ void WlanWizardPageSecurityMode::addToList(QStringList &list, const QString &item, int mode, int page, bool psk) { + OstTraceFunctionEntry0( WLANWIZARDPAGESECURITYMODE_ADDTOLIST_ENTRY ); if (mWizard->configurationExists(WlanWizardHelper::ConfAvailableNetworkOptions)) { WlanNetworkSetting netMode; netMode.mode = mWizard->configuration(WlanWizardPrivate::ConfNetworkMode).toInt(); netMode.hidden = mWizard->configuration(WlanWizardPrivate::ConfHiddenWlan).toBool(); - - // wps always set to false at this point of the wizard. - netMode.wpsSupported = false; - + netMode.wpsSupported = mWizard->configuration(WlanWizardPrivate::ConfWpsSupported).toBool(); WlanWizardScanList networkOptions = mWizard->configuration( WlanWizardHelper::ConfAvailableNetworkOptions).value(); for (int i = 0; i < networkOptions.secModes(netMode); i++) { WlanSecuritySetting secMode = networkOptions.getSecMode(netMode, i); - + if (secMode.mode == mode && secMode.usePsk == psk) { list << item; mSecModes.append(mode); @@ -273,4 +287,5 @@ mPageIds.append(page); mUsePsk.append(psk); } + OstTraceFunctionExit0( WLANWIZARDPAGESECURITYMODE_ADDTOLIST_EXIT ); } diff -r 7b3e49e4608a -r 72ebcbb64834 wlanutilities/wlanwizard/src/wlanwizardpagessid.cpp --- a/wlanutilities/wlanwizard/src/wlanwizardpagessid.cpp Thu Jun 24 10:49:51 2010 +0300 +++ b/wlanutilities/wlanwizard/src/wlanwizardpagessid.cpp Fri Jul 09 10:38:19 2010 +0300 @@ -44,7 +44,9 @@ mSsid(NULL), mLoader(NULL) { + OstTraceFunctionEntry0( WLANWIZARDPAGESSID_WLANWIZARDPAGESSID_ENTRY ); + OstTraceFunctionExit0( WLANWIZARDPAGESSID_WLANWIZARDPAGESSID_EXIT ); } /*! @@ -53,7 +55,9 @@ */ WlanWizardPageSsid::~WlanWizardPageSsid() { + OstTraceFunctionEntry0( DUP1_WLANWIZARDPAGESSID_WLANWIZARDPAGESSID_ENTRY ); delete mLoader; + OstTraceFunctionExit0( DUP1_WLANWIZARDPAGESSID_WLANWIZARDPAGESSID_EXIT ); } /*! @@ -62,6 +66,7 @@ */ HbWidget* WlanWizardPageSsid::initializePage() { + OstTraceFunctionEntry0( WLANWIZARDPAGESSID_INITIALIZEPAGE_ENTRY ); OstTrace0( TRACE_NORMAL, WLANWIZARDPAGESSID_INITIALIZEPAGE, "WlanWizardPageSsid::initializePage" ); @@ -119,6 +124,7 @@ Qt::ImhNoPredictiveText | Qt::ImhPreferLowercase); mSsid->setMaxLength(WlanWizardUtils::SsidMaxLength); + OstTraceFunctionExit0( WLANWIZARDPAGESSID_INITIALIZEPAGE_EXIT ); return mWidget; } @@ -129,12 +135,13 @@ */ bool WlanWizardPageSsid::showPage() { + OstTraceFunctionEntry0( WLANWIZARDPAGESSID_SHOWPAGE_ENTRY ); // Initiate the scanning of public APs here. mWizard->wlanQtUtils()->scanWlanAps(); // Open virtual keyboard by setting focus to line edit mSsid->setFocus(); - + OstTraceFunctionExit0( WLANWIZARDPAGESSID_SHOWPAGE_EXIT ); return !(mSsid->text().isEmpty()); } @@ -145,11 +152,13 @@ */ int WlanWizardPageSsid::nextId(bool &removeFromStack) const { + OstTraceFunctionEntry0( WLANWIZARDPAGESSID_NEXTID_ENTRY ); removeFromStack = false; // SSID is stored into configuration mWizard->setConfiguration(WlanWizardPrivate::ConfSsid, mSsid->text()); + OstTraceFunctionExit0( WLANWIZARDPAGESSID_NEXTID_EXIT ); return WlanWizardPageInternal::PageScanning; } @@ -161,6 +170,7 @@ */ void WlanWizardPageSsid::loadDocmlSection(Qt::Orientation orientation) { + OstTraceFunctionEntry0( WLANWIZARDPAGESSID_LOADDOCMLSECTION_ENTRY ); OstTrace1( TRACE_FLOW, WLANWIZARDPAGESSID_LOADDOCML, "WlanWizardPageSsid::loadDocml - orientation ;orientation=%x", ( TUint )( orientation ) ); @@ -171,6 +181,7 @@ ":/docml/occ_add_wlan_01_04.docml", "portrait_section", "landscape_section"); + OstTraceFunctionExit0( WLANWIZARDPAGESSID_LOADDOCMLSECTION_EXIT ); } /*! @@ -180,9 +191,11 @@ */ void WlanWizardPageSsid::textChanged(const QString &text) { + OstTraceFunctionEntry0( WLANWIZARDPAGESSID_TEXTCHANGED_ENTRY ); Q_UNUSED(text); OstTrace0( TRACE_FLOW, WLANWIZARDPAGESSID_TEXTCHANGED, "WlanWizardPageSsid::textChanged in text edit widget" ); mWizard->enableNextButton(!(mSsid->text().isEmpty())); + OstTraceFunctionExit0( WLANWIZARDPAGESSID_TEXTCHANGED_EXIT ); } diff -r 7b3e49e4608a -r 72ebcbb64834 wlanutilities/wlanwizard/src/wlanwizardpagesummary.cpp --- a/wlanutilities/wlanwizard/src/wlanwizardpagesummary.cpp Thu Jun 24 10:49:51 2010 +0300 +++ b/wlanutilities/wlanwizard/src/wlanwizardpagesummary.cpp Fri Jul 09 10:38:19 2010 +0300 @@ -30,6 +30,11 @@ #include "wlanwizardplugin.h" #include "wlanwizardsummaryviewitem.h" #include "wlanwizardpagesummary.h" +#include "OstTraceDefinitions.h" +#ifdef OST_TRACE_COMPILER_IN_USE +#include "wlanwizardpagesummaryTraces.h" +#endif + /*! \class WlanWizardPageSummary @@ -56,6 +61,8 @@ WlanWizardPageInternal(parent), mListWidget(NULL) { + OstTraceFunctionEntry0( WLANWIZARDPAGESUMMARY_WLANWIZARDPAGESUMMARY_ENTRY ); + OstTraceFunctionExit0( WLANWIZARDPAGESUMMARY_WLANWIZARDPAGESUMMARY_EXIT ); } /*! @@ -63,9 +70,11 @@ */ WlanWizardPageSummary::~WlanWizardPageSummary() { + OstTraceFunctionEntry0( DUP1_WLANWIZARDPAGESUMMARY_WLANWIZARDPAGESUMMARY_ENTRY ); HbStyleLoader::unregisterFilePath(WlanWizardPageSummaryLayout); // Wizard framework deletes the visualization (owns mListWidget). + OstTraceFunctionExit0( DUP1_WLANWIZARDPAGESUMMARY_WLANWIZARDPAGESUMMARY_EXIT ); } /*! @@ -73,6 +82,7 @@ */ HbWidget* WlanWizardPageSummary::initializePage() { + OstTraceFunctionEntry0( WLANWIZARDPAGESUMMARY_INITIALIZEPAGE_ENTRY ); // Note that from summary page it is not possible to step back // this means that it is not possible that this method is called twice. Q_ASSERT(!mListWidget); @@ -93,6 +103,7 @@ addDynamicItems(row); + OstTraceFunctionExit0( WLANWIZARDPAGESUMMARY_INITIALIZEPAGE_EXIT ); return qobject_cast(mListWidget); } @@ -101,6 +112,7 @@ */ void WlanWizardPageSummary::loadDocml() { + OstTraceFunctionEntry0( WLANWIZARDPAGESUMMARY_LOADDOCML_ENTRY ); bool ok; HbDocumentLoader docLoader(mWizard->mainWindow()); @@ -120,6 +132,7 @@ // Register the location of hblistviewitem.css and hblistviewitem.widgetml ok = HbStyleLoader::registerFilePath(WlanWizardPageSummaryLayout); Q_ASSERT(ok); + OstTraceFunctionExit0( WLANWIZARDPAGESUMMARY_LOADDOCML_EXIT ); } /*! @@ -130,6 +143,7 @@ */ QString WlanWizardPageSummary::networkModeText() const { + OstTraceFunctionEntry0( WLANWIZARDPAGESUMMARY_NETWORKMODETEXT_ENTRY ); QString ret; int mode = mWizard->configuration( WlanWizardPrivate::ConfNetworkMode).toInt(); @@ -148,6 +162,7 @@ } break; } + OstTraceFunctionExit0( WLANWIZARDPAGESUMMARY_NETWORKMODETEXT_EXIT ); return ret; } @@ -159,6 +174,7 @@ */ QString WlanWizardPageSummary::securityModeText() const { + OstTraceFunctionEntry0( WLANWIZARDPAGESUMMARY_SECURITYMODETEXT_ENTRY ); QString ret; int mode = mWizard->configuration(WlanWizardPrivate::ConfSecurityMode).toInt(); switch (mode) { @@ -191,6 +207,7 @@ ret = hbTrId("txt_occ_dblist_security_mode_val_open"); break; } + OstTraceFunctionExit0( WLANWIZARDPAGESUMMARY_SECURITYMODETEXT_EXIT ); return ret; } @@ -201,13 +218,13 @@ */ void WlanWizardPageSummary::addDynamicItems(int &row) { + OstTraceFunctionEntry0( WLANWIZARDPAGESUMMARY_ADDDYNAMICITEMS_ENTRY ); if (mWizard->isEapEnabled()) { appendToListPluginInfo(WlanWizardPlugin::SummaryEapOuterType, row); appendToListPluginInfo(WlanWizardPlugin::SummaryEapInnerType, row); appendToListPluginInfo(WlanWizardPlugin::SummaryEapFastProvisioningMode, row); } - // TODO: Hotspot: no need to show destination.. QString value; switch (mWizard->configuration(WlanWizardPrivate::ConfIctStatus).toInt()) { @@ -222,10 +239,12 @@ break; default: - Q_ASSERT(WlanQtUtils::IctHotspotPassed == mWizard->configuration(WlanWizardPrivate::ConfIctStatus).toInt()); + Q_ASSERT(WlanQtUtils::IctHotspotPassed == + mWizard->configuration(WlanWizardPrivate::ConfIctStatus).toInt()); // Add nothing to list. break; } + OstTraceFunctionExit0( WLANWIZARDPAGESUMMARY_ADDDYNAMICITEMS_EXIT ); } /*! @@ -240,10 +259,12 @@ const QString title, const QString value) { + OstTraceFunctionEntry0( WLANWIZARDPAGESUMMARY_APPENDTOLIST_ENTRY ); HbListWidgetItem *item = new HbListWidgetItem(); item->setText(title); item->setSecondaryText(value); mListWidget->insertItem(row++, item); + OstTraceFunctionExit0( WLANWIZARDPAGESUMMARY_APPENDTOLIST_EXIT ); } /*! @@ -255,6 +276,7 @@ void WlanWizardPageSummary::appendToListPluginInfo( WlanWizardPlugin::Summary id, int &row ) { + OstTraceFunctionEntry0( WLANWIZARDPAGESUMMARY_APPENDTOLISTPLUGININFO_ENTRY ); QString title; QString value; WlanWizardPlugin *plugin = mWizard->wlanWizardPlugin(); @@ -262,4 +284,5 @@ if (plugin->summary(id, title, value)) { appendToList(row, title, value ); } + OstTraceFunctionExit0( WLANWIZARDPAGESUMMARY_APPENDTOLISTPLUGININFO_EXIT ); } diff -r 7b3e49e4608a -r 72ebcbb64834 wlanutilities/wlanwizard/src/wlanwizardscanlist.cpp --- a/wlanutilities/wlanwizard/src/wlanwizardscanlist.cpp Thu Jun 24 10:49:51 2010 +0300 +++ b/wlanutilities/wlanwizard/src/wlanwizardscanlist.cpp Fri Jul 09 10:38:19 2010 +0300 @@ -26,13 +26,20 @@ // User includes #include "wlanwizardscanlist.h" #include "wlanwizardpageinternal.h" +#include "OstTraceDefinitions.h" +#ifdef OST_TRACE_COMPILER_IN_USE +#include "wlanwizardscanlistTraces.h" +#endif + /*! * Constructor for WlanWizardScanList object. */ -WlanWizardScanList::WlanWizardScanList() +WlanWizardScanList::WlanWizardScanList(): mWpsSelected(false) { + OstTraceFunctionEntry0( WLANWIZARDSCANLIST_WLANWIZARDSCANLIST_ENTRY ); + OstTraceFunctionExit0( WLANWIZARDSCANLIST_WLANWIZARDSCANLIST_EXIT ); } /*! @@ -40,9 +47,11 @@ * @param [in] scanList is the object to be copied. */ WlanWizardScanList::WlanWizardScanList(const WlanWizardScanList &scanList): - mOpenOptions(scanList.mOpenOptions) +mOpenOptions(scanList.mOpenOptions), mWpsSelected(false) { + OstTraceFunctionEntry0( DUP1_WLANWIZARDSCANLIST_WLANWIZARDSCANLIST_ENTRY ); + OstTraceFunctionExit0( DUP1_WLANWIZARDSCANLIST_WLANWIZARDSCANLIST_EXIT ); } /*! @@ -50,7 +59,9 @@ */ WlanWizardScanList::~WlanWizardScanList() { + OstTraceFunctionEntry0( DUP2_WLANWIZARDSCANLIST_WLANWIZARDSCANLIST_ENTRY ); + OstTraceFunctionExit0( DUP2_WLANWIZARDSCANLIST_WLANWIZARDSCANLIST_EXIT ); } /*! @@ -62,15 +73,19 @@ */ void WlanWizardScanList::build(const QList &results) { + OstTraceFunctionEntry0( WLANWIZARDSCANLIST_BUILD_ENTRY ); + + mWpsSelected = true; + for (int i = 0; i < results.size(); i++) { WlanNetworkSetting netMode; WlanSecuritySetting secMode; WlanScanResult item = results.at(i); - + netMode.wpsSupported = item.scanResult->value(WlanQtUtilsAp::ConfIdWpsSupported).toBool(); netMode.mode = item.scanResult->value(WlanQtUtilsAp::ConfIdConnectionMode).toInt(); netMode.hidden = (netMode.mode == CMManagerShim::Adhoc) ? false : item.networkHidden; - + secMode.mode = item.scanResult->value(WlanQtUtilsAp::ConfIdSecurityMode).toInt(); secMode.usePsk = (secMode.mode == CMManagerShim::WlanSecModeWep) ? true : item.scanResult->value(WlanQtUtilsAp::ConfIdWpaPskUse).toBool(); @@ -79,11 +94,11 @@ case CMManagerShim::WlanSecMode802_1x: secMode.nextPageId = WlanWizardPage::PageEapStart; break; - + case CMManagerShim::WlanSecModeWep: secMode.nextPageId = WlanWizardPageInternal::PageKeyQuery; break; - + case CMManagerShim::WlanSecModeWpa: case CMManagerShim::WlanSecModeWpa2: if (secMode.usePsk) { @@ -99,11 +114,12 @@ CMManagerShim::WlanSecModeWapi == secMode.mode); secMode.nextPageId = WlanWizardPage::PageProcessSettings; break; - + } - + // prevent duplicate settings. if (!mOpenOptions.contains(netMode)) { + mWpsSelected = (mWpsSelected && netMode.wpsSupported); QList secList; secList.append(secMode); mOpenOptions.insert(netMode, secList); @@ -113,6 +129,7 @@ } // else an identical key-value pair is already in the list -> not added. } + OstTraceFunctionExit0( WLANWIZARDSCANLIST_BUILD_EXIT ); } /*! @@ -127,6 +144,7 @@ WlanNetworkSetting netMode, int index) const { + OstTraceFunctionEntry0( WLANWIZARDSCANLIST_GETSECMODE_ENTRY ); return mOpenOptions.value(netMode).at(index); } @@ -136,6 +154,7 @@ */ int WlanWizardScanList::netModes() const { + OstTraceFunctionEntry0( WLANWIZARDSCANLIST_NETMODES_ENTRY ); return mOpenOptions.size(); } @@ -146,6 +165,8 @@ */ int WlanWizardScanList::secModes(WlanNetworkSetting netMode) const { + OstTraceFunctionEntry0( WLANWIZARDSCANLIST_SECMODES_ENTRY ); + Q_ASSERT(mOpenOptions.contains(netMode)); return mOpenOptions.find(netMode)->size(); } @@ -155,6 +176,18 @@ */ QList WlanWizardScanList::getNetModes() const { + OstTraceFunctionEntry0( WLANWIZARDSCANLIST_GETNETMODES_ENTRY ); return mOpenOptions.keys(); } +/*! + * This function indicates whether the list of scan results supports + * Wi-Fi Protected Setup. + * @return true, if all result network modes support wps, false if even + * a single result does not. + */ +bool WlanWizardScanList::wpsSelected() const +{ + OstTraceFunctionEntry0( WLANWIZARDSCANLIST_WPSSELECTED_ENTRY ); + return mWpsSelected; +} diff -r 7b3e49e4608a -r 72ebcbb64834 wlanutilities/wlanwizard/src/wlanwizardsummaryviewitem.cpp --- a/wlanutilities/wlanwizard/src/wlanwizardsummaryviewitem.cpp Thu Jun 24 10:49:51 2010 +0300 +++ b/wlanutilities/wlanwizard/src/wlanwizardsummaryviewitem.cpp Fri Jul 09 10:38:19 2010 +0300 @@ -21,13 +21,18 @@ // User includes #include "wlanwizardsummaryviewitem.h" +#include "OstTraceDefinitions.h" +#ifdef OST_TRACE_COMPILER_IN_USE +#include "wlanwizardsummaryviewitemTraces.h" +#endif + /*! \class WlanWizardSummaryListViewItem \brief Implements custom List view for Summary page. - + HbListWidget does not support directly views where selection is disabled. - + This implementation removes required operations to disable list selection. */ @@ -41,13 +46,17 @@ /*! Constructor. - + @param [in] parent parent class */ WlanWizardSummaryListViewItem::WlanWizardSummaryListViewItem( QGraphicsItem* parent) : HbListViewItem(parent) { + OstTraceFunctionEntry0( + WLANWIZARDSUMMARYLISTVIEWITEM_WLANWIZARDSUMMARYLISTVIEWITEM_ENTRY ); + OstTraceFunctionExit0( + WLANWIZARDSUMMARYLISTVIEWITEM_WLANWIZARDSUMMARYLISTVIEWITEM_EXIT ); } /*! @@ -55,22 +64,28 @@ */ WlanWizardSummaryListViewItem::~WlanWizardSummaryListViewItem() { + OstTraceFunctionEntry0( + DUP1_WLANWIZARDSUMMARYLISTVIEWITEM_WLANWIZARDSUMMARYLISTVIEWITEM_ENTRY ); + OstTraceFunctionExit0( + DUP1_WLANWIZARDSUMMARYLISTVIEWITEM_WLANWIZARDSUMMARYLISTVIEWITEM_EXIT ); } /*! See HbListViewItem::updateChildItems(). - + Disables selection. */ void WlanWizardSummaryListViewItem::updateChildItems() { + OstTraceFunctionEntry0( WLANWIZARDSUMMARYLISTVIEWITEM_UPDATECHILDITEMS_ENTRY ); HbListViewItem::updateChildItems(); - + ungrabGesture(Qt::TapGesture); - + GraphicsItemFlags itemFlags = flags(); itemFlags &= ~QGraphicsItem::ItemIsFocusable; setFlags(itemFlags); + OstTraceFunctionExit0( WLANWIZARDSUMMARYLISTVIEWITEM_UPDATECHILDITEMS_EXIT ); } /*! @@ -78,5 +93,7 @@ */ HbAbstractViewItem* WlanWizardSummaryListViewItem::createItem() { + OstTraceFunctionEntry0( WLANWIZARDSUMMARYLISTVIEWITEM_CREATEITEM_ENTRY ); + OstTraceFunctionExit0( WLANWIZARDSUMMARYLISTVIEWITEM_CREATEITEM_EXIT ); return new WlanWizardSummaryListViewItem(*this); } diff -r 7b3e49e4608a -r 72ebcbb64834 wlanutilities/wlanwizard/src/wlanwizardutils.cpp --- a/wlanutilities/wlanwizard/src/wlanwizardutils.cpp Thu Jun 24 10:49:51 2010 +0300 +++ b/wlanutilities/wlanwizard/src/wlanwizardutils.cpp Fri Jul 09 10:38:19 2010 +0300 @@ -108,6 +108,7 @@ */ WlanWizardUtils::KeyStatus WlanWizardUtils::validateWpaKey(const QString &key) { + OstTraceFunctionEntry0( WLANWIZARDUTILS_VALIDATEWPAKEY_ENTRY ); #ifdef OST_TRACE_COMPILER_IN_USE TPtrC tmp(key.utf16(),key.length() ); OstTraceExt1( TRACE_NORMAL, WLANWIZARDUTILS_VALIDATEWPAKEY, @@ -131,6 +132,7 @@ TRACE_NORMAL, WLANWIZARDUTILS_VALIDATEWPAKEY_RETURN, "WlanWizardUtils::validateWpaKey - Return;ret=%{KeyStatus}", ret ); + OstTraceFunctionExit0( WLANWIZARDUTILS_VALIDATEWPAKEY_EXIT ); return ret; } @@ -154,6 +156,7 @@ */ WlanWizardUtils::KeyStatus WlanWizardUtils::validateWepKey(const QString &key) { + OstTraceFunctionEntry0( WLANWIZARDUTILS_VALIDATEWEPKEY_ENTRY ); #ifdef OST_TRACE_COMPILER_IN_USE TPtrC tmp(key.utf16(),key.length() ); OstTraceExt1( TRACE_NORMAL, WLANWIZARDUTILS_VALIDATEWEPKEY, @@ -175,6 +178,7 @@ TRACE_NORMAL, WLANWIZARDUTILS_VALIDATEWEPKEY_RETURN, "WlanWizardUtils::validateWepKey - Return;ret=%{KeyStatus}", ret ); + OstTraceFunctionExit0( WLANWIZARDUTILS_VALIDATEWEPKEY_EXIT ); return ret; } @@ -189,16 +193,19 @@ */ WlanWizardUtils::KeyStatus WlanWizardUtils::isAscii(const QString &key) { + OstTraceFunctionEntry0( WLANWIZARDUTILS_ISASCII_ENTRY ); static const QChar ch32(32); // First visible ascii character static const QChar ch126(126); // Last visible ascii character const QChar *data = key.data(); while (!data->isNull()) { if ((*data) < ch32 || (*data) > ch126) { + OstTraceFunctionExit0( WLANWIZARDUTILS_ISASCII_EXIT ); return KeyStatusIllegalCharacters; } ++data; } + OstTraceFunctionExit0( DUP1_WLANWIZARDUTILS_ISASCII_EXIT ); return KeyStatusOk; } @@ -216,6 +223,7 @@ */ WlanWizardUtils::KeyStatus WlanWizardUtils::isHex(const QString &key) { + OstTraceFunctionEntry0( WLANWIZARDUTILS_ISHEX_ENTRY ); static const QChar ch_A(65); // Character: A static const QChar ch_F(70); // Character: F static const QChar ch_a(97); // Character: a @@ -228,9 +236,11 @@ (*data) >= ch_A && (*data) <= ch_F) { ++data; } else { + OstTraceFunctionExit0( WLANWIZARDUTILS_ISHEX_EXIT ); return KeyStatusIllegalCharacters; } } + OstTraceFunctionExit0( DUP1_WLANWIZARDUTILS_ISHEX_EXIT ); return KeyStatusOk; } @@ -245,6 +255,7 @@ */ WlanWizardUtils::SsidStatus WlanWizardUtils::validateSsid(const QString &ssid) { + OstTraceFunctionEntry0( WLANWIZARDUTILS_VALIDATESSID_ENTRY ); TPtrC tmp(ssid.utf16(), ssid.length() ); OstTraceExt1( TRACE_NORMAL, WLANWIZARDUTILS_VALIDATESSID, "WlanWizardUtils::validateSsid;ssid=%S", tmp ); @@ -258,5 +269,6 @@ OstTrace1( TRACE_NORMAL, WLANWIZARDUTILS_VALIDATESSID_RETURN, "WlanWizardUtils::validateSsid - Return;ret=%{SsidStatus}", ret ); + OstTraceFunctionExit0( WLANWIZARDUTILS_VALIDATESSID_EXIT ); return ret; } diff -r 7b3e49e4608a -r 72ebcbb64834 wlanutilities/wlanwizard/t_wlanwizard/stubs/wlanqtutilsap.h --- a/wlanutilities/wlanwizard/t_wlanwizard/stubs/wlanqtutilsap.h Thu Jun 24 10:49:51 2010 +0300 +++ b/wlanutilities/wlanwizard/t_wlanwizard/stubs/wlanqtutilsap.h Fri Jul 09 10:38:19 2010 +0300 @@ -114,7 +114,7 @@ void setValue(int identifier, QVariant value ); bool operator==(const WlanQtUtilsAp & rhs ) const; - static bool compare( + static int compare( const WlanQtUtilsAp *ap1, const WlanQtUtilsAp *ap2); diff -r 7b3e49e4608a -r 72ebcbb64834 wlanutilities/wlanwizard/t_wlanwizard/stubs/wlanqtutilsap_stub.cpp --- a/wlanutilities/wlanwizard/t_wlanwizard/stubs/wlanqtutilsap_stub.cpp Thu Jun 24 10:49:51 2010 +0300 +++ b/wlanutilities/wlanwizard/t_wlanwizard/stubs/wlanqtutilsap_stub.cpp Fri Jul 09 10:38:19 2010 +0300 @@ -91,14 +91,14 @@ @param [in] ap1 First AP to compare. @param [in] ap2 Second AP to compare. - @return TRUE, if APs are considered to be same. + @return Zero(0), if APs are considered to be same. */ -bool WlanQtUtilsAp::compare( +int WlanQtUtilsAp::compare( const WlanQtUtilsAp *ap1, const WlanQtUtilsAp *ap2) { - bool equal = false; + int equal = 1; // Not equal // SSID (case sensitive) and security mode (with or without PSK) // are the values, which identify a unique access point. @@ -108,7 +108,7 @@ ap2->value(WlanQtUtilsAp::ConfIdSecurityMode) && ap1->value(WlanQtUtilsAp::ConfIdWpaPskUse) == ap2->value(WlanQtUtilsAp::ConfIdWpaPskUse)) { - equal = true; + equal = 0; // Equal } return equal; diff -r 7b3e49e4608a -r 72ebcbb64834 wlanutilities/wlanwizard/t_wlanwizard/ut/testwlanwizardmanual.cpp --- a/wlanutilities/wlanwizard/t_wlanwizard/ut/testwlanwizardmanual.cpp Thu Jun 24 10:49:51 2010 +0300 +++ b/wlanutilities/wlanwizard/t_wlanwizard/ut/testwlanwizardmanual.cpp Fri Jul 09 10:38:19 2010 +0300 @@ -992,6 +992,11 @@ QCOMPARE( mouseClickNext(), true ); QCOMPARE( verifyCurrentPage(WlanWizardPageInternal::PageNetworkMode), true ); + QStringList buttons; + buttons << hbTrId("txt_occ_list_infrastructure_hidden") + << hbTrId("txt_occ_list_adhoc_1"); + QCOMPARE( verifyRadioButtons("list"), buttons ); + QTest::qWait(WaitTimeForUi); QCOMPARE( selectRadioButton( "list", 1 ), true ); QTest::qWait(WaitTimeForUi); @@ -1102,6 +1107,11 @@ QCOMPARE( mouseClickNext(), true ); QCOMPARE( verifyCurrentPage(WlanWizardPageInternal::PageNetworkMode), true ); + QStringList buttons; + buttons << hbTrId("txt_occ_dblist_val_infrastructure_public") + << hbTrId("txt_occ_list_infrastructure_hidden") + << hbTrId("txt_occ_list_adhoc_1"); + QCOMPARE( verifyRadioButtons("list"), buttons ); QTest::qWait(WaitTimeForUi); QCOMPARE( selectRadioButton( "list", 0 ), true ); QTest::qWait(WaitTimeForUi); @@ -1168,3 +1178,80 @@ QCOMPARE( verifyCurrentPageWithInfo(WlanWizardPageInternal::PageKeyQuery, "huuhaa3421"), true ); #endif } + +/*! + * + */ +void TestWlanWizardManual::tc_multiple_ssids_with_same_name_wps_and_nonwps() +{ +#ifdef tc_multiple_ssids_with_same_name_wps_and_nonwps_enabled + mApList->Add("huuhaa", CMManagerShim::Infra, CMManagerShim::WlanSecModeWpa, false, false, 100); + + // Add all five kinds of security modes. + mApList->Add("huuhaa", CMManagerShim::Infra, CMManagerShim::WlanSecModeWep, true, true, 300); + + mWlanQtUtilsContext->setScanWlanDirectResult("huuhaa", mApList->List()); + mWlanQtUtilsContext->setCreateWlanIapResult(100); + mWlanQtUtilsContext->setSignalIctResult(100, WlanQtUtils::IctPassed); + mWlanQtUtilsContext->setSignalWlanNetworkOpened(100); + mWlanQtUtilsContext->setConnectionSuccessed(true); + + mView->showWizard(); + + QCOMPARE( verifyCurrentPage(WlanWizardPageInternal::PageSsid), true ); + + QCOMPARE( mouseClickObject("lineEditKey"), true ); + QTest::qWait(WaitTimeForUi); + QCOMPARE( insertTextToObject("lineEditKey", "huuhaa"), true ); + QTest::qWait(WaitTimeForUi); + QCOMPARE( mouseClickObject("dialog"), true ); + QTest::qWait(WaitTimeForUi); + QCOMPARE( mouseClickNext(), true ); + + QCOMPARE( verifyCurrentPageWithInfo(WlanWizardPageInternal::PageScanning, "huuhaa"), true ); + QCOMPARE( verifyCurrentPage(WlanWizardPageInternal::PageNetworkMode), true ); + QStringList buttons; + buttons << hbTrId("txt_occ_list_infrastructure_hidden") + << hbTrId("txt_occ_list_wifi_protected_setup"); + QCOMPARE( verifyRadioButtons("list"), buttons ); + QCOMPARE( selectRadioButton( "list", 1 ), true ); + QTest::qWait(WaitTimeForUi); + QCOMPARE( mouseClickNext(), true ); + + QCOMPARE( verifyCurrentPage(WlanWizardPageInternal::PageWpsStart), true ); +#endif +} + +/*! + * + */ +void TestWlanWizardManual::tc_multiple_ssids_with_same_name_two_wps_aps() +{ +#ifdef tc_multiple_ssids_with_same_name_two_wps_aps_enabled + mApList->Add("huuhaa", CMManagerShim::Infra, CMManagerShim::WlanSecModeWpa, false, true, 100); + + // Add all five kinds of security modes. + mApList->Add("huuhaa", CMManagerShim::Infra, CMManagerShim::WlanSecModeWep, true, true, 300); + + mWlanQtUtilsContext->setScanWlanDirectResult("huuhaa", mApList->List()); + mWlanQtUtilsContext->setCreateWlanIapResult(100); + mWlanQtUtilsContext->setSignalIctResult(100, WlanQtUtils::IctPassed); + mWlanQtUtilsContext->setSignalWlanNetworkOpened(100); + mWlanQtUtilsContext->setConnectionSuccessed(true); + + mView->showWizard(); + + QCOMPARE( verifyCurrentPage(WlanWizardPageInternal::PageSsid), true ); + + QCOMPARE( mouseClickObject("lineEditKey"), true ); + QTest::qWait(WaitTimeForUi); + QCOMPARE( insertTextToObject("lineEditKey", "huuhaa"), true ); + QTest::qWait(WaitTimeForUi); + QCOMPARE( mouseClickObject("dialog"), true ); + QTest::qWait(WaitTimeForUi); + QCOMPARE( mouseClickNext(), true ); + + QCOMPARE( verifyCurrentPageWithInfo(WlanWizardPageInternal::PageScanning, "huuhaa"), true ); + QCOMPARE( verifyCurrentPage(WlanWizardPageInternal::PageWpsStart), true ); +#endif +} diff -r 7b3e49e4608a -r 72ebcbb64834 wlanutilities/wlanwizard/t_wlanwizard/ut/testwlanwizardmanual.h --- a/wlanutilities/wlanwizard/t_wlanwizard/ut/testwlanwizardmanual.h Thu Jun 24 10:49:51 2010 +0300 +++ b/wlanutilities/wlanwizard/t_wlanwizard/ut/testwlanwizardmanual.h Fri Jul 09 10:38:19 2010 +0300 @@ -54,6 +54,8 @@ void tc_multiple_ssids_with_same_name_press_previous(); void tc_multiple_ssids_with_same_name_all_sec_modes(); void tc_multiple_ssids_with_same_name_orientation_switch(); + void tc_multiple_ssids_with_same_name_wps_and_nonwps(); + void tc_multiple_ssids_with_same_name_two_wps_aps(); }; diff -r 7b3e49e4608a -r 72ebcbb64834 wlanutilities/wlanwizard/t_wlanwizard/ut/testwlanwizardmanual_conf.h --- a/wlanutilities/wlanwizard/t_wlanwizard/ut/testwlanwizardmanual_conf.h Thu Jun 24 10:49:51 2010 +0300 +++ b/wlanutilities/wlanwizard/t_wlanwizard/ut/testwlanwizardmanual_conf.h Fri Jul 09 10:38:19 2010 +0300 @@ -49,3 +49,5 @@ #define tc_multiple_ssids_with_same_name_press_previous_enabled #define tc_multiple_ssids_with_same_name_all_sec_modes_enabled #define tc_multiple_ssids_with_same_name_orientation_switch_enabled +#define tc_multiple_ssids_with_same_name_wps_and_nonwps_enabled +#define tc_multiple_ssids_with_same_name_two_wps_aps_enabled diff -r 7b3e49e4608a -r 72ebcbb64834 wlanutilities/wpswizard/resources/occ_wps_P1.docml --- a/wlanutilities/wpswizard/resources/occ_wps_P1.docml Thu Jun 24 10:49:51 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,30 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff -r 7b3e49e4608a -r 72ebcbb64834 wlanutilities/wpswizard/resources/occ_wps_P2.docml --- a/wlanutilities/wpswizard/resources/occ_wps_P2.docml Thu Jun 24 10:49:51 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,20 +0,0 @@ - - - - - - - - - - - - - - - - - - - - diff -r 7b3e49e4608a -r 72ebcbb64834 wlanutilities/wpswizard/resources/occ_wps_P3.docml --- a/wlanutilities/wpswizard/resources/occ_wps_P3.docml Thu Jun 24 10:49:51 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,19 +0,0 @@ - - - - - - - - - - - - - - - - - - - diff -r 7b3e49e4608a -r 72ebcbb64834 wlanutilities/wpswizard/resources/occ_wps_P5.docml --- a/wlanutilities/wpswizard/resources/occ_wps_P5.docml Thu Jun 24 10:49:51 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,27 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - diff -r 7b3e49e4608a -r 72ebcbb64834 wlanutilities/wpswizard/resources/occ_wps_P6.docml --- a/wlanutilities/wpswizard/resources/occ_wps_P6.docml Thu Jun 24 10:49:51 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,49 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff -r 7b3e49e4608a -r 72ebcbb64834 wlanutilities/wpswizard/resources/resource.qrc --- a/wlanutilities/wpswizard/resources/resource.qrc Thu Jun 24 10:49:51 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,14 +0,0 @@ - - - occ_wps_P1.docml - occ_wps_P2.docml - occ_wps_P3.docml - occ_wps_P4.docml - occ_wps_P5.docml - occ_wps_P6.docml - - - - wpswizardplugin.qm - - diff -r 7b3e49e4608a -r 72ebcbb64834 wlanutilities/wpswizard/resources/wpswizardplugin.qm Binary file wlanutilities/wpswizard/resources/wpswizardplugin.qm has changed diff -r 7b3e49e4608a -r 72ebcbb64834 wlanutilities/wpswizard/resources/wpswizardplugin.ts --- a/wlanutilities/wpswizard/resources/wpswizardplugin.ts Thu Jun 24 10:49:51 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,86 +0,0 @@ - - - - - - - Configure manually - Configure manually - qtl_list_popup_sec_add - occ_wps_01 - list - oc - False - - - - Use PIN code - Use PIN code - qtl_list_popup_sec_add - occ_wps_01 - list - oc - False - - - - First, press button on the wireless station to initiate the setup process, then select ‘Next’. - First, press button on the wireless station to initiate the setup process, then select ‘Next’. - qtl_dialog_pri5 - occ_wps_02 - dialog - oc - False - - - - Settings received for multiple WLAN networks. Select the network to use: - Settings received for multiple WLAN networks. Select the network to use: - qtl_dialog_pri5 - occ_wps_05 - dialog - oc - False - - - - Enter ‘%1 on the wireless station then select ‘Next’. - Enter ‘%1 on the wireless station then select ‘Next’. - qtl_dialog_pri5 - occ_wps_03 - dialog - oc - False - - - - Selected network supports Wi-Fi Protected Setup™ for receiving settings automatically. - Selected network supports Wi-Fi Protected Setup™ for receiving settings automatically. - qtl_dialog_pri5 - occ_wps_01 - dialog - oc - False - - - - Negotiating - Negotiating - qtl_dialog_pri3 - occ_wps_04 - dialog - oc - False - - - - Use push-button - Use push-button - qtl_list_popup_sec_add - occ_wps_01 - list - oc - False - - - diff -r 7b3e49e4608a -r 72ebcbb64834 wlanutilities/wpswizard/src/wpswizardprivate.cpp --- a/wlanutilities/wpswizard/src/wpswizardprivate.cpp Thu Jun 24 10:49:51 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,229 +0,0 @@ -/* - * 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 the License "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: - * WPS Wizard: Private implementation. - * - */ - -/* - * %version: 1 % - */ - -// System includes -#include -#include -#include -#include -#include -#include -#include -#include - -// Trace includes -#include "OstTraceDefinitions.h" -#ifdef OST_TRACE_COMPILER_IN_USE -#include "wpswizardprivateTraces.h" -#endif - -// User includes -#include "wlanwizardhelpper.h" -// Wizard -#include "wpswizard.h" -#include "wpswizard_p.h" -// Wizard Pages -#include "wpswizardsteptwo.h" -#include "wpswizardstepthreebutton.h" -#include "wpswizardstepthreenumber.h" -#include "wpswizardstepfour.h" -#include "wpswizardstepfive.h" - - -class WlanWizardHelpper; - -/*! - * Constructor for the private implementation of wps wiazard - * - * \param WpsWizard* pointer to the framework object - * \param WlanWizardHelpper * pointer to the wizard helpper class - * - */ -WpsWizardPrivate::WpsWizardPrivate(WpsWizard* wizard, - WlanWizardHelpper *wizardHelpper, int bearerType, int referenceId) : - q_ptr(wizard), mBearerType(bearerType), mReferenceId(referenceId), - mWizardHelpper(wizardHelpper), mRandomNumber(0) - - { - OstTraceFunctionEntry1(WPSWIZARDPRIVATE_WPSWIZARDPRIVATE_ENTRY, this); - - // TODO: load localization file - mTranslator = new QTranslator(this); - mTranslator->load(":/loc/wpswizardplugin.qm"); - qApp->installTranslator(mTranslator); - - createPages(); - - OstTraceFunctionExit1(WPSWIZARDPRIVATE_WPSWIZARDPRIVATE_EXIT, this); - } - -/*! - * Destructor - */ -WpsWizardPrivate::~WpsWizardPrivate() - { - OstTraceFunctionEntry1(WPSWIZARDPRIVATE_WPSWIZARDPRIVATE_ENTRY, this); - // have to delete the memory that was allocated in this object - mIapList.clear(); - delete mTranslator; - OstTraceFunctionExit1(WPSWIZARDPRIVATE_WPSWIZARDPRIVATE_EXIT, this); - } - -/*! - * Provides the caller with the functionality to enable/disable the 'Next' button - * - * \param bool to indicate whether to enable or disable the 'next button' - */ -void WpsWizardPrivate::enableNextButton(bool enable) - { - OstTraceFunctionEntry1(WPSWIZARDPRIVATE_ENABLENEXTBUTTON_ENTRY, this); - mWizardHelpper->enableNextButton(enable); - OstTraceFunctionExit1(WPSWIZARDPRIVATE_ENABLENEXTBUTTON_EXIT, this); - } - -/*! - * Provides the functionality to automatically move to the next page. - */ -void WpsWizardPrivate::nextPage() - { - OstTraceFunctionEntry1(WPSWIZARDPRIVATE_NEXTPAGE_ENTRY, this); - mWizardHelpper->nextPage(); - OstTraceFunctionExit1(WPSWIZARDPRIVATE_NEXTPAGE_EXIT, this); - } - -/*! - * Provides the functionality to store the recieved settings - * - * \param int indicates the index in the array of received settings to be stored - */ -void WpsWizardPrivate::storeSettings(int aIndex) - { - OstTraceFunctionEntry1(WPSWIZARDPRIVATE_STORESETTINGS_ENTRY, this); - mWpsAttr = mIapList[aIndex]; - - QString ssid = QString::fromUtf8((const char*) mWpsAttr.iSsid.Ptr(), - mWpsAttr.iSsid.Length()); - - mWizardHelpper->setConfigurations(WlanWizardHelpper::ConfSsid, ssid); - mWizardHelpper->setConfigurations(WlanWizardHelpper::ConfNetworkMode, - mWpsAttr.iOperatingMode); - mWizardHelpper->setConfigurations(WlanWizardHelpper::ConfSecurityMode, - mWpsAttr.iSecurityMode); - mWizardHelpper->setConfigurations(WlanWizardHelpper::ConfKeyWepDefault, - mWpsAttr.iWepDefaultKey); - QString str = QString::fromUtf8((const char*) mWpsAttr.iWepKey1.Ptr(), - mWpsAttr.iWepKey1.Length()); - mWizardHelpper->setConfigurations(WlanWizardHelpper::ConfKeyWep1, str); - str = QString::fromUtf8((const char*) mWpsAttr.iWepKey2.Ptr(), mWpsAttr.iWepKey2.Length()); - mWizardHelpper->setConfigurations(WlanWizardHelpper::ConfKeyWep2, str); - str = QString::fromUtf8((const char*) mWpsAttr.iWepKey3.Ptr(), mWpsAttr.iWepKey3.Length()); - mWizardHelpper->setConfigurations(WlanWizardHelpper::ConfKeyWep3, str); - str = QString::fromUtf8((const char*) mWpsAttr.iWepKey4.Ptr(), mWpsAttr.iWepKey4.Length()); - mWizardHelpper->setConfigurations(WlanWizardHelpper::ConfKeyWep4, str); - - OstTraceFunctionExit1(WPSWIZARDPRIVATE_STORESETTINGS_EXIT, this); - } - -/*! - * Provides the functionality to retrieve the ssid of the network to connect - * \return returns the SSID as a QString - */ -QString WpsWizardPrivate::getSsid() - { - OstTraceFunctionEntry1(WPSWIZARDPRIVATE_GETSSID_ENTRY, this); - QString ssid; - ssid = mWizardHelpper->configurations(WlanWizardHelpper::ConfSsid).toString(); - OstTraceFunctionExit1(WPSWIZARDPRIVATE_GETSSID_EXIT, this); - return ssid; - } - -/*! - * Provides functionality for the caller to store the array of recieved settings from AP - * \param QList& received settings - * - */ -void WpsWizardPrivate::storeSettingsArray(QList< - TWlanProtectedSetupCredentialAttribute>& aIapList) - { - OstTraceFunctionEntry1(WPSWIZARDPRIVATE_STORESETTINGSARRAY_ENTRY, this); - mIapList = aIapList; - OstTraceFunctionExit1(WPSWIZARDPRIVATE_STORESETTINGSARRAY_EXIT, this); - } - -/*! - * Returns the array of settings received from the AP - * - * \return Array containing the settings - */ -QList WpsWizardPrivate::getSettingsArray() - { - OstTraceFunctionEntry1(WPSWIZARDPRIVATE_GETSETTINGSARRAY_ENTRY, this); - OstTraceFunctionExit1(WPSWIZARDPRIVATE_GETSETTINGSARRAY_EXIT, this); - return mIapList; - } - - - -/*! - * Creates the required pages for WPS setup - */ -void WpsWizardPrivate::createPages() - { - OstTraceFunctionEntry1(WPSWIZARDPRIVATE_CREATEPAGES_ENTRY, this); - mWizardHelpper->addPage(WpsWizardPage::PageWpsWizardStep2, - new WpsPageStepTwo(this)); - mWizardHelpper->addPage(WpsWizardPage::PageWpsWizardStep3_Button, - new WpsPageStepThreeButton(this)); - mWizardHelpper->addPage(WpsWizardPage::PageWpsWizardStep3_Number, - new WpsPageStepThreeNumber(this)); - mWizardHelpper->addPage(WpsWizardPage::PageWpsWizardStep4, - new WpsPageStepFour(this)); - mWizardHelpper->addPage(WpsWizardPage::PageWpsWizardStep5, - new WpsPageStepFive(this)); - OstTraceFunctionExit1(WPSWIZARDPRIVATE_CREATEPAGES_EXIT, this); - } - -/*! - * Provides with the functionality to store the PIN generated - * - * \param int The generated PIN code to be used in succesive steps - * - */ -void WpsWizardPrivate::setPin(int random) - { - OstTraceFunctionEntry1(WPSWIZARDPRIVATE_SETPIN_ENTRY, this); - mRandomNumber = random; - OstTraceFunctionExit1(WPSWIZARDPRIVATE_SETPIN_EXIT, this); - } - -/*! - * Returns the PIN code stored in one of the WPS Pages - * - * \return PIN code to be used in the WPS operation. - */ -int WpsWizardPrivate::getPin() - { - OstTraceFunctionEntry1(WPSWIZARDPRIVATE_GETPIN_ENTRY, this); - OstTraceFunctionExit1(WPSWIZARDPRIVATE_GETPIN_EXIT, this); - return mRandomNumber; - - }