110 "txt_devicelocking_formlabel_automatic_locking")); |
110 "txt_devicelocking_formlabel_automatic_locking")); |
111 TInt autoLockVal; |
111 TInt autoLockVal; |
112 TInt err = iALPeriodRep->Get(KSettingsAutoLockTime, autoLockVal); |
112 TInt err = iALPeriodRep->Get(KSettingsAutoLockTime, autoLockVal); |
113 TInt index = GetAutoLockIndex(autoLockVal); |
113 TInt index = GetAutoLockIndex(autoLockVal); |
114 Dprint((_L("Current AL period value %d"),autoLockVal)); |
114 Dprint((_L("Current AL period value %d"),autoLockVal)); |
|
115 RDEBUG("err", err); |
|
116 RDEBUG("index", index); |
|
117 RDEBUG("autoLockVal", autoLockVal); |
115 //TODO: need to set autoLockVal in editor |
118 //TODO: need to set autoLockVal in editor |
116 QStringList autolockPeriodList; |
119 QStringList autolockPeriodList; |
117 autolockPeriodList << hbTrId("txt_devicelocking_button_off") |
120 autolockPeriodList << hbTrId("txt_devicelocking_button_off") |
118 << hbTrId("txt_devicelocking_setlabel_val_when_keys_screen") |
121 << hbTrId("txt_devicelocking_setlabel_val_when_keys_screen") |
119 << hbTrId("txt_devicelocking_setlabel_val_5_minutes") |
122 << hbTrId("txt_devicelocking_setlabel_val_5_minutes") |
139 HbDataFormModelItem::ToggleValueItem, hbTrId( |
142 HbDataFormModelItem::ToggleValueItem, hbTrId( |
140 "txt_devicelocking_formlabel_lock_when_sim_changed")); |
143 "txt_devicelocking_formlabel_lock_when_sim_changed")); |
141 TBool lockVal = mUiSecuSettings->IsLockEnabledL( |
144 TBool lockVal = mUiSecuSettings->IsLockEnabledL( |
142 RMobilePhone::ELockPhoneToICC); |
145 RMobilePhone::ELockPhoneToICC); |
143 Dprint((_L("LockWhenSimChange enabled %d"),lockVal)); |
146 Dprint((_L("LockWhenSimChange enabled %d"),lockVal)); |
|
147 RDEBUG("lockVal", lockVal); |
144 if (lockVal) |
148 if (lockVal) |
145 { |
149 { |
146 mLockWhenSimChangeItem->setContentWidgetData("text", hbTrId( |
150 mLockWhenSimChangeItem->setContentWidgetData("text", hbTrId( |
147 "txt_remotelocking_button_sim_changed_on")); |
151 "txt_remotelocking_button_sim_changed_on")); |
148 mLockWhenSimChangeItem->setContentWidgetData("additionalText", |
152 mLockWhenSimChangeItem->setContentWidgetData("additionalText", |
165 |
169 |
166 //Remote Lock Setting |
170 //Remote Lock Setting |
167 TBool enabled = true; |
171 TBool enabled = true; |
168 TBool val = mRemoteLockSettings->GetEnabled(enabled); |
172 TBool val = mRemoteLockSettings->GetEnabled(enabled); |
169 Dprint((_L("Remote Lock Setting enabled %d"),val)); |
173 Dprint((_L("Remote Lock Setting enabled %d"),val)); |
|
174 RDEBUG("val", val); |
170 mDeviceRemoteLockItem = new HbDataFormModelItem( |
175 mDeviceRemoteLockItem = new HbDataFormModelItem( |
171 HbDataFormModelItem::ToggleValueItem, hbTrId( |
176 HbDataFormModelItem::ToggleValueItem, hbTrId( |
172 "txt_devicelocking_subhead_remote_locking")); |
177 "txt_devicelocking_subhead_remote_locking")); |
173 |
178 |
174 if (val && enabled) |
179 if (val && enabled) |
243 ***************************************************************** |
248 ***************************************************************** |
244 */ |
249 */ |
245 void CpDeviceLockPluginView::onLockCodeClicked() |
250 void CpDeviceLockPluginView::onLockCodeClicked() |
246 { |
251 { |
247 Dprint(_L("CpDeviceLockPluginView::onLockCodeClicked()..Enter")); |
252 Dprint(_L("CpDeviceLockPluginView::onLockCodeClicked()..Enter")); |
|
253 RDEBUG("0", 0); |
248 mUiSecuSettings->ChangeSecCodeL(); |
254 mUiSecuSettings->ChangeSecCodeL(); |
249 Dprint(_L("CpDeviceLockPluginView::onLockCodeClicked()..Exit")); |
255 Dprint(_L("CpDeviceLockPluginView::onLockCodeClicked()..Exit")); |
250 } |
256 } |
251 |
257 |
252 |
258 |
259 ************************************************************************ |
265 ************************************************************************ |
260 */ |
266 */ |
261 void CpDeviceLockPluginView::onAutoLockChanged(int index) |
267 void CpDeviceLockPluginView::onAutoLockChanged(int index) |
262 { |
268 { |
263 Dprint(_L("CpDeviceLockPluginView::onAutoLockChanged()..Enter")); |
269 Dprint(_L("CpDeviceLockPluginView::onAutoLockChanged()..Enter")); |
|
270 RDEBUG("index", index); |
264 if (index != mThemeComboPrevIndex) |
271 if (index != mThemeComboPrevIndex) |
265 { |
272 { |
266 //TODO: need to set user entered/selected value |
273 //TODO: need to set user entered/selected value |
267 TInt lockValue = GetValueAtIndex(index); |
274 TInt lockValue = GetValueAtIndex(index); |
268 TInt newAutoLockVal = mUiSecuSettings->ChangeAutoLockPeriodL( |
275 TInt newAutoLockVal = mUiSecuSettings->ChangeAutoLockPeriodL( |
269 lockValue); |
276 lockValue); |
|
277 RDEBUG("newAutoLockVal", newAutoLockVal); |
|
278 RDEBUG("lockValue", lockValue); |
270 if (newAutoLockVal == lockValue) |
279 if (newAutoLockVal == lockValue) |
271 { |
280 { |
272 Dprint(_L("onAutoLockChanged().AL setting success !!")); |
281 Dprint(_L("onAutoLockChanged().AL setting success !!")); |
|
282 RDEBUG("success", 1); |
273 TInt err = iALPeriodRep->Set(KSettingsAutoLockTime, lockValue); |
283 TInt err = iALPeriodRep->Set(KSettingsAutoLockTime, lockValue); |
|
284 RDEBUG("err", err); |
274 mThemeComboPrevIndex = index; |
285 mThemeComboPrevIndex = index; |
275 } |
286 } |
276 else |
287 else |
277 { |
288 { |
278 Dprint(_L("onAutoLockChanged()..Setting to previous value")); |
289 Dprint(_L("onAutoLockChanged()..Setting to previous value")); |
|
290 RDEBUG("previous", 0); |
279 QVariant data(mThemeComboPrevIndex); |
291 QVariant data(mThemeComboPrevIndex); |
280 mAutolockPeriodItem->setContentWidgetData( |
292 mAutolockPeriodItem->setContentWidgetData( |
281 QString("currentIndex"), data); |
293 QString("currentIndex"), data); |
282 } |
294 } |
283 |
295 |
284 } |
296 } |
285 Dprint(_L("CpDeviceLockPluginView::onAutoLockChanged()..Exit")); |
297 Dprint(_L("CpDeviceLockPluginView::onAutoLockChanged()..Exit")); |
|
298 RDEBUG("0", 0); |
286 } |
299 } |
287 |
300 |
288 |
301 |
289 /* |
302 /* |
290 ************************************************************************* |
303 ************************************************************************* |
296 ************************************************************************** |
309 ************************************************************************** |
297 */ |
310 */ |
298 void CpDeviceLockPluginView::onLockMessageClicked() |
311 void CpDeviceLockPluginView::onLockMessageClicked() |
299 { |
312 { |
300 Dprint(_L("CpDeviceLockPluginView::onLockMessageClicked()..Exit")); |
313 Dprint(_L("CpDeviceLockPluginView::onLockMessageClicked()..Exit")); |
|
314 RDEBUG("0", 0); |
301 TBuf<KRLockMaxLockCodeLength> remoteLockCode; |
315 TBuf<KRLockMaxLockCodeLength> remoteLockCode; |
302 TBool remoteLockStatus(EFalse); |
316 TBool remoteLockStatus(EFalse); |
303 TInt retVal = KErrNone; |
317 TInt retVal = KErrNone; |
304 TInt autoLockVal = -1; |
318 TInt autoLockVal = -1; |
305 retVal = mUiSecuSettings->ChangeRemoteLockStatusL(remoteLockStatus, |
319 retVal = mUiSecuSettings->ChangeRemoteLockStatusL(remoteLockStatus, |
306 remoteLockCode, autoLockVal); |
320 remoteLockCode, autoLockVal); |
|
321 RDEBUG("retVal", retVal); |
|
322 RDEBUG("autoLockVal", autoLockVal); |
|
323 RDEBUG("remoteLockStatus", remoteLockStatus); |
307 if (retVal) |
324 if (retVal) |
308 { |
325 { |
309 Dprint(_L("CpDeviceLockPluginView::onLockMessageClicked()..ChangeRemoteLockStatusL sucess")); |
326 Dprint(_L("CpDeviceLockPluginView::onLockMessageClicked()..ChangeRemoteLockStatusL sucess")); |
|
327 RDEBUG("sucess", 1); |
310 } |
328 } |
311 else |
329 else |
312 { |
330 { |
313 Dprint(_L("CpDeviceLockPluginView::onLockMessageClicked()..ChangeRemoteLockStatusL failed")); |
331 Dprint(_L("CpDeviceLockPluginView::onLockMessageClicked()..ChangeRemoteLockStatusL failed")); |
|
332 RDEBUG("failed", 0); |
314 } |
333 } |
315 Dprint(_L("CpDeviceLockPluginView::onLockMessageClicked()..Exit")); |
334 Dprint(_L("CpDeviceLockPluginView::onLockMessageClicked()..Exit")); |
|
335 RDEBUG("0", 0); |
316 } |
336 } |
317 |
337 |
318 |
338 |
319 /* |
339 /* |
320 ************************************************************************* |
340 ************************************************************************* |
330 |
350 |
331 #if 0 |
351 #if 0 |
332 void CpDeviceLockPluginView::onAutoTextChanged(const QString& aText) |
352 void CpDeviceLockPluginView::onAutoTextChanged(const QString& aText) |
333 { |
353 { |
334 Dprint(_L("CpDeviceLockPluginView::onAutoTextChanged()..Enter")); |
354 Dprint(_L("CpDeviceLockPluginView::onAutoTextChanged()..Enter")); |
|
355 RDEBUG("0", 0); |
335 //TBool ret = DisplaySecurityDialog(); |
356 //TBool ret = DisplaySecurityDialog(); |
336 Dprint(_L("CpDeviceLockPluginView::onAutoTextChanged()..Exit")); |
357 Dprint(_L("CpDeviceLockPluginView::onAutoTextChanged()..Exit")); |
337 |
358 RDEBUG("0", 0); |
338 } |
359 } |
339 #endif |
360 #endif |
340 |
361 |
341 /* |
362 /* |
342 ************************************************************************* |
363 ************************************************************************* |
348 */ |
369 */ |
349 void CpDeviceLockPluginView::onRemoteLockDataChanged(QModelIndex aStartIn,QModelIndex aEndIn) |
370 void CpDeviceLockPluginView::onRemoteLockDataChanged(QModelIndex aStartIn,QModelIndex aEndIn) |
350 { |
371 { |
351 Q_UNUSED(aEndIn); |
372 Q_UNUSED(aEndIn); |
352 Dprint(_L("CpDeviceLockPluginView::onRemoteLockDataChanged..Enter")); |
373 Dprint(_L("CpDeviceLockPluginView::onRemoteLockDataChanged..Enter")); |
|
374 RDEBUG("0", 0); |
353 HbDataFormModelItem *item = formModel->itemFromIndex(aStartIn); |
375 HbDataFormModelItem *item = formModel->itemFromIndex(aStartIn); |
354 |
376 |
355 if ((item->type() == HbDataFormModelItem::ToggleValueItem) |
377 if ((item->type() == HbDataFormModelItem::ToggleValueItem) |
356 && (item->data(HbDataFormModelItem::LabelRole).toString() |
378 && (item->data(HbDataFormModelItem::LabelRole).toString() |
357 == hbTrId("txt_devicelocking_subhead_remote_locking"))) |
379 == hbTrId("txt_devicelocking_subhead_remote_locking"))) |
358 { |
380 { |
359 |
381 RDEBUG("mHack", mHack); |
360 //The following If-Else condition should be removed once orbit team fix the issue with datachanged() signal |
382 //The following If-Else condition should be removed once orbit team fix the issue with datachanged() signal |
361 /****************************************************************************************************************/ |
383 /****************************************************************************************************************/ |
362 if ((mHack % 2) == 0) //need to capture second datachanged() signal , not first one. |
384 if ((mHack % 2) == 0) //need to capture second datachanged() signal , not first one. |
363 { |
385 { |
364 mHack++; |
386 mHack++; |
373 TInt retVal = KErrNone; |
395 TInt retVal = KErrNone; |
374 TBuf<KRLockMaxLockCodeLength> remoteLockCode; |
396 TBuf<KRLockMaxLockCodeLength> remoteLockCode; |
375 TBool remoteLockStatus(EFalse); |
397 TBool remoteLockStatus(EFalse); |
376 CRemoteLockSettings *remoteLockSetting = CRemoteLockSettings::NewL(); |
398 CRemoteLockSettings *remoteLockSetting = CRemoteLockSettings::NewL(); |
377 TInt err = iALPeriodRep->Get(KSettingsAutoLockTime, autoLockVal); |
399 TInt err = iALPeriodRep->Get(KSettingsAutoLockTime, autoLockVal); |
|
400 RDEBUG("err", err); |
|
401 RDEBUG("autoLockVal", autoLockVal); |
|
402 RDEBUG("retVal", retVal); |
378 QVariant remLockData = mDeviceRemoteLockItem->contentWidgetData( |
403 QVariant remLockData = mDeviceRemoteLockItem->contentWidgetData( |
379 QString("text")); |
404 QString("text")); |
380 if (remLockData.toString() == hbTrId( |
405 if (remLockData.toString() == hbTrId( |
381 "txt_devicelocking_button_remote_on")) |
406 "txt_devicelocking_button_remote_on")) |
382 { |
407 { |
388 { |
413 { |
389 remoteLockStatus = EFalse; |
414 remoteLockStatus = EFalse; |
390 retVal = mUiSecuSettings->ChangeRemoteLockStatusL( |
415 retVal = mUiSecuSettings->ChangeRemoteLockStatusL( |
391 remoteLockStatus, remoteLockCode, autoLockVal); |
416 remoteLockStatus, remoteLockCode, autoLockVal); |
392 } |
417 } |
|
418 RDEBUG("retVal", retVal); |
393 if (retVal == KErrNone) |
419 if (retVal == KErrNone) |
394 { |
420 { |
|
421 RDEBUG("remoteLockStatus", remoteLockStatus); |
395 if (remoteLockStatus) |
422 if (remoteLockStatus) |
396 { |
423 { |
397 if (remoteLockSetting->SetEnabledL(remoteLockCode)) |
424 if (remoteLockSetting->SetEnabledL(remoteLockCode)) |
398 { |
425 { |
399 Dprint(_L("CpDeviceLockPluginView::onRemoteLockDataChanged..remoteLockSetting->SetEnabledL success")); |
426 Dprint(_L("CpDeviceLockPluginView::onRemoteLockDataChanged..remoteLockSetting->SetEnabledL success")); |
|
427 RDEBUG("success", 1); |
400 mPrevRemLockData |
428 mPrevRemLockData |
401 = mDeviceRemoteLockItem->contentWidgetData( |
429 = mDeviceRemoteLockItem->contentWidgetData( |
402 QString("text")); |
430 QString("text")); |
403 } |
431 } |
404 else |
432 else |
405 { |
433 { |
406 RollbackRemoteLockSettingState(); |
434 RollbackRemoteLockSettingState(); |
407 Dprint(_L("CpDeviceLockPluginView::onRemoteLockDataChanged..remoteLockSetting->SetEnabledL failed")); |
435 Dprint(_L("CpDeviceLockPluginView::onRemoteLockDataChanged..remoteLockSetting->SetEnabledL failed")); |
|
436 RDEBUG("failed", 0); |
408 } |
437 } |
409 } |
438 } |
410 else |
439 else |
411 { |
440 { |
412 if (mRemoteLockSettings->SetDisabled()) |
441 if (mRemoteLockSettings->SetDisabled()) |
413 { |
442 { |
414 Dprint(_L("CpDeviceLockPluginView::onRemoteLockDataChanged..remoteLockSetting->SetDisabled success")); |
443 Dprint(_L("CpDeviceLockPluginView::onRemoteLockDataChanged..remoteLockSetting->SetDisabled success")); |
|
444 RDEBUG("success", 1); |
415 mPrevRemLockData |
445 mPrevRemLockData |
416 = mDeviceRemoteLockItem->contentWidgetData( |
446 = mDeviceRemoteLockItem->contentWidgetData( |
417 QString("text")); |
447 QString("text")); |
418 } |
448 } |
419 else |
449 else |
420 { |
450 { |
421 RollbackRemoteLockSettingState(); |
451 RollbackRemoteLockSettingState(); |
422 Dprint(_L("CpDeviceLockPluginView::onRemoteLockDataChanged..remoteLockSetting->SetDisabled failed")); |
452 Dprint(_L("CpDeviceLockPluginView::onRemoteLockDataChanged..remoteLockSetting->SetDisabled failed")); |
|
453 RDEBUG("failed", 0); |
423 } |
454 } |
424 } |
455 } |
425 } |
456 } |
426 else |
457 else |
427 { |
458 { |
428 Dprint(_L("CpDeviceLockPluginView::onRemoteLockDataChanged..RollbackRemoteLockSettingState")); |
459 Dprint(_L("CpDeviceLockPluginView::onRemoteLockDataChanged..RollbackRemoteLockSettingState")); |
|
460 RDEBUG("Rollback", 0); |
429 RollbackRemoteLockSettingState(); |
461 RollbackRemoteLockSettingState(); |
430 } |
462 } |
431 delete remoteLockSetting; |
463 delete remoteLockSetting; |
432 } |
464 } |
433 Dprint(_L("CpDeviceLockPluginView::onRemoteLockDataChanged..Exit")); |
465 Dprint(_L("CpDeviceLockPluginView::onRemoteLockDataChanged..Exit")); |
|
466 RDEBUG("0", 0); |
434 } |
467 } |
435 |
468 |
436 |
469 |
437 /* |
470 /* |
438 ************************************************************************* |
471 ************************************************************************* |
451 if ((item->type() == HbDataFormModelItem::ToggleValueItem) |
484 if ((item->type() == HbDataFormModelItem::ToggleValueItem) |
452 && (item->data(HbDataFormModelItem::LabelRole).toString() |
485 && (item->data(HbDataFormModelItem::LabelRole).toString() |
453 == hbTrId( |
486 == hbTrId( |
454 "txt_devicelocking_formlabel_lock_when_sim_changed"))) |
487 "txt_devicelocking_formlabel_lock_when_sim_changed"))) |
455 { |
488 { |
|
489 RDEBUG("mHack", mHack); |
456 //The following If-Else condition should be removed once orbit team fix the issue with datachanged() signal |
490 //The following If-Else condition should be removed once orbit team fix the issue with datachanged() signal |
457 /****************************************************************************************************************/ |
491 /****************************************************************************************************************/ |
458 if ((mHack % 2) == 0) //need to capture second datachanged() signal , not first one. |
492 if ((mHack % 2) == 0) //need to capture second datachanged() signal , not first one. |
459 { |
493 { |
460 mHack++; |
494 mHack++; |
579 * then this function resets to previous value. |
615 * then this function resets to previous value. |
580 ************************************************************************** |
616 ************************************************************************** |
581 */ |
617 */ |
582 void CpDeviceLockPluginView::RollbackRemoteLockSettingState() |
618 void CpDeviceLockPluginView::RollbackRemoteLockSettingState() |
583 { |
619 { |
|
620 RDEBUG("0", 0); |
584 /* |
621 /* |
585 * disconnect to datachanged() signal as we are not interested in this signal |
622 * disconnect to datachanged() signal as we are not interested in this signal |
586 * generated as a part of setContentWidgetData() API call below |
623 * generated as a part of setContentWidgetData() API call below |
587 */ |
624 */ |
588 disconnect(formModel, SIGNAL(dataChanged(QModelIndex, QModelIndex)), |
625 disconnect(formModel, SIGNAL(dataChanged(QModelIndex, QModelIndex)), |