15 * |
15 * |
16 */ |
16 */ |
17 |
17 |
18 #include <hbdataformmodel.h> |
18 #include <hbdataformmodel.h> |
19 #include <hbdataformmodelitem.h> |
19 #include <hbdataformmodelitem.h> |
20 #include <hblineedit.h> |
|
21 #include <hbinputeditorinterface.h> |
|
22 #include <hbcombobox.h> |
|
23 #include <hbdeviceprogressdialog.h> |
|
24 #include <sssettingswrapper.h> |
20 #include <sssettingswrapper.h> |
25 #include <psetwrapper.h> |
21 #include <psetwrapper.h> |
26 #include <hbaction.h> |
|
27 #include <hblistwidget.h> |
|
28 #include <hblistwidgetitem.h> |
|
29 #include <hblabel.h> |
|
30 #include <hbparameterlengthlimiter.h> |
|
31 #include <cpitemdatahelper.h> |
22 #include <cpitemdatahelper.h> |
32 #include <psuinotes.h> |
23 #include <psuinotes.h> |
33 #include "cpdivertplugingroup.h" |
24 #include "cpdivertplugingroup.h" |
34 #include "cpplugincommon.h" |
25 #include "cpplugincommon.h" |
35 #include "cppluginlogging.h" |
26 #include "cppluginlogging.h" |
36 #include "cpdivertitemdata.h" |
27 #include "cpdivertitemdata.h" |
|
28 #include "cpdivertquery.h" |
37 |
29 |
38 Q_DECLARE_METATYPE(PsCallDivertingCondition) |
30 Q_DECLARE_METATYPE(PsCallDivertingCondition) |
39 Q_DECLARE_METATYPE(PsServiceGroup) |
31 Q_DECLARE_METATYPE(PsServiceGroup) |
40 |
|
41 // CONSTANTS |
|
42 const QString KOtherNumber("otherNumber"); |
|
43 |
32 |
44 /*! |
33 /*! |
45 CpDivertPluginGroup::CpDivertPluginGroup. |
34 CpDivertPluginGroup::CpDivertPluginGroup. |
46 */ |
35 */ |
47 CpDivertPluginGroup::CpDivertPluginGroup(CpItemDataHelper &helper) |
36 CpDivertPluginGroup::CpDivertPluginGroup(CpItemDataHelper &helper) |
100 m_callDivertingWrapper, |
88 m_callDivertingWrapper, |
101 SIGNAL(requestDone()), |
89 SIGNAL(requestDone()), |
102 this, |
90 this, |
103 SLOT(divertRequestProcessed())); |
91 SLOT(divertRequestProcessed())); |
104 |
92 |
|
93 m_activateDivertPopUp = new CpDivertQuery(*m_callDivertingWrapper); |
|
94 QObject::connect( |
|
95 m_activateDivertPopUp, |
|
96 SIGNAL(result(PSCallDivertingCommand &)), |
|
97 this, |
|
98 SLOT(divertQueryOk(PSCallDivertingCommand &))); |
|
99 |
|
100 QObject::connect( |
|
101 m_activateDivertPopUp, |
|
102 SIGNAL(cancelled(PSCallDivertingCommand &)), |
|
103 this, |
|
104 SLOT(divertQueryCancelled(PSCallDivertingCommand &))); |
|
105 |
|
106 QObject::connect( |
|
107 m_activateDivertPopUp, |
|
108 SIGNAL(handleDivertingError(int)), |
|
109 this, |
|
110 SLOT(handleDivertingError(int))); |
|
111 |
105 // Listen form item visibility change |
112 // Listen form item visibility change |
106 m_helper.connectToForm( |
113 m_helper.connectToForm( |
107 SIGNAL(itemShown(QModelIndex)), this, SLOT(itemShown(QModelIndex))); |
114 SIGNAL(itemShown(QModelIndex)), this, SLOT(itemShown(QModelIndex))); |
108 |
115 |
109 // Create grouped setting items |
116 // Create grouped setting items |
110 createVoiceCallItems(this); |
117 createVoiceCallItems(this); |
111 createVideoCallItems(this); |
118 createVideoCallItems(this); |
112 |
119 |
113 DPRINT << ": OUT"; |
120 DPRINT << ": OUT"; |
114 } |
121 } |
115 |
122 |
116 /*! |
123 /*! |
117 CpDivertPluginGroup::~CpDivertPluginGroup. |
124 CpDivertPluginGroup::~CpDivertPluginGroup. |
118 */ |
125 */ |
119 CpDivertPluginGroup::~CpDivertPluginGroup() |
126 CpDivertPluginGroup::~CpDivertPluginGroup() |
120 { |
127 { |
121 DPRINT << ": IN"; |
128 DPRINT << ": IN"; |
122 |
129 delete m_activateDivertPopUp; |
123 delete m_pSetWrapper; |
130 delete m_pSetWrapper; |
124 delete m_ssSettingsWrapper; |
131 delete m_ssSettingsWrapper; |
125 |
132 |
126 DPRINT << ": OUT"; |
133 DPRINT << ": OUT"; |
127 } |
134 } |
510 DPRINT << ": OUT"; |
542 DPRINT << ": OUT"; |
511 return ret; |
543 return ret; |
512 } |
544 } |
513 |
545 |
514 /*! |
546 /*! |
|
547 CpDivertPluginGroup::disableDivertItems. |
|
548 */ |
|
549 void CpDivertPluginGroup::disableDivertItems(){ |
|
550 DPRINT << ": IN"; |
|
551 |
|
552 m_DataItemVoiceAllCalls->setEnabled(false); |
|
553 m_DataItemVoiceIfBusy->setEnabled(false); |
|
554 m_DataItemVoiceIfNotAnswered->setEnabled(false); |
|
555 m_DataItemVoiceIfOutOfReach->setEnabled(false); |
|
556 m_DataItemVoiceIfNotAvailable->setEnabled(false); |
|
557 |
|
558 m_DataItemVideoAllCalls->setEnabled(false); |
|
559 m_DataItemVideoIfBusy->setEnabled(false); |
|
560 m_DataItemVideoIfNotAnswered->setEnabled(false); |
|
561 m_DataItemVideoIfOutOfReach->setEnabled(false); |
|
562 m_DataItemVideoIfNotAvailable->setEnabled(false); |
|
563 |
|
564 DPRINT << ": OUT"; |
|
565 } |
|
566 |
|
567 /*! |
|
568 CpDivertPluginGroup::enableDivertItems. |
|
569 */ |
|
570 void CpDivertPluginGroup::enableDivertItems(){ |
|
571 DPRINT << ": IN"; |
|
572 |
|
573 // all calls divert activation deactivates automatically other diverts |
|
574 QVariant itemState = m_DataItemVoiceAllCalls->contentWidgetData("checkState"); |
|
575 if ((itemState.isValid()) && |
|
576 (itemState.toInt() == Qt::Checked) && |
|
577 (m_DataItemVoiceAllCalls->contentWidgetData("text") != "")) { |
|
578 m_DataItemVoiceAllCalls->setEnabled(true); |
|
579 deactivateDependentDivertOption(m_DataItemVoiceIfBusy); |
|
580 deactivateDependentDivertOption(m_DataItemVoiceIfNotAnswered); |
|
581 deactivateDependentDivertOption(m_DataItemVoiceIfOutOfReach); |
|
582 deactivateDependentDivertOption(m_DataItemVoiceIfNotAvailable); |
|
583 }else{ |
|
584 m_DataItemVoiceAllCalls->setEnabled(true); |
|
585 m_DataItemVoiceIfBusy->setEnabled(true); |
|
586 m_DataItemVoiceIfNotAnswered->setEnabled(true); |
|
587 m_DataItemVoiceIfOutOfReach->setEnabled(true); |
|
588 m_DataItemVoiceIfNotAvailable->setEnabled(true); |
|
589 } |
|
590 |
|
591 // all calls divert activation deactivates automatically other diverts |
|
592 itemState = m_DataItemVideoAllCalls->contentWidgetData("checkState"); |
|
593 if ((itemState.isValid()) && |
|
594 (itemState.toInt() == Qt::Checked) && |
|
595 (m_DataItemVideoAllCalls->contentWidgetData("text") != "")) { |
|
596 m_DataItemVideoAllCalls->setEnabled(true); |
|
597 deactivateDependentDivertOption(m_DataItemVideoIfBusy); |
|
598 deactivateDependentDivertOption(m_DataItemVideoIfNotAnswered); |
|
599 deactivateDependentDivertOption(m_DataItemVideoIfOutOfReach); |
|
600 deactivateDependentDivertOption(m_DataItemVideoIfNotAvailable); |
|
601 }else{ |
|
602 m_DataItemVideoAllCalls->setEnabled(true); |
|
603 m_DataItemVideoIfBusy->setEnabled(true); |
|
604 m_DataItemVideoIfNotAnswered->setEnabled(true); |
|
605 m_DataItemVideoIfOutOfReach->setEnabled(true); |
|
606 m_DataItemVideoIfNotAvailable->setEnabled(true); |
|
607 } |
|
608 |
|
609 DPRINT << ": OUT"; |
|
610 } |
|
611 |
|
612 /*! |
515 CpDivertPluginGroup::processDivertingRequestQueue. |
613 CpDivertPluginGroup::processDivertingRequestQueue. |
516 */ |
614 */ |
517 void CpDivertPluginGroup::processDivertingRequestQueue() |
615 void CpDivertPluginGroup::processDivertingRequestQueue() |
518 { |
616 { |
519 DPRINT << ": IN"; |
617 DPRINT << ": IN"; |
521 DPRINT << "queue empty : OUT"; |
619 DPRINT << "queue empty : OUT"; |
522 return; |
620 return; |
523 } |
621 } |
524 CpDivertRequestQueueItem request = m_divertRequestQueue.head(); |
622 CpDivertRequestQueueItem request = m_divertRequestQueue.head(); |
525 // Command param |
623 // Command param |
526 m_divertCommand.iServiceGroup = qvariant_cast<PsServiceGroup>( |
624 PSCallDivertingCommand command; |
|
625 command.iServiceGroup = qvariant_cast<PsServiceGroup>( |
527 request.item->property("serviceGroup")); |
626 request.item->property("serviceGroup")); |
528 m_divertCommand.iCondition = qvariant_cast<PsCallDivertingCondition>( |
627 command.iCondition = qvariant_cast<PsCallDivertingCondition>( |
529 request.item->property("condition")); |
628 request.item->property("condition")); |
530 m_divertCommand.iStatus = DivertingStatusUnknown; |
629 command.iStatus = DivertingStatusUnknown; |
531 m_divertCommand.iNumber = ""; |
630 command.iNumber = ""; |
532 m_divertCommand.iNoReplyTimer = 0; |
631 command.iNoReplyTimer = 0; |
533 |
632 |
534 switch (request.request) { |
633 switch (request.request) { |
535 case ActivateDivert: { |
634 case ActivateDivert: { |
536 DPRINT << "activate"; |
635 DPRINT << "activate"; |
537 m_divertCommand.iSetting = RegisterDiverting; |
636 command.iSetting = RegisterDiverting; |
538 m_activateDivertPhase = PopUpVoiceNumberListQueryPhase; |
637 m_activateDivertPopUp->show( |
539 popUpVoiceNumberListQuery( |
638 request.item->property("queryLabel").toString(), |
540 request.item->property("queryLabel").toString(), |
639 command, |
541 m_divertCommand.iServiceGroup); |
640 request.item->property("needTimeoutInfo").toBool()); |
542 } |
641 } |
543 break; |
642 break; |
544 case DeactivateDivert: { |
643 case DeactivateDivert: { |
545 DPRINT << "deactivate"; |
644 DPRINT << "deactivate"; |
546 m_divertCommand.iSetting = EraseDiverting; |
645 command.iSetting = EraseDiverting; |
547 setCallDiverting(m_divertCommand); |
646 setCallDiverting(command); |
548 } |
647 } |
549 break; |
648 break; |
550 case CheckDivertStatus: { |
649 case CheckDivertStatus: { |
551 DPRINT << "check status"; |
650 DPRINT << "check status"; |
552 m_callDivertingWrapper->getCallDivertingStatus( |
651 m_callDivertingWrapper->getCallDivertingStatus( |
553 m_divertCommand.iServiceGroup, |
652 command.iServiceGroup, |
554 m_divertCommand.iCondition, |
653 command.iCondition, |
555 bscParam(m_divertCommand.iServiceGroup) ); |
654 bscParam(command.iServiceGroup) ); |
556 |
655 if (!m_activeProgressNoteId && !PsUiNotes::instance()->noteShowing()) { |
557 if (!PsUiNotes::instance()->noteShowing()) { |
|
558 PsUiNotes::instance()->showGlobalProgressNote( |
656 PsUiNotes::instance()->showGlobalProgressNote( |
559 m_activeProgressNoteId, |
657 m_activeProgressNoteId, |
560 hbTrId("txt_common_info_requesting")); |
658 hbTrId("txt_common_info_requesting")); |
561 } |
659 } |
562 } |
660 } |
707 PsUiNotes::instance()->cancelNote(m_activeNoteId); |
805 PsUiNotes::instance()->cancelNote(m_activeNoteId); |
708 |
806 |
709 // Show error note |
807 // Show error note |
710 PsUiNotes::instance()->showGlobalErrorNote(m_activeNoteId, aReason); |
808 PsUiNotes::instance()->showGlobalErrorNote(m_activeNoteId, aReason); |
711 |
809 |
712 DPRINT << ": OUT"; |
810 divertRequestProcessed(); |
713 } |
811 |
714 |
812 DPRINT << ": OUT"; |
715 /*! |
813 } |
716 CpDivertPluginGroup::popUpVoiceNumberListQuery. |
814 |
717 */ |
|
718 void CpDivertPluginGroup::popUpVoiceNumberListQuery( |
|
719 const QString& heading, PsServiceGroup serviceGroup) |
|
720 { |
|
721 DPRINT << ": IN"; |
|
722 if (m_dialog) { |
|
723 m_dialog->deleteLater(); |
|
724 m_dialog = NULL; |
|
725 } |
|
726 |
|
727 m_divertCommand.iNumber.clear(); |
|
728 QStringList defNumbers; |
|
729 QScopedPointer<HbDialog> dialog(createDialog(heading)); |
|
730 HbListWidget *list = new HbListWidget(dialog.data()); |
|
731 |
|
732 QString vmbxNumber; |
|
733 int vmbxErr = 0; |
|
734 if (serviceGroup == ServiceGroupVoice) { |
|
735 vmbxErr = m_callDivertingWrapper->getVoiceMailBoxNumber( |
|
736 vmbxNumber, ServiceGroupVoice); |
|
737 |
|
738 } else if(serviceGroup == ServiceGroupData) { |
|
739 vmbxErr = m_callDivertingWrapper->getVoiceMailBoxNumber( |
|
740 vmbxNumber, ServiceGroupData); |
|
741 |
|
742 } else { |
|
743 vmbxErr = -1; |
|
744 // Skip |
|
745 } |
|
746 |
|
747 if (!vmbxErr) { |
|
748 if (serviceGroup == ServiceGroupVoice) { |
|
749 addItemToListWidget( |
|
750 list, |
|
751 hbTrId("txt_phone_setlabel_voice_mbx"), |
|
752 vmbxNumber ); |
|
753 |
|
754 } else { |
|
755 addItemToListWidget( |
|
756 list, |
|
757 hbTrId("txt_phone_setlabel_video_mbx"), |
|
758 vmbxNumber ); |
|
759 } |
|
760 } |
|
761 |
|
762 // Add "old" divert number to list |
|
763 m_callDivertingWrapper->getDefaultNumbers(defNumbers); |
|
764 int count(defNumbers.count()); |
|
765 for (int i = 0; i < count; i++) { |
|
766 addItemToListWidget(list, defNumbers[i], defNumbers[i]); |
|
767 } |
|
768 addItemToListWidget( |
|
769 list, |
|
770 hbTrId("txt_phone_list_enter_number_manually"), |
|
771 KOtherNumber ); |
|
772 dialog->setContentWidget(list); |
|
773 |
|
774 // Connect list item activation signal to close the popup |
|
775 QObject::connect(list, |
|
776 SIGNAL(activated(HbListWidgetItem*)), |
|
777 dialog.data(), |
|
778 SLOT(close()), |
|
779 Qt::UniqueConnection); |
|
780 |
|
781 // Sets the "Cancel"-action/button |
|
782 HbAction *cancelAction = new HbAction(hbTrId( |
|
783 "txt_common_button_cancel"), |
|
784 dialog.data()); |
|
785 dialog->addAction(cancelAction); |
|
786 QObject::connect(cancelAction, |
|
787 SIGNAL(triggered(bool)), |
|
788 dialog.data(), |
|
789 SLOT(close())); |
|
790 |
|
791 dialog->open(this, SLOT(voiceNumberListQueryClosed(HbAction *))); |
|
792 m_dialog = dialog.take(); |
|
793 DPRINT << ": OUT"; |
|
794 } |
|
795 |
|
796 /*! |
|
797 CpDivertPluginGroup::voiceNumberListQueryClosed() |
|
798 */ |
|
799 void CpDivertPluginGroup::voiceNumberListQueryClosed(HbAction* action) |
|
800 { |
|
801 DPRINT << ": IN"; |
|
802 HbListWidget *list(NULL); |
|
803 m_divertCommand.iNumber.clear(); |
|
804 bool processNextPhase(true); |
|
805 |
|
806 if (m_dialog) { |
|
807 bool err = QObject::disconnect(m_dialog->contentWidget(), |
|
808 SIGNAL(activated(HbListWidgetItem*)), |
|
809 m_dialog, |
|
810 SLOT(close())); |
|
811 list = qobject_cast<HbListWidget*>(m_dialog->contentWidget()); |
|
812 m_dialog->deleteLater(); |
|
813 m_dialog = NULL; |
|
814 } |
|
815 |
|
816 // Enter if cancel wasn't selected |
|
817 if (!action && list) { |
|
818 // Update the view with selected text |
|
819 QString data = list->currentItem()->data().toString(); |
|
820 QString text = list->currentItem()->text(); |
|
821 |
|
822 DPRINT << ": data: " << data; |
|
823 DPRINT << ": text: " << text; |
|
824 |
|
825 if (data == KOtherNumber) { |
|
826 DPRINT << ": open popUpNumberEditor"; |
|
827 processNextPhase = false; |
|
828 popUpNumberEditor(hbTrId("txt_phone_info_number")); |
|
829 } else if (text == hbTrId("txt_phone_setlabel_voice_mbx")) { |
|
830 DPRINT << ": get voicemailboxnumber"; |
|
831 m_callDivertingWrapper->getVoiceMailBoxNumber( |
|
832 m_divertCommand.iNumber, ServiceGroupVoice); |
|
833 if (m_divertCommand.iNumber.isEmpty()) { |
|
834 DPRINT << ": voicemailboxnumber query"; |
|
835 m_callDivertingWrapper->queryVoiceMailBoxNumber( |
|
836 m_divertCommand.iNumber, ServiceGroupVoice); |
|
837 } |
|
838 } else if (text == hbTrId("txt_phone_setlabel_video_mbx")) { |
|
839 DPRINT << ": get videomailboxnumber"; |
|
840 m_callDivertingWrapper->getVoiceMailBoxNumber( |
|
841 m_divertCommand.iNumber, ServiceGroupData); |
|
842 if (m_divertCommand.iNumber.isEmpty()) { |
|
843 DPRINT << ": videomailboxnumber query"; |
|
844 m_callDivertingWrapper->queryVoiceMailBoxNumber( |
|
845 m_divertCommand.iNumber, ServiceGroupData); |
|
846 } |
|
847 } else { |
|
848 //TODO if matched contact name not work |
|
849 DPRINT << ": else"; |
|
850 m_divertCommand.iNumber = data; |
|
851 } |
|
852 } |
|
853 DPRINT << ": processNextPhase: " << processNextPhase; |
|
854 DPRINT << ": m_divertCommand.iNumber: " << m_divertCommand.iNumber; |
|
855 if (processNextPhase) { |
|
856 if (m_divertCommand.iNumber.isEmpty()) { |
|
857 nextPhaseForActivateDivert(false); |
|
858 } else { |
|
859 nextPhaseForActivateDivert(true); |
|
860 } |
|
861 } |
|
862 |
|
863 DPRINT << ": OUT"; |
|
864 } |
|
865 |
|
866 /*! |
|
867 CpDivertPluginGroup::popUpNumberEditor. |
|
868 */ |
|
869 void CpDivertPluginGroup::popUpNumberEditor( |
|
870 const QString& heading) |
|
871 { |
|
872 DPRINT << ": IN"; |
|
873 |
|
874 if (m_dialog) { |
|
875 m_dialog->deleteLater(); |
|
876 m_dialog = NULL; |
|
877 } |
|
878 QScopedPointer<HbDialog> dialog(createDialog(heading)); |
|
879 |
|
880 HbLineEdit *editor = new HbLineEdit(dialog.data()); |
|
881 editor->setInputMethodHints(Qt::ImhDialableCharactersOnly); |
|
882 //Ownership is transferred |
|
883 dialog->setContentWidget(editor); |
|
884 |
|
885 HbAction *okAction = new HbAction( |
|
886 hbTrId("txt_common_button_ok"), |
|
887 dialog.data()); |
|
888 dialog->addAction(okAction); |
|
889 |
|
890 HbAction *cancelAction = new HbAction( |
|
891 hbTrId("txt_common_button_cancel"), |
|
892 dialog.data()); |
|
893 dialog->addAction(cancelAction); |
|
894 dialog->open(this, SLOT(popUpNumberEditorClosed(HbAction*))); |
|
895 m_dialog = dialog.take(); |
|
896 DPRINT << ": OUT"; |
|
897 } |
|
898 |
|
899 /*! |
|
900 CpDivertPluginGroup::popUpNumberEditorClosed. |
|
901 */ |
|
902 void CpDivertPluginGroup::popUpNumberEditorClosed(HbAction* action) |
|
903 { |
|
904 DPRINT << ": IN"; |
|
905 bool cancelled(true); |
|
906 if (action) { |
|
907 if (action->text() == hbTrId("txt_common_button_ok")) { |
|
908 cancelled = false; |
|
909 DPRINT << ": ok selected"; |
|
910 } |
|
911 } |
|
912 |
|
913 if (!cancelled) { |
|
914 HbLineEdit *editor = qobject_cast<HbLineEdit *>(m_dialog->contentWidget()); |
|
915 if (editor) { |
|
916 m_divertCommand.iNumber = editor->text(); |
|
917 } |
|
918 |
|
919 DPRINT << ": m_divertCommand.iNumber " |
|
920 << m_divertCommand.iNumber; |
|
921 if (m_divertCommand.iNumber.isEmpty()) { |
|
922 PsUiNotes::instance()->showNotificationDialog(hbTrId("txt_phone_info_invalid_phone_number")); |
|
923 } |
|
924 } |
|
925 if (m_dialog) { |
|
926 m_dialog->deleteLater(); |
|
927 m_dialog = NULL; |
|
928 } |
|
929 |
|
930 nextPhaseForActivateDivert(!cancelled); |
|
931 |
|
932 DPRINT << ": OUT"; |
|
933 } |
|
934 |
815 |
935 /*! |
816 /*! |
936 CpDivertPluginGroup::setCallDiverting. |
817 CpDivertPluginGroup::setCallDiverting. |
937 */ |
818 */ |
938 void CpDivertPluginGroup::setCallDiverting(PSCallDivertingCommand& command) |
819 void CpDivertPluginGroup::setCallDiverting(PSCallDivertingCommand& command) |
956 handleDivertingError(result); |
837 handleDivertingError(result); |
957 } |
838 } |
958 |
839 |
959 DPRINT << ": OUT "; |
840 DPRINT << ": OUT "; |
960 } |
841 } |
961 |
|
962 /*! |
|
963 CpDivertPluginGroup::popUpTimerQuery. |
|
964 */ |
|
965 void CpDivertPluginGroup::popUpTimerQuery() |
|
966 { |
|
967 DPRINT << ": IN"; |
|
968 |
|
969 m_divertCommand.iNoReplyTimer = 0; |
|
970 |
|
971 QScopedPointer<HbDialog> dialog(createDialog(hbTrId("txt_phone_title_delay"))); |
|
972 HbListWidget *list = new HbListWidget(dialog.data()); |
|
973 |
|
974 HbParameterLengthLimiter pluralLimiter; |
|
975 pluralLimiter = HbParameterLengthLimiter("txt_phone_list_ln_seconds", 5); |
|
976 addItemToListWidget(list, pluralLimiter, 5 ); |
|
977 pluralLimiter = HbParameterLengthLimiter("txt_phone_list_ln_seconds", 10); |
|
978 addItemToListWidget(list, pluralLimiter, 10); |
|
979 pluralLimiter = HbParameterLengthLimiter("txt_phone_list_ln_seconds", 15); |
|
980 addItemToListWidget(list, pluralLimiter, 15); |
|
981 pluralLimiter = HbParameterLengthLimiter("txt_phone_list_ln_seconds", 20); |
|
982 addItemToListWidget(list, pluralLimiter, 20); |
|
983 pluralLimiter = HbParameterLengthLimiter("txt_phone_list_ln_seconds", 25); |
|
984 addItemToListWidget(list, pluralLimiter, 25); |
|
985 pluralLimiter = HbParameterLengthLimiter("txt_phone_list_ln_seconds", 30); |
|
986 addItemToListWidget(list, pluralLimiter, 30); |
|
987 |
|
988 // Connect list item activation signal to close the popup |
|
989 QObject::connect( |
|
990 list, SIGNAL(activated(HbListWidgetItem*)), |
|
991 dialog.data(), SLOT(close()), |
|
992 Qt::UniqueConnection); |
|
993 |
|
994 // Sets the "Cancel"-action/button |
|
995 HbAction *cancelAction = new HbAction(hbTrId("txt_common_button_cancel")); |
|
996 dialog->addAction(cancelAction); |
|
997 dialog->setContentWidget(list); |
|
998 |
|
999 dialog->open(this, SLOT(popUpTimerQueryClosed(HbAction *))); |
|
1000 if (m_dialog) { |
|
1001 m_dialog->deleteLater(); |
|
1002 m_dialog = NULL; |
|
1003 } |
|
1004 m_dialog = dialog.take(); |
|
1005 |
|
1006 DPRINT << ": OUT"; |
|
1007 } |
|
1008 |
|
1009 /*! |
|
1010 CpDivertPluginGroup::popUpTimerQueryClosed. |
|
1011 */ |
|
1012 void CpDivertPluginGroup::popUpTimerQueryClosed(HbAction* action) |
|
1013 { |
|
1014 DPRINT << ": IN"; |
|
1015 |
|
1016 // If not cancel action selected |
|
1017 bool cancelled(true); |
|
1018 if (!action) { |
|
1019 cancelled = false; |
|
1020 // Update the view with selected text |
|
1021 HbListWidget *list = qobject_cast<HbListWidget*>(m_dialog->contentWidget()); |
|
1022 if (list && list->currentItem()) { |
|
1023 m_divertCommand.iNoReplyTimer = |
|
1024 list->currentItem()->data().toInt(); |
|
1025 } |
|
1026 } |
|
1027 |
|
1028 if (m_dialog) { |
|
1029 m_dialog->deleteLater(); |
|
1030 m_dialog = NULL; |
|
1031 } |
|
1032 |
|
1033 nextPhaseForActivateDivert(!cancelled); |
|
1034 |
|
1035 DPRINT << ": OUT: timeout: " << m_divertCommand.iNoReplyTimer; |
|
1036 } |
|
1037 |
|
1038 |
842 |
1039 /*! |
843 /*! |
1040 CpDivertPluginGroup::bscParam. |
844 CpDivertPluginGroup::bscParam. |
1041 */ |
845 */ |
1042 int CpDivertPluginGroup::bscParam(PsServiceGroup serviceGroup) |
846 int CpDivertPluginGroup::bscParam(PsServiceGroup serviceGroup) |
1069 DPRINT << ": OUT : bsc :" << bsc; |
873 DPRINT << ": OUT : bsc :" << bsc; |
1070 return bsc; |
874 return bsc; |
1071 } |
875 } |
1072 |
876 |
1073 /*! |
877 /*! |
1074 CpDivertPluginGroup::createDialog. |
|
1075 */ |
|
1076 HbDialog* CpDivertPluginGroup::createDialog( const QString& heading ) const |
|
1077 { |
|
1078 DPRINT << ": IN"; |
|
1079 |
|
1080 HbDialog *dialog = new HbDialog(); |
|
1081 dialog->setDismissPolicy(HbDialog::NoDismiss); |
|
1082 dialog->setTimeout(HbDialog::NoTimeout); |
|
1083 dialog->setHeadingWidget(new HbLabel(heading)); |
|
1084 |
|
1085 DPRINT << ": OUT"; |
|
1086 return dialog; |
|
1087 } |
|
1088 |
|
1089 /*! |
|
1090 CpDivertPluginGroup::addItemToListWidget. |
|
1091 */ |
|
1092 void CpDivertPluginGroup::addItemToListWidget(HbListWidget* w, |
|
1093 const QString& item, const QString& data) const |
|
1094 { |
|
1095 DPRINT << ": IN"; |
|
1096 |
|
1097 HbListWidgetItem* o = new HbListWidgetItem(); |
|
1098 o->setText(item); |
|
1099 o->setData(data); |
|
1100 w->addItem(o); |
|
1101 |
|
1102 DPRINT << ": OUT"; |
|
1103 } |
|
1104 |
|
1105 /*! |
|
1106 CpDivertPluginGroup::addItemToListWidget. |
|
1107 */ |
|
1108 void CpDivertPluginGroup::addItemToListWidget(HbListWidget* w, |
|
1109 const QString& item, const int& data) const |
|
1110 { |
|
1111 DPRINT << ": IN"; |
|
1112 |
|
1113 HbListWidgetItem* o = new HbListWidgetItem(); |
|
1114 o->setText(item); |
|
1115 o->setData(data); |
|
1116 w->addItem(o); |
|
1117 |
|
1118 DPRINT << ": OUT"; |
|
1119 } |
|
1120 |
|
1121 /*! |
|
1122 CpDivertPluginGroup::updateDependentDivertOptions. |
878 CpDivertPluginGroup::updateDependentDivertOptions. |
1123 Updates statuses of diverts which are dependent from the status of some |
879 Updates statuses of diverts which are dependent from the status of some |
1124 other divert. Logic for dependent changes are: |
880 other divert. Logic for dependent changes are: |
1125 1. Activation of all calls divert deactivates other diverts/puts them |
881 1. Activation of all calls divert deactivates other diverts/puts them |
1126 into quiescent state. |
882 into quiescent state. |