wlanutilities/wlanwizard/src/wlanwizardpageprocessingsettings.cpp
author hgs
Fri, 03 Sep 2010 09:37:37 +0300 (2010-09-03)
changeset 60 822a45792fdd
parent 49 fb81b597edf1
permissions -rw-r--r--
201035
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
31
hgs
parents:
diff changeset
     1
/*
hgs
parents:
diff changeset
     2
* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
hgs
parents:
diff changeset
     3
* All rights reserved.
hgs
parents:
diff changeset
     4
* This component and the accompanying materials are made available
hgs
parents:
diff changeset
     5
* under the terms of "Eclipse Public License v1.0"
hgs
parents:
diff changeset
     6
* which accompanies this distribution, and is available
hgs
parents:
diff changeset
     7
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
hgs
parents:
diff changeset
     8
*
hgs
parents:
diff changeset
     9
* Initial Contributors:
hgs
parents:
diff changeset
    10
* Nokia Corporation - initial contribution.
hgs
parents:
diff changeset
    11
*
hgs
parents:
diff changeset
    12
* Contributors:
hgs
parents:
diff changeset
    13
*
hgs
parents:
diff changeset
    14
* Description: 
60
hgs
parents: 49
diff changeset
    15
* WLAN Wizard Page: Processing settings, connection and running ICT.
31
hgs
parents:
diff changeset
    16
*/
hgs
parents:
diff changeset
    17
hgs
parents:
diff changeset
    18
// System includes
hgs
parents:
diff changeset
    19
#include <HbMainWindow>
hgs
parents:
diff changeset
    20
#include <HbDocumentLoader>
hgs
parents:
diff changeset
    21
#include <HbWidget>
hgs
parents:
diff changeset
    22
#include <HbLabel>
hgs
parents:
diff changeset
    23
#include <HbProgressBar>
39
hgs
parents: 31
diff changeset
    24
#include <HbParameterLengthLimiter>
31
hgs
parents:
diff changeset
    25
#include <wlanerrorcodes.h>
hgs
parents:
diff changeset
    26
hgs
parents:
diff changeset
    27
// User includes
hgs
parents:
diff changeset
    28
#include "wlanwizardplugin.h"
hgs
parents:
diff changeset
    29
#include "wlanqtutils.h"
hgs
parents:
diff changeset
    30
#include "wlanwizard_p.h"
hgs
parents:
diff changeset
    31
#include "wlanwizardpageprocessingsettings.h"
hgs
parents:
diff changeset
    32
#include "OstTraceDefinitions.h"
hgs
parents:
diff changeset
    33
#ifdef OST_TRACE_COMPILER_IN_USE
hgs
parents:
diff changeset
    34
#include "wlanwizardpageprocessingsettingsTraces.h"
hgs
parents:
diff changeset
    35
#endif
hgs
parents:
diff changeset
    36
hgs
parents:
diff changeset
    37
/*!
hgs
parents:
diff changeset
    38
   \class WlanWizardPageProcessingSettings
hgs
parents:
diff changeset
    39
   \brief Implements Processing settings wizard page.
hgs
parents:
diff changeset
    40
   
hgs
parents:
diff changeset
    41
   In this page 
hgs
parents:
diff changeset
    42
   - possible wizard plugin settings are stored
hgs
parents:
diff changeset
    43
   - connection to the wlan ap is established
hgs
parents:
diff changeset
    44
   - ICT (Internet connectivity test) is run 
hgs
parents:
diff changeset
    45
 */
hgs
parents:
diff changeset
    46
hgs
parents:
diff changeset
    47
// External function prototypes
hgs
parents:
diff changeset
    48
hgs
parents:
diff changeset
    49
// Local constants
hgs
parents:
diff changeset
    50
hgs
parents:
diff changeset
    51
// ======== LOCAL FUNCTIONS ========
hgs
parents:
diff changeset
    52
hgs
parents:
diff changeset
    53
// ======== MEMBER FUNCTIONS ========
hgs
parents:
diff changeset
    54
hgs
parents:
diff changeset
    55
hgs
parents:
diff changeset
    56
