wlanutilities/wlanwizard/src/wlanwizardpagenetworkmode.cpp
author hgs
Thu, 16 Sep 2010 12:52:33 +0300
changeset 61 e1d68407ed06
parent 53 bdc64aa9b954
permissions -rw-r--r--
201037
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
31
hgs
parents:
diff changeset
     1
/*
53
hgs
parents: 43
diff changeset
     2
* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
hgs
parents: 43
diff changeset
     3
* All rights reserved.
hgs
parents: 43
diff changeset
     4
* This component and the accompanying materials are made available
hgs
parents: 43
diff changeset
     5
* under the terms of "Eclipse Public License v1.0"
hgs
parents: 43
diff changeset
     6
* which accompanies this distribution, and is available
hgs
parents: 43
diff changeset
     7
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
hgs
parents: 43
diff changeset
     8
*
hgs
parents: 43
diff changeset
     9
* Initial Contributors:
hgs
parents: 43
diff changeset
    10
* Nokia Corporation - initial contribution.
hgs
parents: 43
diff changeset
    11
*
hgs
parents: 43
diff changeset
    12
* Contributors:
hgs
parents: 43
diff changeset
    13
*
hgs
parents: 43
diff changeset
    14
* Description: 
hgs
parents: 43
diff changeset
    15
* WLAN Wizard Page: Network mode Selection.
hgs
parents: 43
diff changeset
    16
*/
31
hgs
parents:
diff changeset
    17
hgs
parents:
diff changeset
    18
// System includes
hgs
parents:
diff changeset
    19
#include <HbDocumentLoader>
hgs
parents:
diff changeset
    20
#include <HbWidget>
hgs
parents:
diff changeset
    21
#include <HbRadioButtonList>
hgs
parents:
diff changeset
    22
#include <HbMainWindow>
hgs
parents:
diff changeset
    23
#include <HbLabel>
hgs
parents:
diff changeset
    24
#include <cmmanagerdefines_shim.h>
hgs
parents:
diff changeset
    25
hgs
parents:
diff changeset
    26
// User includes
hgs
parents:
diff changeset
    27
#include "wlanwizard_p.h"
hgs
parents:
diff changeset
    28
#include "wlanwizard.h"
hgs
parents:
diff changeset
    29
#include "wlanwizardpagenetworkmode.h"
39
hgs
parents: 31
diff changeset
    30
#include "wlanwizardscanlist.h"
31
hgs
parents:
diff changeset
    31
#include "OstTraceDefinitions.h"
hgs
parents:
diff changeset
    32
#ifdef OST_TRACE_COMPILER_IN_USE
hgs
parents:
diff changeset
    33
#include "wlanwizardpagenetworkmodeTraces.h"
hgs
parents:
diff changeset
    34
#endif
hgs
parents:
diff changeset
    35
39
hgs
parents: 31
diff changeset
    36
// Local constants
hgs
parents: 31
diff changeset
    37
31
hgs
parents:
diff changeset
    38
/*!
39
hgs
parents: 31
diff changeset
    39
 * Constructor method for the network mode view object
hgs
parents: 31
diff changeset
    40
 * @param parent [in] pointer to parent object.
31
hgs
parents:
diff changeset
    41
 */
hgs
parents:
diff changeset
    42
WlanWizardPageNetworkMode::WlanWizardPageNetworkMode(
hgs
parents:
diff changeset
    43
    WlanWizardPrivate* parent) :
hgs
parents:
diff changeset
    44
    WlanWizardPageInternal(parent),
hgs
parents:
diff changeset
    45
    mWidget(NULL),
hgs
parents:
diff changeset
    46
    mList(NULL),
hgs
parents:
diff changeset
    47
    mLabel(NULL),
61
hgs
parents: 53
diff changeset
    48
    mLoader(NULL)
31
hgs
parents:
diff changeset
    49
{
43
hgs
parents: 39
diff changeset
    50
    OstTraceFunctionEntry0( WLANWIZARDPAGENETWORKMODE_WLANWIZARDPAGENETWORKMODE_ENTRY );
hgs
parents: 39
diff changeset
    51
    OstTraceFunctionExit0( WLANWIZARDPAGENETWORKMODE_WLANWIZARDPAGENETWORKMODE_EXIT );
31
hgs
parents:
diff changeset
    52
}
hgs
parents:
diff changeset
    53
