46
|
1 |
/*
|
|
2 |
* Copyright (c) 2001-2009 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 the License "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: Implementation of class CWiFiProtSelectNetworkDlg.
|
|
15 |
*
|
|
16 |
*/
|
|
17 |
|
|
18 |
/*
|
|
19 |
* %version: tr1cfwln#9 %
|
|
20 |
*/
|
|
21 |
|
|
22 |
// INCLUDE FILES
|
|
23 |
//system includes
|
|
24 |
#include <uikon/eiksrvui.h>
|
|
25 |
#include <StringLoader.h>
|
|
26 |
#include <wifiprotplugin.rsg>
|
|
27 |
#include <badesca.h>
|
|
28 |
|
|
29 |
//user includes
|
|
30 |
#include "wifiprotselectnetworkdlg.h"
|
|
31 |
#include "wifiprotdlgsplugin.h"
|
|
32 |
#include "wifiprotplugin.hrh"
|
|
33 |
// ========================== MEMBER FUNCTIONS ==============================
|
|
34 |
//
|
|
35 |
// --------------------------------------------------------------------------
|
|
36 |
// CWiFiProtSelectNetworkDlg::CWiFiProtSelectNetworkDlg
|
|
37 |
// --------------------------------------------------------------------------
|
|
38 |
//
|
|
39 |
CWiFiProtSelectNetworkDlg::CWiFiProtSelectNetworkDlg(
|
|
40 |
TRequestStatus& aStatus ,
|
|
41 |
TInt& aSelected ,
|
|
42 |
CDesCArrayFlat* aItems,
|
|
43 |
CArrayPtr<CGulIcon>* aIcons ):
|
|
44 |
CAknListQueryDialog( &aSelected ),
|
|
45 |
iRequestStatus( aStatus ),
|
|
46 |
iSelected( aSelected ),
|
|
47 |
iIcons( aIcons ),
|
|
48 |
iItems( aItems )
|
|
49 |
{
|
|
50 |
iRequestStatus = KRequestPending;
|
|
51 |
}
|
|
52 |
|
|
53 |
|
|
54 |
// --------------------------------------------------------------------------
|
|
55 |
// CWiFiProtSelectNetworkDlg::~CWiFiProtSelectNetworkDlg
|
|
56 |
// --------------------------------------------------------------------------
|
|
57 |
//
|
|
58 |
CWiFiProtSelectNetworkDlg::~CWiFiProtSelectNetworkDlg()
|
|
59 |
{
|
|
60 |
|
|
61 |
STATIC_CAST( CEikServAppUi*,
|
|
62 |
CCoeEnv::Static()->AppUi() )->SuppressAppSwitching( EFalse );
|
|
63 |
delete iIcons;
|
|
64 |
delete iItems;
|
|
65 |
}
|
|
66 |
|
|
67 |
// --------------------------------------------------------------------------
|
|
68 |
// void CSelectDestinationDlg::PrepareAndRunLD
|
|
69 |
// --------------------------------------------------------------------------
|
|
70 |
//
|
|
71 |
void CWiFiProtSelectNetworkDlg::PrepareAndRunLD()
|
|
72 |
{
|
|
73 |
PrepareLC(R_CONN_LIST_QUERY);
|
|
74 |
// Set the description field on the query
|
|
75 |
HBufC* desc = StringLoader::LoadLC(
|
|
76 |
R_QTN_NETW_CONSET_WPS_DETAIL_SELECT_NETWORK );
|
|
77 |
//ownership transferred
|
|
78 |
SetItemTextArray( iItems );
|
|
79 |
iItems = NULL;
|
|
80 |
//ownership transferred
|
|
81 |
SetIconArrayL( iIcons );
|
|
82 |
iIcons = NULL;
|
|
83 |
|
|
84 |
MessageBox()->SetMessageTextL( desc );
|
|
85 |
CleanupStack::PopAndDestroy( desc );
|
|
86 |
RunLD();
|
|
87 |
}
|
|
88 |
|
|
89 |
|
|
90 |
// --------------------------------------------------------------------------
|
|
91 |
// CWiFiProtSelectNetworkDlg::OkToExitL
|
|
92 |
// --------------------------------------------------------------------------
|
|
93 |
//
|
|
94 |
TBool CWiFiProtSelectNetworkDlg::OkToExitL( TInt aButtonId )
|
|
95 |
{
|
|
96 |
TInt status = KErrCancel;
|
|
97 |
if ( aButtonId == EAknSoftkeyOk
|
|
98 |
|| aButtonId == EAknSoftkeyYes
|
|
99 |
|| aButtonId == EAknSoftkeyDone
|
|
100 |
|| aButtonId == EAknSoftkeySelect )
|
|
101 |
{
|
|
102 |
// This should be done automatically
|
|
103 |
// I have no idea why iSelected isn't updated
|
|
104 |
iSelected = ListBox()->CurrentItemIndex();
|
|
105 |
status = KErrNone;
|
|
106 |
}
|
|
107 |
TRequestStatus* pS = &iRequestStatus;
|
|
108 |
User::RequestComplete( pS, status );
|
|
109 |
|
|
110 |
return ETrue;
|
|
111 |
}
|
|
112 |
|
|
113 |
// --------------------------------------------------------------------------
|
|
114 |
// CWiFiProtSelectNetworkDlg::PreLayoutDynInitL()
|
|
115 |
// --------------------------------------------------------------------------
|
|
116 |
//
|
|
117 |
void CWiFiProtSelectNetworkDlg::PreLayoutDynInitL()
|
|
118 |
{
|
|
119 |
CAknListQueryDialog::PreLayoutDynInitL();
|
|
120 |
STATIC_CAST( CEikServAppUi*,
|
|
121 |
CCoeEnv::Static()->AppUi() )->SuppressAppSwitching( ETrue );
|
|
122 |
|
|
123 |
}
|
|
124 |
|
|
125 |
// --------------------------------------------------------------------------
|
|
126 |
// void CSelectDestinationDlg::HandleResourceChange
|
|
127 |
// --------------------------------------------------------------------------
|
|
128 |
//
|
|
129 |
void CWiFiProtSelectNetworkDlg::HandleResourceChange( TInt aType )
|
|
130 |
{
|
|
131 |
if ( aType == KAknsMessageSkinChange )
|
|
132 |
{
|
|
133 |
CAknListQueryDialog::HandleResourceChange( aType );
|
|
134 |
|
|
135 |
TRAP_IGNORE( SetIconArrayL( iIcons ) );
|
|
136 |
|
|
137 |
SizeChanged();
|
|
138 |
}
|
|
139 |
else
|
|
140 |
{
|
|
141 |
if ( aType == KEikDynamicLayoutVariantSwitch )
|
|
142 |
{
|
|
143 |
TRect mainPaneRect;
|
|
144 |
AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EMainPane,
|
|
145 |
mainPaneRect );
|
|
146 |
|
|
147 |
TAknLayoutRect layoutRect;
|
|
148 |
layoutRect.LayoutRect( TRect( TPoint( 0, 0 ),
|
|
149 |
mainPaneRect.Size() ),
|
|
150 |
AKN_LAYOUT_WINDOW_list_gen_pane( 0 ) );
|
|
151 |
|
|
152 |
ListBox()->SetRect( layoutRect.Rect() );
|
|
153 |
}
|
|
154 |
|
|
155 |
// Base call
|
|
156 |
CAknListQueryDialog::HandleResourceChange( aType );
|
|
157 |
}
|
|
158 |
}
|
|
159 |
// End of File
|