/*!
hgs
parents:
diff changeset
    57
   Constructor.
hgs
parents:
diff changeset
    58
   
hgs
parents:
diff changeset
    59
   @param [in] parent pointer to private implementation of wizard.
hgs
parents:
diff changeset
    60
 */
hgs
parents:
diff changeset
    61
WlanWizardPageProcessingSettings::WlanWizardPageProcessingSettings(
hgs
parents:
diff changeset
    62
    WlanWizardPrivate* parent) :
hgs
parents:
diff changeset
    63
    WlanWizardPageInternal(parent), 
hgs
parents:
diff changeset
    64
    mDocLoader(NULL),
hgs
parents:
diff changeset
    65
    mWidget(NULL), 
hgs
parents:
diff changeset
    66
    mLabel(NULL), 
hgs
parents:
diff changeset
    67
    mNextPageId(WlanWizardPageInternal::PageSummary)
hgs
parents:
diff changeset
    68
{
60
hgs
parents: 49
diff changeset
    69
    OstTraceFunctionEntry0(WLANWIZARDPAGEPROCESSINGSETTINGS_WLANWIZARDPAGEPROCESSINGSETTINGS_ENTRY);
hgs
parents: 49
diff changeset
    70
    
31
hgs
parents:
diff changeset
    71
    WlanQtUtils* utils = mWizard->wlanQtUtils();
hgs
parents:
diff changeset
    72
hgs
parents:
diff changeset
    73
    bool ok;
hgs
parents:
diff changeset
    74
    ok = connect(
39
hgs
parents: 31
diff changeset
    75
        utils,
hgs
parents: 31
diff changeset
    76
        SIGNAL(wlanNetworkOpened(int)), 
hgs
parents: 31
diff changeset
    77
        this,
hgs
parents: 31
diff changeset
    78
        SLOT(wlanNetworkOpened(int)));
31
hgs
parents:
diff changeset
    79
    Q_ASSERT(ok);
hgs
parents:
diff changeset
    80
    
hgs
parents:
diff changeset
    81
    ok = connect(
39
hgs
parents: 31
diff changeset
    82
        utils,
hgs
parents: 31
diff changeset
    83
        SIGNAL(wlanNetworkClosed(int,int)), 
hgs
parents: 31
diff changeset
    84
        this,
hgs
parents: 31
diff changeset
    85
        SLOT(wlanNetworkClosed(int,int)));
31
hgs
parents:
diff changeset
    86
    Q_ASSERT(ok);
hgs
parents:
diff changeset
    87
    
hgs
parents:
diff changeset
    88
    ok = connect(
39
hgs
parents: 31
diff changeset
    89
        utils,
hgs
parents: 31
diff changeset
    90
        SIGNAL(ictResult(int,int)), 
hgs
parents: 31
diff changeset
    91
        this,
hgs
parents: 31
diff changeset
    92
        SLOT(ictResult(int,int)));
hgs
parents: 31
diff changeset
    93
    Q_ASSERT(ok);
hgs
parents: 31
diff changeset
    94
31
hgs
parents:
diff changeset
    95
    Q_UNUSED(ok);
hgs
parents:
diff changeset
    96
    Q_ASSERT(ok);
60
hgs
parents: 49
diff changeset
    97
    
hgs
parents: 49
diff changeset
    98
    OstTraceFunctionExit0(WLANWIZARDPAGEPROCESSINGSETTINGS_WLANWIZARDPAGEPROCESSINGSETTINGS_EXIT);
31
hgs
parents:
diff changeset
    99
}
hgs
parents:
diff changeset
   100
hgs
parents:
diff changeset
   101
/*!
hgs
parents:
diff changeset
   102
   Destructor.
hgs
parents:
diff changeset
   103
 */
hgs
parents:
diff changeset
   104