hgs
parents:
diff changeset
    54
/*!
hgs
parents:
diff changeset
    55
 * Destructor. Loader widget is deleted.
hgs
parents:
diff changeset
    56
 * All document widgets are deleted by wlanwizard_p destructor. 
hgs
parents:
diff changeset
    57
 */
hgs
parents:
diff changeset
    58
WlanWizardPageNetworkMode::~WlanWizardPageNetworkMode()
hgs
parents:
diff changeset
    59
{
43
hgs
parents: 39
diff changeset
    60
    OstTraceFunctionEntry0( DUP1_WLANWIZARDPAGENETWORKMODE_WLANWIZARDPAGENETWORKMODE_ENTRY );
31
hgs
parents:
diff changeset
    61
    delete mLoader;
43
hgs
parents: 39
diff changeset
    62
    OstTraceFunctionExit0( DUP1_WLANWIZARDPAGENETWORKMODE_WLANWIZARDPAGENETWORKMODE_EXIT );
31
hgs
parents:
diff changeset
    63
}
hgs
parents:
diff changeset
    64
hgs
parents:
diff changeset
    65
/*!
hgs
parents:
diff changeset
    66
 * Page initialization. If view is already loaded, does nothing.
39
hgs
parents: 31
diff changeset
    67
 * Inherited from WlanWizardPage.
31
hgs
parents:
diff changeset
    68
 */
hgs
parents:
diff changeset
    69
HbWidget* WlanWizardPageNetworkMode::initializePage()
hgs
parents:
diff changeset
    70
{
43
hgs
parents: 39
diff changeset
    71
    OstTraceFunctionEntry0( WLANWIZARDPAGENETWORKMODE_INITIALIZEPAGE_ENTRY );
31
hgs
parents:
diff changeset
    72
    OstTrace0( TRACE_NORMAL, WLANWIZARDPAGENETWORKMODE_INITIALIZEPAGE,
hgs
parents:
diff changeset
    73
        "WlanWizardPageNetworkMode::initializePage" );
hgs
parents:
diff changeset
    74
hgs
parents:
diff changeset
    75
    if (mWidget == NULL) {
hgs
parents:
diff changeset
    76
        mLoader = new HbDocumentLoader(mWizard->mainWindow());
hgs
parents:
diff changeset
    77
hgs
parents:
diff changeset
    78
        bool ok;
hgs
parents:
diff changeset
    79
hgs
parents:
diff changeset
    80
        mLoader->load(":/docml/occ_add_wlan_02_03.docml", &ok);
39
hgs
parents: 31
diff changeset
    81
        Q_ASSERT(ok);
31
hgs
parents:
diff changeset
    82
39
hgs
parents: 31
diff changeset
    83
        loadDocmlSection(mWizard->mainWindow()->orientation());
31
hgs
parents:
diff changeset
    84
hgs
parents:
diff changeset
    85
        mWidget = qobject_cast<HbWidget*> (mLoader->findWidget(
hgs
parents:
diff changeset
    86
            "occ_add_wlan_02"));
39
hgs
parents: 31
diff changeset
    87
        Q_ASSERT(mWidget != NULL);
31
hgs
parents:
diff changeset
    88
hgs
parents:
diff changeset
    89
        mList = qobject_cast<HbRadioButtonList*> (mLoader->findWidget("list"));
39
hgs
parents: 31
diff changeset
    90
        Q_ASSERT(mList != NULL);
31
hgs
parents:
diff changeset
    91
hgs
parents:
diff changeset
    92
        mLabel = qobject_cast<HbLabel*> (mLoader->findWidget("dialog_6"));
39
hgs
parents: 31
diff changeset
    93
        Q_ASSERT(mLabel != NULL);
31
hgs
parents:
diff changeset
    94
hgs
parents:
diff changeset
    95
        // Connect document loading to main window orientation changes.
61
hgs
parents: 53
diff changeset
    96
        ok = connect(
hgs
parents: 53
diff changeset
    97
            mWizard->mainWindow(),
hgs
parents: 53
diff changeset
    98
            SIGNAL(orientationChanged(Qt::Orientation)),
hgs
parents: 53
diff changeset
    99
            this,
39
hgs
parents: 31
diff changeset
   100
            SLOT(loadDocmlSection(Qt::Orientation)));
hgs
parents: 31
diff changeset
   101
        Q_ASSERT(ok);
hgs
parents: 31
diff changeset
   102
        
31
hgs
parents:
diff changeset
   103
        // Connect a function to a radio button selection.
61
hgs
parents: 53
diff changeset
   104
        ok = connect(
hgs
parents: 53
diff changeset
   105
            mList,
hgs
parents: 53
diff changeset
   106
            SIGNAL(itemSelected(int)),
hgs
parents: 53
diff changeset
   107
            this,
39
hgs
parents: 31
diff changeset
   108
            SLOT(itemSelected()));
hgs
parents: 31
diff changeset
   109
        Q_ASSERT(ok);
31
hgs
parents:
diff changeset
   110
hgs
parents:
diff changeset
   111
        mLabel->setPlainText(hbTrId(
hgs
parents:
diff changeset
   112
            "txt_occ_dialog_select_network_mode_and_status"));
hgs
parents:
diff changeset
   113
    }
39
hgs
parents: 31
diff changeset
   114
    
61
hgs
parents: 53
diff changeset
   115
    QStringList items;    
39
hgs
parents: 31
diff changeset
   116
    populateRadioButtonList(items);
61
hgs
parents: 53
diff changeset
   117
hgs
parents: 53
diff changeset
   118
    // Do not override the list, if it didn't change, because setItems()
hgs
parents: 53
diff changeset
   119
    // clears the possible selected item.
hgs
parents: 53
diff changeset
   120
    if (items != mList->items()) {
hgs
parents: 53
diff changeset
   121
        mList->setItems(items);
hgs
parents: 53
diff changeset
   122
    }
39
hgs
parents: 31
diff changeset
   123
    
43
hgs
parents: 39
diff changeset
   124
    OstTraceFunctionExit0( WLANWIZARDPAGENETWORKMODE_INITIALIZEPAGE_EXIT );
31
hgs
parents:
diff changeset
   125
    return mWidget;
hgs
parents:
diff changeset
   126
}
hgs
parents:
diff changeset
   127
