33
|
1 |
|
|
2 |
/*
|
|
3 |
* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies).
|
|
4 |
* All rights reserved.
|
|
5 |
* This component and the accompanying materials are made available
|
|
6 |
* under the terms of "Eclipse Public License v1.0"
|
|
7 |
* which accompanies this distribution, and is available
|
|
8 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
|
9 |
*
|
|
10 |
* Initial Contributors:
|
|
11 |
* Nokia Corporation - initial contribution.
|
|
12 |
*
|
|
13 |
* Contributors:
|
|
14 |
*
|
|
15 |
* Description: Methods for DmAdvancedView.
|
|
16 |
*
|
|
17 |
*/
|
38
|
18 |
#include <hbnamespace.h>
|
33
|
19 |
#include "dmadvancedview.h"
|
36
|
20 |
#include "serversettingsview.h"
|
33
|
21 |
|
|
22 |
DmAdvancedView::DmAdvancedView(HbMainWindow *mainWindow, HbView *mainView, QGraphicsItem *parent):HbView(parent),
|
|
23 |
bluetooth(":/icons/qgn_prop_sml_bt.svg"),
|
|
24 |
internet(":/icons/qgn_prop_sml_http.svg"),
|
|
25 |
defaultprofileicon(":/icons/qtg_large_avatar.svg")
|
|
26 |
{
|
|
27 |
iMainWindow = mainWindow;
|
|
28 |
serverSetView = NULL;
|
|
29 |
iMainView = mainView;
|
|
30 |
dminfo = new DmInfo(this);
|
|
31 |
currentdefaultprofile = -1;
|
|
32 |
currentview = 0;
|
|
33 |
connectionRequested = false;
|
|
34 |
backbehaviorset = false;
|
38
|
35 |
currentselecteditem = -1;
|
33
|
36 |
}
|
|
37 |
|
|
38 |
DmAdvancedView::~DmAdvancedView()
|
|
39 |
{
|
|
40 |
qDebug("omadm DmAdvancedView::~DmAdvancedView");
|
|
41 |
if(docmlLoader)
|
|
42 |
delete docmlLoader;
|
|
43 |
if(dminfo)
|
|
44 |
delete dminfo;
|
|
45 |
qDebug("omadm DmAdvancedView::~DmAdvancedView end");
|
|
46 |
}
|
|
47 |
|
|
48 |
void DmAdvancedView::handleLongPress(HbAbstractViewItem* item , QPointF coOrdinates)
|
|
49 |
{
|
38
|
50 |
if (connectionRequested)
|
33
|
51 |
return;
|
38
|
52 |
if (item)
|
33
|
53 |
{
|
38
|
54 |
modelItem = model->itemFromIndex(item->modelIndex());
|
|
55 |
currentselecteditem = modelItem->row();
|
33
|
56 |
|
38
|
57 |
HbMenu *csmenu = new HbMenu();
|
|
58 |
csmenu->setAttribute( Qt::WA_DeleteOnClose);
|
|
59 |
HbAction *defaultprofileAction = 0;
|
|
60 |
HbAction *deleteaction = 0;
|
|
61 |
HbAction *connectaction = 0;
|
|
62 |
if (!dminfo->Isdefaultprofile(currentselecteditem))
|
33
|
63 |
{
|
38
|
64 |
defaultprofileAction = csmenu->addAction(hbTrId(
|
|
65 |
"txt_device_update_menu_set_as_default"));
|
|
66 |
connect(defaultprofileAction, SIGNAL(triggered()), this,
|
|
67 |
SLOT(defaultMenuItemSelected()));
|
33
|
68 |
}
|
38
|
69 |
if (!dminfo->Isprofilelocked(currentselecteditem))
|
33
|
70 |
{
|
38
|
71 |
deleteaction = csmenu->addAction(hbTrId(
|
|
72 |
"txt_device_update_menu_delete"));
|
|
73 |
connect(deleteaction, SIGNAL(triggered()), this,
|
|
74 |
SLOT(deleteMenuItemSelected()));
|
33
|
75 |
}
|
38
|
76 |
connectaction = csmenu->addAction(hbTrId(
|
|
77 |
"txt_device_update_menu_connect"));
|
|
78 |
connect(connectaction, SIGNAL(triggered()), this,
|
|
79 |
SLOT(connectMenuItemSelected()));
|
|
80 |
csmenu->setPreferredPos(coOrdinates);
|
|
81 |
csmenu->open();
|
33
|
82 |
}
|
|
83 |
}
|
|
84 |
|
|
85 |
|
|
86 |
void DmAdvancedView::handleClicked(QModelIndex index)
|
|
87 |
{
|
|
88 |
if(connectionRequested)
|
|
89 |
return;
|
|
90 |
//Stop listening DB events for profile addition
|
|
91 |
dminfo->DisableDbNotifications(true);
|
|
92 |
//If profile is not locked then take to edit server view
|
|
93 |
int itemnum = 0;
|
38
|
94 |
QStandardItem *selectedItem = model->itemFromIndex(index);
|
|
95 |
itemnum = selectedItem->row();
|
33
|
96 |
if(itemnum >= 0 && !dminfo->Isprofilelocked(itemnum))
|
|
97 |
{
|
|
98 |
//read profile items
|
|
99 |
QStringList itemdata;
|
|
100 |
bool sessmode = 0;
|
|
101 |
QStringList iaplist;
|
|
102 |
int curriap = 0;
|
|
103 |
int portnum = 0;
|
|
104 |
bool nwauth = false ;
|
|
105 |
dminfo->getProfiledata(itemnum, itemdata, sessmode,iaplist,curriap,portnum, nwauth);
|
|
106 |
QString editserverprof(itemdata[0]);
|
|
107 |
if(!serverSetView)
|
|
108 |
{
|
|
109 |
serverSetView = new ServerSettingsView(iMainWindow, this , editserverprof);
|
|
110 |
}
|
|
111 |
else // view already created
|
|
112 |
{
|
|
113 |
//Just update the setting items as per this profile
|
|
114 |
serverSetView->makeviewItemsVisible(editserverprof);
|
|
115 |
}
|
|
116 |
serverSetView->setProfileValues(itemdata,sessmode,iaplist,curriap,portnum,nwauth);
|
|
117 |
iMainWindow->setCurrentView(serverSetView);
|
|
118 |
|
|
119 |
}
|
|
120 |
}
|
|
121 |
|
|
122 |
bool DmAdvancedView::displayItems()
|
|
123 |
{
|
|
124 |
docmlLoader = new HbDocumentLoader;
|
|
125 |
bool ok ;
|
|
126 |
docmlLoader->load( DOCML_FILE_NAME, &ok );
|
|
127 |
if(ok)
|
|
128 |
{
|
|
129 |
if(iMainWindow->orientation() == Qt::Vertical)
|
|
130 |
docmlLoader->load( DOCML_FILE_NAME, PORTRAIT,&ok );
|
|
131 |
else
|
|
132 |
docmlLoader->load( DOCML_FILE_NAME, LANDSCAPE,&ok );
|
|
133 |
}
|
|
134 |
else
|
|
135 |
{
|
|
136 |
qDebug("omadm docml loading failed");
|
|
137 |
return ok;
|
|
138 |
}
|
|
139 |
if(ok)
|
|
140 |
{
|
|
141 |
connect(iMainWindow, SIGNAL(orientationChanged(Qt::Orientation)),
|
|
142 |
this, SLOT(reLayout(Qt::Orientation)));
|
|
143 |
viewwidget = qobject_cast<HbView *>(docmlLoader->findWidget( VIEW_NAME ) );
|
|
144 |
Q_ASSERT_X(viewwidget != 0, "OMADM View not found","Not found");
|
|
145 |
viewspecificmenu = new HbMenu();
|
|
146 |
help = viewspecificmenu->addAction(hbTrId("txt_common_menu_help"));
|
|
147 |
exit = viewspecificmenu->addAction(hbTrId("txt_common_menu_exit"));
|
|
148 |
connect(exit, SIGNAL(triggered()), QCoreApplication::instance(), SLOT(quit()));
|
|
149 |
setMenu(viewspecificmenu);
|
|
150 |
serversListGroup = qobject_cast<HbGroupBox *>(docmlLoader->findWidget( GROUP ) );
|
|
151 |
serversListGroup->setHeading(hbTrId("txt_device_update_setlabel_device_update_services"));
|
|
152 |
serversListGroup->setCollapsable( true );
|
|
153 |
connect(serversListGroup, SIGNAL(toggled(bool)), this, SLOT(serversListGroupClicked(bool)));
|
|
154 |
otherDetailsGroup = qobject_cast<HbGroupBox *>(docmlLoader->findWidget( OTHERDETAILSGROUP ) );
|
|
155 |
connect(otherDetailsGroup, SIGNAL(toggled(bool)), this, SLOT(otherDetailsGroupClicked(bool)));
|
|
156 |
otherDetailsGroup->setHeading(hbTrId("txt_device_update_setlabel_other_details"));
|
|
157 |
otherDetailsGroup->setCollapsable( true );
|
|
158 |
otherDetailsGroup->setCollapsed( true );
|
|
159 |
list = qobject_cast<HbListView *>(docmlLoader->findWidget( LIST_NAME ) );
|
|
160 |
HbListViewItem *prototype = list->listItemPrototype();
|
|
161 |
prototype->setGraphicsSize(HbListViewItem::LargeIcon);
|
|
162 |
prototype->setSecondaryTextRowCount(1,2);
|
|
163 |
prototype->setStretchingStyle(HbListViewItem::StretchLandscape);
|
|
164 |
dminfo->refreshProfileList();
|
|
165 |
int IndicatorCount =dminfo->profilescount();
|
|
166 |
model = new QStandardItemModel();
|
|
167 |
for (int i = 0; IndicatorCount > 0 && i < IndicatorCount; ++i) {
|
|
168 |
QStringList liststr;
|
|
169 |
bool lock = false;
|
|
170 |
int icon = 0;
|
|
171 |
int ret = dminfo->profileinfo(i,liststr,icon, lock);
|
|
172 |
if(ret <= 0)
|
|
173 |
{
|
|
174 |
break;
|
|
175 |
}
|
|
176 |
QStandardItem* item ;
|
|
177 |
item = new QStandardItem();
|
|
178 |
HbIcon icon1;
|
|
179 |
icon1.setIconName(":/icons/qgn_prop_sml_http.svg");
|
|
180 |
HbIcon icon2;
|
|
181 |
icon2.setIconName(":/icons/qgn_prop_sml_bt.svg");
|
|
182 |
HbIcon icon3;
|
|
183 |
icon3.setIconName(":/icons/qgn_indi_sett_protected_add.svg");
|
|
184 |
HbIcon defaultprofile;
|
|
185 |
defaultprofile.setIconName(":/icons/qtg_large_avatar.svg");
|
|
186 |
QList<QVariant> Iconl;
|
|
187 |
if(icon == 0)//Internet
|
|
188 |
Iconl.insert(0,icon1);
|
|
189 |
else if(icon == 1)//Bluetooth
|
|
190 |
Iconl.insert(0,icon2);
|
|
191 |
else
|
|
192 |
{
|
|
193 |
Iconl.insert(0,defaultprofile);
|
|
194 |
currentdefaultprofile = i;
|
|
195 |
}
|
|
196 |
icon = 0;
|
|
197 |
if(lock)
|
|
198 |
{
|
|
199 |
Iconl.insert(1,icon3);
|
|
200 |
lock = false;
|
|
201 |
}
|
|
202 |
QVariant iconlist(Iconl);
|
|
203 |
iconlist.setValue(Iconl);
|
|
204 |
item->setData(liststr , Qt::DisplayRole);
|
|
205 |
item->setData(iconlist , Qt::DecorationRole);
|
|
206 |
model->setItem(i, item);
|
|
207 |
}
|
|
208 |
list->setModel(model,prototype);
|
|
209 |
list->setItemRecycling(false);
|
|
210 |
connect(list, SIGNAL(longPressed(HbAbstractViewItem*,QPointF)),
|
|
211 |
this, SLOT(handleLongPress(HbAbstractViewItem*,QPointF)));
|
|
212 |
|
|
213 |
connect(list, SIGNAL(activated(QModelIndex)), this, SLOT(handleClicked(QModelIndex)));
|
|
214 |
|
|
215 |
qDebug("omadm launching other details list");
|
|
216 |
otherdetailslist = qobject_cast<HbListView *>(docmlLoader->findWidget( LISTOTHERDETAILS ) );
|
|
217 |
otherdetailslist->listItemPrototype()->setStretchingStyle(HbListViewItem::StretchLandscape);
|
|
218 |
otherdetailslist->setLongPressEnabled(EFalse);
|
|
219 |
qDebug("omadm launching other details list done");
|
|
220 |
mainCalltoUpdateView();
|
|
221 |
|
|
222 |
|
|
223 |
newserverprofile = qobject_cast<HbPushButton *>(docmlLoader->findWidget(NEWSERVERBUTTON));
|
|
224 |
newserverprofile->setText(hbTrId("txt_device_update_button_new_server_profile"));
|
|
225 |
connect(newserverprofile, SIGNAL(clicked()),this, SLOT(createNewProfile()));
|
|
226 |
|
|
227 |
label = qobject_cast<HbLabel *>(docmlLoader->findWidget(LABEL));
|
|
228 |
label->setPlainText(hbTrId("txt_device_update_subhead_advanced_device_updates"));
|
|
229 |
|
|
230 |
setWidget(viewwidget);
|
|
231 |
}
|
|
232 |
else
|
|
233 |
{
|
|
234 |
qDebug("omadm docml section loading failed");
|
|
235 |
}
|
|
236 |
return ok;
|
|
237 |
}
|
|
238 |
|
|
239 |
void DmAdvancedView::updateEarlierdefaultProfileIcon()
|
|
240 |
{
|
|
241 |
if(currentdefaultprofile >= 0)
|
|
242 |
{
|
38
|
243 |
QStandardItem *earlierDefaultProfile = model->item(currentdefaultprofile);
|
33
|
244 |
//Find the transport type & set the icon
|
|
245 |
int transporttype = 0;
|
|
246 |
dminfo->profileTransport(currentdefaultprofile,transporttype);
|
|
247 |
if(transporttype == 0)//Internet
|
|
248 |
{
|
38
|
249 |
earlierDefaultProfile->setIcon(internet);
|
33
|
250 |
}
|
|
251 |
else
|
|
252 |
{
|
38
|
253 |
earlierDefaultProfile->setIcon(bluetooth);
|
33
|
254 |
}
|
|
255 |
}
|
|
256 |
}
|
|
257 |
|
|
258 |
void DmAdvancedView::createNewProfile()
|
|
259 |
{
|
|
260 |
if(dminfo->createNewprofile())
|
|
261 |
{
|
|
262 |
//Open server settings view
|
|
263 |
QString newserverprof(hbTrId("txt_device_update_setlabel_new_server_profile"));
|
|
264 |
if(!serverSetView)
|
|
265 |
{
|
|
266 |
serverSetView = new ServerSettingsView(iMainWindow, this, newserverprof);
|
|
267 |
}
|
|
268 |
else // view already created
|
|
269 |
{
|
|
270 |
//Just update the setting items as per this profile
|
|
271 |
serverSetView->makeviewItemsVisible(newserverprof);
|
|
272 |
}
|
|
273 |
QStringList serveritems;
|
|
274 |
serveritems<< "" <<"" <<"" <<"" <<""<<""<<""<<"";
|
|
275 |
bool sessmode = true;
|
|
276 |
bool nauth = true;
|
|
277 |
QStringList apdata;
|
|
278 |
int currap =-1;
|
|
279 |
int destap = 0;
|
|
280 |
dminfo->getIaplist(apdata,currap,destap);
|
|
281 |
int portnum = 8080;
|
|
282 |
serverSetView->setProfileValues(serveritems,sessmode,apdata,currap,portnum,nauth);
|
|
283 |
iMainWindow->setCurrentView(serverSetView);
|
|
284 |
}
|
|
285 |
else // profile not getting created
|
|
286 |
{
|
|
287 |
qDebug("OMADM New server profile creation failed");
|
|
288 |
}
|
|
289 |
}
|
|
290 |
|
|
291 |
void DmAdvancedView::saveProfile(QStringList& itemdata, bool& sessmode, QString& currap,unsigned int& portnum, bool& nauth )
|
|
292 |
{
|
|
293 |
dminfo->DisableDbNotifications(true);
|
|
294 |
dminfo->saveProfile(itemdata,sessmode,currap,portnum,nauth);
|
|
295 |
updateListview();
|
|
296 |
dminfo->DisableDbNotifications(false);
|
|
297 |
}
|
|
298 |
|
|
299 |
void DmAdvancedView::updateListview()
|
|
300 |
{
|
|
301 |
model->clear();
|
|
302 |
int IndicatorCount =dminfo->profilescount();
|
|
303 |
for (int i = 0; IndicatorCount > 0 && i < IndicatorCount; ++i) {
|
|
304 |
QStringList liststr;
|
|
305 |
bool lock = false;
|
|
306 |
int icon = 0;
|
|
307 |
int ret = dminfo->profileinfo(i,liststr,icon, lock);
|
|
308 |
if(ret <= 0)
|
|
309 |
{
|
|
310 |
break;
|
|
311 |
}
|
|
312 |
QStandardItem* item ;
|
|
313 |
item = new QStandardItem();
|
|
314 |
HbIcon icon1;
|
|
315 |
icon1.setIconName(":/icons/qgn_prop_sml_http.svg");
|
|
316 |
HbIcon icon2;
|
|
317 |
icon2.setIconName(":/icons/qgn_prop_sml_bt.svg");
|
|
318 |
HbIcon icon3;
|
|
319 |
icon3.setIconName(":/icons/qgn_indi_sett_protected_add.svg");
|
|
320 |
HbIcon defaultprofile;
|
|
321 |
defaultprofile.setIconName(":/icons/qtg_large_avatar.svg");
|
|
322 |
QList<QVariant> Iconl;
|
|
323 |
if(icon == 0)//Internet
|
|
324 |
Iconl.insert(0,icon1);
|
|
325 |
else if(icon == 1)//Bluetooth
|
|
326 |
Iconl.insert(0,icon2);
|
|
327 |
else //Default profile
|
|
328 |
{
|
|
329 |
Iconl.insert(0,defaultprofile);
|
|
330 |
currentdefaultprofile = i;
|
|
331 |
}
|
|
332 |
icon = 0;
|
|
333 |
if(lock)
|
|
334 |
{
|
|
335 |
Iconl.insert(1,icon3);
|
|
336 |
lock = false;
|
|
337 |
}
|
|
338 |
QVariant iconlist(Iconl);
|
|
339 |
iconlist.setValue(Iconl);
|
|
340 |
item->setData(liststr , Qt::DisplayRole);
|
|
341 |
item->setData(iconlist , Qt::DecorationRole);
|
|
342 |
model->setItem(i, item);
|
|
343 |
}
|
|
344 |
model->sort(0);
|
|
345 |
}
|
|
346 |
|
|
347 |
void DmAdvancedView::serversListGroupClicked(bool state)
|
|
348 |
{
|
|
349 |
Q_UNUSED(state);
|
|
350 |
if(serversListGroup->isCollapsed())
|
|
351 |
otherDetailsGroup->setCollapsed(false);
|
|
352 |
else
|
|
353 |
otherDetailsGroup->setCollapsed(true);
|
|
354 |
}
|
|
355 |
|
|
356 |
void DmAdvancedView::otherDetailsGroupClicked(bool state)
|
|
357 |
{
|
|
358 |
Q_UNUSED(state);
|
|
359 |
if(otherDetailsGroup->isCollapsed())
|
|
360 |
serversListGroup->setCollapsed(false);
|
|
361 |
else
|
|
362 |
serversListGroup->setCollapsed(true);
|
|
363 |
}
|
|
364 |
|
|
365 |
bool DmAdvancedView::checkServerId(QString& serverid)
|
|
366 |
{
|
|
367 |
return dminfo->checksrvid(serverid);
|
|
368 |
}
|
|
369 |
|
|
370 |
void DmAdvancedView::reLayout(Qt::Orientation orientation)
|
|
371 |
{
|
|
372 |
qDebug("OMADM servers view DmAdvancedView::reLayout");
|
|
373 |
if(orientation == Qt::Horizontal)
|
|
374 |
{
|
|
375 |
qDebug("OMADM servers view landscape");
|
|
376 |
docmlLoader->load(DOCML_FILE_NAME,LANDSCAPE);
|
|
377 |
}
|
|
378 |
else
|
|
379 |
{
|
|
380 |
qDebug("OMADM servers view portrait");
|
|
381 |
bool ok;
|
|
382 |
docmlLoader->load( DOCML_FILE_NAME, PORTRAIT, &ok );
|
|
383 |
}
|
|
384 |
|
|
385 |
|
|
386 |
}
|
|
387 |
|
|
388 |
void DmAdvancedView::setBackBehavior()
|
|
389 |
{
|
|
390 |
if (!backbehaviorset)
|
|
391 |
{
|
|
392 |
qDebug("OMADM servers view back behavior setting");
|
|
393 |
backaction = new HbAction(Hb::BackNaviAction, this);
|
|
394 |
connect(backaction, SIGNAL(triggered()), this,
|
|
395 |
SLOT(backButtonClicked()));
|
|
396 |
setNavigationAction(backaction);
|
|
397 |
backbehaviorset = true;
|
|
398 |
}
|
|
399 |
qDebug("OMADM servers view back behavior setting done");
|
|
400 |
}
|
|
401 |
|
|
402 |
void DmAdvancedView::backButtonClicked()
|
|
403 |
{
|
|
404 |
QList <HbView*> views = iMainWindow->views();
|
|
405 |
if(iMainWindow->orientation()==Qt::Vertical)
|
|
406 |
{
|
|
407 |
iMainWindow->setCurrentView(views[0]);
|
|
408 |
}
|
|
409 |
else
|
|
410 |
{
|
|
411 |
iMainWindow->setCurrentView(views[1]);
|
|
412 |
}
|
|
413 |
}
|
|
414 |
|
|
415 |
|
|
416 |
void DmAdvancedView::mainCalltoUpdateView()
|
|
417 |
{
|
|
418 |
int IndicatorCount =6;
|
|
419 |
otherdetailsmodel = new QStandardItemModel(IndicatorCount,0);
|
|
420 |
TInt i=0;
|
|
421 |
TRequestStatus status;
|
|
422 |
QStringList liststr;
|
|
423 |
QStandardItem* item;
|
|
424 |
QString val;
|
|
425 |
QString str;
|
|
426 |
|
|
427 |
iServer.Connect();
|
|
428 |
iServer.GetPhoneInfo(0, info);
|
|
429 |
imobPhone.Open(iServer, info.iName);
|
|
430 |
//Bands supported
|
|
431 |
|
|
432 |
RMobilePhone::TMobilePhoneNetworkInfoV1 nwInfov1;
|
|
433 |
RMobilePhone::TMobilePhoneNetworkInfoV1Pckg nwInfov1Pckg(nwInfov1);
|
|
434 |
imobPhone.GetCurrentNetwork(status, nwInfov1Pckg);
|
|
435 |
User::WaitForRequest( status );
|
|
436 |
status = KRequestPending;
|
|
437 |
nwInfov1 = nwInfov1Pckg();
|
|
438 |
NetworkBand(nwInfov1.iBandInfo, str);
|
|
439 |
item = new QStandardItem();
|
|
440 |
val = hbTrId("txt_device_update_dblist_gsm_bands");
|
|
441 |
liststr << val;
|
|
442 |
liststr << str;
|
|
443 |
item->setData(liststr , Qt::DisplayRole);
|
|
444 |
otherdetailsmodel->setItem(i++, item);
|
|
445 |
|
|
446 |
//Packet Service
|
|
447 |
|
|
448 |
TInt packetsrvc =0;
|
|
449 |
RMobilePhone::TMobilePhoneNetworkInfoV5 nwInfov5;
|
|
450 |
RMobilePhone::TMobilePhoneNetworkInfoV5Pckg nwInfov5Pckg(nwInfov5);
|
|
451 |
imobPhone.GetCurrentNetwork( status, nwInfov5Pckg );
|
|
452 |
User::WaitForRequest( status );
|
|
453 |
status = KRequestPending;
|
|
454 |
nwInfov5 = nwInfov5Pckg();
|
|
455 |
|
|
456 |
if(nwInfov5.iHsdpaAvailableIndicator) packetsrvc =1;
|
|
457 |
|
|
458 |
if(nwInfov5.iEgprsAvailableIndicator) packetsrvc =2;
|
|
459 |
|
|
460 |
if(!packetsrvc)
|
|
461 |
{
|
|
462 |
RMobilePhone::TMobilePhoneNetworkInfoV8 nwInfov8;
|
|
463 |
RMobilePhone::TMobilePhoneNetworkInfoV8Pckg nwInfov8Pckg(nwInfov8);
|
|
464 |
imobPhone.GetCurrentNetwork( status, nwInfov8Pckg );
|
|
465 |
User::WaitForRequest( status );
|
|
466 |
status = KRequestPending;
|
|
467 |
nwInfov8 = nwInfov8Pckg();
|
|
468 |
if(nwInfov8.iHsupaAvailableIndicator) packetsrvc =3;
|
|
469 |
}
|
|
470 |
liststr.clear();
|
|
471 |
val = hbTrId("txt_device_update_dblist_wcdma_uldl_data_rates");
|
|
472 |
liststr << val;
|
|
473 |
item = new QStandardItem();
|
|
474 |
PacketService(packetsrvc, str);
|
|
475 |
liststr << str;
|
|
476 |
item->setData(liststr , Qt::DisplayRole);
|
|
477 |
otherdetailsmodel->setItem(i++, item);
|
|
478 |
|
|
479 |
// Ciphering
|
|
480 |
|
|
481 |
liststr.clear();
|
|
482 |
item = new QStandardItem();
|
|
483 |
val = hbTrId("txt_device_update_dblist_gsm_cipherings");
|
|
484 |
liststr << val;
|
|
485 |
imobPhone.GetNetworkSecurityLevel(status,idispSecurity);
|
|
486 |
User::WaitForRequest( status );
|
|
487 |
NetworkCiphering(idispSecurity, str);
|
|
488 |
liststr << str;
|
|
489 |
item->setData(liststr, Qt::DisplayRole);
|
|
490 |
otherdetailsmodel->setItem(i++, item);
|
|
491 |
|
|
492 |
// WLAN MAC
|
|
493 |
|
|
494 |
TUint KPhoneWlanSeparator (':');
|
|
495 |
_LIT( KWLanMACDataFormat, "%02x");
|
|
496 |
// Fetch WLAN MAC address
|
|
497 |
TBuf<KWlanMacAddrLength> address;
|
|
498 |
RProperty::Get( KPSUidWlan, KPSWlanMacAddress, address );
|
|
499 |
// Format fetched address
|
|
500 |
TBuf<KWlanMacAddrLength> wlanMACAddress;
|
|
501 |
for ( TInt i( 0 ); i < address.Length(); i++ )
|
|
502 |
{
|
|
503 |
// Set separator
|
|
504 |
if( i > 0 )
|
|
505 |
{
|
|
506 |
wlanMACAddress.Append( KPhoneWlanSeparator );
|
|
507 |
}
|
|
508 |
// Set data
|
|
509 |
TBuf<50> tmp;
|
|
510 |
tmp.Format( KWLanMACDataFormat, address[i] );
|
|
511 |
wlanMACAddress.Append( tmp );
|
|
512 |
}
|
|
513 |
liststr.clear();
|
|
514 |
item = new QStandardItem();
|
|
515 |
val = hbTrId("txt_device_update_dblist_wlan_mac_address");
|
|
516 |
liststr << val;
|
|
517 |
str = QString::fromUtf16(wlanMACAddress.Ptr(), wlanMACAddress.Length());
|
|
518 |
liststr << str;
|
|
519 |
item->setData(liststr, Qt::DisplayRole);
|
|
520 |
otherdetailsmodel->setItem(i++, item);
|
|
521 |
|
|
522 |
// BT MAC
|
|
523 |
|
|
524 |
TBuf<KBTAddrLength> addressBuffer;
|
|
525 |
// Fetch from Cenrep
|
|
526 |
CRepository* repository = NULL;
|
|
527 |
TRAPD( err, repository = CRepository::NewL( KCRUidBluetoothLocalDeviceAddress ) );
|
|
528 |
if ( err == KErrNone )
|
|
529 |
{
|
|
530 |
qDebug("KCRUidBluetoothLocalDeviceAddress errnone");
|
|
531 |
err = repository->Get( KBTLocalDeviceAddress, addressBuffer );
|
|
532 |
|
|
533 |
if (err == KErrNone)
|
|
534 |
qDebug("KBTLocalDeviceAddress errnone");
|
|
535 |
else
|
|
536 |
qDebug("KBTLocalDeviceAddress Error");
|
|
537 |
|
|
538 |
delete repository;
|
|
539 |
}
|
|
540 |
else
|
|
541 |
{
|
|
542 |
qDebug("KCRUidBluetoothLocalDeviceAddress Error openin cenrep");
|
|
543 |
}
|
|
544 |
liststr.clear();
|
|
545 |
val = hbTrId("txt_device_update_dblist_bt_mac_address");
|
|
546 |
liststr << val;
|
|
547 |
item = new QStandardItem();
|
|
548 |
str = QString::fromUtf16(addressBuffer.Ptr(), addressBuffer.Length());
|
|
549 |
liststr << str;
|
|
550 |
item->setData(liststr , Qt::DisplayRole);
|
|
551 |
otherdetailsmodel->setItem(i++, item);
|
|
552 |
|
|
553 |
otherdetailslist->setModel(otherdetailsmodel);
|
|
554 |
|
|
555 |
}
|
|
556 |
|
|
557 |
void DmAdvancedView::PacketService(TInt val, QString& string)
|
|
558 |
{
|
|
559 |
switch (val)
|
|
560 |
{
|
|
561 |
case (0):
|
|
562 |
string = hbTrId("txt_device_update_dblist_wcdma_uldl_data_val_l1");
|
|
563 |
break;
|
|
564 |
case (1):
|
|
565 |
string = hbTrId("txt_device_update_dblist_wcdma_uldl_data_val_l2");
|
|
566 |
break;
|
|
567 |
case (2):
|
|
568 |
string = hbTrId("txt_device_update_dblist_wcdma_uldl_data_val_l3");
|
|
569 |
break;
|
|
570 |
case (3):
|
|
571 |
string = hbTrId("txt_device_update_dblist_wcdma_uldl_data_val_l4");
|
|
572 |
break;
|
|
573 |
case (4):
|
|
574 |
string = hbTrId("txt_device_update_dblist_gsm_cipherings_val_l4");
|
|
575 |
break;
|
|
576 |
case (5):
|
|
577 |
default :
|
|
578 |
string = hbTrId("txt_device_update_dblist_wcdma_uldl_data_val_l5");
|
|
579 |
break;
|
|
580 |
}
|
|
581 |
}
|
|
582 |
|
|
583 |
|
|
584 |
void DmAdvancedView::NetworkCiphering(RMobilePhone::TMobilePhoneNetworkSecurity val, QString& string)
|
|
585 |
{
|
|
586 |
switch (val)
|
|
587 |
{
|
|
588 |
case (RMobilePhone::ECipheringGSM):
|
|
589 |
string = hbTrId("txt_device_update_dblist_gsm_cipherings_val_l2");
|
|
590 |
break;
|
|
591 |
case (RMobilePhone::ECipheringWCDMA):
|
|
592 |
string = hbTrId("txt_device_update_dblist_gsm_cipherings_val_l3");
|
|
593 |
break;
|
|
594 |
case (RMobilePhone::ECipheringCDMA):
|
|
595 |
string = hbTrId("txt_device_update_dblist_gsm_cipherings_val_l4");
|
|
596 |
break;
|
|
597 |
case (RMobilePhone::ECipheringOff):
|
|
598 |
default :
|
|
599 |
string = hbTrId("txt_device_update_dblist_gsm_cipherings_val_l1");
|
|
600 |
break;
|
|
601 |
}
|
|
602 |
}
|
|
603 |
|
|
604 |
void DmAdvancedView::NetworkBand(RMobilePhone::TMobilePhoneNetworkBandInfo val, QString& string)
|
|
605 |
{
|
|
606 |
switch (val)
|
|
607 |
{
|
|
608 |
case (RMobilePhone::E800BandA):
|
|
609 |
string = hbTrId("txt_device_update_dblist_gsm_bands_val_l2");
|
|
610 |
break;
|
|
611 |
case (RMobilePhone::E800BandB):
|
|
612 |
string = hbTrId("txt_device_update_dblist_gsm_bands_val_l3");
|
|
613 |
break;
|
|
614 |
case (RMobilePhone::E800BandC):
|
|
615 |
string = hbTrId("txt_device_update_dblist_gsm_bands_val_l4");
|
|
616 |
break;
|
|
617 |
case (RMobilePhone::E1900BandA):
|
|
618 |
string = hbTrId("txt_device_update_dblist_gsm_bands_val_l5");
|
|
619 |
break;
|
|
620 |
case (RMobilePhone::E1900BandB):
|
|
621 |
string = hbTrId("txt_device_update_dblist_gsm_bands_val_l6");
|
|
622 |
break;
|
|
623 |
case (RMobilePhone::E1900BandC):
|
|
624 |
string = hbTrId("txt_device_update_dblist_gsm_bands_val_l7");
|
|
625 |
break;
|
|
626 |
case (RMobilePhone::E1900BandD):
|
|
627 |
string = hbTrId("txt_device_update_dblist_gsm_bands_val_l8");
|
|
628 |
break;
|
|
629 |
case (RMobilePhone::E1900BandE):
|
|
630 |
string = hbTrId("txt_device_update_dblist_gsm_bands_val_l9");
|
|
631 |
break;
|
|
632 |
case (RMobilePhone::E1900BandF):
|
|
633 |
string = hbTrId("txt_device_update_dblist_gsm_bands_val_l10");
|
|
634 |
break;
|
|
635 |
case (RMobilePhone::EBandUnknown):
|
|
636 |
default :
|
|
637 |
string = hbTrId("txt_device_update_dblist_gsm_bands_val_l1");
|
|
638 |
break;
|
|
639 |
}
|
|
640 |
}
|
|
641 |
|
|
642 |
void DmAdvancedView::syncCompleted(int jobstatus)
|
|
643 |
{
|
|
644 |
Q_UNUSED(jobstatus);
|
|
645 |
connectionRequested = false;
|
|
646 |
updateListview();
|
|
647 |
}
|
|
648 |
|
38
|
649 |
void DmAdvancedView::defaultMenuItemSelected()
|
|
650 |
{
|
|
651 |
dminfo->setDefaultProfile(currentselecteditem);
|
|
652 |
updateEarlierdefaultProfileIcon();
|
|
653 |
modelItem->setIcon(defaultprofileicon);
|
|
654 |
currentdefaultprofile = currentselecteditem;
|
|
655 |
}
|
|
656 |
|
|
657 |
void DmAdvancedView::deleteMenuItemSelected()
|
|
658 |
{
|
|
659 |
dminfo->DisableDbNotifications(true);
|
|
660 |
//check currentdefaultprofile is current item
|
|
661 |
if(currentselecteditem == currentdefaultprofile) // deleting default profile
|
|
662 |
currentdefaultprofile = -1;
|
|
663 |
if(dminfo->DeleteProfile(currentselecteditem) >=0 )
|
|
664 |
{
|
|
665 |
//Update the profile list
|
|
666 |
model->removeRow(currentselecteditem);
|
|
667 |
}
|
|
668 |
dminfo->DisableDbNotifications(false);
|
|
669 |
}
|
|
670 |
|
|
671 |
void DmAdvancedView::connectMenuItemSelected()
|
|
672 |
{
|
|
673 |
dminfo->synchronize(currentselecteditem);
|
|
674 |
connectionRequested = true;
|
|
675 |
}
|
|
676 |
|