WlanWizardPageProcessingSettings::~WlanWizardPageProcessingSettings()
hgs
parents:
diff changeset
   105
{
60
hgs
parents: 49
diff changeset
   106
    OstTraceFunctionEntry0(DUP1_WLANWIZARDPAGEPROCESSINGSETTINGS_WLANWIZARDPAGEPROCESSINGSETTINGS_ENTRY);
hgs
parents: 49
diff changeset
   107
    
31
hgs
parents:
diff changeset
   108
    // signals are automatically disconnected
hgs
parents:
diff changeset
   109
    delete mDocLoader;
hgs
parents:
diff changeset
   110
    
hgs
parents:
diff changeset
   111
    // Wizard framework deletes the visualization (owns mWidget).
60
hgs
parents: 49
diff changeset
   112
    
hgs
parents: 49
diff changeset
   113
    OstTraceFunctionExit0(DUP1_WLANWIZARDPAGEPROCESSINGSETTINGS_WLANWIZARDPAGEPROCESSINGSETTINGS_EXIT);
31
hgs
parents:
diff changeset
   114
}
hgs
parents:
diff changeset
   115
hgs
parents:
diff changeset
   116
/*!
hgs
parents:
diff changeset
   117
   See WlanWizardPage::initializePage()
hgs
parents:
diff changeset
   118
 */
hgs
parents:
diff changeset
   119
HbWidget* WlanWizardPageProcessingSettings::initializePage()
hgs
parents:
diff changeset
   120
{
60
hgs
parents: 49
diff changeset
   121
    OstTraceFunctionEntry0(WLANWIZARDPAGEPROCESSINGSETTINGS_INITIALIZEPAGE_ENTRY);
hgs
parents: 49
diff changeset
   122
    
31
hgs
parents:
diff changeset
   123
    if (!mWidget) {
hgs
parents:
diff changeset
   124
        mDocLoader = new HbDocumentLoader(mWizard->mainWindow());
hgs
parents:
diff changeset
   125
        
hgs
parents:
diff changeset
   126
        bool ok;
hgs
parents:
diff changeset
   127
        mDocLoader->load(":/docml/occ_add_wlan_06.docml", &ok);
hgs
parents:
diff changeset
   128
        Q_ASSERT(ok);
hgs
parents:
diff changeset
   129
        loadDocmlSection(mWizard->mainWindow()->orientation());
hgs
parents:
diff changeset
   130
        
hgs
parents:
diff changeset
   131
        mWidget = qobject_cast<HbWidget*> (mDocLoader->findWidget("occ_add_wlan_06"));
hgs
parents:
diff changeset
   132
        Q_ASSERT(mWidget != NULL);
hgs
parents:
diff changeset
   133
hgs
parents:
diff changeset
   134
        mLabel = qobject_cast<HbLabel*> (mDocLoader->findWidget("dialog"));
hgs
parents:
diff changeset
   135
        Q_ASSERT(mLabel != NULL);
hgs
parents:
diff changeset
   136
hgs
parents:
diff changeset
   137
        ok = connect(
hgs
parents:
diff changeset
   138
            mWizard->mainWindow(), SIGNAL(orientationChanged(Qt::Orientation)),
hgs
parents:
diff changeset
   139
            this, SLOT(loadDocmlSection(Qt::Orientation)));
hgs
parents:
diff changeset
   140
        Q_ASSERT(ok);
hgs
parents:
diff changeset
   141
    }
hgs
parents:
diff changeset
   142
    
39
hgs
parents: 31
diff changeset
   143
    mLabel->setPlainText(
hgs
parents: 31
diff changeset
   144
        HbParameterLengthLimiter(
49
hgs
parents: 43
diff changeset
   145
            "txt_occ_dialog_checking_connection_to_1").arg(
60
hgs
parents: 49
diff changeset
   146
                mWizard->configuration(WlanWizardPrivate::ConfName).toString()));
31
hgs
parents:
diff changeset
   147
60
hgs
parents: 49
diff changeset
   148
    OstTraceFunctionExit0(WLANWIZARDPAGEPROCESSINGSETTINGS_INITIALIZEPAGE_EXIT);
31
hgs
parents:
diff changeset
   149
    return mWidget;
hgs
parents:
diff changeset
   150
}
hgs
parents:
diff changeset
   151
hgs
parents:
diff changeset
   152
/*!
hgs
parents:
diff changeset
   153
   See WlanWizardPage::nextId()
hgs
parents:
diff changeset
   154
   
hgs
parents:
diff changeset
   155
   @param [out] removeFromStack return value is always true
hgs
parents:
diff changeset
   156
   
hgs
parents:
diff changeset
   157
   @return WlanWizardPageInternal::PageSummary
hgs
parents:
diff changeset
   158
 */