hgs
parents:
diff changeset
   128
/*!
39
hgs
parents: 31
diff changeset
   129
 * Evaluates the network mode selection and sets the configuration in
hgs
parents: 31
diff changeset
   130
 * the wlanwizard.
hgs
parents: 31
diff changeset
   131
 * @param [out] removeFromStack always returns false.
hgs
parents: 31
diff changeset
   132
 * @return WlanWizardPageSecurityMode page id.
31
hgs
parents:
diff changeset
   133
 */
hgs
parents:
diff changeset
   134
int WlanWizardPageNetworkMode::nextId(bool &removeFromStack) const
hgs
parents:
diff changeset
   135
{
43
hgs
parents: 39
diff changeset
   136
    OstTraceFunctionEntry0( WLANWIZARDPAGENETWORKMODE_NEXTID_ENTRY );
31
hgs
parents:
diff changeset
   137
    removeFromStack = false;
39
hgs
parents: 31
diff changeset
   138
    WlanNetworkSetting setting;
43
hgs
parents: 39
diff changeset
   139
    int index = mList->selected();
hgs
parents: 39
diff changeset
   140
    int nextPage = WlanWizardPageInternal::PageNetworkSecurity;
31
hgs
parents:
diff changeset
   141
    
43
hgs
parents: 39
diff changeset
   142
    if (mWpsSupported.at(index)) {
hgs
parents: 39
diff changeset
   143
        nextPage = WlanWizardPageInternal::PageWpsStart;
61
hgs
parents: 53
diff changeset
   144
    } else {
43
hgs
parents: 39
diff changeset
   145
        setting.mode = mNetworkModes.at(index);
hgs
parents: 39
diff changeset
   146
        setting.hidden = mIsHidden.at(index);
hgs
parents: 39
diff changeset
   147
        setting.wpsSupported = mWpsSupported.at(index);
hgs
parents: 39
diff changeset
   148
53
hgs
parents: 43
diff changeset
   149
        mWizard->setConfiguration(
hgs
parents: 43
diff changeset
   150
            WlanWizardPrivate::ConfNetworkMode,
43
hgs
parents: 39
diff changeset
   151
            setting.mode);
31
hgs
parents:
diff changeset
   152
53
hgs
parents: 43
diff changeset
   153
        mWizard->setConfiguration(
hgs
parents: 43
diff changeset
   154
            WlanWizardPrivate::ConfWlanScanSSID,
43
hgs
parents: 39
diff changeset
   155
            setting.hidden);
hgs
parents: 39
diff changeset
   156
        
53
hgs
parents: 43
diff changeset
   157
        mWizard->setConfiguration(
hgs
parents: 43
diff changeset
   158
            WlanWizardPrivate::ConfWpsSupported,
43
hgs
parents: 39
diff changeset
   159
            setting.wpsSupported);
hgs
parents: 39
diff changeset
   160
hgs
parents: 39
diff changeset
   161
        if (mWizard->configurationExists(WlanWizardPrivate::ConfAvailableNetworkOptions)) {
hgs
parents: 39
diff changeset
   162
            nextPage = selectNextPage(setting);
hgs
parents: 39
diff changeset
   163
        }
39
hgs
parents: 31
diff changeset
   164
    }
43
hgs
parents: 39
diff changeset
   165
    OstTraceFunctionExit0( WLANWIZARDPAGENETWORKMODE_NEXTID_EXIT );
hgs
parents: 39
diff changeset
   166
    return nextPage;
31
hgs
parents:
diff changeset
   167
}
hgs
parents:
diff changeset
   168
