diff -r ab513c8439db -r e8f4211554fb wlanutilities/wlanentryplugin/src/cpwlanentryitemdata.cpp --- a/wlanutilities/wlanentryplugin/src/cpwlanentryitemdata.cpp Fri May 14 10:30:51 2010 +0300 +++ b/wlanutilities/wlanentryplugin/src/cpwlanentryitemdata.cpp Mon May 24 21:11:39 2010 +0300 @@ -2,7 +2,7 @@ * 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"" +* 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". * @@ -11,34 +11,34 @@ * * Contributors: * -* Description: -* +* Description: +* WLAN Entry plugin item data implementation. */ // System includes +#include +#include +#include + #ifdef WLANENTRYPLUGIN_SERVICETRACES #include #endif -#include - -#include -#include +#include #include #include // User includes +#include "wlanstatusinfo.h" +#include "cpwlanentryitemdata.h" + #include "OstTraceDefinitions.h" #ifdef OST_TRACE_COMPILER_IN_USE #include "cpwlanentryitemdataTraces.h" #endif -#include "wlanstatusinfo.h" - -#include "cpwlanentryitemdata.h" - /*! \class CpWlanEntryItemData \brief Implementation of WLAN Status Plugin entry item data. @@ -55,13 +55,15 @@ /*! Constructor. + + @param[in,out] itemDataHelper Control Panel item data helper object. */ CpWlanEntryItemData::CpWlanEntryItemData(CpItemDataHelper &itemDataHelper) : CpSettingFormEntryItemData(itemDataHelper, hbTrId("txt_occ_dblist_wireless_lan")), mWlanStatusInfo(new WlanStatusInfo(this)) { - OstTraceFunctionEntry1(CPWLANENTRYITEMDATA_CPWLANENTRYITEMDATA_ENTRY, this); + OstTraceFunctionEntry0(CPWLANENTRYITEMDATA_CPWLANENTRYITEMDATA_ENTRY); // Listen for WLAN status updates bool connectStatus = connect( @@ -74,7 +76,7 @@ // Update to show initial WLAN status. statusUpdate(); - OstTraceFunctionExit1(CPWLANENTRYITEMDATA_CPWLANENTRYITEMDATA_EXIT, this); + OstTraceFunctionExit0(CPWLANENTRYITEMDATA_CPWLANENTRYITEMDATA_EXIT); } /*! @@ -83,8 +85,8 @@ CpWlanEntryItemData::~CpWlanEntryItemData() { - OstTraceFunctionEntry1(DUP1_CPWLANENTRYITEMDATA_CPWLANENTRYITEMDATA_ENTRY, this); - OstTraceFunctionExit1(DUP1_CPWLANENTRYITEMDATA_CPWLANENTRYITEMDATA_EXIT, this); + OstTraceFunctionEntry0(DUP1_CPWLANENTRYITEMDATA_CPWLANENTRYITEMDATA_ENTRY); + OstTraceFunctionExit0(DUP1_CPWLANENTRYITEMDATA_CPWLANENTRYITEMDATA_EXIT); } /*! @@ -93,7 +95,7 @@ CpBaseSettingView *CpWlanEntryItemData::createSettingView() const { - OstTraceFunctionEntry1(CPWLANENTRYITEMDATA_CREATESETTINGVIEW_ENTRY, this); + OstTraceFunctionEntry0(CPWLANENTRYITEMDATA_CREATESETTINGVIEW_ENTRY); #ifdef WLANENTRYPLUGIN_SERVICETRACES qInstallMsgHandler(XQSERVICEMESSAGEHANDLER); @@ -101,15 +103,34 @@ #endif // Execute synchronous WLAN Sniffer list view - XQServiceRequest* snd = new XQServiceRequest("com.nokia.services.wlansniffer.list","listView()",true); - bool status = snd->send(); + // TODO: Start using defines in xqaiwdeclplat.h when available + XQApplicationManager aiwMgr; + XQAiwRequest *request = aiwMgr.create( + "wlansniffer", + "com.nokia.symbian.IWlanSniffer", + "listView()", + true); + + // The WLAN Sniffer service must always exist + Q_ASSERT(request); + + // The service is synchronous & embedded + request->setSynchronous(true); + + // Window title needs to be set to "Control Panel" + XQRequestInfo reqInfo; + // TODO: Start using the official define when available + reqInfo.setInfo("WindowTitle", hbTrId("txt_cp_title_control_panel")); + request->setInfo(reqInfo); + + bool status = request->send(); #ifdef WLANENTRYPLUGIN_SERVICETRACES XQSERVICE_DEBUG_PRINT("CpWlanEntryItemData::createSettingView listView() service request completed"); #endif Q_ASSERT(status); - delete snd; + delete request; - OstTraceFunctionExit1(CPWLANENTRYITEMDATA_CREATESETTINGVIEW_EXIT, this); + OstTraceFunctionExit0(CPWLANENTRYITEMDATA_CREATESETTINGVIEW_EXIT); return 0; } @@ -119,31 +140,37 @@ */ void CpWlanEntryItemData::statusUpdate() { - OstTraceFunctionEntry1(CPWLANENTRYITEMDATA_STATUSUPDATE_ENTRY, this); + OstTraceFunctionEntry0(CPWLANENTRYITEMDATA_STATUSUPDATE_ENTRY); // Build icon with (possible) badge - HbIcon wlanIcon("qtg_large_wlan"); + HbIcon wlanIcon; switch (mWlanStatusInfo->status()) { + case WlanStatusInfo::WlanStatusIdle: + wlanIcon = HbIcon("qtg_large_wlan"); + break; + case WlanStatusInfo::WlanStatusOff: -#ifdef WLANSTATUSICONBADGING // TODO: Remove flagging when icon badging is supported - wlanIcon.addBadge( - Qt::AlignTop | Qt::AlignRight, - HbIcon("pri_small_super_off")); -#endif + wlanIcon = HbIcon("qtg_large_wlan_off"); break; case WlanStatusInfo::WlanStatusConnected: -#ifdef WLANSTATUSICONBADGING // TODO: Remove flagging when icon badging is supported + wlanIcon = HbIcon("qtg_large_wlan"); wlanIcon.addBadge( - Qt::AlignTop | Qt::AlignRight, - HbIcon("qtg_small_online")); + Qt::AlignBottom | Qt::AlignRight, + HbIcon("qtg_small_connection")); + break; + +#ifndef QT_NO_DEBUG + default: + // Unsupported status type detected + Q_ASSERT(0); + break; #endif - break; } // Set the updated WLAN status this->setEntryItemIcon(wlanIcon); this->setDescription(mWlanStatusInfo->statusText()); - OstTraceFunctionExit1(CPWLANENTRYITEMDATA_STATUSUPDATE_EXIT, this); + OstTraceFunctionExit0(CPWLANENTRYITEMDATA_STATUSUPDATE_EXIT); }