hgs
parents:
diff changeset
   159
int WlanWizardPageProcessingSettings::nextId(bool &removeFromStack) const
hgs
parents:
diff changeset
   160
{
60
hgs
parents: 49
diff changeset
   161
    OstTraceFunctionEntry0(WLANWIZARDPAGEPROCESSINGSETTINGS_NEXTID_ENTRY);
hgs
parents: 49
diff changeset
   162
    
31
hgs
parents:
diff changeset
   163
    removeFromStack = true;
60
hgs
parents: 49
diff changeset
   164
    
hgs
parents: 49
diff changeset
   165
    OstTraceFunctionExit0(WLANWIZARDPAGEPROCESSINGSETTINGS_NEXTID_EXIT);
31
hgs
parents:
diff changeset
   166
    return mNextPageId;
hgs
parents:
diff changeset
   167
}
hgs
parents:
diff changeset
   168
hgs
parents:
diff changeset
   169
hgs
parents:
diff changeset
   170
/*!
hgs
parents:
diff changeset
   171
   See WlanWizardPage::showPage()
hgs
parents:
diff changeset
   172
   
hgs
parents:
diff changeset
   173
   @return false. Next button is dimmed when the page is displayed.
hgs
parents:
diff changeset
   174
 */
hgs
parents:
diff changeset
   175
bool WlanWizardPageProcessingSettings::showPage()
hgs
parents:
diff changeset
   176
{
60
hgs
parents: 49
diff changeset
   177
    OstTraceFunctionEntry0(WLANWIZARDPAGEPROCESSINGSETTINGS_SHOWPAGE_ENTRY);
hgs
parents: 49
diff changeset
   178
    OstTraceFunctionExit0(WLANWIZARDPAGEPROCESSINGSETTINGS_SHOWPAGE_EXIT);
31
hgs
parents:
diff changeset
   179
    return false;
hgs
parents:
diff changeset
   180
}
hgs
parents:
diff changeset
   181
hgs
parents:
diff changeset
   182
/*!
hgs
parents:
diff changeset
   183
   Loads docml at initialization phase and when HbMainWindow sends orientation()
hgs
parents:
diff changeset
   184
   signal.
hgs
parents:
diff changeset
   185
   
hgs
parents:
diff changeset
   186
   @param [in] orientation to be loaded.
hgs
parents:
diff changeset
   187
 */
hgs
parents:
diff changeset
   188
void WlanWizardPageProcessingSettings::loadDocmlSection(Qt::Orientation orientation)
hgs
parents:
diff changeset
   189
{
60
hgs
parents: 49
diff changeset
   190
    OstTraceFunctionEntry0(WLANWIZARDPAGEPROCESSINGSETTINGS_LOADDOCMLSECTION_ENTRY);
hgs
parents: 49
diff changeset
   191
    
39
hgs
parents: 31
diff changeset
   192
    WlanWizardPageInternal::loadDocmlSection(
hgs
parents: 31
diff changeset
   193
        mDocLoader,
hgs
parents: 31
diff changeset
   194
        orientation,
hgs
parents: 31
diff changeset
   195
        ":/docml/occ_add_wlan_06.docml", 
hgs
parents: 31
diff changeset
   196
        "portrait_section",
hgs
parents: 31
diff changeset
   197
        "landscape_section");
60
hgs
parents: 49
diff changeset
   198
    
hgs
parents: 49
diff changeset
   199
    OstTraceFunctionExit0(WLANWIZARDPAGEPROCESSINGSETTINGS_LOADDOCMLSECTION_EXIT);
31
hgs
parents:
diff changeset
   200
}
hgs
parents:
diff changeset
   201
hgs
parents:
diff changeset
   202
/*!
hgs
parents:
diff changeset
   203
   This method is connected to WlanQtUtils::wlanNetworkClosed(int, int) signal.
hgs
parents:
diff changeset
   204
   to get disconnected status events of currently established connection.
hgs
parents:
diff changeset
   205
   
hgs
parents:
diff changeset
   206
   In case of failure, movement to generic error page is triggered.
hgs
parents:
diff changeset
   207
   
hgs
parents:
diff changeset
   208
   @param [in] iapId IAP ID
hgs
parents:
diff changeset
   209
   @param [in] reason Symbian Error code.
hgs
parents:
diff changeset
   210
 */