hgs
parents:
diff changeset
   169
/*!
39
hgs
parents: 31
diff changeset
   170
 * This method is overrides the default implementation from WlanWizardPage.
61
hgs
parents: 53
diff changeset
   171
 * @return Should the Next-button be enabled or not.
31
hgs
parents:
diff changeset
   172
 */
hgs
parents:
diff changeset
   173
bool WlanWizardPageNetworkMode::showPage()
hgs
parents:
diff changeset
   174
{
43
hgs
parents: 39
diff changeset
   175
    OstTraceFunctionEntry0( WLANWIZARDPAGENETWORKMODE_SHOWPAGE_ENTRY );
hgs
parents: 39
diff changeset
   176
    OstTraceFunctionExit0( WLANWIZARDPAGENETWORKMODE_SHOWPAGE_EXIT );
61
hgs
parents: 53
diff changeset
   177
    // Next-button is enabled whenever the radio button list has some value
hgs
parents: 53
diff changeset
   178
    // selected.
hgs
parents: 53
diff changeset
   179
    return mList->selected() != -1;
31
hgs
parents:
diff changeset
   180
}
hgs
parents:
diff changeset
   181
hgs
parents:
diff changeset
   182
/*!
39
hgs
parents: 31
diff changeset
   183
 * This function is invoked when user selects a mode from the radio button list.
hgs
parents: 31
diff changeset
   184
 * (HbRadioButtonList's itemSelected-signal)
31
hgs
parents:
diff changeset
   185
 */
39
hgs
parents: 31
diff changeset
   186
void WlanWizardPageNetworkMode::itemSelected()
31
hgs
parents:
diff changeset
   187
{
43
hgs
parents: 39
diff changeset
   188
    OstTraceFunctionEntry0( WLANWIZARDPAGENETWORKMODE_ITEMSELECTED_ENTRY );
31
hgs
parents:
diff changeset
   189
    OstTrace0( TRACE_BORDER, WLANWIZARDPAGENETWORKMODE_ITEMSELECTED,
hgs
parents:
diff changeset
   190
        "WlanWizardPageNetworkMode::itemSelected" );
hgs
parents:
diff changeset
   191
61
hgs
parents: 53
diff changeset
   192
    mWizard->enableNextButton(true);
43
hgs
parents: 39
diff changeset
   193
    OstTraceFunctionExit0( WLANWIZARDPAGENETWORKMODE_ITEMSELECTED_EXIT );
31
hgs
parents:
diff changeset
   194
}
hgs
parents:
diff changeset
   195
