wlanutilities/eapwizard/src/eapwizardpagecertuser.cpp
changeset 50 d4198dcb9983
parent 46 2fbd1d709fe7
equal deleted inserted replaced
46:2fbd1d709fe7 50:d4198dcb9983
    28 
    28 
    29 // User includes
    29 // User includes
    30 #include "wlanwizardhelper.h"
    30 #include "wlanwizardhelper.h"
    31 #include "eapwizardpagecertuser.h"
    31 #include "eapwizardpagecertuser.h"
    32 #include "eapwizard_p.h"
    32 #include "eapwizard_p.h"
       
    33 #include "OstTraceDefinitions.h"
       
    34 #ifdef OST_TRACE_COMPILER_IN_USE
       
    35 #include "eapwizardpagecertuserTraces.h"
       
    36 #endif
       
    37 
    33 
    38 
    34 /*!
    39 /*!
    35    \class EapWizardPageCertUser
    40    \class EapWizardPageCertUser
    36    \brief Implements EAP wizard page: User Certificate selection
    41    \brief Implements EAP wizard page: User Certificate selection
    37  */
    42  */
    45 // ======== MEMBER FUNCTIONS ========
    50 // ======== MEMBER FUNCTIONS ========
    46 
    51 
    47 
    52 
    48 /*!
    53 /*!
    49    Constructor.
    54    Constructor.
    50    
    55 
    51    @param [in] parent Pointer to EAP Wizard private implementation.
    56    @param [in] parent Pointer to EAP Wizard private implementation.
    52  */
    57  */
    53 
    58 
    54 EapWizardPageCertUser::EapWizardPageCertUser(EapWizardPrivate* parent) :
    59 EapWizardPageCertUser::EapWizardPageCertUser(EapWizardPrivate* parent) :
    55     EapWizardPage(parent), 
    60     EapWizardPage(parent), 
    57     mCertList(NULL),
    62     mCertList(NULL),
    58     mErrorLabel(NULL),
    63     mErrorLabel(NULL),
    59     mDocumentLoader(NULL),
    64     mDocumentLoader(NULL),
    60     mValid(false)
    65     mValid(false)
    61 {
    66 {
       
    67     OstTraceFunctionEntry0( EAPWIZARDPAGECERTUSER_EAPWIZARDPAGECERTUSER_ENTRY );
       
    68     OstTraceFunctionExit0( EAPWIZARDPAGECERTUSER_EAPWIZARDPAGECERTUSER_EXIT );
    62 }
    69 }
    63 
    70 
    64 /*!
    71 /*!
    65    Destructor.
    72    Destructor.
    66  */
    73  */
    67 EapWizardPageCertUser::~EapWizardPageCertUser()
    74 EapWizardPageCertUser::~EapWizardPageCertUser()
    68 {
    75 {
       
    76     OstTraceFunctionEntry0( DUP1_EAPWIZARDPAGECERTUSER_EAPWIZARDPAGECERTUSER_ENTRY );
       
    77     OstTraceFunctionExit0( DUP1_EAPWIZARDPAGECERTUSER_EAPWIZARDPAGECERTUSER_EXIT );
    69 }
    78 }
    70 
    79 
    71 /*!
    80 /*!
    72    See WlanWizardPage. 
    81    See WlanWizardPage. 
    73  */
    82  */
    74 HbWidget* EapWizardPageCertUser::initializePage()
    83 HbWidget* EapWizardPageCertUser::initializePage()
    75 {
    84 {
       
    85     OstTraceFunctionEntry0( EAPWIZARDPAGECERTUSER_INITIALIZEPAGE_ENTRY );
    76     if (!mWidget) {
    86     if (!mWidget) {
    77         bool ok;
    87         bool ok;
    78         mDocumentLoader.reset(new HbDocumentLoader(mWizard->wizardHelper()->mainWindow()));
    88         mDocumentLoader.reset(new HbDocumentLoader(mWizard->wizardHelper()->mainWindow()));
    79         mDocumentLoader->load(":/docml/occ_eap_wizard_06.docml", &ok);
    89         mDocumentLoader->load(":/docml/occ_eap_wizard_06.docml", &ok);
    80         Q_ASSERT(ok);
    90         Q_ASSERT(ok);
    81         loadDocmlSection(mWizard->wizardHelper()->mainWindow()->orientation());
    91         loadDocmlSection(mWizard->wizardHelper()->mainWindow()->orientation());
    82         
    92 
    83         mWidget = qobject_cast<HbWidget*> (mDocumentLoader->findWidget("occ_eap_wizard_06"));
    93         mWidget = qobject_cast<HbWidget*> (mDocumentLoader->findWidget("occ_eap_wizard_06"));
    84         Q_ASSERT(mWidget);
    94         Q_ASSERT(mWidget);
    85 
    95 
    86         mCertList = qobject_cast<HbRadioButtonList*> (mDocumentLoader->findWidget("list"));
    96         mCertList = qobject_cast<HbRadioButtonList*> (mDocumentLoader->findWidget("list"));
    87         Q_ASSERT(mCertList);
    97         Q_ASSERT(mCertList);
    95             mWizard->wizardHelper()->mainWindow(),
   105             mWizard->wizardHelper()->mainWindow(),
    96             SIGNAL(orientationChanged(Qt::Orientation)), 
   106             SIGNAL(orientationChanged(Qt::Orientation)), 
    97             this, 
   107             this, 
    98             SLOT(loadDocmlSection(Qt::Orientation)));
   108             SLOT(loadDocmlSection(Qt::Orientation)));
    99         Q_ASSERT(ok);
   109         Q_ASSERT(ok);
   100         
   110 
   101         ok = connect(
   111         ok = connect(
   102             mCertList, SIGNAL(itemSelected(int)), 
   112             mCertList, SIGNAL(itemSelected(int)), 
   103             this, SLOT(itemSelected(int)));
   113             this, SLOT(itemSelected(int)));
   104         Q_ASSERT(ok);
   114         Q_ASSERT(ok);
   105     }
   115     }
   121     } else if (list != mCertList->items()){
   131     } else if (list != mCertList->items()){
   122         // in case the user cert list has been changed, update UI
   132         // in case the user cert list has been changed, update UI
   123         mCertList->setItems(list);
   133         mCertList->setItems(list);
   124         mErrorLabel->setVisible(false);
   134         mErrorLabel->setVisible(false);
   125         mCertList->setVisible(true);
   135         mCertList->setVisible(true);
   126         
   136 
   127         if (list.count() == 1) {
   137         if (list.count() == 1) {
   128             mValid = true;
   138             mValid = true;
   129             mCertList->setSelected(0);
   139             mCertList->setSelected(0);
   130         } else {
   140         } else {
   131             mValid = false;
   141             mValid = false;
   132         }
   142         }
   133     }
   143     }
       
   144     OstTraceFunctionExit0( EAPWIZARDPAGECERTUSER_INITIALIZEPAGE_EXIT );
   134     return mWidget;
   145     return mWidget;
   135 }
   146 }
   136 
   147 
   137 /*!
   148 /*!
   138    Loads the required orientation of docml.
   149    Loads the required orientation of docml.
   139    
   150 
   140    @param [in] orientation Orientation to be loaded. 
   151    @param [in] orientation Orientation to be loaded. 
   141  */
   152  */
   142 void EapWizardPageCertUser::loadDocmlSection(Qt::Orientation orientation)
   153 void EapWizardPageCertUser::loadDocmlSection(Qt::Orientation orientation)
   143 {
   154 {
       
   155     OstTraceFunctionEntry0( EAPWIZARDPAGECERTUSER_LOADDOCMLSECTION_ENTRY );
   144     EapWizardPage::loadDocmlSection(
   156     EapWizardPage::loadDocmlSection(
   145         mDocumentLoader.data(),
   157         mDocumentLoader.data(),
   146         orientation,
   158         orientation,
   147         ":/docml/occ_eap_wizard_06.docml", 
   159         ":/docml/occ_eap_wizard_06.docml", 
   148         "portrait_section",
   160         "portrait_section",
   149         "landscape_section");
   161         "landscape_section");
       
   162     OstTraceFunctionExit0( EAPWIZARDPAGECERTUSER_LOADDOCMLSECTION_EXIT );
   150 }
   163 }
   151 
   164 
   152 /*!
   165 /*!
   153    See WlanWizardPage. 
   166    See WlanWizardPage. 
   154    
   167 
   155    @return next wizard page: EapWizardPage::PageIdentity
   168    @return next wizard page: EapWizardPage::PageIdentity
   156  */
   169  */
   157 int EapWizardPageCertUser::nextId() const
   170 int EapWizardPageCertUser::nextId() const
   158 {
   171 {
       
   172     OstTraceFunctionEntry0( EAPWIZARDPAGECERTUSER_NEXTID_ENTRY );
   159     mWizard->setConfigurations(
   173     mWizard->setConfigurations(
   160         EapWizardPrivate::CertificateUser, 
   174         EapWizardPrivate::CertificateUser, 
   161         qVariantFromValue(
   175         qVariantFromValue(
   162             mCerts.at(mCertList->selected())));
   176             mCerts.at(mCertList->selected())));
   163 
   177 
       
   178     OstTraceFunctionExit0( EAPWIZARDPAGECERTUSER_NEXTID_EXIT );
   164     return EapWizardPage::PageIdentity;
   179     return EapWizardPage::PageIdentity;
   165 }
   180 }
   166 
   181 
   167 /*!
   182 /*!
   168    See WlanWizardPage.
   183    See WlanWizardPage.
   169    
   184 
   170    Validates the content of the page.
   185    Validates the content of the page.
   171    
   186 
   172    @return true if content is valid.
   187    @return true if content is valid.
   173  */
   188  */
   174 bool EapWizardPageCertUser::showPage()
   189 bool EapWizardPageCertUser::showPage()
   175 {
   190 {
       
   191     OstTraceFunctionEntry0( EAPWIZARDPAGECERTUSER_SHOWPAGE_ENTRY );
       
   192     OstTraceFunctionExit0( EAPWIZARDPAGECERTUSER_SHOWPAGE_EXIT );
   176     return mValid;
   193     return mValid;
   177 }
   194 }
   178 
   195 
   179 /*!
   196 /*!
   180    Handler for itemsSelected() signal from HbRadioButtonList.
   197    Handler for itemsSelected() signal from HbRadioButtonList.
   181    
   198 
   182    @param [in] index NOT USED
   199    @param [in] index NOT USED
   183  */
   200  */
   184 void EapWizardPageCertUser::itemSelected(int index)
   201 void EapWizardPageCertUser::itemSelected(int index)
   185 {
   202 {
       
   203     OstTraceFunctionEntry0( EAPWIZARDPAGECERTUSER_ITEMSELECTED_ENTRY );
   186     Q_UNUSED(index);
   204     Q_UNUSED(index);
   187     mValid = true;
   205     mValid = true;
   188     mWizard->wizardHelper()->enableNextButton(mValid);
   206     mWizard->wizardHelper()->enableNextButton(mValid);
   189 }
   207     OstTraceFunctionExit0( EAPWIZARDPAGECERTUSER_ITEMSELECTED_EXIT );
   190 
   208 }
       
   209