hgs
parents:
diff changeset
   211
void WlanWizardPageProcessingSettings::wlanNetworkClosed(int iapId, int reason)
hgs
parents:
diff changeset
   212
{
60
hgs
parents: 49
diff changeset
   213
    OstTraceFunctionEntry0(WLANWIZARDPAGEPROCESSINGSETTINGS_WLANNETWORKCLOSED_ENTRY);
hgs
parents: 49
diff changeset
   214
    
hgs
parents: 49
diff changeset
   215
    OstTraceExt2(
hgs
parents: 49
diff changeset
   216
        TRACE_BORDER,
31
hgs
parents:
diff changeset
   217
        WLANWIZARDPAGEPROCESSINGSETTINGS_WLANNETWORKCLOSED, 
hgs
parents:
diff changeset
   218
        "WlanWizardPageProcessingSettings::wlanNetworkClosed;iapId=%d;reason=%d",
60
hgs
parents: 49
diff changeset
   219
        iapId,
hgs
parents: 49
diff changeset
   220
        reason);
31
hgs
parents:
diff changeset
   221
        
hgs
parents:
diff changeset
   222
    if (iapId != mWizard->configuration(WlanWizardHelper::ConfIapId).toInt()) {
60
hgs
parents: 49
diff changeset
   223
        OstTraceFunctionExit0(WLANWIZARDPAGEPROCESSINGSETTINGS_WLANNETWORKCLOSED_EXIT);
31
hgs
parents:
diff changeset
   224
        return;
hgs
parents:
diff changeset
   225
    }
hgs
parents:
diff changeset
   226
hgs
parents:
diff changeset
   227
    mWizard->setConfiguration(WlanWizardPrivate::ConfIctStatus, false);
hgs
parents:
diff changeset
   228
    mWizard->setConfiguration(WlanWizardPrivate::ConfConnected, false);
hgs
parents:
diff changeset
   229
    
hgs
parents:
diff changeset
   230
    if (mWizard->isCurrentPage(mWidget)) {
hgs
parents:
diff changeset
   231
        QString errorText;
hgs
parents:
diff changeset
   232
        switch (reason) {
hgs
parents:
diff changeset
   233
        case KErrWlanOpenAuthFailed:
hgs
parents:
diff changeset
   234
        case KErrWlanSharedKeyAuthRequired:
hgs
parents:
diff changeset
   235
        case KErrWlanWpaAuthRequired:
hgs
parents:
diff changeset
   236
        case KErrWlanWpaAuthFailed:
hgs
parents:
diff changeset
   237
        case KErrWlan802dot1xAuthFailed:
hgs
parents:
diff changeset
   238
        case KErrWlanIllegalEncryptionKeys:
hgs
parents:
diff changeset
   239
        case KErrWlanPskModeRequired:
hgs
parents:
diff changeset
   240
        case KErrWlanEapModeRequired:
hgs
parents:
diff changeset
   241
            errorText = hbTrId("txt_occ_dialog_authentication_unsuccessful");
hgs
parents:
diff changeset
   242
            break;
hgs
parents:
diff changeset
   243
            
hgs
parents:
diff changeset
   244
        case KErrWlanIllegalWpaPskKey:
hgs
parents:
diff changeset
   245
            errorText = hbTrId("txt_occ_dialog_incorrect_wpa_preshared_key_pleas");
hgs
parents:
diff changeset
   246
            break;
hgs
parents:
diff changeset
   247
            
hgs
parents:
diff changeset
   248
        case KErrWlanSharedKeyAuthFailed:
hgs
parents:
diff changeset
   249
            errorText = hbTrId("txt_occ_dialog_incorrect_wep_key_please_check_the");
hgs
parents:
diff changeset
   250
            break;
39
hgs
parents: 31
diff changeset
   251
31
hgs
parents:
diff changeset
   252
        default:
39
hgs
parents: 31
diff changeset
   253
            // Handles also KErrNone
31
hgs
parents:
diff changeset
   254
            // Get plugin specific localized error text if any
hgs
parents:
diff changeset
   255
            WlanWizardPlugin *plugin = mWizard->wlanWizardPlugin();
hgs
parents:
diff changeset
   256
            
hgs
parents:
diff changeset
   257
            if (plugin){
hgs
parents:
diff changeset
   258
                errorText = plugin->errorString(reason);
hgs
parents:
diff changeset
   259
            }
hgs
parents:
diff changeset
   260
            if (errorText.length() == 0) {
hgs
parents:
diff changeset
   261
                errorText = hbTrId("txt_occ_dialog_connection_failed");
hgs
parents:
diff changeset
   262
            }
hgs
parents:
diff changeset
   263
            break;
hgs
parents:
diff changeset
   264
        }
hgs
parents:
diff changeset
   265
        mNextPageId = WlanWizardPageInternal::PageGenericError;
hgs
parents:
diff changeset
   266
        mWizard->setConfiguration(
hgs
parents:
diff changeset
   267
            WlanWizardHelper::ConfGenericErrorString, errorText);
39
hgs
parents: 31
diff changeset
   268
        
hgs
parents: 31
diff changeset
   269
        mWizard->setConfiguration(
hgs
parents: 31
diff changeset
   270
            WlanWizardHelper::ConfGenericErrorPageStepsBackwards, 
hgs
parents: 31
diff changeset
   271
            WlanWizardPage::OneStepBackwards);
hgs
parents: 31
diff changeset
   272
        
31
hgs
parents:
diff changeset
   273
        mWizard->nextPage();
hgs
parents:
diff changeset
   274
    }
hgs
parents:
diff changeset
   275
    
hgs
parents:
diff changeset
   276
    OstTrace0( 
60
hgs
parents: 49
diff changeset
   277
        TRACE_BORDER,
hgs
parents: 49
diff changeset
   278
        WLANWIZARDPAGEPROCESSINGSETTINGS_WLANNETWORKCLOSED_DONE,
hgs
parents: 49
diff changeset
   279
        "WlanWizardPageProcessingSettings::wlanNetworkClosed - Done");
hgs
parents: 49
diff changeset
   280
    
hgs
parents: 49
diff changeset
   281
    OstTraceFunctionExit0(DUP1_WLANWIZARDPAGEPROCESSINGSETTINGS_WLANNETWORKCLOSED_EXIT);
31
hgs
parents:
diff changeset
   282
}
hgs
parents:
diff changeset
   283
