securitysettings/cpwlansecurityuiplugins/cpwepui/src/cpwepui.cpp
changeset 26 9abfd4f00d37
parent 22 093cf0757204
child 34 ad1f037f1ac2
equal deleted inserted replaced
25:e03a3db4489e 26:9abfd4f00d37
    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: 16 %
    20  * %version: 22 %
    21  */
    21  */
    22 
    22 
    23 //User Includes
    23 //User Includes
    24 #include "cpwepui.h"
    24 #include "cpwepui.h"
       
    25 #include "wepkeyvalidator.h"
       
    26 
    25 
    27 
    26 // System includes
    28 // System includes
    27 #include <QStringList>
    29 #include <QStringList>
    28 #include <cpsettingformentryitemdata.h>
       
    29 #include <cpitemdatahelper.h>
    30 #include <cpitemdatahelper.h>
    30 #include <HbDataForm> 
       
    31 #include <HbDeviceNotificationDialog> 
       
    32 #include <QLocale>
       
    33 #include <QCoreApplication>
       
    34 #include <cmconnectionmethod_shim.h>
    31 #include <cmconnectionmethod_shim.h>
    35 #include <cmpluginwlandef.h>
       
    36 #include <cmmanagerdefines_shim.h>
    32 #include <cmmanagerdefines_shim.h>
    37 
    33 #include <HbLineEdit>
       
    34 #include <HbTranslator>
       
    35 #include <HbEditorInterface>
       
    36 
       
    37 //Trace Definition
    38 #include "OstTraceDefinitions.h"
    38 #include "OstTraceDefinitions.h"
    39 #ifdef OST_TRACE_COMPILER_IN_USE
    39 #ifdef OST_TRACE_COMPILER_IN_USE
    40 #include "cpwepuiTraces.h"
    40 #include "cpwepuiTraces.h"
    41 #endif
    41 #endif
    42 
    42 
    43 // Constants
    43 // Constants
    44 //The order in which WEP only mode appears in the list of available 
    44 //The order in which WEP only mode appears in the list of available 
    45 //security mode
    45 //security mode
    46 static const int UI_ORDER_WEP = 10;
    46 static const int UI_ORDER_WEP = 10;
    47 
    47 
       
    48 //! Index of first WEP key
       
    49 static const int KFirstKey = 0;
       
    50 
       
    51 //! Index of second WEP key
       
    52 static const int KSecondKey = 1;
       
    53 
       
    54 //! Index of third WEP key
       
    55 static const int KThirdKey = 2;
       
    56 
       
    57 //! Index of fourth WEP key
       
    58 static const int KFourthKey = 3;
       
    59 
       
    60 //!Maximum allowed length for WEP keys, in hex mode
       
    61 static const int KMaxKeyLength  = 26;
       
    62 
       
    63 
       
    64 
    48 /*!
    65 /*!
    49  \class CpWepUi
    66  \class CpWepUi
    50  \brief CpWepUi implements the WEP Security Settings Control Panel Plugin
    67  \brief CpWepUi implements the WEP Security Settings Control Panel Plugin
    51  which will allow viewing/editing of WEP Security Settings.
    68  which will allow viewing/editing of WEP Security Settings.
    52  */
    69  */
    53 //Contructs WEP object
    70 //Contructs WEP object
    54 CpWepUi::CpWepUi() :
    71 CpWepUi::CpWepUi() :
    55     mUi(NULL), mNewKeySelected(0), mTranslator(NULL), mCmCM(NULL), mCmId(0)
    72     mUi(NULL),
    56 {
    73     mNewKeySelected(0), 
    57     mTranslator = new QTranslator(this);
    74     mTranslator(new HbTranslator("cpwlansecsettingsplugin")),
    58     mTranslator->load(":/loc/wlan_en_GB.qm");
    75     mCmCM(NULL), 
    59     qApp->installTranslator(mTranslator);
    76     mCmId(0)    
    60 
    77 {
    61     /* Install localization
    78     //Initialize array members
    62      mTranslator = QSharedPointer<HbTranslator> (
    79     for(int index=0;index<KMaxNumberofKeys;index++)
    63      new HbTranslator("wlan_en_GB"));*/
    80     {
       
    81         mWepKey[index] = NULL;
       
    82         mWepKeyText[index] = NULL;   
       
    83         mkeyFormat[index] = EFormatHex;
       
    84     }
       
    85       
    64 }
    86 }
    65 
    87 
    66 //Deletes all objects WEP owns
    88 //Deletes all objects WEP owns
    67 CpWepUi::~CpWepUi()
    89 CpWepUi::~CpWepUi()
    68 {
    90 {
    69     OstTraceFunctionEntry1(CPWEPUI_CPWEPUI_ENTRY,this);
    91     OstTraceFunctionEntry1(CPWEPUI_CPWEPUI_ENTRY,this);
    70     //Elements like mUi and components that belong to it
    92     //Elements like mUi and components that belong to it
    71     //, are taken care by the parent
    93     //, are taken care by the parent
       
    94     delete mTranslator;
    72     OstTraceFunctionExit1(CPWEPUI_CPWEPUI_EXIT,this);
    95     OstTraceFunctionExit1(CPWEPUI_CPWEPUI_EXIT,this);
    73 }
    96 }
    74 
    97 
    75 // ======== MEMBER FUNCTIONS ========
    98 // ======== MEMBER FUNCTIONS ========
    76 
    99 
    80 
   103 
    81  \return Security mode identifier
   104  \return Security mode identifier
    82  */
   105  */
    83 CMManagerShim::WlanSecMode CpWepUi::securityMode() const
   106 CMManagerShim::WlanSecMode CpWepUi::securityMode() const
    84 {
   107 {
    85     OstTraceFunctionEntry1(CPWEPUI_MODE_ENTRY,this);
   108     OstTraceFunctionEntry1(CPWEPUI_SECURITYMODE_ENTRY,this);
    86     OstTraceFunctionExit1(CPWEPUI_MODE_EXIT,this);
   109     OstTraceFunctionExit1(CPWEPUI_SECURITYMODE_EXIT,this);
    87     //return security mode
   110     //return security mode
    88     return CMManagerShim::WlanSecModeWep;
   111     return CMManagerShim::WlanSecModeWep;
    89 }
   112 }
    90 
   113 
    91 /*!
   114 /*!
    95  
   118  
    96  \return Localization text ID
   119  \return Localization text ID
    97  */
   120  */
    98 QString CpWepUi::securityModeTextId() const
   121 QString CpWepUi::securityModeTextId() const
    99 {
   122 {
   100     OstTraceFunctionEntry1(CPWEPUI_LOCALIZATION_ID_ENTRY,this);
   123     OstTraceFunctionEntry1( CPWEPUI_SECURITYMODETEXTID_ENTRY, this );
   101     OstTraceFunctionExit1(CPWEPUI_LOCALIZATION_ID_EXIT,this);
   124     OstTraceFunctionExit1( CPWEPUI_SECURITYMODETEXTID_EXIT, this );
   102     return "txt_occ_setlabel_wlan_security_mode_val_wep";
   125     return "txt_occ_setlabel_wlan_security_mode_val_wep";
   103 }
   126 }
   104 
   127 
   105 /*! 
   128 /*! 
   106  Sets the database reference (WLAN Service Table ID).
   129  Sets the database reference Iap id.
   107 
   130 
   108  \param id Database reference
   131  \param id Database reference
   109  */
   132  */
   110 void CpWepUi::setReference(CmConnectionMethodShim *cmCm, uint id)
   133 void CpWepUi::setReference(CmConnectionMethodShim *cmCm, uint id)
   111 {
   134 {
   112     OstTraceFunctionEntry1(CPWEPUI_SETREFERENCE_ENTRY,this);
   135     OstTraceFunctionEntry1(CPWEPUI_SETREFERENCE_ENTRY,this);
   113 
       
   114     // Assuming that id is the connection method Id/IAP Id.
       
   115     //mCmId - Not used currently
       
   116     mCmId = id;
   136     mCmId = id;
   117 
   137 
   118     //mCmCM is not deleted assuming CmManager owns it.
   138     //mCmCM is not deleted assuming CmManager owns it.
   119     mCmCM = cmCm;
   139     mCmCM = cmCm;
   120     OstTraceFunctionExit1(CPWEPUI_SETREFERENCE_EXIT,this);
   140     OstTraceFunctionExit1(CPWEPUI_SETREFERENCE_EXIT,this);
   134 }
   154 }
   135 
   155 
   136 /*!
   156 /*!
   137  * Returns the fully constructed Ui Group , for WEP security plugin
   157  * Returns the fully constructed Ui Group , for WEP security plugin
   138  * 
   158  * 
   139  * \param \param dataHelper to add Connections
   159  * \param dataHelper to add Connections
   140  * 
   160  * 
   141  * \return The WEP UI
   161  * \return The WEP UI
   142  */
   162  */
   143 CpSettingFormItemData* CpWepUi::uiInstance(CpItemDataHelper &dataHelpper)
   163 CpSettingFormItemData* CpWepUi::uiInstance(CpItemDataHelper &dataHelpper)
   144 {
   164 {
   148     //Read values From CommsDatbase
   168     //Read values From CommsDatbase
   149     QT_TRYCATCH_ERROR(err, loadFieldsFromDataBase());
   169     QT_TRYCATCH_ERROR(err, loadFieldsFromDataBase());
   150     if (err != KErrNone) {
   170     if (err != KErrNone) {
   151         OstTrace1( TRACE_ERROR, CPWEPUI_UIINSTANCE, "LoadFromDataBase returned %d", err );
   171         OstTrace1( TRACE_ERROR, CPWEPUI_UIINSTANCE, "LoadFromDataBase returned %d", err );
   152     }
   172     }
       
   173     
       
   174     //Store the address of the Data Helper
       
   175     mItemDataHelper = &dataHelpper;
   153 
   176 
   154     mUi = new CpSettingFormItemData(HbDataFormModelItem::GroupItem, hbTrId(
   177     mUi = new CpSettingFormItemData(HbDataFormModelItem::GroupItem, hbTrId(
   155             "txt_occ_subhead_security_settings"));
   178             "txt_occ_subhead_security_settings"));
   156 
   179 
   157     CpSettingFormItemData *wepKeyInUse = new CpSettingFormItemData(
   180     CpSettingFormItemData *wepKeyInUse = new CpSettingFormItemData(
   167     wepKeyInUse->setContentWidgetData("currentIndex", mNewKeySelected);
   190     wepKeyInUse->setContentWidgetData("currentIndex", mNewKeySelected);
   168     dataHelpper.addConnection(wepKeyInUse, SIGNAL(currentIndexChanged(int)),
   191     dataHelpper.addConnection(wepKeyInUse, SIGNAL(currentIndexChanged(int)),
   169             this, SLOT(wepKeyInUseChanged(int)));
   192             this, SLOT(wepKeyInUseChanged(int)));
   170     mUi->appendChild(wepKeyInUse);
   193     mUi->appendChild(wepKeyInUse);
   171 
   194 
   172     createWEPKeyOneGroup(dataHelpper);
   195     //Create Ui for all 4 WEP keys
   173 
   196     createWEPKeyGroup(KFirstKey);
   174     createWEPKeyTwoGroup(dataHelpper);
   197 
   175 
   198     createWEPKeyGroup(KSecondKey);
   176     createWEPKeyThreeGroup(dataHelpper);
   199 
   177 
   200     createWEPKeyGroup(KThirdKey);
   178     createWEPKeyFourGroup(dataHelpper);
   201 
       
   202     createWEPKeyGroup(KFourthKey);
       
   203     
       
   204     //Add Connections(signals)
       
   205     addConnections(dataHelpper);
   179 
   206 
   180     OstTraceFunctionExit1(CPWEPUI_UIINSTANCE_EXIT,this);
   207     OstTraceFunctionExit1(CPWEPUI_UIINSTANCE_EXIT,this);
   181     return mUi;
   208     return mUi;
   182 }
   209 }
   183 
   210 
   184 /*!
   211 
   185  * Create Ui element with text edit for WEP KEY One
   212 /*!
   186  * 
   213    Validates current security settings. This function is called whenever
   187  * \param dataHelper to add Connections
   214    user tries to exit from the settings view. If the plugin determines
   188  */
   215    that some settings need editing before considered valid, it shall
   189 void CpWepUi::createWEPKeyOneGroup(CpItemDataHelper &dataHelpper)
   216    return false. A dialog will be shown to the user indicating that
       
   217    settings are still incomplete and asking if he/she wishes to exit
       
   218    anyway.
       
   219 
       
   220    \return True if security settings for WEP are valid, false if not.
       
   221 */
       
   222 bool CpWepUi::validateSettings()
       
   223 {
       
   224     bool ret(false);
       
   225     //Check the latest string entered for the WEP key in the text box
       
   226     QVariant keyValue = mWepKeyText[mNewKeySelected]->contentWidgetData("text");
       
   227     QString keyString = keyValue.toString();
       
   228     
       
   229     WepKeyValidator::KeyStatus keystatus = WepKeyValidator::validateWepKey(keyString);
       
   230     
       
   231     //Check if key is  valid and not of zero length 
       
   232     if(keystatus==WepKeyValidator::KeyStatusOk) {
       
   233         ret = true;
       
   234     }
       
   235     return ret;
       
   236 }
       
   237 
       
   238 /*!
       
   239  * Create Ui element with text edit for WEP KEYS
       
   240  * 
       
   241  * \param index of the WEP key
       
   242  * */
       
   243 void CpWepUi::createWEPKeyGroup(int index)
   190     {
   244     {
   191     OstTraceFunctionEntry1(CPWEPUI_CREATEWEPKEYONEGROUP_ENTRY,this);
   245     OstTraceFunctionEntry1(CPWEPUI_CREATEWEPKEYGROUP_ENTRY,this);
   192     mWepKeyText[KFirstKey] = new CpSettingFormItemData(
   246     QString textId;
       
   247     
       
   248     switch(index)
       
   249         {
       
   250         case KFirstKey:
       
   251             textId  = hbTrId("txt_occ_subhead_wep_key_1");
       
   252             break;
       
   253             
       
   254             
       
   255         case KSecondKey:
       
   256             textId  = hbTrId("txt_occ_subhead_wep_key_2");
       
   257             break;
       
   258             
       
   259         case KThirdKey:
       
   260             textId  = hbTrId("txt_occ_subhead_wep_key_3");
       
   261             break;
       
   262             
       
   263         case KFourthKey:
       
   264             textId  = hbTrId("txt_occ_subhead_wep_key_4");
       
   265             break;
       
   266         }
       
   267         
       
   268    
       
   269     mWepKeyText[index] = new CpSettingFormItemData(
   193             HbDataFormModelItem::TextItem,
   270             HbDataFormModelItem::TextItem,
   194             hbTrId("txt_occ_subhead_wep_key_1"), mUi);
   271             textId, mUi);
   195 
   272 
   196     if (mKeyData[KFirstKey].length() != 0) {
   273     if (mKeyData[index].length() != 0) {
   197         mWepKeyText[KFirstKey]->setContentWidgetData("text",
   274         mWepKeyText[index]->setContentWidgetData("text",
   198                 mKeyData[KFirstKey]);
   275                 mKeyData[index]);
   199     }
   276     }
   200     mWepKeyText[KFirstKey]->setContentWidgetData("echoMode", 2);
   277     mWepKeyText[index]->setContentWidgetData("echoMode",HbLineEdit::PasswordEchoOnEdit);
   201     mWepKeyText[KFirstKey]->setContentWidgetData("smileysEnabled", "false");
   278     mWepKeyText[index]->setContentWidgetData("smileysEnabled", "false");
   202 
   279 
       
   280     
       
   281     mUi->appendChild(mWepKeyText[index]);
       
   282     OstTraceFunctionExit1(CPWEPUI_CREATEWEPKEYGROUP_EXIT,this);
       
   283     }
       
   284 
       
   285 
       
   286 /*!
       
   287  * Add signals to all the text Edit of WEP key groups.
       
   288  *  
       
   289  *  \param dataHelper ; to add Connections
       
   290  */
       
   291 void CpWepUi::addConnections(CpItemDataHelper &dataHelpper)
       
   292     {
       
   293     OstTraceFunctionEntry1( CPWEPUI_ADDCONNECTIONS_ENTRY, this );
       
   294     
   203     dataHelpper.addConnection(mWepKeyText[KFirstKey],
   295     dataHelpper.addConnection(mWepKeyText[KFirstKey],
   204             SIGNAL( editingFinished ()), this, SLOT(wepKeyOneChanged() ));
   296                 SIGNAL( editingFinished ()), this, SLOT(wepKeyOneChanged() ));
   205 
   297     
   206     mUi->appendChild(mWepKeyText[KFirstKey]);
       
   207     OstTraceFunctionExit1(CPWEPUI_CREATEWEPKEYONEGROUP_EXIT,this);
       
   208     }
       
   209 
       
   210 /*!
       
   211  * Create Ui element with text edit for WEP KEY Two
       
   212  * \param dataHelper to add Connections
       
   213  */
       
   214 void CpWepUi::createWEPKeyTwoGroup(CpItemDataHelper &dataHelpper)
       
   215 {
       
   216     OstTraceFunctionEntry1(CPWEPUI_CREATEWEPKEYTWOGROUP_ENTRY,this);
       
   217     mWepKeyText[KSecondKey] = new CpSettingFormItemData(
       
   218             HbDataFormModelItem::TextItem,
       
   219             hbTrId("txt_occ_subhead_wep_key_2"), mUi);
       
   220 
       
   221     if (mKeyData[KSecondKey].length() != 0) {
       
   222         mWepKeyText[KSecondKey]->setContentWidgetData("text",
       
   223                 mKeyData[KSecondKey]);
       
   224     }
       
   225     mWepKeyText[KSecondKey]->setContentWidgetData("echoMode", 2);
       
   226     mWepKeyText[KSecondKey]->setContentWidgetData("smileysEnabled", "false");
       
   227     dataHelpper.addConnection(mWepKeyText[KSecondKey],
   298     dataHelpper.addConnection(mWepKeyText[KSecondKey],
   228             SIGNAL( editingFinished ()), this, SLOT(wepKeyTwoChanged() ));
   299                SIGNAL( editingFinished ()), this, SLOT(wepKeyTwoChanged() ));
   229 
   300     
   230     mUi->appendChild(mWepKeyText[KSecondKey]);
       
   231     OstTraceFunctionExit1(CPWEPUI_CREATEWEPKEYTWOGROUP_EXIT,this);
       
   232 }
       
   233 
       
   234 /*!
       
   235  * Create Ui element with text edit for WEP KEY Three
       
   236  * \param dataHelper to add Connections
       
   237  */
       
   238 void CpWepUi::createWEPKeyThreeGroup(CpItemDataHelper &dataHelpper)
       
   239 {
       
   240     OstTraceFunctionEntry1(CPWEPUI_CREATEWEPKEYTHREEGROUP_ENTRY,this);
       
   241     mWepKeyText[KThirdKey] = new CpSettingFormItemData(
       
   242             HbDataFormModelItem::TextItem,
       
   243             hbTrId("txt_occ_subhead_wep_key_3"), mUi);
       
   244 
       
   245     if (mKeyData[KThirdKey].length() != 0) {
       
   246         mWepKeyText[KThirdKey]->setContentWidgetData("text",
       
   247                 mKeyData[KThirdKey]);
       
   248     }
       
   249     mWepKeyText[KThirdKey]->setContentWidgetData("echoMode", 2);
       
   250     mWepKeyText[KThirdKey]->setContentWidgetData("smileysEnabled", "false");
       
   251     dataHelpper.addConnection(mWepKeyText[KThirdKey],
   301     dataHelpper.addConnection(mWepKeyText[KThirdKey],
   252             SIGNAL( editingFinished ()), this, SLOT(wepKeyThreeChanged() ));
   302                SIGNAL( editingFinished ()), this, SLOT(wepKeyThreeChanged() ));
   253 
   303     
   254     mUi->appendChild(mWepKeyText[KThirdKey]);
       
   255     OstTraceFunctionExit1(CPWEPUI_CREATEWEPKEYTHREEGROUP_EXIT,this);
       
   256 }
       
   257 
       
   258 /*!
       
   259  * Create Ui element with text edit for WEP KEY  Four
       
   260  * \param dataHelper to add Connections
       
   261  */
       
   262 void CpWepUi::createWEPKeyFourGroup(CpItemDataHelper &dataHelpper)
       
   263 {
       
   264     OstTraceFunctionEntry1(CPWEPUI_CREATEWEPKEYFOURGROUP_ENTRY,this);
       
   265     mWepKeyText[KFourthKey] = new CpSettingFormItemData(
       
   266             HbDataFormModelItem::TextItem,
       
   267             hbTrId("txt_occ_subhead_wep_key_4"), mUi);
       
   268 
       
   269     if (mKeyData[KFourthKey].length() != 0) {
       
   270         mWepKeyText[KFourthKey]->setContentWidgetData("text",
       
   271                 mKeyData[KFourthKey]);
       
   272     }
       
   273     mWepKeyText[KFourthKey]->setContentWidgetData("echoMode", 2);
       
   274     mWepKeyText[KFourthKey]->setContentWidgetData("smileysEnabled", "false");
       
   275     dataHelpper.addConnection(mWepKeyText[KFourthKey],
   304     dataHelpper.addConnection(mWepKeyText[KFourthKey],
   276             SIGNAL( editingFinished ()), this, SLOT(wepKeyFourChanged() ));
   305                 SIGNAL( editingFinished ()), this, SLOT(wepKeyFourChanged() ));
   277 
   306     
   278     mUi->appendChild(mWepKeyText[KFourthKey]);
   307     dataHelpper.connectToForm(SIGNAL(itemShown (const QModelIndex &) ), 
   279     OstTraceFunctionExit1(CPWEPUI_CREATEWEPKEYFOURGROUP_EXIT,this);
   308             this, SLOT(setEditorPreferences(const QModelIndex &)));
   280 }
   309  
       
   310     OstTraceFunctionExit1( CPWEPUI_ADDCONNECTIONS_EXIT, this );
       
   311     }
       
   312 
   281 
   313 
   282 /*!
   314 /*!
   283  * Slot to handle , if a different wep key (index) 
   315  * Slot to handle , if a different wep key (index) 
   284  * is made active
   316  * is made active
   285  * \param wepKeyInUse index of the chosen wep key
   317  * \param wepKeyInUse index of the chosen wep key
   293     QT_TRYCATCH_ERROR(err, mCmCM->setIntAttribute(CMManagerShim::WlanWepKeyIndex, wepKeyInUse));
   325     QT_TRYCATCH_ERROR(err, mCmCM->setIntAttribute(CMManagerShim::WlanWepKeyIndex, wepKeyInUse));
   294     if (err != KErrNone) {
   326     if (err != KErrNone) {
   295         OstTrace1( TRACE_ERROR, CPWEPUI_WEPKEYINUSECHANGED, "Error wepKeyInUse returned %d", err );
   327         OstTrace1( TRACE_ERROR, CPWEPUI_WEPKEYINUSECHANGED, "Error wepKeyInUse returned %d", err );
   296     }
   328     }
   297     tryUpdate();
   329     tryUpdate();
       
   330     
       
   331     //Store the wep key in use
       
   332     mNewKeySelected = wepKeyInUse;
   298     OstTraceFunctionExit1(CPWEPUI_WEPKEYINUSECHANGED_EXIT,this);
   333     OstTraceFunctionExit1(CPWEPUI_WEPKEYINUSECHANGED_EXIT,this);
   299 }
   334 }
   300 
   335 
   301 /*!
   336 /*!
   302  * Slot to handle ,when the  
   337  * Slot to handle ,when the  
   398          * Commit All 4 WEP keys , anyways
   433          * Commit All 4 WEP keys , anyways
   399          */
   434          */
   400         commitWEPkeys(index);
   435         commitWEPkeys(index);
   401     }
   436     }
   402     else {
   437     else {
       
   438         OstTrace0( TRACE_ERROR, CPWEPUI_WEPKEYTEXTCHANGED_ERROR, "CpWepUi::wepKeyTextChanged Invalid WEP Key Input" );        
   403         showMessageBox(HbMessageBox::MessageTypeWarning, hbTrId(
   439         showMessageBox(HbMessageBox::MessageTypeWarning, hbTrId(
   404                 "txt_occ_info_invalid_input"));
   440                 "txt_occ_info_invalid_input"));
   405     }
   441     }
   406     OstTraceFunctionExit1(CPWEPUI_WEPKEYTEXTCHANGED_EXIT,this);
   442     OstTraceFunctionExit1(CPWEPUI_WEPKEYTEXTCHANGED_EXIT,this);
   407 }
   443 }
       
   444 
       
   445 /*!
       
   446  * Slot that configures the editor settings for all WEP key fields.
       
   447  * This slot is invoked whenever a new item(s) are shown in the current view 
       
   448  * 
       
   449  * \param modelIndex Index of the current item in the  model
       
   450  */
       
   451 void CpWepUi::setEditorPreferences(const QModelIndex &modelIndex)
       
   452 {
       
   453     
       
   454     HbDataFormModelItem *item = mItemDataHelper->modelItemFromModelIndex(modelIndex);
       
   455 
       
   456     HbSmileyTheme smiley;
       
   457     /* Configure settings only for text fields*/
       
   458     if(item->type() == HbDataFormModelItem::TextItem) {
       
   459         HbLineEdit *edit = qobject_cast<HbLineEdit*>(mItemDataHelper->widgetFromModelIndex(modelIndex));           
       
   460         HbEditorInterface editInterface(edit);    
       
   461         editInterface.setInputConstraints(HbEditorConstraintLatinAlphabetOnly);
       
   462         edit->setInputMethodHints(Qt::ImhNoPredictiveText);    
       
   463         edit->setMaxLength(KMaxKeyLength);
       
   464         }
       
   465 }
       
   466 
   408 
   467 
   409 /*!
   468 /*!
   410  * Store the WEP key in Comms
   469  * Store the WEP key in Comms
   411  * \enumValue the right field represented by the enum value
   470  * \enumValue the right field represented by the enum value
   412  * \key the WEP key String to store
   471  * \key the WEP key String to store
   506 
   565 
   507     //All data fetched in Hex Format
   566     //All data fetched in Hex Format
   508     mKeyData.insert(KFirstKey, mCmCM->getString8Attribute(
   567     mKeyData.insert(KFirstKey, mCmCM->getString8Attribute(
   509             CMManagerShim::WlanWepKey1InHex));
   568             CMManagerShim::WlanWepKey1InHex));
   510 
   569 
   511     mKeyData.insert(KSecondKey, mCmCM->getString8Attribute(
   570     mKeyData.insert(KSecondKey,mCmCM->getString8Attribute(
   512             CMManagerShim::WlanWepKey2InHex));
   571             CMManagerShim::WlanWepKey2InHex));
   513 
   572 
   514     mKeyData.insert(KThirdKey, mCmCM->getString8Attribute(
   573     mKeyData.insert(KThirdKey, mCmCM->getString8Attribute(
   515             CMManagerShim::WlanWepKey3InHex));
   574             CMManagerShim::WlanWepKey3InHex));
   516 
   575