wlanutilities/wlanwizard/src/wlanwizardpagegenericerror.cpp
branchRCL_3
changeset 24 63be7eb3fc78
equal deleted inserted replaced
23:b852595f5cbe 24:63be7eb3fc78
       
     1 /*
       
     2  * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
       
     3  * All rights reserved.
       
     4  * This component and the accompanying materials are made available
       
     5  * under the terms of "Eclipse Public License v1.0"
       
     6  * which accompanies this distribution, and is available
       
     7  * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8  *
       
     9  * Initial Contributors:
       
    10  * Nokia Corporation - initial contribution.
       
    11  *
       
    12  * Contributors:
       
    13  *
       
    14  * Description: 
       
    15  *   WLAN Wizard Page: Generic error page.
       
    16  *
       
    17  */
       
    18 
       
    19 // System includes
       
    20 #include <HbMainWindow>
       
    21 #include <HbDocumentLoader>
       
    22 #include <HbWidget>
       
    23 #include <HbLabel>
       
    24 
       
    25 // User includes
       
    26 #include "wlanwizard_p.h"
       
    27 #include "wlanwizardpagegenericerror.h"
       
    28 #include "OstTraceDefinitions.h"
       
    29 #ifdef OST_TRACE_COMPILER_IN_USE
       
    30 #include "wlanwizardpageprocessingsettingsTraces.h"
       
    31 #include "OstTraceDefinitions.h"
       
    32 #ifdef OST_TRACE_COMPILER_IN_USE
       
    33 #include "wlanwizardpagegenericerrorTraces.h"
       
    34 #endif
       
    35 
       
    36 #endif
       
    37 
       
    38 /*!
       
    39    \class WlanWizardPageGenericError
       
    40    \brief Implements generic error page for wizard.
       
    41    
       
    42    Error text is read from the configurations 
       
    43    (WlanWizardHelper::ConfGenericErrorString) of the wizard. 
       
    44  */
       
    45 
       
    46 // External function prototypes
       
    47 
       
    48 // Local constants
       
    49 
       
    50 // ======== LOCAL FUNCTIONS ========
       
    51 
       
    52 // ======== MEMBER FUNCTIONS ========
       
    53 
       
    54 
       
    55 /*!
       
    56    Constructor.
       
    57    
       
    58    @param [in] parent pointer to private implementation of wizard.
       
    59  */
       
    60 WlanWizardPageGenericError::WlanWizardPageGenericError(
       
    61     WlanWizardPrivate* parent) :
       
    62     WlanWizardPageInternal(parent), 
       
    63     mWidget(NULL), 
       
    64     mLabel(NULL)
       
    65 {
       
    66     OstTraceFunctionEntry0( WLANWIZARDPAGEGENERICERROR_WLANWIZARDPAGEGENERICERROR_ENTRY );
       
    67     OstTraceFunctionExit0( WLANWIZARDPAGEGENERICERROR_WLANWIZARDPAGEGENERICERROR_EXIT );
       
    68 }
       
    69 
       
    70 /*!
       
    71    Destructor.
       
    72  */
       
    73 WlanWizardPageGenericError::~WlanWizardPageGenericError()
       
    74 {
       
    75     OstTraceFunctionEntry0( DUP1_WLANWIZARDPAGEGENERICERROR_WLANWIZARDPAGEGENERICERROR_ENTRY );
       
    76     // signals are automatically disconnected
       
    77     OstTraceFunctionExit0( DUP1_WLANWIZARDPAGEGENERICERROR_WLANWIZARDPAGEGENERICERROR_EXIT );
       
    78 }
       
    79 
       
    80 /*!
       
    81    See WlanWizardPage::initializePage()
       
    82  */
       
    83 HbWidget* WlanWizardPageGenericError::initializePage()
       
    84 {
       
    85     OstTraceFunctionEntry0( WLANWIZARDPAGEGENERICERROR_INITIALIZEPAGE_ENTRY );
       
    86     // Create the visualization at the first time
       
    87     if (!mWidget) {
       
    88         HbDocumentLoader docLoader(mWizard->mainWindow());
       
    89         
       
    90         bool ok;
       
    91         docLoader.load(":/docml/occ_add_wlan_error.docml", &ok);
       
    92         Q_ASSERT(ok);
       
    93         
       
    94         mWidget = qobject_cast<HbWidget*> (docLoader.findWidget("occ_add_wlan_error"));
       
    95         Q_ASSERT(mWidget != NULL);
       
    96 
       
    97         mLabel = qobject_cast<HbLabel*> (docLoader.findWidget("dialog"));
       
    98         Q_ASSERT(mLabel != NULL);
       
    99     }
       
   100 
       
   101     // Get the error string from the wizards configurations
       
   102     mLabel->setPlainText(
       
   103         mWizard->configuration(
       
   104             WlanWizardHelper::ConfGenericErrorString).toString());
       
   105 
       
   106     OstTraceFunctionExit0( WLANWIZARDPAGEGENERICERROR_INITIALIZEPAGE_EXIT );
       
   107     return mWidget;
       
   108 }
       
   109 
       
   110 /*!
       
   111    See WlanWizardPage::showPage()
       
   112    
       
   113    @return false. Next button is dimmed when the page is displayed.
       
   114  */
       
   115 bool WlanWizardPageGenericError::showPage()
       
   116 {
       
   117     OstTraceFunctionEntry0( WLANWIZARDPAGEGENERICERROR_SHOWPAGE_ENTRY );
       
   118     OstTraceFunctionExit0( WLANWIZARDPAGEGENERICERROR_SHOWPAGE_EXIT );
       
   119     return false;
       
   120 }
       
   121 
       
   122 /*!
       
   123     See WlanWizardPage::previousTriggered()
       
   124    
       
   125    @return steps backwards
       
   126  */
       
   127 int WlanWizardPageGenericError::previousTriggered()
       
   128 {
       
   129     OstTraceFunctionEntry0( WLANWIZARDPAGEGENERICERROR_PREVIOUSTRIGGERED_ENTRY );
       
   130     OstTraceFunctionExit0( WLANWIZARDPAGEGENERICERROR_PREVIOUSTRIGGERED_EXIT );
       
   131     return mWizard->configuration(
       
   132         WlanWizardHelper::ConfGenericErrorPageStepsBackwards).toInt();
       
   133 }