hgs
parents:
diff changeset
   284
/*!
hgs
parents:
diff changeset
   285
   Handles ictResult(int, bool) signal from WlanQtUtils and calls
hgs
parents:
diff changeset
   286
   WlanWizardHelper::nextPage() to trigger movement to next page.
hgs
parents:
diff changeset
   287
   
hgs
parents:
diff changeset
   288
   @param [in] iapId IAP ID
hgs
parents:
diff changeset
   289
   @param [in] reason ICT result, Symbian error code
hgs
parents:
diff changeset
   290
 */
39
hgs
parents: 31
diff changeset
   291
void WlanWizardPageProcessingSettings::ictResult(int iapId, int reason)
31
hgs
parents:
diff changeset
   292
{
60
hgs
parents: 49
diff changeset
   293
    OstTraceFunctionEntry0(WLANWIZARDPAGEPROCESSINGSETTINGS_ICTRESULT_ENTRY);
hgs
parents: 49
diff changeset
   294
    
31
hgs
parents:
diff changeset
   295
    OstTraceExt2( 
hgs
parents:
diff changeset
   296
        TRACE_BORDER, 
hgs
parents:
diff changeset
   297
        WLANWIZARDPAGEPROCESSINGSETTINGS_ICTRESULT, 
hgs
parents:
diff changeset
   298
        "WlanWizardPageProcessingSettings::ictResult;iapId=%d;result=%d", 
60
hgs
parents: 49
diff changeset
   299
        iapId,
hgs
parents: 49
diff changeset
   300
        reason);
31
hgs
parents:
diff changeset
   301
    
hgs
parents:
diff changeset
   302
    if (iapId != mWizard->configuration(WlanWizardHelper::ConfIapId).toInt()) {
60
hgs
parents: 49
diff changeset
   303
        OstTraceFunctionExit0(WLANWIZARDPAGEPROCESSINGSETTINGS_ICTRESULT_EXIT);
31
hgs
parents:
diff changeset
   304
        return;
hgs
parents:
diff changeset
   305
    }
39
hgs
parents: 31
diff changeset
   306
    
hgs
parents: 31
diff changeset
   307
    // Cast of result .
hgs
parents: 31
diff changeset
   308
    WlanQtUtils::IctStatus status = 
hgs
parents: 31
diff changeset
   309
        static_cast<WlanQtUtils::IctStatus>(reason);
hgs
parents: 31
diff changeset
   310
hgs
parents: 31
diff changeset
   311
    if(status == WlanQtUtils::IctCancelled) {
hgs
parents: 31
diff changeset
   312
        
hgs
parents: 31
diff changeset
   313
        mNextPageId = WlanWizardPageInternal::PageNone;
hgs
parents: 31
diff changeset
   314
        mWizard->cancelTriggered();
31
hgs
parents:
diff changeset
   315
    }
39
hgs
parents: 31
diff changeset
   316
    else {
hgs
parents: 31
diff changeset
   317
        mWizard->setConfiguration(WlanWizardPrivate::ConfConnected, true);
hgs
parents: 31
diff changeset
   318
    }
hgs
parents: 31
diff changeset
   319
    mWizard->setConfiguration(WlanWizardPrivate::ConfIctStatus, status);
hgs
parents: 31
diff changeset
   320
        
31
hgs
parents:
diff changeset
   321
    mWizard->nextPage();
hgs
parents:
diff changeset
   322
    
60
hgs
parents: 49
diff changeset
   323
    OstTrace0(
hgs
parents: 49
diff changeset
   324
        TRACE_BORDER,
hgs
parents: 49
diff changeset
   325
        WLANWIZARDPAGEPROCESSINGSETTINGS_ICTRESULT_DONE, 
hgs
parents: 49
diff changeset
   326
        "WlanWizardPageProcessingSettings::ictResult - Done");
hgs
parents: 49
diff changeset
   327
    
hgs
parents: 49
diff changeset
   328
    OstTraceFunctionExit0(DUP1_WLANWIZARDPAGEPROCESSINGSETTINGS_ICTRESULT_EXIT);
31
hgs
parents:
diff changeset
   329
}
hgs
parents:
diff changeset
   330