hgs
parents:
diff changeset
   196
/*!
39
hgs
parents: 31
diff changeset
   197
 * Loads the document orientation information from occ_add_wlan_02_03.docml.
hgs
parents: 31
diff changeset
   198
 * This is called each time phone orientation changes.
hgs
parents: 31
diff changeset
   199
 * @param [in] orientation indicates whether the phone is in portrait or
hgs
parents: 31
diff changeset
   200
 * landscape mode.
31
hgs
parents:
diff changeset
   201
 */
39
hgs
parents: 31
diff changeset
   202
void WlanWizardPageNetworkMode::loadDocmlSection(Qt::Orientation orientation)
31
hgs
parents:
diff changeset
   203
{
43
hgs
parents: 39
diff changeset
   204
    OstTraceFunctionEntry0( WLANWIZARDPAGENETWORKMODE_LOADDOCMLSECTION_ENTRY );
31
hgs
parents:
diff changeset
   205
    OstTrace1( TRACE_NORMAL, WLANWIZARDPAGENETWORKMODE_LOADDOCML,
hgs
parents:
diff changeset
   206
        "WlanWizardPageNetworkMode::loadDocml - Orientation;orientation=%x",
hgs
parents:
diff changeset
   207
        ( TUint )( orientation ) );
hgs
parents:
diff changeset
   208
39
hgs
parents: 31
diff changeset
   209
    WlanWizardPageInternal::loadDocmlSection(
hgs
parents: 31
diff changeset
   210
        mLoader,
hgs
parents: 31
diff changeset
   211
        orientation,
hgs
parents: 31
diff changeset
   212
        ":/docml/occ_add_wlan_02_03.docml", 
hgs
parents: 31
diff changeset
   213
        "portrait_section",
hgs
parents: 31
diff changeset
   214
        "landscape_section");
43
hgs
parents: 39
diff changeset
   215
    OstTraceFunctionExit0( WLANWIZARDPAGENETWORKMODE_LOADDOCMLSECTION_EXIT );
39
hgs
parents: 31
diff changeset
   216
}
hgs
parents: 31
diff changeset
   217
hgs
parents: 31
diff changeset
   218
/*!
hgs
parents: 31
diff changeset
   219
 * A support function to map the radio button list to a generic network
hgs
parents: 31
diff changeset
   220
 * mode list. This enables the changing of button order without it
hgs
parents: 31
diff changeset
   221
 * affecting the entire class.
hgs
parents: 31
diff changeset
   222
 * In case previous scan has revealed multiple results with the same ssid, only
hgs
parents: 31
diff changeset
   223
 * available network mode options are shown in the radio button list.
hgs
parents: 31
diff changeset
   224
 * @param [out] list is the list of captions used for the radio buttons.
hgs
parents: 31
diff changeset
   225
 * @param [in] item is the caption to be added.
hgs
parents: 31
diff changeset
   226
 * @param [in] mode is the network mode to be added.
hgs
parents: 31
diff changeset
   227
 * @param [in] isHidden is the visibility status of the network.
43
hgs
parents: 39
diff changeset
   228
 * @param [in] wpsSupported is the possibility for wps support.
39
hgs
parents: 31
diff changeset
   229
 */
43
hgs
parents: 39
diff changeset
   230
void WlanWizardPageNetworkMode::addToList(
hgs
parents: 39
diff changeset
   231
    QStringList &list,
hgs
parents: 39
diff changeset
   232
    const QString &item,
hgs
parents: 39
diff changeset
   233
    int mode,
hgs
parents: 39
diff changeset
   234
    bool isHidden,
hgs
parents: 39
diff changeset
   235
    bool wpsSupported)
