securitysettings/cpwlansecurityuiplugins/cpwepui/src/cpwepui.cpp
changeset 39 fe6b6762fccd
parent 33 938269283a16
child 47 712b4ffd76bb
equal deleted inserted replaced
38:7a0216d033ac 39:fe6b6762fccd
     1 /*
     1 /*
     2  * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
     2  * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
     3  * All rights reserved.
     3  * All rights reserved.
     4  * This component and the accompanying materials are made available
     4  * This component and the accompanying materials are made available
     5  * under the terms of the License "Eclipse Public License v1.0"
     5  * under the terms of "Eclipse Public License v1.0"
     6  * which accompanies this distribution, and is available
     6  * which accompanies this distribution, and is available
     7  * at the URL "http://www.eclipse.org/legal/epl-v10.html".
     7  * at the URL "http://www.eclipse.org/legal/epl-v10.html".
     8  *
     8  *
     9  * Initial Contributors:
     9  * Initial Contributors:
    10  * Nokia Corporation - initial contribution.
    10  * Nokia Corporation - initial contribution.
    15  *    Control Panel QT UI for WEP configuration
    15  *    Control Panel QT UI for WEP configuration
    16  *
    16  *
    17  */
    17  */
    18 
    18 
    19 /*
    19 /*
    20  * %version: 22 %
    20  * %version: tr1cfwln#24 %
    21  */
    21  */
    22 
    22 
    23 //User Includes
    23 //User Includes
    24 #include "cpwepui.h"
    24 #include "cpwepui.h"
    25 #include "wepkeyvalidator.h"
    25 #include "wepkeyvalidator.h"
   246     QString textId;
   246     QString textId;
   247     
   247     
   248     switch(index)
   248     switch(index)
   249         {
   249         {
   250         case KFirstKey:
   250         case KFirstKey:
   251             textId  = hbTrId("txt_occ_subhead_wep_key_1");
   251             textId  = hbTrId("txt_occ_setlabel_wep_key_1");
   252             break;
   252             break;
   253             
       
   254             
   253             
   255         case KSecondKey:
   254         case KSecondKey:
   256             textId  = hbTrId("txt_occ_subhead_wep_key_2");
   255             textId  = hbTrId("txt_occ_setlabel_wep_key_2");
   257             break;
   256             break;
   258             
   257             
   259         case KThirdKey:
   258         case KThirdKey:
   260             textId  = hbTrId("txt_occ_subhead_wep_key_3");
   259             textId  = hbTrId("txt_occ_setlabel_wep_key_3");
   261             break;
   260             break;
   262             
   261             
   263         case KFourthKey:
   262         case KFourthKey:
   264             textId  = hbTrId("txt_occ_subhead_wep_key_4");
   263             textId  = hbTrId("txt_occ_setlabel_wep_key_4");
   265             break;
   264             break;
   266         }
   265         }
   267         
   266         
   268    
       
   269     mWepKeyText[index] = new CpSettingFormItemData(
   267     mWepKeyText[index] = new CpSettingFormItemData(
   270             HbDataFormModelItem::TextItem,
   268             HbDataFormModelItem::TextItem,
   271             textId, mUi);
   269             textId, mUi);
   272 
   270 
   273     if (mKeyData[index].length() != 0) {
   271     if (mKeyData[index].length() != 0) {
   408 void CpWepUi::wepKeyTextChanged(int index)
   406 void CpWepUi::wepKeyTextChanged(int index)
   409 {
   407 {
   410     OstTraceFunctionEntry1(CPWEPUI_WEPKEYTEXTCHANGED_ENTRY,this);
   408     OstTraceFunctionEntry1(CPWEPUI_WEPKEYTEXTCHANGED_ENTRY,this);
   411 
   409 
   412     QVariant value = mWepKeyText[index]->contentWidgetData("text");
   410     QVariant value = mWepKeyText[index]->contentWidgetData("text");
   413 
   411     QString key = value.toString();
   414     WepKeyValidator::KeyStatus keystatus = WepKeyValidator::validateWepKey(
   412 
   415             value.toString());
   413     WepKeyValidator::KeyStatus keystatus = WepKeyValidator::validateWepKey(key);
   416 
   414 
   417     if (keystatus == WepKeyValidator::KeyStatusOk) {
   415     // allow storing an empty key to enable clearing WEP keys
   418         QString key = value.toString();
   416     if (keystatus == WepKeyValidator::KeyStatusOk || key.length() == 0) {
   419 
   417 
   420         //If key is valid set the format of the key
   418         //If key is valid set the format of the key
   421         setKeyFormat(key, index);
   419         setKeyFormat(key, index);
   422 
   420 
   423         //Get the right field to store
   421         //Get the right field to store