hgs
parents:
diff changeset
   331
/*!
hgs
parents:
diff changeset
   332
   Handles wlanNetworkOpened(int) signal from WlanQtUtils.
hgs
parents:
diff changeset
   333
   
hgs
parents:
diff changeset
   334
   @param [in] iapId IAP ID
hgs
parents:
diff changeset
   335
 */
hgs
parents:
diff changeset
   336
void WlanWizardPageProcessingSettings::wlanNetworkOpened(int iapId)
hgs
parents:
diff changeset
   337
{
60
hgs
parents: 49
diff changeset
   338
    OstTraceFunctionEntry0(WLANWIZARDPAGEPROCESSINGSETTINGS_WLANNETWORKOPENED_ENTRY);
hgs
parents: 49
diff changeset
   339
    
31
hgs
parents:
diff changeset
   340
    Q_UNUSED(iapId);
hgs
parents:
diff changeset
   341
    OstTrace1(
hgs
parents:
diff changeset
   342
        TRACE_BORDER, 
hgs
parents:
diff changeset
   343
        WLANWIZARDPAGEPROCESSINGSETTINGS_WLANNETWORKOPENED, 
hgs
parents:
diff changeset
   344
        "WlanWizardPageProcessingSettings::wlanNetworkOpened;iapId=%d", 
hgs
parents:
diff changeset
   345
        iapId);
60
hgs
parents: 49
diff changeset
   346
    
hgs
parents: 49
diff changeset
   347
    OstTraceFunctionExit0(WLANWIZARDPAGEPROCESSINGSETTINGS_WLANNETWORKOPENED_EXIT);
31
hgs
parents:
diff changeset
   348
}
hgs
parents:
diff changeset
   349
hgs
parents:
diff changeset
   350
