wlanutilities/eapwizard/src/eapwizardpageoutertype.cpp
changeset 43 72ebcbb64834
parent 39 7b3e49e4608a
equal deleted inserted replaced
39:7b3e49e4608a 43:72ebcbb64834
    30 
    30 
    31 // User includes
    31 // User includes
    32 #include "wlanwizardhelper.h"
    32 #include "wlanwizardhelper.h"
    33 #include "eapwizard_p.h"
    33 #include "eapwizard_p.h"
    34 #include "eapwizardpageoutertype.h"
    34 #include "eapwizardpageoutertype.h"
       
    35 #include "OstTraceDefinitions.h"
       
    36 #ifdef OST_TRACE_COMPILER_IN_USE
       
    37 #include "eapwizardpageoutertypeTraces.h"
       
    38 #endif
       
    39 
    35 
    40 
    36 /*!
    41 /*!
    37    \class EapWizardPageOuterType
    42    \class EapWizardPageOuterType
    38    \brief Implements EAP wizard page: Outer EAP type selection
    43    \brief Implements EAP wizard page: Outer EAP type selection
    39  */
    44  */
    58     mRadio(NULL),
    63     mRadio(NULL),
    59     mTitle(NULL),
    64     mTitle(NULL),
    60     mDocumentLoader(NULL),    
    65     mDocumentLoader(NULL),    
    61     mValid(false)
    66     mValid(false)
    62 {
    67 {
       
    68     OstTraceFunctionEntry0( EAPWIZARDPAGEOUTERTYPE_EAPWIZARDPAGEOUTERTYPE_ENTRY );
       
    69     OstTraceFunctionExit0( EAPWIZARDPAGEOUTERTYPE_EAPWIZARDPAGEOUTERTYPE_EXIT );
    63 }
    70 }
    64 
    71 
    65 /*!
    72 /*!
    66    Destructor.
    73    Destructor.
    67  */
    74  */
    68 EapWizardPageOuterType::~EapWizardPageOuterType()
    75 EapWizardPageOuterType::~EapWizardPageOuterType()
    69 {
    76 {
       
    77     OstTraceFunctionEntry0( DUP1_EAPWIZARDPAGEOUTERTYPE_EAPWIZARDPAGEOUTERTYPE_ENTRY );
       
    78     OstTraceFunctionExit0( DUP1_EAPWIZARDPAGEOUTERTYPE_EAPWIZARDPAGEOUTERTYPE_EXIT );
    70 }
    79 }
    71 
    80 
    72 /*!
    81 /*!
    73    See WlanWizardPage. 
    82    See WlanWizardPage. 
    74  */
    83  */
    75 HbWidget* EapWizardPageOuterType::initializePage()
    84 HbWidget* EapWizardPageOuterType::initializePage()
    76 {
    85 {
       
    86     OstTraceFunctionEntry0( EAPWIZARDPAGEOUTERTYPE_INITIALIZEPAGE_ENTRY );
    77     if (!mWidget) {
    87     if (!mWidget) {
    78         bool ok;
    88         bool ok;
    79         mDocumentLoader.reset(
    89         mDocumentLoader.reset(
    80             new HbDocumentLoader(mWizard->wizardHelper()->mainWindow()));
    90             new HbDocumentLoader(mWizard->wizardHelper()->mainWindow()));
    81         mDocumentLoader->load(":/docml/occ_eap_wizard_01_02_04.docml", &ok);
    91         mDocumentLoader->load(":/docml/occ_eap_wizard_01_02_04.docml", &ok);
   114             SIGNAL(orientationChanged(Qt::Orientation)), 
   124             SIGNAL(orientationChanged(Qt::Orientation)), 
   115             this, 
   125             this, 
   116             SLOT(loadDocmlSection(Qt::Orientation)));
   126             SLOT(loadDocmlSection(Qt::Orientation)));
   117         Q_ASSERT(ok);
   127         Q_ASSERT(ok);
   118     }
   128     }
       
   129     OstTraceFunctionExit0( EAPWIZARDPAGEOUTERTYPE_INITIALIZEPAGE_EXIT );
   119     return mWidget;
   130     return mWidget;
   120 }
   131 }
   121 
   132 
   122 /*!
   133 /*!
   123    Loads the required orientation of docml.
   134    Loads the required orientation of docml.
   124    
   135    
   125    @param [in] orientation Orientation to be loaded. 
   136    @param [in] orientation Orientation to be loaded. 
   126  */
   137  */
   127 void EapWizardPageOuterType::loadDocmlSection(Qt::Orientation orientation)
   138 void EapWizardPageOuterType::loadDocmlSection(Qt::Orientation orientation)
   128 {
   139 {
       
   140     OstTraceFunctionEntry0( EAPWIZARDPAGEOUTERTYPE_LOADDOCMLSECTION_ENTRY );
   129     EapWizardPage::loadDocmlSection(
   141     EapWizardPage::loadDocmlSection(
   130         mDocumentLoader.data(),
   142         mDocumentLoader.data(),
   131         orientation,
   143         orientation,
   132         ":/docml/occ_eap_wizard_01_02_04.docml",
   144         ":/docml/occ_eap_wizard_01_02_04.docml",
   133         "portrait_section",
   145         "portrait_section",
   134         "landscape_section");
   146         "landscape_section");
       
   147     OstTraceFunctionExit0( EAPWIZARDPAGEOUTERTYPE_LOADDOCMLSECTION_EXIT );
   135 }
   148 }
   136 
   149 
   137 /*!
   150 /*!
   138    See WlanWizardPage.
   151    See WlanWizardPage.
   139    
   152    
   144    - EapWizardPage::PageNewPacStorePassword: For EAP-FAST (no pac store)
   157    - EapWizardPage::PageNewPacStorePassword: For EAP-FAST (no pac store)
   145    - EapWizardPage::PagePromptPacStorePassword: For EAP-FAST (confirm pac store)
   158    - EapWizardPage::PagePromptPacStorePassword: For EAP-FAST (confirm pac store)
   146  */
   159  */
   147 int EapWizardPageOuterType::nextId() const
   160 int EapWizardPageOuterType::nextId() const
   148 {
   161 {
       
   162     OstTraceFunctionEntry0( EAPWIZARDPAGEOUTERTYPE_NEXTID_ENTRY );
   149     int id = WlanWizardPage::PageNone;
   163     int id = WlanWizardPage::PageNone;
   150     EapQtPluginHandle::Plugin handle = 
   164     EapQtPluginHandle::Plugin handle = 
   151         static_cast<EapQtPluginHandle::Plugin>(mEapTypes.at(mRadio->selected()));
   165         static_cast<EapQtPluginHandle::Plugin>(mEapTypes.at(mRadio->selected()));
   152     switch (handle) {
   166     switch (handle) {
   153     case EapQtPluginHandle::PluginPeap:
   167     case EapQtPluginHandle::PluginPeap:
   171         break;
   185         break;
   172     }
   186     }
   173     
   187     
   174     mWizard->setConfigurations(EapWizardPrivate::OuterType, handle);
   188     mWizard->setConfigurations(EapWizardPrivate::OuterType, handle);
   175 
   189 
       
   190     OstTraceFunctionExit0( EAPWIZARDPAGEOUTERTYPE_NEXTID_EXIT );
   176     return id;
   191     return id;
   177 }
   192 }
   178 
   193 
   179 /*!
   194 /*!
   180    See WlanWizardPage.
   195    See WlanWizardPage.
   183    
   198    
   184    @return true if content is valid.
   199    @return true if content is valid.
   185  */
   200  */
   186 bool EapWizardPageOuterType::showPage()
   201 bool EapWizardPageOuterType::showPage()
   187 {
   202 {
       
   203     OstTraceFunctionEntry0( EAPWIZARDPAGEOUTERTYPE_SHOWPAGE_ENTRY );
       
   204     OstTraceFunctionExit0( EAPWIZARDPAGEOUTERTYPE_SHOWPAGE_EXIT );
   188     return mValid;
   205     return mValid;
   189 }
   206 }
   190 
   207 
   191 /*!
   208 /*!
   192    Slot for itemSelected() signal from HbRadioButtonList.
   209    Slot for itemSelected() signal from HbRadioButtonList.
   193    
   210    
   194    @param [in] index NOT USED.
   211    @param [in] index NOT USED.
   195  */
   212  */
   196 void EapWizardPageOuterType::itemSelected(int index)
   213 void EapWizardPageOuterType::itemSelected(int index)
   197 {
   214 {
       
   215     OstTraceFunctionEntry0( EAPWIZARDPAGEOUTERTYPE_ITEMSELECTED_ENTRY );
   198     Q_UNUSED(index);
   216     Q_UNUSED(index);
   199     mValid = true;
   217     mValid = true;
   200     mWizard->wizardHelper()->enableNextButton(mValid);
   218     mWizard->wizardHelper()->enableNextButton(mValid);
       
   219     OstTraceFunctionExit0( EAPWIZARDPAGEOUTERTYPE_ITEMSELECTED_EXIT );
   201 }
   220 }
   202 
   221 
   203 /*!
   222 /*!
   204    Appends given method to radiobutton list if plugin (method) is supported
   223    Appends given method to radiobutton list if plugin (method) is supported
   205    
   224    
   207    @param [in] pluginHandle EAP Type plugin handle to be added.
   226    @param [in] pluginHandle EAP Type plugin handle to be added.
   208  */
   227  */
   209 void EapWizardPageOuterType::appendToList(
   228 void EapWizardPageOuterType::appendToList(
   210     QStringList &items, int pluginHandle)
   229     QStringList &items, int pluginHandle)
   211 {
   230 {
       
   231     OstTraceFunctionEntry0( EAPWIZARDPAGEOUTERTYPE_APPENDTOLIST_ENTRY );
   212     if (mWizard->eapConfigurationInterface()->isSupportedOuterType(
   232     if (mWizard->eapConfigurationInterface()->isSupportedOuterType(
   213         (EapQtPluginHandle::Plugin)pluginHandle)) {
   233         (EapQtPluginHandle::Plugin)pluginHandle)) {
   214         items << mWizard->eapTypeToString(pluginHandle);
   234         items << mWizard->eapTypeToString(pluginHandle);
   215         mEapTypes.append(pluginHandle);
   235         mEapTypes.append(pluginHandle);
   216     }
   236     }
       
   237     OstTraceFunctionExit0( EAPWIZARDPAGEOUTERTYPE_APPENDTOLIST_EXIT );
   217 }
   238 }
   218 
   239 
   219 /*
   240 /*
   220    Getter for next page id when outer eap type is EAP-FAST.
   241    Getter for next page id when outer eap type is EAP-FAST.
   221    
   242    
   222    @return Page ID.
   243    @return Page ID.
   223  */
   244  */
   224 int EapWizardPageOuterType::nextIdForEapFast() const
   245 int EapWizardPageOuterType::nextIdForEapFast() const
   225 {
   246 {
       
   247     OstTraceFunctionEntry0( EAPWIZARDPAGEOUTERTYPE_NEXTIDFOREAPFAST_ENTRY );
   226     int pageId;
   248     int pageId;
   227     
   249     
   228     mWizard->setConfigurations(EapWizardPrivate::InnerType,
   250     mWizard->setConfigurations(EapWizardPrivate::InnerType,
   229         EapQtPluginHandle::PluginEapMschapv2);
   251         EapQtPluginHandle::PluginEapMschapv2);
   230     
   252     
   254         Q_ASSERT(pacStoreState == EapQtPacStoreConfig::PacStoreStatePasswordStored);
   276         Q_ASSERT(pacStoreState == EapQtPacStoreConfig::PacStoreStatePasswordStored);
   255         pageId = EapWizardPage::PageUsernamePassword;
   277         pageId = EapWizardPage::PageUsernamePassword;
   256         break;
   278         break;
   257     }
   279     }
   258     
   280     
       
   281     OstTraceFunctionExit0( EAPWIZARDPAGEOUTERTYPE_NEXTIDFOREAPFAST_EXIT );
   259     return pageId;
   282     return pageId;
   260 }
   283 }