author | Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> |
Mon, 04 Oct 2010 00:16:48 +0300 | |
changeset 77 | 2be0b271d017 |
parent 72 | c76a0b1755b9 |
child 76 | cfea66083b62 |
permissions | -rw-r--r-- |
37 | 1 |
/* |
2 |
* Copyright (c) 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 "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 |
* |
|
16 |
*/ |
|
17 |
#include <hbdataform.h> |
|
18 |
#include <hbdataformmodel.h> |
|
19 |
#include <hbdataformmodelitem.h> |
|
20 |
#include <hbdataformviewitem.h> |
|
21 |
#include <hbdialog.h> |
|
22 |
#include <hbaction.h> |
|
23 |
#include <hblistwidget.h> |
|
24 |
#include <hblistwidgetitem.h> |
|
25 |
#include <hblabel.h> |
|
26 |
#include <cpsettingformitemdata.h> |
|
27 |
#include <psetwrapper.h> |
|
56
5bcb308bd24d
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
46
diff
changeset
|
28 |
#include <psuinotes.h> |
37 | 29 |
|
30 |
#include "cpnetworkpluginform.h" |
|
31 |
#include "cpplugincommon.h" |
|
32 |
#include "cppluginlogging.h" |
|
33 |
#include "cellulardatasettings.h" |
|
34 |
||
35 |
/*! |
|
36 |
CpNetworkPluginForm::CpNetworkPluginForm |
|
37 |
*/ |
|
38 |
CpNetworkPluginForm::CpNetworkPluginForm(QGraphicsItem *parent) : |
|
39 |
HbDataForm(parent), |
|
40 |
m_activeNoteId(0), |
|
41 |
m_activeProgressNoteId(0), |
|
42 |
m_pSetWrapper(NULL), |
|
43 |
m_cpSettingsWrapper(NULL), |
|
44 |
mCellularSettings(), |
|
64
6aaf0276100e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
45 |
m_dialog(NULL), |
6aaf0276100e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
46 |
m_NetworkOperatorSelectionItemData(NULL) |
37 | 47 |
{ |
48 |
DPRINT << ": IN"; |
|
49 |
||
50 |
setHeading(hbTrId("txt_cp_subhead_mobile_network")); |
|
51 |
||
52 |
QScopedPointer<PSetWrapper> pSetWrapperGuard(new PSetWrapper); |
|
53 |
m_psetNetworkWrapper = &pSetWrapperGuard->networkWrapper(); |
|
54 |
mCellularSettings = QSharedPointer<CellularDataSettings>(new CellularDataSettings); |
|
64
6aaf0276100e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
55 |
|
37 | 56 |
QScopedPointer<HbDataFormModel> model(new HbDataFormModel); |
57 |
QScopedPointer<CpSettingsWrapper> cpSettingsWrapperGuard(new CpSettingsWrapper); |
|
58 |
||
59 |
// #1 Read Network mode value from Cenrep |
|
60 |
model->appendDataFormItem(createNetworkModeItem()); |
|
46
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
61 |
if(m_psetNetworkWrapper->isManualNetworkSelectionSupported()) { |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
62 |
// #2 Use phone settings for operator selection |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
63 |
model->appendDataFormItem(createOperatorSelectionItem()); |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
64 |
} |
37 | 65 |
// Home network cellular data usage |
66 |
model->appendDataFormItem(createHomeDataUsageItem()); |
|
67 |
// Cellular network data usage when roaming |
|
68 |
model->appendDataFormItem(createRoamDataUsageItem()); |
|
69 |
setModel(model.take()); |
|
70 |
m_pSetWrapper = pSetWrapperGuard.take(); |
|
71 |
m_cpSettingsWrapper = cpSettingsWrapperGuard.take(); |
|
64
6aaf0276100e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
72 |
|
6aaf0276100e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
73 |
connectToNetworkWrapper(*m_psetNetworkWrapper); |
6aaf0276100e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
74 |
connectToPhoneNotes(*PsUiNotes::instance()); |
37 | 75 |
|
76 |
DPRINT << ": OUT"; |
|
77 |
} |
|
78 |
||
79 |
||
80 |
/*! |
|
81 |
CpNetworkPluginForm::~CpNetworkPluginForm |
|
82 |
*/ |
|
83 |
CpNetworkPluginForm::~CpNetworkPluginForm() |
|
84 |
{ |
|
46
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
85 |
DPRINT; |
37 | 86 |
delete m_pSetWrapper; |
87 |
delete m_cpSettingsWrapper; |
|
88 |
} |
|
89 |
||
90 |
||
91 |
/*! |
|
92 |
CpNetworkPluginForm::createNetworkModeItem |
|
93 |
*/ |
|
94 |
HbDataFormModelItem *CpNetworkPluginForm::createNetworkModeItem() |
|
95 |
{ |
|
96 |
// #1A Read network mode value from Cenrep |
|
97 |
DPRINT << ": IN"; |
|
98 |
||
99 |
m_NetworkModeOptionsItemData = new CpSettingFormItemData( |
|
100 |
HbDataFormModelItem::ComboBoxItem, |
|
101 |
hbTrId("txt_cp_setlabel_network_mode"), |
|
102 |
NULL ); |
|
103 |
QScopedPointer<CpSettingFormItemData> settingFormItemGuard( |
|
104 |
m_NetworkModeOptionsItemData); |
|
46
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
105 |
m_NetworkModeOptionsItemData->setObjectName("networkModeItem"); |
37 | 106 |
|
107 |
mNetworkModeOptions << hbTrId("txt_cp_setlabel_network_mode_val_dual_mode") |
|
108 |
<< hbTrId("txt_cp_setlabel_network_mode_val_umts") |
|
109 |
<< hbTrId("txt_cp_setlabel_network_mode_val_gsm"); |
|
110 |
m_NetworkModeOptionsItemData->setContentWidgetData( |
|
111 |
"items", QVariant(mNetworkModeOptions)); |
|
112 |
||
113 |
QObject::connect( |
|
114 |
m_psetNetworkWrapper, |
|
115 |
SIGNAL(networkAccessModeGot(int)), |
|
116 |
this, |
|
117 |
SLOT(networkAccessModeGot(int))); |
|
118 |
QObject::connect( |
|
119 |
m_psetNetworkWrapper, |
|
120 |
SIGNAL(availableNetworksGot(QList<PSetNetworkWrapper::NetworkInfo*> &)), |
|
121 |
this, |
|
122 |
SLOT(availableNetworksGot(QList<PSetNetworkWrapper::NetworkInfo*> &))); |
|
123 |
||
124 |
m_psetNetworkWrapper->getNetworkAccessMode(); |
|
125 |
||
126 |
addConnection( |
|
127 |
m_NetworkModeOptionsItemData, |
|
128 |
SIGNAL(currentIndexChanged(int)), |
|
129 |
this, |
|
130 |
SLOT(networkModeStateChanged(int))); |
|
131 |
||
132 |
settingFormItemGuard.take(); |
|
133 |
DPRINT << ": OUT"; |
|
134 |
return m_NetworkModeOptionsItemData; |
|
135 |
} |
|
136 |
||
137 |
||
138 |
/*! |
|
139 |
CpNetworkPluginForm::createOperatorSelectionItem |
|
140 |
*/ |
|
141 |
HbDataFormModelItem *CpNetworkPluginForm::createOperatorSelectionItem() |
|
142 |
{ |
|
143 |
// #2A Use phone settings for operator selection |
|
144 |
DPRINT << ": IN"; |
|
145 |
||
146 |
m_NetworkOperatorSelectionItemData = new CpSettingFormItemData( |
|
147 |
HbDataFormModelItem::ToggleValueItem, |
|
148 |
hbTrId("txt_cp_setlabel_operator_selection"), |
|
149 |
NULL); |
|
150 |
QScopedPointer<CpSettingFormItemData> settingFormItemGuard( |
|
151 |
m_NetworkOperatorSelectionItemData); |
|
46
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
152 |
m_NetworkOperatorSelectionItemData->setObjectName("operatorSelectionItem"); |
37 | 153 |
|
154 |
PSetNetworkWrapper::NetworkSelectionMode mode; |
|
155 |
PSetNetworkWrapper::ErrorCode err = |
|
156 |
m_psetNetworkWrapper->getNetworkSelectionMode(mode); |
|
157 |
if(err == PSetNetworkWrapper::ErrNoError) { |
|
158 |
switch (mode) { |
|
159 |
case PSetNetworkWrapper::SelectionModeAutomatic: |
|
160 |
m_NetworkOperatorSelectionItemData->setContentWidgetData( |
|
161 |
"text", QVariant(hbTrId("txt_cp_setlabel_operator_selection_val_automatic"))); |
|
162 |
break; |
|
163 |
case PSetNetworkWrapper::SelectionModeManual: |
|
164 |
m_NetworkOperatorSelectionItemData->setContentWidgetData( |
|
165 |
"text", QVariant(hbTrId("txt_cp_setlabel_operator_selection_val_manual"))); |
|
166 |
break; |
|
167 |
default: |
|
168 |
break; |
|
169 |
} |
|
170 |
} |
|
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
171 |
|
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
172 |
addConnection( |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
173 |
m_NetworkOperatorSelectionItemData, SIGNAL(valueChanged(QPersistentModelIndex, QVariant)), |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
174 |
this, SLOT(operatorSelectionStateChanged())); |
37 | 175 |
|
176 |
settingFormItemGuard.take(); |
|
177 |
DPRINT << ": OUT"; |
|
178 |
return m_NetworkOperatorSelectionItemData; |
|
179 |
} |
|
180 |
||
181 |
/*! |
|
182 |
CpNetworkPluginForm::createHomeDataUsageItem |
|
183 |
*/ |
|
184 |
HbDataFormModelItem *CpNetworkPluginForm::createHomeDataUsageItem() |
|
185 |
{ |
|
186 |
DPRINT << ": IN"; |
|
187 |
||
188 |
mCellularUseHomeSelectionItemData = new CpSettingFormItemData( |
|
189 |
HbDataFormModelItem::ComboBoxItem, |
|
190 |
hbTrId("txt_cp_setlabel_data_usage_in_home_network"), |
|
191 |
NULL); |
|
192 |
QScopedPointer<CpSettingFormItemData> settingFormItemGuard( |
|
193 |
mCellularUseHomeSelectionItemData); |
|
46
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
194 |
mCellularUseHomeSelectionItemData->setObjectName("homeDataUsageItem"); |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
195 |
|
37 | 196 |
// Populate the dropdown with selection items |
197 |
mCellularUseHomeOptions |
|
198 |
<< hbTrId("txt_cp_setlabel_data_usage_in_val_automatic") |
|
199 |
<< hbTrId("txt_cp_setlabel_data_usage_in_val_confirm") |
|
200 |
<< hbTrId("txt_cp_setlabel_data_usage_in_val_disabled"); |
|
201 |
mCellularUseHomeSelectionItemData->setContentWidgetData( |
|
202 |
"items", |
|
203 |
QVariant(mCellularUseHomeOptions)); |
|
204 |
||
205 |
// Set initial selection based on current setting |
|
206 |
mCellularUseHomeSelectionItemData->setContentWidgetData( |
|
207 |
"currentIndex", |
|
208 |
mCellularSettings->dataUseHome()); // NOTE: Indexes must match! |
|
209 |
||
210 |
addConnection( |
|
211 |
mCellularUseHomeSelectionItemData, |
|
212 |
SIGNAL(currentIndexChanged(int)), |
|
213 |
this, |
|
214 |
SLOT(cellularDataUseHomeStateChanged(int))); |
|
215 |
||
216 |
settingFormItemGuard.take(); |
|
217 |
DPRINT << ": OUT"; |
|
218 |
return mCellularUseHomeSelectionItemData; |
|
219 |
} |
|
220 |
||
221 |
/*! |
|
222 |
CpNetworkPluginForm::cellularDataUseHomeStateChanged |
|
223 |
*/ |
|
224 |
void CpNetworkPluginForm::cellularDataUseHomeStateChanged(int index) |
|
225 |
{ |
|
226 |
DPRINT << ": IN : index: " << index; |
|
227 |
mCellularSettings->setDataUseHome(index); |
|
228 |
DPRINT << ": OUT"; |
|
229 |
} |
|
230 |
||
231 |
/*! |
|
232 |
CpNetworkPluginForm::createRoamDataUsageItem |
|
233 |
*/ |
|
234 |
HbDataFormModelItem *CpNetworkPluginForm::createRoamDataUsageItem() |
|
235 |
{ |
|
236 |
DPRINT << ": IN"; |
|
237 |
||
238 |
mCellularUseRoamSelectionItemData = new CpSettingFormItemData( |
|
239 |
HbDataFormModelItem::ComboBoxItem, |
|
240 |
hbTrId("txt_cp_setlabel_data_usage_when_roaming"), |
|
241 |
NULL); |
|
242 |
QScopedPointer<CpSettingFormItemData> settingFormItemGuard( |
|
243 |
mCellularUseRoamSelectionItemData); |
|
46
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
244 |
mCellularUseRoamSelectionItemData->setObjectName("roamDataUsageItem"); |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
245 |
|
37 | 246 |
// Populate the dropdown with selection items |
247 |
mCellularUseRoamOptions |
|
248 |
<< hbTrId("txt_cp_setlabel_data_usage_when_val_automatic") |
|
249 |
<< hbTrId("txt_cp_setlabel_data_usage_when_val_confirm") |
|
250 |
<< hbTrId("txt_cp_setlabel_data_usage_when_val_disabled"); |
|
251 |
mCellularUseRoamSelectionItemData->setContentWidgetData( |
|
252 |
"items", |
|
253 |
QVariant(mCellularUseRoamOptions)); |
|
254 |
||
255 |
// Set initial selection based on current setting |
|
256 |
mCellularUseRoamSelectionItemData->setContentWidgetData( |
|
257 |
"currentIndex", |
|
258 |
mCellularSettings->dataUseRoam()); // NOTE: Indexes must match! |
|
259 |
||
260 |
addConnection( |
|
261 |
mCellularUseRoamSelectionItemData, |
|
262 |
SIGNAL(currentIndexChanged(int)), |
|
263 |
this, |
|
264 |
SLOT(cellularDataUseRoamStateChanged(int))); |
|
265 |
||
266 |
settingFormItemGuard.take(); |
|
267 |
DPRINT << ": OUT"; |
|
268 |
return mCellularUseRoamSelectionItemData; |
|
269 |
} |
|
270 |
||
271 |
/*! |
|
272 |
CpNetworkPluginForm::cellularDataUseRoamStateChanged |
|
273 |
*/ |
|
274 |
void CpNetworkPluginForm::cellularDataUseRoamStateChanged(int index) |
|
275 |
{ |
|
276 |
DPRINT << ": IN : index: " << index; |
|
277 |
||
278 |
mCellularSettings->setDataUseRoam(index); |
|
279 |
||
280 |
DPRINT << ": OUT"; |
|
281 |
} |
|
282 |
||
283 |
/*! |
|
284 |
CpNetworkPluginForm::networkModeStateChanged |
|
285 |
*/ |
|
286 |
void CpNetworkPluginForm::networkModeStateChanged(int index) |
|
287 |
{ |
|
288 |
// #1C network mode changed |
|
289 |
DPRINT << ": IN : index: " << index; |
|
290 |
||
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
291 |
if(m_cpSettingsWrapper->isPhoneOffline()) { |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
292 |
// offline mode. |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
293 |
m_psetNetworkWrapper->getNetworkAccessMode(); |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
294 |
emit showGlobalNote( |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
295 |
m_activeNoteId, |
77
2be0b271d017
Revision: 201037
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
72
diff
changeset
|
296 |
emit hbTrId("txt_phone_info_offline_not_allowed"), |
72
c76a0b1755b9
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
64
diff
changeset
|
297 |
HbMessageBox::MessageTypeWarning); |
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
298 |
} else if(m_cpSettingsWrapper->isOngoingCall()) { |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
299 |
// ongoing call. |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
300 |
m_psetNetworkWrapper->getNetworkAccessMode(); |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
301 |
emit showGlobalNote( |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
302 |
m_activeNoteId, |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
303 |
emit hbTrId("txt_cp_info_active_calls_must_be_disconnected_befo"), |
72
c76a0b1755b9
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
64
diff
changeset
|
304 |
HbMessageBox::MessageTypeWarning); |
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
305 |
} else { |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
306 |
// ok case |
37 | 307 |
if(index == 0) { |
308 |
dualModeSelection(); |
|
309 |
} else if(index == 1) { |
|
310 |
umtsSelection(); |
|
311 |
} else if(index == 2) { |
|
312 |
gsmSelection(); |
|
313 |
} |
|
314 |
} |
|
315 |
||
316 |
DPRINT << ": OUT"; |
|
317 |
} |
|
318 |
||
319 |
||
320 |
/*! |
|
321 |
CpNetworkPluginForm::operatorSelectionStateChanged |
|
322 |
*/ |
|
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
323 |
void CpNetworkPluginForm::operatorSelectionStateChanged() |
37 | 324 |
{ |
325 |
// #2C operator selection mode changed |
|
326 |
DPRINT << ": IN "; |
|
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
327 |
|
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
328 |
if (m_cpSettingsWrapper->isPhoneOffline()) { |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
329 |
// off line |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
330 |
restoreOperatorSelectionUi(); |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
331 |
emit showGlobalNote( |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
332 |
m_activeNoteId, |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
333 |
emit hbTrId("txt_cp_info_operator_selection_is_not_possible_in"), |
72
c76a0b1755b9
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
64
diff
changeset
|
334 |
HbMessageBox::MessageTypeWarning); |
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
335 |
} else if(m_cpSettingsWrapper->isOngoingCall()) { |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
336 |
// ongoing call. |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
337 |
restoreOperatorSelectionUi(); |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
338 |
emit showGlobalNote( |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
339 |
m_activeNoteId, |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
340 |
emit hbTrId("txt_cp_info_active_calls_must_be_disconnected_befo"), |
72
c76a0b1755b9
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
64
diff
changeset
|
341 |
HbMessageBox::MessageTypeWarning); |
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
342 |
} else { |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
343 |
// ok case |
37 | 344 |
PSetNetworkWrapper::NetworkSelectionMode mode; |
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
345 |
PSetNetworkWrapper::ErrorCode err = |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
346 |
m_psetNetworkWrapper->getNetworkSelectionMode(mode); |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
347 |
|
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
348 |
if(err == PSetNetworkWrapper::ErrNoError) { |
37 | 349 |
switch (mode) { |
350 |
case PSetNetworkWrapper::SelectionModeAutomatic: |
|
351 |
manualOperatorSelection(); |
|
352 |
m_NetworkOperatorSelectionItemData->setContentWidgetData( |
|
353 |
"text", QVariant(hbTrId("txt_cp_setlabel_operator_selection_val_manual"))); |
|
354 |
break; |
|
355 |
case PSetNetworkWrapper::SelectionModeManual: |
|
356 |
automaticOperatorSelection(); |
|
357 |
m_NetworkOperatorSelectionItemData->setContentWidgetData( |
|
358 |
"text", QVariant(hbTrId("txt_cp_setlabel_operator_selection_val_automatic"))); |
|
359 |
break; |
|
360 |
default: |
|
361 |
break; |
|
362 |
} |
|
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
363 |
} else { |
46
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
364 |
DWARNING << ": err: " << err; |
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
365 |
} |
37 | 366 |
} |
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
367 |
|
37 | 368 |
DPRINT << ": OUT"; |
369 |
} |
|
370 |
||
371 |
||
372 |
/*! |
|
373 |
CpNetworkPluginForm::automaticOperatorSelection |
|
374 |
*/ |
|
375 |
void CpNetworkPluginForm::automaticOperatorSelection() |
|
376 |
{ |
|
377 |
DPRINT << ": IN"; |
|
378 |
||
379 |
PSetNetworkWrapper::NetworkInfo info; |
|
380 |
info.m_mode = PSetNetworkWrapper::SelectionModeAutomatic; |
|
381 |
m_psetNetworkWrapper->selectNetwork(info); |
|
382 |
||
383 |
DPRINT << ": OUT"; |
|
384 |
} |
|
385 |
||
386 |
||
387 |
/*! |
|
388 |
CpNetworkPluginForm::manualOperatorSelection |
|
389 |
*/ |
|
390 |
void CpNetworkPluginForm::manualOperatorSelection() |
|
391 |
{ |
|
392 |
DPRINT << ": IN"; |
|
393 |
||
394 |
m_psetNetworkWrapper->getAvailableNetworks(); |
|
395 |
||
396 |
DPRINT << ": OUT"; |
|
397 |
} |
|
398 |
||
399 |
||
400 |
/*! |
|
401 |
CpNetworkPluginForm::dualModeSelection |
|
402 |
*/ |
|
403 |
void CpNetworkPluginForm::dualModeSelection() |
|
404 |
{ |
|
405 |
DPRINT << ": IN"; |
|
406 |
||
407 |
m_psetNetworkWrapper->setNetworkAccessMode( |
|
408 |
PSetNetworkWrapper::AccessModeDual); |
|
409 |
||
410 |
DPRINT << ": OUT"; |
|
411 |
} |
|
412 |
||
413 |
||
414 |
/*! |
|
415 |
CpNetworkPluginForm::umtsSelection |
|
416 |
*/ |
|
417 |
void CpNetworkPluginForm::umtsSelection() |
|
418 |
{ |
|
419 |
DPRINT << ": IN"; |
|
420 |
||
421 |
m_psetNetworkWrapper->setNetworkAccessMode( |
|
422 |
PSetNetworkWrapper::AccessModeUmts); |
|
423 |
||
424 |
DPRINT << ": OUT"; |
|
425 |
} |
|
426 |
||
427 |
||
428 |
/*! |
|
429 |
CpNetworkPluginForm::gsmSelection |
|
430 |
*/ |
|
431 |
void CpNetworkPluginForm::gsmSelection() |
|
432 |
{ |
|
433 |
DPRINT << ": IN"; |
|
434 |
||
435 |
m_psetNetworkWrapper->setNetworkAccessMode( |
|
436 |
PSetNetworkWrapper::AccessModeGsm); |
|
437 |
||
438 |
DPRINT << ": OUT"; |
|
439 |
} |
|
440 |
||
441 |
||
442 |
/*! |
|
443 |
CpNetworkPluginForm::networkAccessModeGot |
|
444 |
*/ |
|
445 |
void CpNetworkPluginForm::networkAccessModeGot( |
|
446 |
int mode) |
|
447 |
{ |
|
448 |
DPRINT << ": IN"; |
|
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
449 |
removeConnection( |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
450 |
m_NetworkModeOptionsItemData, |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
451 |
SIGNAL(currentIndexChanged(int)), |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
452 |
this, |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
453 |
SLOT(networkModeStateChanged(int))); |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
454 |
|
37 | 455 |
switch (mode) { |
456 |
case PSetNetworkWrapper::AccessModeDual: |
|
457 |
m_NetworkModeOptionsItemData->setContentWidgetData( |
|
458 |
"currentIndex", 0); |
|
459 |
break; |
|
460 |
case PSetNetworkWrapper::AccessModeUmts: |
|
461 |
m_NetworkModeOptionsItemData->setContentWidgetData( |
|
462 |
"currentIndex", 1); |
|
463 |
break; |
|
464 |
case PSetNetworkWrapper::AccessModeGsm: |
|
465 |
m_NetworkModeOptionsItemData->setContentWidgetData( |
|
466 |
"currentIndex", 2); |
|
467 |
break; |
|
468 |
default: |
|
469 |
break; |
|
470 |
} |
|
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
471 |
|
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
472 |
addConnection( |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
473 |
m_NetworkModeOptionsItemData, |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
474 |
SIGNAL(currentIndexChanged(int)), |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
475 |
this, |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
476 |
SLOT(networkModeStateChanged(int))); |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
477 |
|
37 | 478 |
DPRINT << ": OUT"; |
479 |
} |
|
480 |
||
481 |
||
482 |
/*! |
|
483 |
CpNetworkPluginForm::availableNetworksGot |
|
484 |
*/ |
|
485 |
void CpNetworkPluginForm::availableNetworksGot( |
|
486 |
QList<PSetNetworkWrapper::NetworkInfo*> &networkInfoList) |
|
487 |
{ |
|
488 |
DPRINT << ": IN"; |
|
489 |
||
490 |
m_networkInfoList = &networkInfoList; |
|
491 |
showManualSelectiondialog(); |
|
492 |
||
493 |
DPRINT << ": OUT"; |
|
494 |
} |
|
495 |
||
496 |
||
497 |
/*! |
|
498 |
CpNetworkPluginForm::createDialog |
|
499 |
*/ |
|
500 |
HbDialog* CpNetworkPluginForm::createDialog(const QString& heading) const |
|
501 |
{ |
|
502 |
DPRINT << ": IN"; |
|
503 |
||
504 |
HbDialog *dialog = new HbDialog(); |
|
505 |
dialog->setDismissPolicy(HbDialog::NoDismiss); |
|
506 |
dialog->setTimeout(HbDialog::NoTimeout); |
|
507 |
dialog->setHeadingWidget(new HbLabel(heading)); |
|
508 |
||
509 |
DPRINT << ": OUT"; |
|
510 |
return dialog; |
|
511 |
} |
|
512 |
||
513 |
||
514 |
/*! |
|
515 |
CpNetworkPluginForm::createDialog |
|
516 |
*/ |
|
517 |
void CpNetworkPluginForm::addItemToListWidget(HbListWidget* w, |
|
46
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
518 |
const QString& item, const int& data, |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
519 |
const HbIcon& primaryIcon) const |
37 | 520 |
{ |
521 |
DPRINT << ": IN"; |
|
522 |
Q_ASSERT(w != 0); |
|
523 |
||
524 |
HbListWidgetItem* o = new HbListWidgetItem(); |
|
525 |
o->setText(item); |
|
526 |
o->setData(data); |
|
46
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
527 |
if(!primaryIcon.isNull()) |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
528 |
o->setIcon(primaryIcon); |
37 | 529 |
w->addItem(o); |
530 |
||
531 |
DPRINT << ": OUT"; |
|
532 |
} |
|
533 |
||
534 |
||
535 |
/*! |
|
536 |
CpNetworkPluginForm::networkReqestFailed |
|
537 |
*/ |
|
538 |
void CpNetworkPluginForm::networkReqestFailed( |
|
539 |
PSetNetworkWrapper::ErrorCode error, |
|
540 |
PSetNetworkWrapper::RequestType type) |
|
541 |
{ |
|
542 |
DPRINT << ": IN"; |
|
543 |
||
544 |
QString text; |
|
545 |
switch(error) { |
|
546 |
case PSetNetworkWrapper::ErrCauseCallActive: |
|
77
2be0b271d017
Revision: 201037
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
72
diff
changeset
|
547 |
text = hbTrId("txt_phone_info_active_calls_must_be_disconnected_befo"); |
37 | 548 |
break; |
549 |
case PSetNetworkWrapper::ErrNoNetworkService: |
|
77
2be0b271d017
Revision: 201037
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
72
diff
changeset
|
550 |
text = hbTrId("txt_phone_info_no_operators_found"); |
37 | 551 |
break; |
552 |
case PSetNetworkWrapper::ErrOfflineOpNotAllowed: |
|
77
2be0b271d017
Revision: 201037
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
72
diff
changeset
|
553 |
text = hbTrId("txt_phone_info_offline_not_allowed"); |
37 | 554 |
break; |
555 |
case PSetNetworkWrapper::ErrNoNetworkAccess: |
|
77
2be0b271d017
Revision: 201037
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
72
diff
changeset
|
556 |
text = hbTrId("txt_phone_info_no_access_to_operators_network"); |
37 | 557 |
break; |
558 |
default: |
|
559 |
break; |
|
560 |
} |
|
561 |
emit showGlobalNote( |
|
72
c76a0b1755b9
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
64
diff
changeset
|
562 |
m_activeNoteId, text, HbMessageBox::MessageTypeWarning); |
37 | 563 |
|
564 |
// Update UI |
|
565 |
if(type == PSetNetworkWrapper::RequestSetNetworkMode) { |
|
566 |
m_psetNetworkWrapper->getNetworkAccessMode(); |
|
567 |
} |
|
568 |
else if(type == PSetNetworkWrapper::RequestSetNetwork && |
|
569 |
error == PSetNetworkWrapper::ErrNoNetworkAccess) { |
|
570 |
showManualSelectiondialog(); |
|
571 |
} |
|
572 |
else if(type == PSetNetworkWrapper::RequestSetNetwork || |
|
573 |
type == PSetNetworkWrapper::RequestSetNetworkAutomatic || |
|
574 |
type == PSetNetworkWrapper::RequestGetNetworkInfo) { |
|
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
575 |
restoreOperatorSelectionUi(); |
37 | 576 |
} |
577 |
||
578 |
DPRINT << ": OUT"; |
|
579 |
} |
|
580 |
||
581 |
||
582 |
/*! |
|
583 |
CpNetworkPluginForm::userCancel |
|
584 |
*/ |
|
585 |
void CpNetworkPluginForm::userCancel() |
|
586 |
{ |
|
587 |
DPRINT << ": IN"; |
|
588 |
||
589 |
m_psetNetworkWrapper->cancelRequest(); |
|
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
590 |
restoreOperatorSelectionUi(); |
37 | 591 |
|
592 |
DPRINT << ": OUT"; |
|
593 |
} |
|
594 |
||
595 |
||
596 |
/*! |
|
597 |
CpNetworkPluginForm::handleSearchingNetworks |
|
598 |
*/ |
|
599 |
void CpNetworkPluginForm::handleSearchingNetworks( |
|
600 |
PSetNetworkWrapper::RequestType &type) |
|
601 |
{ |
|
602 |
DPRINT << ": IN"; |
|
603 |
||
604 |
if (type != PSetNetworkWrapper::RequestNone) { |
|
605 |
QObject::connect( |
|
56
5bcb308bd24d
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
46
diff
changeset
|
606 |
PsUiNotes::instance(), SIGNAL(progressNoteCanceled()), |
37 | 607 |
this, SLOT(userCancel())); |
77
2be0b271d017
Revision: 201037
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
72
diff
changeset
|
608 |
emit showGlobalProgressNote(m_activeProgressNoteId, hbTrId("txt_phone_info_updating_operator_list")); |
37 | 609 |
} else { |
610 |
QObject::disconnect( |
|
56
5bcb308bd24d
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
46
diff
changeset
|
611 |
PsUiNotes::instance(), SIGNAL(progressNoteCanceled()), |
37 | 612 |
this, SLOT(userCancel())); |
613 |
emit cancelNote(m_activeProgressNoteId); |
|
614 |
m_activeProgressNoteId = 0; |
|
615 |
} |
|
616 |
||
617 |
DPRINT << ": OUT"; |
|
618 |
} |
|
619 |
||
620 |
||
621 |
/*! |
|
622 |
CpNetworkPluginForm::handleRequestingSelectedNetwork |
|
623 |
*/ |
|
624 |
void CpNetworkPluginForm::handleRequestingSelectedNetwork(bool ongoing) |
|
625 |
{ |
|
626 |
DPRINT << ": IN"; |
|
627 |
||
628 |
if (ongoing) { |
|
629 |
QObject::connect( |
|
56
5bcb308bd24d
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
46
diff
changeset
|
630 |
PsUiNotes::instance(), SIGNAL(progressNoteCanceled()), |
37 | 631 |
this, SLOT(userCancel())); |
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
632 |
emit showGlobalProgressNote(m_activeProgressNoteId, hbTrId("txt_common_info_requesting")); |
37 | 633 |
} else { |
634 |
QObject::disconnect( |
|
56
5bcb308bd24d
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
46
diff
changeset
|
635 |
PsUiNotes::instance(), SIGNAL(progressNoteCanceled()), |
37 | 636 |
this, SLOT(userCancel())); |
637 |
emit cancelNote(m_activeProgressNoteId); |
|
638 |
m_activeProgressNoteId = 0; |
|
639 |
} |
|
640 |
||
641 |
DPRINT << ": OUT"; |
|
642 |
} |
|
643 |
||
644 |
||
645 |
/*! |
|
646 |
CpNetworkPluginForm::handleNetworkChanged |
|
647 |
*/ |
|
648 |
void CpNetworkPluginForm::handleNetworkChanged( |
|
649 |
PSetNetworkWrapper::NetworkInfo& currentInfo, |
|
650 |
PSetNetworkWrapper::RegistrationStatus& status) |
|
651 |
{ |
|
652 |
DPRINT << ": IN"; |
|
653 |
||
654 |
QString text; |
|
655 |
switch (status){ |
|
656 |
case PSetNetworkWrapper::RegisteredOnHomeNetwork: |
|
77
2be0b271d017
Revision: 201037
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
72
diff
changeset
|
657 |
text = hbTrId("txt_phone_dpopinfo_home_network_selected"); |
37 | 658 |
break; |
77
2be0b271d017
Revision: 201037
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
72
diff
changeset
|
659 |
case PSetNetworkWrapper::RegisteredRoaming: |
2be0b271d017
Revision: 201037
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
72
diff
changeset
|
660 |
text = hbTrId("txt_phone_dpopinfo_selected_network_l").arg(networkName(currentInfo)); |
2be0b271d017
Revision: 201037
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
72
diff
changeset
|
661 |
break; |
2be0b271d017
Revision: 201037
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
72
diff
changeset
|
662 |
default: |
2be0b271d017
Revision: 201037
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
72
diff
changeset
|
663 |
text = hbTrId("txt_phone_info_result_unknown"); |
2be0b271d017
Revision: 201037
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
72
diff
changeset
|
664 |
break; |
37 | 665 |
} |
72
c76a0b1755b9
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
64
diff
changeset
|
666 |
|
c76a0b1755b9
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
64
diff
changeset
|
667 |
emit showNotificationDialog(text); |
c76a0b1755b9
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
64
diff
changeset
|
668 |
|
37 | 669 |
DPRINT << ": OUT"; |
670 |
} |
|
671 |
||
672 |
||
673 |
/*! |
|
674 |
CpNetworkPluginForm::showManualSelectiondialog |
|
675 |
*/ |
|
676 |
void CpNetworkPluginForm::showManualSelectiondialog() |
|
677 |
{ |
|
678 |
DPRINT << ": IN"; |
|
679 |
||
680 |
QScopedPointer<HbDialog> dialog( |
|
77
2be0b271d017
Revision: 201037
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
72
diff
changeset
|
681 |
createDialog(hbTrId("txt_phone_title_select_operator"))); |
37 | 682 |
HbListWidget *list = new HbListWidget(dialog.data()); |
683 |
//then insert found networks |
|
684 |
int itemsCount = m_networkInfoList->count(); |
|
685 |
for (int i = 0; i < itemsCount; i++) { |
|
686 |
PSetNetworkWrapper::NetworkInfo *info = m_networkInfoList->at(i); |
|
687 |
QString text = networkName(*info); |
|
46
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
688 |
addItemToListWidget(list, text, i, HbIcon(primaryIconForNetwork(*info))); |
37 | 689 |
DPRINT << ": " << info; |
690 |
} |
|
691 |
// Connect list item activation signal to close the popup |
|
692 |
connect( |
|
693 |
list, SIGNAL(activated(HbListWidgetItem*)), |
|
694 |
dialog.data(), SLOT(close())); |
|
695 |
// Sets the "Cancel"-action/button |
|
696 |
HbAction *cancelAction = new HbAction(hbTrId("txt_common_button_cancel")); |
|
697 |
dialog->addAction(cancelAction); |
|
698 |
dialog->setContentWidget(list); |
|
699 |
// Launch popup and handle the response |
|
700 |
dialog->open(this, SLOT(finishedManualSelectiondialog(HbAction*))); |
|
701 |
if (m_dialog) { |
|
702 |
m_dialog->deleteLater(); |
|
703 |
m_dialog = NULL; |
|
704 |
} |
|
705 |
m_dialog = dialog.take(); |
|
706 |
||
707 |
DPRINT << ": OUT"; |
|
708 |
} |
|
709 |
||
46
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
710 |
/*! |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
711 |
CpNetworkPluginForm::primaryIconForNetwork |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
712 |
*/ |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
713 |
QString CpNetworkPluginForm::primaryIconForNetwork(const PSetNetworkWrapper::NetworkInfo &info) |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
714 |
{ |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
715 |
DPRINT << ": IN"; |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
716 |
|
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
717 |
QString iconName; |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
718 |
bool isForbiddenIconSupported = m_cpSettingsWrapper->forbiddenIconSupported(); |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
719 |
if (isForbiddenIconSupported) { |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
720 |
if (info.m_access == PSetNetworkWrapper::AccessTypeGsm) { |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
721 |
if (info.m_status == PSetNetworkWrapper::StatusForbidden) { |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
722 |
iconName.append("qtg_small_network_off"); |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
723 |
} else { |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
724 |
iconName.append("qtg_small_network"); |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
725 |
} |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
726 |
} else if (info.m_access == PSetNetworkWrapper::AccessTypeWcdma) { |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
727 |
if (info.m_status == PSetNetworkWrapper::StatusForbidden) { |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
728 |
iconName.append("qtg_small_wcdma_off"); |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
729 |
} else { |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
730 |
iconName.append("qtg_small_wcdma"); |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
731 |
} |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
732 |
} |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
733 |
else if (info.m_access == PSetNetworkWrapper::AccessTypeGsmAndWcdma) { |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
734 |
if (info.m_status == PSetNetworkWrapper::StatusForbidden) { |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
735 |
iconName.append("qtg_small_pd_wcdma_off"); |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
736 |
} else { |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
737 |
iconName.append("qtg_small_pd_wcdma"); |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
738 |
} |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
739 |
} |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
740 |
} |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
741 |
|
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
742 |
DPRINT << ": OUT : " << iconName; |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
743 |
return iconName; |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
744 |
} |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
745 |
|
37 | 746 |
|
747 |
/*! |
|
748 |
CpNetworkPluginForm::finishedManualSelectiondialog. |
|
749 |
*/ |
|
750 |
void CpNetworkPluginForm::finishedManualSelectiondialog(HbAction* action) |
|
751 |
{ |
|
752 |
DPRINT << ": IN"; |
|
753 |
||
754 |
if (m_dialog) { |
|
755 |
QList<QAction *> actionList = m_dialog->actions(); |
|
756 |
bool cancelAction = actionList.contains(action); |
|
757 |
if (!cancelAction) { |
|
758 |
// Update the view with selected text |
|
759 |
QGraphicsWidget *contectWidget = m_dialog->contentWidget(); |
|
760 |
HbListWidget *list(NULL); |
|
761 |
if (contectWidget) { |
|
762 |
list = qobject_cast<HbListWidget *>(contectWidget); |
|
763 |
} |
|
764 |
if (list) { |
|
765 |
int seletion = 0; |
|
766 |
if(list->currentItem()) { |
|
767 |
seletion = list->currentItem()->data().toInt(); |
|
768 |
DPRINT << ": seletion : " << seletion; |
|
769 |
} |
|
770 |
PSetNetworkWrapper::NetworkInfo param; |
|
771 |
param.m_id.m_countryCode = |
|
772 |
m_networkInfoList->at(seletion)->m_id.m_countryCode; |
|
773 |
param.m_id.m_networkCode = |
|
774 |
m_networkInfoList->at(seletion)->m_id.m_networkCode; |
|
775 |
param.m_mode = PSetNetworkWrapper::SelectionModeManual; |
|
776 |
DPRINT << ": m_countryCode : " << param.m_id.m_countryCode; |
|
777 |
DPRINT << ": m_networkCode : " << param.m_id.m_networkCode; |
|
778 |
DPRINT << ": m_mode : " << param.m_mode; |
|
779 |
m_psetNetworkWrapper->selectNetwork(param); |
|
780 |
} |
|
781 |
} else { |
|
782 |
DPRINT << ": Cancel"; |
|
783 |
m_psetNetworkWrapper->cancelRequest(); |
|
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
784 |
restoreOperatorSelectionUi(); |
37 | 785 |
} |
786 |
m_dialog->deleteLater(); |
|
787 |
m_dialog = NULL; |
|
788 |
} |
|
789 |
||
790 |
DPRINT << ": OUT"; |
|
791 |
} |
|
792 |
||
793 |
/*! |
|
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
794 |
CpNetworkPluginForm::restoreOperatorSelectionUi |
37 | 795 |
*/ |
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
796 |
void CpNetworkPluginForm::restoreOperatorSelectionUi() |
37 | 797 |
{ |
798 |
DPRINT << ": IN"; |
|
799 |
||
800 |
removeConnection( |
|
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
801 |
m_NetworkOperatorSelectionItemData, SIGNAL(valueChanged(QPersistentModelIndex, QVariant)), |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
802 |
this, SLOT(operatorSelectionStateChanged())); |
37 | 803 |
PSetNetworkWrapper::NetworkSelectionMode mode; |
804 |
PSetNetworkWrapper::ErrorCode err = |
|
805 |
m_psetNetworkWrapper->getNetworkSelectionMode(mode); |
|
806 |
if(err == PSetNetworkWrapper::ErrNoError) { |
|
807 |
switch (mode) { |
|
808 |
case PSetNetworkWrapper::SelectionModeAutomatic: |
|
809 |
m_NetworkOperatorSelectionItemData->setContentWidgetData( |
|
810 |
"text", QVariant(hbTrId("txt_cp_setlabel_operator_selection_val_automatic"))); |
|
811 |
break; |
|
812 |
case PSetNetworkWrapper::SelectionModeManual: |
|
813 |
m_NetworkOperatorSelectionItemData->setContentWidgetData( |
|
814 |
"text", QVariant(hbTrId("txt_cp_setlabel_operator_selection_val_manual"))); |
|
815 |
break; |
|
816 |
default: |
|
817 |
break; |
|
818 |
} |
|
819 |
} |
|
820 |
addConnection( |
|
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
821 |
m_NetworkOperatorSelectionItemData, SIGNAL(valueChanged(QPersistentModelIndex, QVariant)), |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
822 |
this, SLOT(operatorSelectionStateChanged())); |
37 | 823 |
|
824 |
DPRINT << ": OUT"; |
|
825 |
} |
|
826 |
||
827 |
||
828 |
/*! |
|
829 |
CpNetworkPluginForm::networkName() |
|
830 |
*/ |
|
831 |
QString CpNetworkPluginForm::networkName( |
|
832 |
PSetNetworkWrapper::NetworkInfo &info) |
|
833 |
{ |
|
834 |
DPRINT << ": IN"; |
|
835 |
||
836 |
QString text; |
|
837 |
if (!info.m_longName.isEmpty()) |
|
838 |
{ |
|
839 |
text.append(info.m_longName); |
|
840 |
} |
|
841 |
else if (!info.m_shortName.isEmpty()) |
|
842 |
{ |
|
843 |
text.append(info.m_shortName); |
|
844 |
} |
|
845 |
else //network returned only ids |
|
846 |
{ |
|
847 |
text.append(info.m_id.m_countryCode); |
|
848 |
text.append(" "); |
|
849 |
text.append(info.m_id.m_networkCode); |
|
850 |
} |
|
851 |
||
852 |
DPRINT << ": OUT : " << text; |
|
853 |
return text; |
|
854 |
} |
|
855 |
||
856 |
||
857 |
/*! |
|
858 |
CpNetworkPluginForm::connectToNetworkWrapper |
|
859 |
*/ |
|
860 |
void CpNetworkPluginForm::connectToNetworkWrapper(PSetNetworkWrapper &wrapper) |
|
861 |
{ |
|
862 |
QObject::connect( |
|
863 |
&wrapper, |
|
864 |
SIGNAL(networkReqestFailed( |
|
865 |
PSetNetworkWrapper::ErrorCode,PSetNetworkWrapper::RequestType)), |
|
866 |
this, |
|
867 |
SLOT(networkReqestFailed( |
|
868 |
PSetNetworkWrapper::ErrorCode,PSetNetworkWrapper::RequestType))); |
|
869 |
||
870 |
QObject::connect( |
|
871 |
&wrapper, |
|
872 |
SIGNAL(searchingNetworks(PSetNetworkWrapper::RequestType &)), |
|
873 |
this, |
|
874 |
SLOT(handleSearchingNetworks(PSetNetworkWrapper::RequestType &))); |
|
875 |
||
876 |
QObject::connect( |
|
877 |
&wrapper, |
|
878 |
SIGNAL(requestingSelectedNetwork(bool)), |
|
879 |
this, |
|
880 |
SLOT(handleRequestingSelectedNetwork(bool))); |
|
881 |
||
882 |
QObject::connect( |
|
883 |
&wrapper, |
|
884 |
SIGNAL(networkChanged( |
|
885 |
PSetNetworkWrapper::NetworkInfo&, |
|
886 |
PSetNetworkWrapper::RegistrationStatus&)), |
|
887 |
this, |
|
888 |
SLOT(handleNetworkChanged( |
|
889 |
PSetNetworkWrapper::NetworkInfo&, |
|
890 |
PSetNetworkWrapper::RegistrationStatus&))); |
|
64
6aaf0276100e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
891 |
|
6aaf0276100e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
892 |
QObject::connect( |
6aaf0276100e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
893 |
&wrapper, |
6aaf0276100e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
894 |
SIGNAL(chageVisbilityOfManualNetworkSelection(bool)), |
6aaf0276100e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
895 |
this, |
6aaf0276100e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
896 |
SLOT(chageVisbilityOfManualNetworkSelection(bool))); |
6aaf0276100e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
897 |
|
37 | 898 |
} |
899 |
||
900 |
||
901 |
/*! |
|
902 |
CpNetworkPluginForm::connectToPhoneNotes |
|
903 |
*/ |
|
56
5bcb308bd24d
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
46
diff
changeset
|
904 |
void CpNetworkPluginForm::connectToPhoneNotes(PsUiNotes ¬es) |
37 | 905 |
{ |
906 |
QObject::connect( |
|
907 |
this, |
|
908 |
SIGNAL(showGlobalProgressNote(int &, const QString&)), |
|
909 |
¬es, |
|
910 |
SLOT(showGlobalProgressNote(int &, const QString&))); |
|
911 |
||
912 |
QObject::connect( |
|
913 |
this, |
|
914 |
SIGNAL(showGlobalNote( |
|
915 |
int &, const QString&, HbMessageBox::MessageBoxType)), |
|
916 |
¬es, |
|
917 |
SLOT(showGlobalNote( |
|
918 |
int &, const QString&, HbMessageBox::MessageBoxType))); |
|
72
c76a0b1755b9
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
64
diff
changeset
|
919 |
|
c76a0b1755b9
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
64
diff
changeset
|
920 |
QObject::connect( |
c76a0b1755b9
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
64
diff
changeset
|
921 |
this, |
c76a0b1755b9
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
64
diff
changeset
|
922 |
SIGNAL(showNotificationDialog( const QString&)), |
c76a0b1755b9
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
64
diff
changeset
|
923 |
¬es, |
c76a0b1755b9
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
64
diff
changeset
|
924 |
SLOT(showNotificationDialog( const QString&))); |
37 | 925 |
|
926 |
QObject::connect( |
|
927 |
this, |
|
928 |
SIGNAL(cancelNote(int)), |
|
929 |
¬es, |
|
930 |
SLOT(cancelNote(int))); |
|
931 |
} |
|
932 |
||
933 |
/*! |
|
934 |
CpNetworkPluginForm::searchAvailableNetworks |
|
935 |
*/ |
|
936 |
void CpNetworkPluginForm::searchAvailableNetworks() |
|
937 |
{ |
|
938 |
DPRINT << ": IN"; |
|
939 |
||
940 |
m_psetNetworkWrapper->cancelRequest(); |
|
941 |
manualOperatorSelection(); |
|
942 |
||
943 |
DPRINT << ": OUT"; |
|
944 |
} |
|
945 |
||
64
6aaf0276100e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
946 |
/*! |
6aaf0276100e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
947 |
CpNetworkPluginForm::chageVisbilityOfManualNetworkSelection |
6aaf0276100e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
948 |
*/ |
6aaf0276100e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
949 |
void CpNetworkPluginForm::chageVisbilityOfManualNetworkSelection(bool visible) |
6aaf0276100e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
950 |
{ |
6aaf0276100e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
951 |
DPRINT << ": IN : visible " << visible; |
6aaf0276100e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
952 |
|
6aaf0276100e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
953 |
HbDataFormModel* formModel = qobject_cast<HbDataFormModel*>(model()); |
6aaf0276100e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
954 |
if (formModel) { |
6aaf0276100e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
955 |
if (visible && !m_NetworkOperatorSelectionItemData) { |
6aaf0276100e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
956 |
formModel->appendDataFormItem(createOperatorSelectionItem()); |
6aaf0276100e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
957 |
} else if (!visible && m_NetworkOperatorSelectionItemData) { |
6aaf0276100e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
958 |
removeConnection( |
6aaf0276100e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
959 |
m_NetworkOperatorSelectionItemData, |
6aaf0276100e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
960 |
SIGNAL(valueChanged(QPersistentModelIndex, QVariant)), |
6aaf0276100e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
961 |
this, |
6aaf0276100e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
962 |
SLOT(operatorSelectionStateChanged())); |
6aaf0276100e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
963 |
formModel->removeItem(m_NetworkOperatorSelectionItemData); |
6aaf0276100e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
964 |
m_NetworkOperatorSelectionItemData = NULL; |
6aaf0276100e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
965 |
} |
6aaf0276100e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
966 |
} |
6aaf0276100e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
967 |
|
6aaf0276100e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
968 |
DPRINT << ": OUT"; |
6aaf0276100e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
969 |
} |
6aaf0276100e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
970 |
|
37 | 971 |
// End of File. |