/*!
hgs
parents:
diff changeset
   351
   See WlanWizardPage::requiresStartOperation().
hgs
parents:
diff changeset
   352
   
hgs
parents:
diff changeset
   353
   Indicates to framework that startOperation() needs to called.
hgs
parents:
diff changeset
   354
 */
hgs
parents:
diff changeset
   355
bool WlanWizardPageProcessingSettings::requiresStartOperation()
hgs
parents:
diff changeset
   356
{
60
hgs
parents: 49
diff changeset
   357
    OstTraceFunctionEntry0(WLANWIZARDPAGEPROCESSINGSETTINGS_REQUIRESSTARTOPERATION_ENTRY);
hgs
parents: 49
diff changeset
   358
    OstTraceFunctionExit0(WLANWIZARDPAGEPROCESSINGSETTINGS_REQUIRESSTARTOPERATION_EXIT);
31
hgs
parents:
diff changeset
   359
    return true;
hgs
parents:
diff changeset
   360
}
hgs
parents:
diff changeset
   361
hgs
parents:
diff changeset
   362
/*!
hgs
parents:
diff changeset
   363
   See WlanWizardPage::startOperation().
hgs
parents:
diff changeset
   364
   
hgs
parents:
diff changeset
   365
   Starts the page operation.
hgs
parents:
diff changeset
   366
 */
hgs
parents:
diff changeset
   367
void WlanWizardPageProcessingSettings::startOperation()
hgs
parents:
diff changeset
   368
{
60
hgs
parents: 49
diff changeset
   369
    OstTraceFunctionEntry0(WLANWIZARDPAGEPROCESSINGSETTINGS_STARTOPERATION_ENTRY);
hgs
parents: 49
diff changeset
   370
    
31
hgs
parents:
diff changeset
   371
    if (mWizard->handleIap()) {
hgs
parents:
diff changeset
   372
        mNextPageId = WlanWizardPageInternal::PageSummary;
hgs
parents:
diff changeset
   373
        
hgs
parents:
diff changeset
   374
        // in case wlan connection is already established disconnect it
hgs
parents:
diff changeset
   375
        // note that connectIap() disconnects implicitly connection when 
hgs
parents:
diff changeset
   376
        // same IAP is already connected.
hgs
parents:
diff changeset
   377
        WlanQtUtils* utils = mWizard->wlanQtUtils();
hgs
parents:
diff changeset
   378
        int connectedIapId = utils->activeIap();
hgs
parents:
diff changeset
   379
        int iapId = mWizard->configuration(WlanWizardHelper::ConfIapId).toInt();
hgs
parents:
diff changeset
   380
        if (connectedIapId != iapId){
hgs
parents:
diff changeset
   381
            utils->disconnectIap(connectedIapId);
hgs
parents:
diff changeset
   382
        }
hgs
parents:
diff changeset
   383
        mWizard->wlanQtUtils()->connectIap( iapId, true);        
hgs
parents:
diff changeset
   384
    } else {
hgs
parents:
diff changeset
   385
        mNextPageId = WlanWizardPageInternal::PageGenericError;
hgs
parents:
diff changeset
   386
        mWizard->setConfiguration(
hgs
parents:
diff changeset
   387
            WlanWizardHelper::ConfGenericErrorString, 
hgs
parents:
diff changeset
   388
            hbTrId("txt_occ_dialog_unable_to_save_settings_please_ret"));
39
hgs
parents: 31
diff changeset
   389
        
hgs
parents: 31
diff changeset
   390
        mWizard->setConfiguration(
hgs
parents: 31
diff changeset
   391
            WlanWizardHelper::ConfGenericErrorPageStepsBackwards, 
hgs
parents: 31
diff changeset
   392
            WlanWizardPage::OneStepBackwards);
31
hgs
parents:
diff changeset
   393
        mWizard->nextPage();
hgs
parents:
diff changeset
   394
    }
60
hgs
parents: 49
diff changeset
   395
    
hgs
parents: 49
diff changeset
   396
	OstTraceFunctionExit0(WLANWIZARDPAGEPROCESSINGSETTINGS_STARTOPERATION_EXIT);
31
hgs
parents:
diff changeset
   397
}