39
hgs
parents: 31
diff changeset
   236
{
43
hgs
parents: 39
diff changeset
   237
    OstTraceFunctionEntry0( WLANWIZARDPAGENETWORKMODE_ADDTOLIST_ENTRY );
39
hgs
parents: 31
diff changeset
   238
        
hgs
parents: 31
diff changeset
   239
    if (mWizard->configurationExists(WlanWizardHelper::ConfAvailableNetworkOptions)) {
hgs
parents: 31
diff changeset
   240
        WlanWizardScanList networkOptions = mWizard->configuration(
hgs
parents: 31
diff changeset
   241
            WlanWizardHelper::ConfAvailableNetworkOptions).value<WlanWizardScanList> ();
hgs
parents: 31
diff changeset
   242
hgs
parents: 31
diff changeset
   243
        QList<WlanNetworkSetting> modes = networkOptions.getNetModes();
hgs
parents: 31
diff changeset
   244
hgs
parents: 31
diff changeset
   245
        for (int i = 0; i < modes.size(); i++) {
43
hgs
parents: 39
diff changeset
   246
            if ( (modes[i].mode == mode 
hgs
parents: 39
diff changeset
   247
                && modes[i].hidden == isHidden
hgs
parents: 39
diff changeset
   248
                && modes[i].wpsSupported == wpsSupported)
hgs
parents: 39
diff changeset
   249
                || (modes[i].wpsSupported && wpsSupported) ) {
39
hgs
parents: 31
diff changeset
   250
                list << item;
hgs
parents: 31
diff changeset
   251
                mNetworkModes.append(mode);
hgs
parents: 31
diff changeset
   252
                mIsHidden.append(isHidden);
43
hgs
parents: 39
diff changeset
   253
                mWpsSupported.append(wpsSupported);
39
hgs
parents: 31
diff changeset
   254
            }
hgs
parents: 31
diff changeset
   255
        }
61
hgs
parents: 53
diff changeset
   256
    } else { 
39
hgs
parents: 31
diff changeset
   257
        list << item;
hgs
parents: 31
diff changeset
   258
        mNetworkModes.append(mode);
hgs
parents: 31
diff changeset
   259
        mIsHidden.append(isHidden);
43
hgs
parents: 39
diff changeset
   260
        // If there are no known network options, WPS is not allowed to be
hgs
parents: 39
diff changeset
   261
        // selected.
hgs
parents: 39
diff changeset
   262
        mWpsSupported.append(false);
31
hgs
parents:
diff changeset
   263
    }
43
hgs
parents: 39
diff changeset
   264
    OstTraceFunctionExit0( WLANWIZARDPAGENETWORKMODE_ADDTOLIST_EXIT );
31
hgs
parents:
diff changeset
   265
}
hgs
parents:
diff changeset
   266
hgs
parents:
diff changeset
   267
/*!
39
hgs
parents: 31
diff changeset
   268
 * This function checks the sets up the radio button list for user input.
hgs
parents: 31
diff changeset
   269
 * @param [out] list is the list of captions used for the radio buttons.
31
hgs
parents:
diff changeset
   270
 */
39
hgs
parents: 31
diff changeset
   271
