299 m_phoneNotes->cancelNote(m_activeNoteId); |
299 m_phoneNotes->cancelNote(m_activeNoteId); |
300 m_phoneNotes->showGlobalErrorNote(m_activeNoteId, result); |
300 m_phoneNotes->showGlobalErrorNote(m_activeNoteId, result); |
301 m_barringRequestQueue.clear(); |
301 m_barringRequestQueue.clear(); |
302 return; |
302 return; |
303 } |
303 } |
304 |
304 |
305 CpSettingFormItemData *itemForCompletedRequest = |
305 if (!m_barringRequestQueue.isEmpty()) { |
306 m_barringRequestQueue.dequeue(); |
306 CpSettingFormItemData *itemForCompletedRequest = |
307 |
307 m_barringRequestQueue.dequeue(); |
308 if (!itemForCompletedRequest->isEnabled()) { |
308 |
309 // After enabling setting item here status query will not be started |
309 if (!itemForCompletedRequest->isEnabled()) { |
310 // again for the item when user collapses and expands the barring |
310 // After enabling setting item here status query will not be started |
311 // settings group again. |
311 // again for the item when user collapses and expands the barring |
312 itemForCompletedRequest->setEnabled(true); |
312 // settings group again. |
313 // start to observe user initiated state changes |
313 itemForCompletedRequest->setEnabled(true); |
314 m_helper.addConnection( |
314 // start to observe user initiated state changes |
315 itemForCompletedRequest, SIGNAL(stateChanged(int)), |
315 m_helper.addConnection( |
316 this, SLOT(changeBarringStateRequested(int))); |
316 itemForCompletedRequest, SIGNAL(stateChanged(int)), |
317 } |
317 this, SLOT(changeBarringStateRequested(int))); |
318 |
318 } |
319 Qt::CheckState checkState = |
319 |
320 (PSetCallBarringWrapper::BarringStatusActive == status) |
320 Qt::CheckState checkState = |
321 ? Qt::Checked |
321 (PSetCallBarringWrapper::BarringStatusActive == status) |
322 : Qt::Unchecked; |
322 ? Qt::Checked |
323 updateCheckStateOfItem(*itemForCompletedRequest, checkState); |
323 : Qt::Unchecked; |
324 |
324 updateCheckStateOfItem(*itemForCompletedRequest, checkState); |
|
325 } |
325 if (m_barringRequestQueue.isEmpty()) { |
326 if (m_barringRequestQueue.isEmpty()) { |
326 m_phoneNotes->cancelNote(m_activeNoteId); |
327 m_phoneNotes->cancelNote(m_activeNoteId); |
327 if (m_delayedBarringActivationNote) { |
328 if (m_delayedBarringActivationNote) { |
328 m_delayedBarringActivationNote = false; |
329 m_delayedBarringActivationNote = false; |
329 m_phoneNotes->showGlobalNote( |
330 m_phoneNotes->showNotificationDialog(hbTrId("txt_phone_info_barring_activated")); |
330 m_activeNoteId, |
|
331 hbTrId("txt_phone_info_barring_activated"), |
|
332 HbMessageBox::MessageTypeInformation); |
|
333 } |
331 } |
334 |
332 |
335 // Password editing is enabled only after all barring statuses are |
333 // Password editing is enabled only after all barring statuses are |
336 // queried. Otherwise user may be able to issue two requests |
334 // queried. Otherwise user may be able to issue two requests |
337 // simultaneously by hiding status query progress note and clicking |
335 // simultaneously by hiding status query progress note and clicking |
338 // edit password. |
336 // edit password. |
339 if (!m_editBarringPasswordItem->isEnabled()) { |
337 if (!m_editBarringPasswordItem->isEnabled()) { |
340 m_editBarringPasswordItem->setEnabled(true); |
338 m_editBarringPasswordItem->setEnabled(true); |
341 m_helper.addConnection( |
339 m_helper.addConnection( |
342 m_editBarringPasswordItem, SIGNAL(clicked(bool)), |
340 m_editBarringPasswordItem, SIGNAL(valueChanged(QPersistentModelIndex, QVariant)), |
343 this, SLOT(changeBarringPasswordRequested(bool))); |
341 this, SLOT(changeBarringPasswordRequested())); |
344 } |
342 } |
345 } else { |
343 } else { |
346 processBarringStatusRequestQueue(); |
344 processBarringStatusRequestQueue(); |
347 } |
345 } |
348 |
346 |
363 << "barringStatus:" << barringStatus << "plural:" << plural; |
361 << "barringStatus:" << barringStatus << "plural:" << plural; |
364 Q_UNUSED(barringType) |
362 Q_UNUSED(barringType) |
365 Q_UNUSED(barringStatus) |
363 Q_UNUSED(barringStatus) |
366 Q_UNUSED(plural) |
364 Q_UNUSED(plural) |
367 |
365 |
368 CpSettingFormItemData *barringItem = m_barringRequestQueue.dequeue(); |
366 if (!m_barringRequestQueue.isEmpty()) { |
369 if (PSetCallBarringWrapper::BarringErrorNone == result) { |
367 CpSettingFormItemData *barringItem = m_barringRequestQueue.dequeue(); |
370 if (updateDependentBarringProgramStatuses(*barringItem)) { |
368 if (PSetCallBarringWrapper::BarringErrorNone == result) { |
371 // Indicate barring activation completion only when dependent |
369 if (updateDependentBarringProgramStatuses(*barringItem)) { |
372 // barring items are also updated. |
370 // Indicate barring activation completion only when dependent |
373 m_delayedBarringActivationNote = true; |
371 // barring items are also updated. |
|
372 m_delayedBarringActivationNote = true; |
|
373 } else { |
|
374 m_phoneNotes->cancelNote(m_activeNoteId); |
|
375 m_phoneNotes->showNotificationDialog(hbTrId("txt_phone_info_barring_activated")); |
|
376 } |
374 } else { |
377 } else { |
|
378 revertCheckStateOfItem(barringItem); |
|
379 |
375 m_phoneNotes->cancelNote(m_activeNoteId); |
380 m_phoneNotes->cancelNote(m_activeNoteId); |
376 m_phoneNotes->showGlobalNote( |
381 m_phoneNotes->showGlobalErrorNote(m_activeNoteId, result); |
377 m_activeNoteId, |
382 } |
378 hbTrId("txt_phone_info_barring_activated"), |
|
379 HbMessageBox::MessageTypeInformation); |
|
380 } |
|
381 } else { |
|
382 revertCheckStateOfItem(barringItem); |
|
383 |
|
384 m_phoneNotes->cancelNote(m_activeNoteId); |
|
385 m_phoneNotes->showGlobalErrorNote(m_activeNoteId, result); |
|
386 } |
383 } |
387 |
384 |
388 DPRINT << ": OUT"; |
385 DPRINT << ": OUT"; |
389 } |
386 } |
390 |
387 |
404 Q_UNUSED(barringStatus) |
401 Q_UNUSED(barringStatus) |
405 Q_UNUSED(plural) |
402 Q_UNUSED(plural) |
406 |
403 |
407 m_phoneNotes->cancelNote(m_activeNoteId); |
404 m_phoneNotes->cancelNote(m_activeNoteId); |
408 |
405 |
409 CpSettingFormItemData *barringItem = m_barringRequestQueue.dequeue(); |
|
410 if (PSetCallBarringWrapper::BarringErrorNone == result) { |
406 if (PSetCallBarringWrapper::BarringErrorNone == result) { |
411 m_phoneNotes->showGlobalNote( |
407 m_phoneNotes->showNotificationDialog(hbTrId("txt_phone_info_barring_deactivated")); |
412 m_activeNoteId, |
|
413 hbTrId("txt_phone_info_barring_deactivated"), |
|
414 HbMessageBox::MessageTypeInformation); |
|
415 } else { |
408 } else { |
416 revertCheckStateOfItem(barringItem); |
409 if (!m_barringRequestQueue.isEmpty()) { |
|
410 CpSettingFormItemData *barringItem = m_barringRequestQueue.dequeue(); |
|
411 revertCheckStateOfItem(barringItem); |
|
412 } |
417 |
413 |
418 m_phoneNotes->showGlobalErrorNote(m_activeNoteId, result); |
414 m_phoneNotes->showGlobalErrorNote(m_activeNoteId, result); |
419 } |
415 } |
420 |
416 |
421 DPRINT << ": OUT"; |
417 DPRINT << ": OUT"; |
453 (!m_barringRequestQueue.isEmpty())) { |
446 (!m_barringRequestQueue.isEmpty())) { |
454 |
447 |
455 CpSettingFormItemData *item = m_barringRequestQueue.head(); |
448 CpSettingFormItemData *item = m_barringRequestQueue.head(); |
456 PSetCallBarringWrapper::BarringType barringType = |
449 PSetCallBarringWrapper::BarringType barringType = |
457 qvariant_cast<PSetCallBarringWrapper::BarringType>( |
450 qvariant_cast<PSetCallBarringWrapper::BarringType>( |
458 item->property("barringType")); |
451 item->contentWidgetData("barringType")); |
459 m_barringWrapper->barringStatus(ServiceGroupVoice, barringType); |
452 m_barringWrapper->barringStatus(ServiceGroupVoice, barringType); |
460 |
453 |
461 m_barringStatusRequestOngoing = true; |
454 m_barringStatusRequestOngoing = true; |
462 |
455 |
463 if (!m_phoneNotes->noteShowing()) { |
456 if (!m_phoneNotes->noteShowing()) { |
464 // Launch progress note only once for status update. |
457 // Launch progress note only once for status update. |
465 m_phoneNotes->showGlobalProgressNote( |
458 m_phoneNotes->showGlobalProgressNote( |
466 m_activeNoteId, hbTrId("txt_phone_info_requesting")); |
459 m_activeNoteId, hbTrId("txt_common_info_requesting")); |
467 } |
460 } |
468 } |
461 } |
469 |
462 |
470 DPRINT << ": OUT"; |
463 DPRINT << ": OUT"; |
471 } |
464 } |
515 DPRINT << ": IN"; |
508 DPRINT << ": IN"; |
516 |
509 |
517 QObject::disconnect( |
510 QObject::disconnect( |
518 m_phoneNotes, SIGNAL(passwordQueryCompleted(QString, bool)), |
511 m_phoneNotes, SIGNAL(passwordQueryCompleted(QString, bool)), |
519 this, SLOT(completeBarringStateChangeRequestHandling(QString, bool))); |
512 this, SLOT(completeBarringStateChangeRequestHandling(QString, bool))); |
520 if (okPressed) { |
513 if (okPressed && m_clickedBarringItem) { |
521 QVariant checkState = m_clickedBarringItem->contentWidgetData("checkState"); |
514 QVariant checkState = m_clickedBarringItem->contentWidgetData("checkState"); |
522 if (Qt::Checked == checkState.toInt()) { |
515 if (Qt::Checked == checkState.toInt()) { |
523 m_barringWrapper->enableBarring( |
516 m_barringWrapper->enableBarring( |
524 ServiceGroupVoice, |
517 ServiceGroupVoice, |
525 qvariant_cast<PSetCallBarringWrapper::BarringType>( |
518 qvariant_cast<PSetCallBarringWrapper::BarringType>( |
526 m_clickedBarringItem->property("barringType")), |
519 m_clickedBarringItem->contentWidgetData("barringType")), |
527 barringPassword); |
520 barringPassword); |
528 } else { |
521 } else { |
529 m_barringWrapper->disableBarring( |
522 m_barringWrapper->disableBarring( |
530 ServiceGroupVoice, |
523 ServiceGroupVoice, |
531 qvariant_cast<PSetCallBarringWrapper::BarringType>( |
524 qvariant_cast<PSetCallBarringWrapper::BarringType>( |
532 m_clickedBarringItem->property("barringType")), |
525 m_clickedBarringItem->contentWidgetData("barringType")), |
533 barringPassword); |
526 barringPassword); |
534 } |
527 } |
535 |
528 |
536 m_barringRequestQueue.enqueue(m_clickedBarringItem); |
529 m_barringRequestQueue.enqueue(m_clickedBarringItem); |
537 m_phoneNotes->showGlobalProgressNote( |
530 m_phoneNotes->showGlobalProgressNote( |
538 m_activeNoteId, hbTrId("txt_phone_info_requesting")); |
531 m_activeNoteId, hbTrId("txt_common_info_requesting")); |
539 } else { |
532 } else if (m_clickedBarringItem) { |
540 revertCheckStateOfItem(m_clickedBarringItem); |
533 revertCheckStateOfItem(m_clickedBarringItem); |
541 } |
534 } |
542 m_clickedBarringItem = NULL; |
535 m_clickedBarringItem = NULL; |
543 |
536 |
544 DPRINT << ": OUT"; |
537 DPRINT << ": OUT"; |
545 } |
538 } |
546 |
539 |
547 /*! |
540 /*! |
548 CpBarringPluginGroup::changeBarringPasswordRequested. |
541 CpBarringPluginGroup::changeBarringPasswordRequested. |
549 */ |
542 */ |
550 void CpBarringPluginGroup::changeBarringPasswordRequested(bool checked) |
543 void CpBarringPluginGroup::changeBarringPasswordRequested() |
551 { |
544 { |
552 DPRINT << ": IN"; |
545 DPRINT << ": IN"; |
553 Q_UNUSED(checked) |
|
554 |
546 |
555 m_changeBarringPasswordPhase = CurrentPasswordPhase; |
547 m_changeBarringPasswordPhase = CurrentPasswordPhase; |
556 QString currentPasswordQueryDialogTitle( |
548 QString currentPasswordQueryDialogTitle( |
557 hbTrId("txt_phone_info_current_password")); |
549 hbTrId("txt_phone_info_current_password")); |
558 QObject::connect( |
550 QObject::connect( |
649 DPRINT << ": IN"; |
641 DPRINT << ": IN"; |
650 |
642 |
651 CpSettingFormItemData* barringItem = NULL; |
643 CpSettingFormItemData* barringItem = NULL; |
652 PSetCallBarringWrapper::BarringType barringType = |
644 PSetCallBarringWrapper::BarringType barringType = |
653 qvariant_cast<PSetCallBarringWrapper::BarringType>( |
645 qvariant_cast<PSetCallBarringWrapper::BarringType>( |
654 changedBarringItem.property("barringType")); |
646 changedBarringItem.contentWidgetData("barringType")); |
655 QList<CpSettingFormItemData*> itemCandidatesForUpdate; |
647 QList<CpSettingFormItemData*> itemCandidatesForUpdate; |
656 switch (barringType) { |
648 switch (barringType) { |
657 case PSetCallBarringWrapper::BarringTypeAllOutgoing: |
649 case PSetCallBarringWrapper::BarringTypeAllOutgoing: |
658 { |
650 { |
659 barringItem = &barringItemByProgram( |
651 barringItem = &barringItemByProgram( |
748 for (int childInd = 0; (childInd < numOfChilds) && (!item); childInd++) { |
740 for (int childInd = 0; (childInd < numOfChilds) && (!item); childInd++) { |
749 CpSettingFormItemData *itemCandidate = |
741 CpSettingFormItemData *itemCandidate = |
750 static_cast<CpSettingFormItemData*>(childAt(childInd)); |
742 static_cast<CpSettingFormItemData*>(childAt(childInd)); |
751 PSetCallBarringWrapper::BarringType candidateBarringProgram = |
743 PSetCallBarringWrapper::BarringType candidateBarringProgram = |
752 qvariant_cast<PSetCallBarringWrapper::BarringType>( |
744 qvariant_cast<PSetCallBarringWrapper::BarringType>( |
753 itemCandidate->property("barringType")); |
745 itemCandidate->contentWidgetData("barringType")); |
754 if (candidateBarringProgram == barringProgram) { |
746 if (candidateBarringProgram == barringProgram) { |
755 item = itemCandidate; |
747 item = itemCandidate; |
756 } |
748 } |
757 } |
749 } |
758 |
750 |