67 model->appendDataFormItem(createRoamDataUsageItem()); |
67 model->appendDataFormItem(createRoamDataUsageItem()); |
68 setModel(model.take()); |
68 setModel(model.take()); |
69 m_pSetWrapper = pSetWrapperGuard.take(); |
69 m_pSetWrapper = pSetWrapperGuard.take(); |
70 m_cpSettingsWrapper = cpSettingsWrapperGuard.take(); |
70 m_cpSettingsWrapper = cpSettingsWrapperGuard.take(); |
71 |
71 |
72 if(!isPhoneOnLine()) { |
|
73 DPRINT << "offline, set dimmed"; |
|
74 m_NetworkOperatorSelectionItemData->setEnabled(false); |
|
75 } |
|
76 |
|
77 DPRINT << ": OUT"; |
72 DPRINT << ": OUT"; |
78 } |
73 } |
79 |
74 |
80 |
75 |
81 /*! |
76 /*! |
288 void CpNetworkPluginForm::networkModeStateChanged(int index) |
283 void CpNetworkPluginForm::networkModeStateChanged(int index) |
289 { |
284 { |
290 // #1C network mode changed |
285 // #1C network mode changed |
291 DPRINT << ": IN : index: " << index; |
286 DPRINT << ": IN : index: " << index; |
292 |
287 |
293 if(isPhoneOnLine()) { |
288 if(m_cpSettingsWrapper->isPhoneOffline()) { |
|
289 // offline mode. |
|
290 m_psetNetworkWrapper->getNetworkAccessMode(); |
|
291 emit showGlobalNote( |
|
292 m_activeNoteId, |
|
293 emit hbTrId("Off-line, not allowed"), |
|
294 HbMessageBox::MessageTypeInformation); |
|
295 } else if(m_cpSettingsWrapper->isOngoingCall()) { |
|
296 // ongoing call. |
|
297 m_psetNetworkWrapper->getNetworkAccessMode(); |
|
298 emit showGlobalNote( |
|
299 m_activeNoteId, |
|
300 emit hbTrId("txt_cp_info_active_calls_must_be_disconnected_befo"), |
|
301 HbMessageBox::MessageTypeInformation); |
|
302 } else { |
|
303 // ok case |
294 if(index == 0) { |
304 if(index == 0) { |
295 dualModeSelection(); |
305 dualModeSelection(); |
296 } else if(index == 1) { |
306 } else if(index == 1) { |
297 umtsSelection(); |
307 umtsSelection(); |
298 } else if(index == 2) { |
308 } else if(index == 2) { |
299 gsmSelection(); |
309 gsmSelection(); |
300 } |
310 } |
301 } else { |
311 } |
302 // offline mode. |
312 |
|
313 DPRINT << ": OUT"; |
|
314 } |
|
315 |
|
316 |
|
317 /*! |
|
318 CpNetworkPluginForm::operatorSelectionStateChanged |
|
319 */ |
|
320 void CpNetworkPluginForm::operatorSelectionStateChanged() |
|
321 { |
|
322 // #2C operator selection mode changed |
|
323 DPRINT << ": IN "; |
|
324 |
|
325 if (m_cpSettingsWrapper->isPhoneOffline()) { |
|
326 // off line |
|
327 restoreOperatorSelectionUi(); |
303 emit showGlobalNote( |
328 emit showGlobalNote( |
304 m_activeNoteId, |
329 m_activeNoteId, |
305 emit hbTrId("Operation not possible in Off-line mode"), |
330 emit hbTrId("txt_cp_info_operator_selection_is_not_possible_in"), |
306 HbMessageBox::MessageTypeInformation); |
331 HbMessageBox::MessageTypeInformation); |
307 } |
332 } else if(m_cpSettingsWrapper->isOngoingCall()) { |
308 |
333 // ongoing call. |
309 DPRINT << ": OUT"; |
334 restoreOperatorSelectionUi(); |
310 } |
335 emit showGlobalNote( |
311 |
336 m_activeNoteId, |
312 |
337 emit hbTrId("txt_cp_info_active_calls_must_be_disconnected_befo"), |
313 /*! |
338 HbMessageBox::MessageTypeInformation); |
314 CpNetworkPluginForm::operatorSelectionStateChanged |
339 } else { |
315 */ |
340 // ok case |
316 void CpNetworkPluginForm::operatorSelectionStateChanged(bool) |
|
317 { |
|
318 // #2C operator selection mode changed |
|
319 DPRINT << ": IN "; |
|
320 |
|
321 if (isPhoneOnLine()) { |
|
322 PSetNetworkWrapper::NetworkSelectionMode mode; |
341 PSetNetworkWrapper::NetworkSelectionMode mode; |
323 m_psetNetworkWrapper->getNetworkSelectionMode(mode); |
342 PSetNetworkWrapper::ErrorCode err = |
|
343 m_psetNetworkWrapper->getNetworkSelectionMode(mode); |
|
344 |
|
345 if(err == PSetNetworkWrapper::ErrNoError) { |
324 switch (mode) { |
346 switch (mode) { |
325 case PSetNetworkWrapper::SelectionModeAutomatic: |
347 case PSetNetworkWrapper::SelectionModeAutomatic: |
326 manualOperatorSelection(); |
348 manualOperatorSelection(); |
327 m_NetworkOperatorSelectionItemData->setContentWidgetData( |
349 m_NetworkOperatorSelectionItemData->setContentWidgetData( |
328 "text", QVariant(hbTrId("txt_cp_setlabel_operator_selection_val_manual"))); |
350 "text", QVariant(hbTrId("txt_cp_setlabel_operator_selection_val_manual"))); |
591 |
621 |
592 if (ongoing) { |
622 if (ongoing) { |
593 QObject::connect( |
623 QObject::connect( |
594 CpPhoneNotes::instance(), SIGNAL(progressNoteCanceled()), |
624 CpPhoneNotes::instance(), SIGNAL(progressNoteCanceled()), |
595 this, SLOT(userCancel())); |
625 this, SLOT(userCancel())); |
596 emit showGlobalProgressNote(m_activeProgressNoteId, hbTrId("Requesting")); |
626 emit showGlobalProgressNote(m_activeProgressNoteId, hbTrId("txt_common_info_requesting")); |
597 } else { |
627 } else { |
598 QObject::disconnect( |
628 QObject::disconnect( |
599 CpPhoneNotes::instance(), SIGNAL(progressNoteCanceled()), |
629 CpPhoneNotes::instance(), SIGNAL(progressNoteCanceled()), |
600 this, SLOT(userCancel())); |
630 this, SLOT(userCancel())); |
601 emit cancelNote(m_activeProgressNoteId); |
631 emit cancelNote(m_activeProgressNoteId); |
707 m_psetNetworkWrapper->selectNetwork(param); |
737 m_psetNetworkWrapper->selectNetwork(param); |
708 } |
738 } |
709 } else { |
739 } else { |
710 DPRINT << ": Cancel"; |
740 DPRINT << ": Cancel"; |
711 m_psetNetworkWrapper->cancelRequest(); |
741 m_psetNetworkWrapper->cancelRequest(); |
712 restoreUiSelection(); |
742 restoreOperatorSelectionUi(); |
713 } |
743 } |
714 m_dialog->deleteLater(); |
744 m_dialog->deleteLater(); |
715 m_dialog = NULL; |
745 m_dialog = NULL; |
716 } |
746 } |
717 |
747 |
718 DPRINT << ": OUT"; |
748 DPRINT << ": OUT"; |
719 } |
749 } |
720 |
750 |
721 /*! |
751 /*! |
722 CpNetworkPluginForm::restoreUiSelection |
752 CpNetworkPluginForm::restoreOperatorSelectionUi |
723 */ |
753 */ |
724 void CpNetworkPluginForm::restoreUiSelection() |
754 void CpNetworkPluginForm::restoreOperatorSelectionUi() |
725 { |
755 { |
726 DPRINT << ": IN"; |
756 DPRINT << ": IN"; |
727 |
757 |
728 removeConnection( |
758 removeConnection( |
729 m_NetworkOperatorSelectionItemData, SIGNAL(currentIndexChanged(int)), |
759 m_NetworkOperatorSelectionItemData, SIGNAL(valueChanged(QPersistentModelIndex, QVariant)), |
730 this, SLOT(operatorSelectionStateChanged(int))); |
760 this, SLOT(operatorSelectionStateChanged())); |
731 PSetNetworkWrapper::NetworkSelectionMode mode; |
761 PSetNetworkWrapper::NetworkSelectionMode mode; |
732 PSetNetworkWrapper::ErrorCode err = |
762 PSetNetworkWrapper::ErrorCode err = |
733 m_psetNetworkWrapper->getNetworkSelectionMode(mode); |
763 m_psetNetworkWrapper->getNetworkSelectionMode(mode); |
734 if(err == PSetNetworkWrapper::ErrNoError) { |
764 if(err == PSetNetworkWrapper::ErrNoError) { |
735 switch (mode) { |
765 switch (mode) { |