void WlanWizardPageNetworkMode::populateRadioButtonList(QStringList &list)
31
hgs
parents:
diff changeset
   272
{
43
hgs
parents: 39
diff changeset
   273
    OstTraceFunctionEntry0( WLANWIZARDPAGENETWORKMODE_POPULATERADIOBUTTONLIST_ENTRY );
39
hgs
parents: 31
diff changeset
   274
    list.clear();
hgs
parents: 31
diff changeset
   275
    mNetworkModes.clear();
hgs
parents: 31
diff changeset
   276
    mIsHidden.clear();
43
hgs
parents: 39
diff changeset
   277
    mWpsSupported.clear();
39
hgs
parents: 31
diff changeset
   278
61
hgs
parents: 53
diff changeset
   279
    addToList(
hgs
parents: 53
diff changeset
   280
        list,
hgs
parents: 53
diff changeset
   281
        hbTrId("txt_occ_dblist_val_infrastructure_public"),
hgs
parents: 53
diff changeset
   282
        CMManagerShim::Infra,
hgs
parents: 53
diff changeset
   283
        false,
hgs
parents: 53
diff changeset
   284
        false);
39
hgs
parents: 31
diff changeset
   285
61
hgs
parents: 53
diff changeset
   286
    addToList(
hgs
parents: 53
diff changeset
   287
        list,
hgs
parents: 53
diff changeset
   288
        hbTrId("txt_occ_list_infrastructure_hidden"),
hgs
parents: 53
diff changeset
   289
        CMManagerShim::Infra,
hgs
parents: 53
diff changeset
   290
        true,
hgs
parents: 53
diff changeset
   291
        false);
39
hgs
parents: 31
diff changeset
   292
61
hgs
parents: 53
diff changeset
   293
    addToList(
hgs
parents: 53
diff changeset
   294
        list,
hgs
parents: 53
diff changeset
   295
        hbTrId("txt_occ_list_adhoc_1"),
hgs
parents: 53
diff changeset
   296
        CMManagerShim::Adhoc,
hgs
parents: 53
diff changeset
   297
        false,
hgs
parents: 53
diff changeset
   298
        false);
43
hgs
parents: 39
diff changeset
   299
    
hgs
parents: 39
diff changeset
   300
    if (mWizard->configurationExists(WlanWizardHelper::ConfAvailableNetworkOptions)) {
hgs
parents: 39
diff changeset
   301
        // addToList with wpsSupported=true is only called, when there are available
hgs
parents: 39
diff changeset
   302
        // scan result options. If no network options exist, the user can not get to
hgs
parents: 39
diff changeset
   303
        // wps wizard from this view. Also, mode and isHidden are "don't care".
hgs
parents: 39
diff changeset
   304
        addToList(list, hbTrId("txt_occ_list_wifi_protected_setup"), NetworkModeNone, false, true);
hgs
parents: 39
diff changeset
   305
    }
hgs
parents: 39
diff changeset
   306
    OstTraceFunctionExit0( WLANWIZARDPAGENETWORKMODE_POPULATERADIOBUTTONLIST_EXIT );
31
hgs
parents:
diff changeset
   307
}
hgs
parents:
diff changeset
   308
39
hgs
parents: 31
diff changeset
   309
/*!
hgs
parents: 31
diff changeset
   310
 * This function selects the next page. Security mode may be skipped in case
hgs
parents: 31
diff changeset
   311
 * scan results exist and only single option remains.
hgs
parents: 31
diff changeset
   312
 * @param [in] setting indicates the selected network mode.
hgs
parents: 31
diff changeset
   313
 * @return Security mode query page identifier unless it can be skipped.
hgs
parents: 31
diff changeset
   314
 */
hgs
parents: 31
diff changeset
   315
int WlanWizardPageNetworkMode::selectNextPage(const WlanNetworkSetting &setting) const
hgs
parents: 31
diff changeset
   316
{
43
hgs
parents: 39
diff changeset
   317
    OstTraceFunctionEntry0( WLANWIZARDPAGENETWORKMODE_SELECTNEXTPAGE_ENTRY );
hgs
parents: 39
diff changeset
   318
    
hgs
parents: 39
diff changeset
   319
    int nextPage = WlanWizardPageInternal::PageNetworkSecurity;
hgs
parents: 39
diff changeset
   320
    
39
hgs
parents: 31
diff changeset
   321
    WlanWizardScanList networkOptions = mWizard->configuration(
hgs
parents: 31
diff changeset
   322
        WlanWizardHelper::ConfAvailableNetworkOptions).value<WlanWizardScanList>();
43
hgs
parents: 39
diff changeset
   323
39
hgs
parents: 31
diff changeset
   324
    if (networkOptions.secModes(setting) == SingleResult) {
hgs
parents: 31
diff changeset
   325
        WlanSecuritySetting secMode = networkOptions.getSecMode(setting);
hgs
parents: 31
diff changeset
   326
        mWizard->setConfiguration(WlanWizardHelper::ConfSecurityMode, secMode.mode);
hgs
parents: 31
diff changeset
   327
        mWizard->setConfiguration(WlanWizardHelper::ConfUsePsk, secMode.usePsk);
43
hgs
parents: 39
diff changeset
   328
        nextPage = secMode.nextPageId;
39
hgs
parents: 31
diff changeset
   329
    }
hgs
parents: 31
diff changeset
   330
    
43
hgs
parents: 39
diff changeset
   331
    OstTraceFunctionExit0( DUP1_WLANWIZARDPAGENETWORKMODE_SELECTNEXTPAGE_EXIT );
hgs
parents: 39
diff changeset
   332
    return nextPage;
39
hgs
parents: 31
diff changeset
   333
}