satui/satapp/src/satappuiprovider.cpp
changeset 27 7eb70891911c
parent 23 427125ac6cb8
child 31 a2467631ae02
equal deleted inserted replaced
23:427125ac6cb8 27:7eb70891911c
    39 const char *SATAPP_DOCML = ":/xml/satapp.docml";
    39 const char *SATAPP_DOCML = ":/xml/satapp.docml";
    40 const char *SATAPP_SETUPMENU_VIEW = "setupmenu_view";
    40 const char *SATAPP_SETUPMENU_VIEW = "setupmenu_view";
    41 const char *SATAPP_SELECTITEM_VIEW = "selectitem_view";
    41 const char *SATAPP_SELECTITEM_VIEW = "selectitem_view";
    42 
    42 
    43 // ======== MEMBER FUNCTIONS ==================================================
    43 // ======== MEMBER FUNCTIONS ==================================================
       
    44 // TODO: #ifndef _DEBUG need to be remove when orbit works well. Now the macro
       
    45 // is to avoid panic on emulator. Deleting pointer before create dialog is to
       
    46 // avoid memory leak in emulator.
    44 
    47 
    45 // ----------------------------------------------------------------------------
    48 // ----------------------------------------------------------------------------
    46 // SatAppUiProvider
    49 // SatAppUiProvider
    47 // ----------------------------------------------------------------------------
    50 // ----------------------------------------------------------------------------
    48 //
    51 //
   263     const int aDuration)
   266     const int aDuration)
   264 {
   267 {
   265     TFLOGSTRING("SATAPP: SatAppUiProvider::showDisplayTextPopup call")
   268     TFLOGSTRING("SATAPP: SatAppUiProvider::showDisplayTextPopup call")
   266     resetUserResponse();
   269     resetUserResponse();
   267     stopShowWaitNote();
   270     stopShowWaitNote();
   268     // Create a note
   271     
       
   272     if (mDisplayPopup){
       
   273         delete mDisplayPopup;
       
   274         mDisplayPopup = NULL;        
       
   275     }
   269     mDisplayPopup = new HbMessageBox(HbMessageBox::MessageTypeInformation);
   276     mDisplayPopup = new HbMessageBox(HbMessageBox::MessageTypeInformation);
   270 
       
   271     if (mDisplayPopup) {
   277     if (mDisplayPopup) {
   272         TFLOGSTRING(
   278         TFLOGSTRING(
   273         "SATAPP: SatAppUiProvider::showDisplayTextPopup note created")
   279         "SATAPP: SatAppUiProvider::showDisplayTextPopup note created")
   274 
   280 
   275         // Set the label as heading widget
   281         // Set the label as heading widget
   276         HbLabel *heading = new HbLabel(aHeading, mDisplayPopup);
   282         HbLabel *lHeading = new HbLabel(aHeading, mDisplayPopup);
   277         mDisplayPopup->setHeadingWidget(heading);
   283         mDisplayPopup->setHeadingWidget(lHeading);
   278         mDisplayPopup->setText(aContent);
   284         mDisplayPopup->setText(aContent);
       
   285         mDisplayPopup->setIconVisible(false);
   279         composeDialog(mDisplayPopup, aDuration, ESatDialogDisplayText);
   286         composeDialog(mDisplayPopup, aDuration, ESatDialogDisplayText);
   280 
       
   281         TFLOGSTRING(
   287         TFLOGSTRING(
   282         "SATAPP: SatAppUiProvider::showDisplayTextPopup duration before open")
   288         "SATAPP: SatAppUiProvider::showDisplayTextPopup duration before open")
   283         DialogWaiter waiter;
   289         DialogWaiter waiter;
   284         mDisplayPopup->open(&waiter, SLOT(done(HbAction *)));
   290         mDisplayPopup->open(&waiter, SLOT(done(HbAction *)));
   285         waiter.wait();
   291         waiter.wait();
   286         TFLOGSTRING(
   292         TFLOGSTRING(
   287         "SATAPP: SatAppUiProvider::showDisplayTextPopup duration end open")
   293         "SATAPP: SatAppUiProvider::showDisplayTextPopup duration end open")
   288 
   294         
       
   295 #ifndef _DEBUG
   289         delete mDisplayPopup;
   296         delete mDisplayPopup;
   290         mDisplayPopup = 0;
   297         mDisplayPopup = 0;
       
   298 #endif        
   291     }
   299     }
   292     TFLOGSTRING("SATAPP: SatAppUiProvider::showDisplayTextPopup exit")
   300     TFLOGSTRING("SATAPP: SatAppUiProvider::showDisplayTextPopup exit")
   293     return mUserRsp;
   301     return mUserRsp;
   294 }
   302 }
   295 
   303 
   305 {
   313 {
   306     TFLOGSTRING("SATAPP: SatAppUiProvider::showGetInkeyQuery call")
   314     TFLOGSTRING("SATAPP: SatAppUiProvider::showGetInkeyQuery call")
   307 
   315 
   308     resetUserResponse();
   316     resetUserResponse();
   309     stopShowWaitNote();
   317     stopShowWaitNote();
   310     // Create a query
   318     
       
   319     if (mGetInkeyQuery){
       
   320         delete mGetInkeyQuery;
       
   321         mGetInkeyQuery = NULL;       
       
   322     }
   311     mGetInkeyQuery = new HbInputDialog();
   323     mGetInkeyQuery = new HbInputDialog();
   312     if (mGetInkeyQuery) {
   324     if (mGetInkeyQuery) {
   313         TFLOGSTRING("SATAPP: SatAppUiProvider::showGetInkeyQuery note created")
   325         TFLOGSTRING("SATAPP: SatAppUiProvider::showGetInkeyQuery note created")
   314         // Set PromptText
   326         // Set PromptText
   315         mGetInkeyQuery->setPromptText(aHeading);
   327         mGetInkeyQuery->setPromptText(aHeading);
   316         // Set ContentText
   328         // Set ContentText
   317         QVariant vContent(aContent);
   329         QVariant vContent(aContent);
   318         mGetInkeyQuery->setValue(vContent);
   330         mGetInkeyQuery->setValue(vContent);
   319         HbEditorInterface inputMode(mGetInkeyQuery->lineEdit());
   331         HbEditorInterface inputMode(mGetInkeyQuery->lineEdit());
       
   332         mGetInkeyQuery->lineEdit()->setFocus();
   320         if (ESatDigitOnly == aCharacterSet) {
   333         if (ESatDigitOnly == aCharacterSet) {
   321             // digit mode, digits only (0 9, *, #, and +)
   334             // digit mode, digits only (0 9, *, #, and +)
   322             inputMode.setFilter(HbPhoneNumberFilter::instance());
   335             inputMode.setFilter(HbPhoneNumberFilter::instance());
   323          } else {
   336          } else {
   324             // char mode
   337             // char mode
   339         waiter.wait();
   352         waiter.wait();
   340         TFLOGSTRING("SATAPP: SatAppUiProvider::showGetInkeyQuery end pop")
   353         TFLOGSTRING("SATAPP: SatAppUiProvider::showGetInkeyQuery end pop")
   341 
   354 
   342         QString inputString = (mGetInkeyQuery->value()).toString();
   355         QString inputString = (mGetInkeyQuery->value()).toString();
   343         aContent = inputString;
   356         aContent = inputString;
       
   357         
       
   358 #ifndef _DEBUG       
   344         delete mGetInkeyQuery;
   359         delete mGetInkeyQuery;
   345         mGetInkeyQuery = 0;
   360         mGetInkeyQuery = 0;
       
   361 #endif        
   346     }
   362     }
   347     TFLOGSTRING("SATAPP: SatAppUiProvider::showGetInkeyQuery exit")
   363     TFLOGSTRING("SATAPP: SatAppUiProvider::showGetInkeyQuery exit")
   348     return mUserRsp;
   364     return mUserRsp;
   349 }
   365 }
   350 
   366 
   367     if (aDuration) {
   383     if (aDuration) {
   368         duration = aDuration * KSymbianTimeConvertQtTime;
   384         duration = aDuration * KSymbianTimeConvertQtTime;
   369     }
   385     }
   370     TFLOGSTRING2("SATAPP: SatAppUiProvider::showGetYesNoQuery duration=%d",
   386     TFLOGSTRING2("SATAPP: SatAppUiProvider::showGetYesNoQuery duration=%d",
   371             duration)
   387             duration)
       
   388     
       
   389     if (mYesNoPopup){
       
   390         delete mYesNoPopup;
       
   391         mYesNoPopup = NULL;        
       
   392     }
       
   393     
   372     if (ESatYesNo == aCharacterSet) {
   394     if (ESatYesNo == aCharacterSet) {
   373         mYesNoPopup = new SatAppGetInkeyNote(aText);
   395         mYesNoPopup = new SatAppGetInkeyNote(aText);
   374         TFLOGSTRING("SATAPP: SatAppUiProvider::showGetYesNoQuery normal")
   396         TFLOGSTRING("SATAPP: SatAppUiProvider::showGetYesNoQuery normal")
   375         composeDialog(mYesNoPopup, duration, ESatDialogGetYesNo);
   397         composeDialog(mYesNoPopup, duration, ESatDialogGetYesNo);
   376     } else if (aImmediateDigitResponse){
   398     } else if (aImmediateDigitResponse){
   398         waiter.wait();
   420         waiter.wait();
   399         TFLOGSTRING("SATAPP: SatAppUiProvider::showGetYesNoQuery end pop")
   421         TFLOGSTRING("SATAPP: SatAppUiProvider::showGetYesNoQuery end pop")
   400         aDuration = time.elapsed() / KSymbianTimeConvertQtTime;
   422         aDuration = time.elapsed() / KSymbianTimeConvertQtTime;
   401         TFLOGSTRING2("SATAPP: SatAppUiProvider::showGetYesNoQuery duration out=%d",
   423         TFLOGSTRING2("SATAPP: SatAppUiProvider::showGetYesNoQuery duration out=%d",
   402                 aDuration)
   424                 aDuration)
       
   425 #ifndef _DEBUG        
   403         delete mYesNoPopup;
   426         delete mYesNoPopup;
   404         mYesNoPopup = 0;
   427         mYesNoPopup = 0;
       
   428 #endif        
   405     }
   429     }
   406     if (ESatYesNo == aCharacterSet) {
   430     if (ESatYesNo == aCharacterSet) {
   407         mDigitalRsp = mUserRsp;
   431         mDigitalRsp = mUserRsp;
   408         TFLOGSTRING("SATAPP: SatAppUiProvider::showGetYesNoQuery:yes/no rsp")
   432         TFLOGSTRING("SATAPP: SatAppUiProvider::showGetYesNoQuery:yes/no rsp")
   409     }
   433     }
   427     TFLOGSTRING3("SATAPP: SatAppUiProvider::showGetInputQuery \
   451     TFLOGSTRING3("SATAPP: SatAppUiProvider::showGetInputQuery \
   428                   min %d max %d length", minLength, maxLength)
   452                   min %d max %d length", minLength, maxLength)
   429     resetUserResponse();
   453     resetUserResponse();
   430     stopShowWaitNote();
   454     stopShowWaitNote();
   431     mMinLength = minLength;
   455     mMinLength = minLength;
   432     // Create a query
   456     
       
   457     if (mGetInputQuery){
       
   458         delete mGetInputQuery;
       
   459         mGetInputQuery = NULL;        
       
   460     }    
   433     mGetInputQuery = new HbInputDialog();
   461     mGetInputQuery = new HbInputDialog();
   434     // Set PromptText
       
   435     mGetInputQuery->setPromptText(heading);
   462     mGetInputQuery->setPromptText(heading);
   436     // Set ContentText
       
   437     QVariant vContent(content);
   463     QVariant vContent(content);
   438     mGetInputQuery->setValue(vContent);
   464     mGetInputQuery->setValue(vContent);
   439     HbEditorInterface inputMode(mGetInputQuery->lineEdit());
   465     HbEditorInterface inputMode(mGetInputQuery->lineEdit());
       
   466     mGetInputQuery->lineEdit()->setFocus();
   440     if (ESatDigitOnly == characterSet) {
   467     if (ESatDigitOnly == characterSet) {
   441         // digit mode, digits only (0 9, *, #, and +)
   468         // digit mode, digits only (0 9, *, #, and +)
   442         inputMode.setFilter(HbPhoneNumberFilter::instance());
   469         inputMode.setFilter(HbPhoneNumberFilter::instance());
   443     } else {
   470     } else {
   444         // char mode
   471         // char mode
   448         this, SLOT(updateQueryAction(QString)));
   475         this, SLOT(updateQueryAction(QString)));
   449     mGetInputQuery->lineEdit()->setMaxLength(maxLength);
   476     mGetInputQuery->lineEdit()->setMaxLength(maxLength);
   450 
   477 
   451     composeDialog(mGetInputQuery, KDefaultSelectionTimeoutMseconds, ESatDialogGetInput);
   478     composeDialog(mGetInputQuery, KDefaultSelectionTimeoutMseconds, ESatDialogGetInput);
   452     // Sets the "OK"-action/button
   479     // Sets the "OK"-action/button
   453     if (0 == minLength || content.length() >= minLength) {
   480     if ((0 == minLength || content.length() >= minLength) && 
   454         HbAction* okAction = new HbAction(hbTrId("txt_sat_general_ok"), 
   481          mGetInputQuery->actions().at(0)) {
   455             mGetInputQuery);
   482         mGetInputQuery->actions().at(0)->setEnabled(true);
   456         bool ret = connect(okAction, SIGNAL(triggered()),
   483     } 
   457                             this, SLOT(userPrimaryResponse()));
       
   458         TFLOGSTRING2("SATAPP: SatAppUiProvider::showGetInputQuery \
       
   459         connect okAction: %d", ret)
       
   460         mGetInputQuery->setPrimaryAction(okAction);
       
   461     } else {
       
   462         // Set default primary action is 0
       
   463         mGetInputQuery->setPrimaryAction(0);
       
   464     }
       
   465 
   484 
   466     if (aHideInput) {
   485     if (aHideInput) {
   467         mGetInputQuery->lineEdit()->setEchoMode(HbLineEdit::Password);
   486         mGetInputQuery->lineEdit()->setEchoMode(HbLineEdit::Password);
   468         TFLOGSTRING("SATAPP: SatAppUiProvider::showGetInputQuery hide")
   487         TFLOGSTRING("SATAPP: SatAppUiProvider::showGetInputQuery hide")
   469     }
   488     }
   473     mGetInputQuery->open(&waiter, SLOT(done(HbAction *)));
   492     mGetInputQuery->open(&waiter, SLOT(done(HbAction *)));
   474     waiter.wait();
   493     waiter.wait();
   475     TFLOGSTRING("SATAPP: SatAppUiProvider::showGetInputQuery end pop")
   494     TFLOGSTRING("SATAPP: SatAppUiProvider::showGetInputQuery end pop")
   476 
   495 
   477     content = (mGetInputQuery->value()).toString();
   496     content = (mGetInputQuery->value()).toString();
   478 
   497     
       
   498 #ifndef _DEBUG
   479     delete mGetInputQuery;
   499     delete mGetInputQuery;
   480     mGetInputQuery = 0;
   500     mGetInputQuery = 0;
       
   501 #endif    
   481 
   502 
   482     TFLOGSTRING2("SATAPP: SatAppUiProvider::showGetInputQuery mUserRsp =%d exit",
   503     TFLOGSTRING2("SATAPP: SatAppUiProvider::showGetInputQuery mUserRsp =%d exit",
   483             mUserRsp)
   504             mUserRsp)
   484     return mUserRsp;
   505     return mUserRsp;
   485 }
   506 }
   490 //
   511 //
   491 void SatAppUiProvider::updateQueryAction(QString text)
   512 void SatAppUiProvider::updateQueryAction(QString text)
   492 {
   513 {
   493     TFLOGSTRING("SATAPP: SatAppUiProvider::updateQueryAction call")
   514     TFLOGSTRING("SATAPP: SatAppUiProvider::updateQueryAction call")
   494     // Get Input
   515     // Get Input
   495     if (mGetInputQuery) {
   516     if (mGetInputQuery && mGetInputQuery->actions().at(0)) {
   496         if (text.length() >= mMinLength) {
   517         if (text.length() >= mMinLength ) {
   497             if (!mGetInputQuery->primaryAction()) {
   518             mGetInputQuery->actions().at(0)->setEnabled(true);
   498                 HbAction *okAction = new HbAction(hbTrId("txt_sat_general_ok"), 
       
   499                     mGetInputQuery);
       
   500                 bool ret = connect(
       
   501                     okAction, SIGNAL(triggered()),
       
   502                     this, SLOT(userPrimaryResponse()));
       
   503               TFLOGSTRING2("SATAPP: SatAppUiProvider::updateQueryAction \
       
   504               get input connect okAction: %d", ret)
       
   505               mGetInputQuery->setPrimaryAction(okAction);
       
   506             }
       
   507             TFLOGSTRING("SATAPP: SatAppUiProvider::updateQueryAction \
       
   508                 get input  OK")
       
   509         } else {
   519         } else {
   510             if (mGetInputQuery->primaryAction()) {
   520             mGetInputQuery->actions().at(0)->setEnabled(false);
   511                 mGetInputQuery->removeAction(mGetInputQuery->primaryAction());
       
   512             }
       
   513             TFLOGSTRING("SATAPP: SatAppUiProvider::updateQueryAction \
       
   514                 get input no OK Action")
       
   515         }
   521         }
   516     }
   522     }
       
   523     
   517     // Get InKey
   524     // Get InKey
   518     if (mGetInkeyQuery) {
   525     if (mGetInkeyQuery && mGetInkeyQuery->actions().at(0)) {
   519         if (!mGetInkeyQuery->primaryAction() && (text.length() == 1)) {
   526         if (1 == text.length()) {
   520             HbAction *okAction = new HbAction(hbTrId("txt_sat_general_ok"), 
   527             mGetInkeyQuery->actions().at(0)->setEnabled(true);
   521                 mGetInkeyQuery);
   528         } else {
   522             bool ret = connect(okAction, SIGNAL(triggered()),
   529             mGetInkeyQuery->actions().at(0)->setEnabled(false); 
   523                 this, SLOT(userPrimaryResponse()));
       
   524             TFLOGSTRING2("SATAPP: SatAppUiProvider::updateQueryAction \
       
   525                 get inkey  connect okAction: %d", ret)
       
   526             mGetInkeyQuery->setPrimaryAction(okAction);
       
   527         TFLOGSTRING("SATAPP: SatAppUiProvider::updateQueryAction \
       
   528             get inkey OK")
       
   529     } else {
       
   530         if (mGetInkeyQuery->primaryAction()) {
       
   531             mGetInkeyQuery->removeAction(mGetInkeyQuery->primaryAction());
       
   532         }
       
   533         TFLOGSTRING("SATAPP: SatAppUiProvider::updateQueryAction \
       
   534             get inkey not OK Action")
       
   535         }
   530         }
   536     }
   531     }
   537 
   532 
   538     TFLOGSTRING("SATAPP: SatAppUiProvider::updateQueryAction exit")
   533     TFLOGSTRING("SATAPP: SatAppUiProvider::updateQueryAction exit")
   539 }
   534 }
   546     const QString &aText,
   541     const QString &aText,
   547     bool &aActionAccepted)
   542     bool &aActionAccepted)
   548 {
   543 {
   549     TFLOGSTRING("SATAPP: SatAppUiProvider::showConfirmSendQuery call")
   544     TFLOGSTRING("SATAPP: SatAppUiProvider::showConfirmSendQuery call")
   550     resetUserResponse();
   545     resetUserResponse();
   551     mConfirmSendQuery = new HbMessageBox();
   546     
       
   547     if (mConfirmSendQuery){
       
   548         delete mConfirmSendQuery;
       
   549         mConfirmSendQuery = NULL;        
       
   550     }
       
   551     
       
   552     mConfirmSendQuery = new HbMessageBox(HbMessageBox::MessageTypeQuestion);
   552     if(mConfirmSendQuery) {
   553     if(mConfirmSendQuery) {
   553         mConfirmSendQuery->setText(aText);
   554         mConfirmSendQuery->setText(aText);        
   554         composeDialog(mConfirmSendQuery, 0, ESatDialogConfirmSend);
   555         composeDialog(mConfirmSendQuery, 0, ESatDialogConfirmSend);
   555 
   556 
   556         TFLOGSTRING("SATAPP: SatAppUiProvider::confirmSend before open")
   557         TFLOGSTRING("SATAPP: SatAppUiProvider::confirmSend before open")
   557         DialogWaiter waiter;
   558         DialogWaiter waiter;
   558         mConfirmSendQuery->open(&waiter, SLOT(done(HbAction *)));
   559         mConfirmSendQuery->open(&waiter, SLOT(done(HbAction *)));
   559         waiter.wait();
   560         waiter.wait();
   560         TFLOGSTRING("SATAPP: SatAppUiProvider::confirmSend after open")
   561         TFLOGSTRING("SATAPP: SatAppUiProvider::confirmSend after open")
   561 
   562         
       
   563 #ifndef _DEBUG
   562         delete mConfirmSendQuery;
   564         delete mConfirmSendQuery;
   563         mConfirmSendQuery = 0;
   565         mConfirmSendQuery = 0;
       
   566 #endif        
   564     }
   567     }
   565     aActionAccepted = (EUserPrimaryResponse == mUserRsp) ? true : false;
   568     aActionAccepted = (EUserPrimaryResponse == mUserRsp) ? true : false;
   566     TFLOGSTRING("SATAPP: SatAppUiProvider::showConfirmSendQuery exit")
   569     TFLOGSTRING("SATAPP: SatAppUiProvider::showConfirmSendQuery exit")
   567 }
   570 }
   568 
   571 
   577         delete mWaitNote;
   580         delete mWaitNote;
   578         mWaitNote = 0;
   581         mWaitNote = 0;
   579     }
   582     }
   580     mWaitNote = new HbProgressDialog(HbProgressDialog::WaitDialog);
   583     mWaitNote = new HbProgressDialog(HbProgressDialog::WaitDialog);
   581     //remove the default cancel softkey
   584     //remove the default cancel softkey
   582     mWaitNote->removeAction(mWaitNote->primaryAction());
   585     if (mWaitNote){
   583     if(aText.isEmpty()) {
   586         mWaitNote->clearActions();
   584         mWaitNote->setText(hbTrId("txt_sat_sendingtextmessage"));
   587         if(aText.isEmpty()) {
   585     } else {
   588             mWaitNote->setText(hbTrId("txt_sat_sendingtextmessage"));
   586         mWaitNote->setText(aText);
   589         } else {
   587     }
   590             mWaitNote->setText(aText);
   588     mWaitNote->show();
   591         }
   589     // Extend showing sms wait note  timer for test
   592         mWaitNote->show();
   590     extendNoteShowtime();
   593         // Extend showing sms wait note  timer for test
       
   594         extendNoteShowtime();        
       
   595     }
   591     TFLOGSTRING("SATAPP: SatAppUiProvider::showSmsWaitNote exit")
   596     TFLOGSTRING("SATAPP: SatAppUiProvider::showSmsWaitNote exit")
   592  }
   597  }
   593 
   598 
   594 // ----------------------------------------------------------------------------
   599 // ----------------------------------------------------------------------------
   595 // showDtmfWaitNote
   600 // showDtmfWaitNote
   607         mWaitNote = 0;
   612         mWaitNote = 0;
   608     }
   613     }
   609 
   614 
   610     mWaitNote = new HbProgressDialog(HbProgressDialog::WaitDialog);
   615     mWaitNote = new HbProgressDialog(HbProgressDialog::WaitDialog);
   611     //remove the default cancel softkey
   616     //remove the default cancel softkey
   612     bool ret = connect(mWaitNote->primaryAction(), SIGNAL(triggered()),
   617     bool ret = connect(mWaitNote->actions().at(0), SIGNAL(triggered()),
   613                        this, SLOT(cancelResponse()));
   618                        this, SLOT(cancelResponse()));
   614     TFLOGSTRING2("SATAPP: SatAppUiProvider::showDtmfWaitNote \
   619     TFLOGSTRING2("SATAPP: SatAppUiProvider::showDtmfWaitNote \
   615     primaryAction=%d", ret)
   620     primaryAction=%d", ret)
   616     if(aText.isEmpty()) {
   621     if(aText.isEmpty()) {
   617         mWaitNote->setText(hbTrId("txt_sat_senddtmf_wait_note"));
   622         mWaitNote->setText(hbTrId("txt_sat_senddtmf_wait_note"));
   671         TFLOGSTRING("SATAPP: SatAppUiProvider::showConfirmSetUpCallQUery length 0")
   676         TFLOGSTRING("SATAPP: SatAppUiProvider::showConfirmSetUpCallQUery length 0")
   672     } else {
   677     } else {
   673         alphaId.append(aText);
   678         alphaId.append(aText);
   674         TFLOGSTRING("SATAPP: SatAppUiProvider::showConfirmSetUpCallQUery exit")
   679         TFLOGSTRING("SATAPP: SatAppUiProvider::showConfirmSetUpCallQUery exit")
   675     }
   680     }
   676 
   681     
   677     mSetUpCallQuery = new HbMessageBox(HbMessageBox::MessageTypeInformation);
   682     if (mSetUpCallQuery){
       
   683         delete mSetUpCallQuery;
       
   684         mSetUpCallQuery = NULL;
       
   685     }
       
   686     
       
   687     mSetUpCallQuery = new HbMessageBox(HbMessageBox::MessageTypeQuestion);
   678     if(mSetUpCallQuery) {
   688     if(mSetUpCallQuery) {
   679         mSetUpCallQuery->setText(alphaId);
   689         mSetUpCallQuery->setText(alphaId);  
       
   690         
   680         composeDialog(mSetUpCallQuery, 0, ESatDialogSetUpCall);
   691         composeDialog(mSetUpCallQuery, 0, ESatDialogSetUpCall);
   681 
   692 
   682         TFLOGSTRING("SATAPP: SatAppSetUpCall::showSetUpCallConfirm before open")
   693         TFLOGSTRING("SATAPP: SatAppSetUpCall::showSetUpCallConfirm before open")
   683         DialogWaiter waiter;
   694         DialogWaiter waiter;
   684         mSetUpCallQuery->open(&waiter, SLOT(done(HbAction *)));
   695         mSetUpCallQuery->open(&waiter, SLOT(done(HbAction *)));
   685         waiter.wait();
   696         waiter.wait();
   686         TFLOGSTRING("SATAPP: SatAppSetUpCall::showSetUpCallConfirm after open")
   697         TFLOGSTRING("SATAPP: SatAppSetUpCall::showSetUpCallConfirm after open")
   687 
   698         
       
   699 #ifndef _DEBUG
   688         delete mSetUpCallQuery;
   700         delete mSetUpCallQuery;
   689         mSetUpCallQuery = 0;
   701         mSetUpCallQuery = 0;
       
   702 #endif        
   690     }
   703     }
   691     aActionAccepted = (EUserPrimaryResponse == mUserRsp) ? true : false;
   704     aActionAccepted = (EUserPrimaryResponse == mUserRsp) ? true : false;
   692     TFLOGSTRING("SATAPP: SatAppUiProvider::showConfirmSetUpCallQUery exit")
   705     TFLOGSTRING("SATAPP: SatAppUiProvider::showConfirmSetUpCallQUery exit")
   693 }
   706 }
   694 
   707 
   788     mMinLength = 0;
   801     mMinLength = 0;
   789     TFLOGSTRING("SATAPP: SatAppUiProvider::resetUserResponse exit")
   802     TFLOGSTRING("SATAPP: SatAppUiProvider::resetUserResponse exit")
   790 }
   803 }
   791 
   804 
   792 // ----------------------------------------------------------------------------
   805 // ----------------------------------------------------------------------------
   793 // composeDialog
   806 // composeDialog: make sure dlg has 2 buttons
   794 // ----------------------------------------------------------------------------
   807 // ----------------------------------------------------------------------------
   795 //
   808 //
   796 void SatAppUiProvider::composeDialog(
   809 void SatAppUiProvider::composeDialog(
   797     HbDialog *dlg, 
   810     HbDialog *dlg, 
   798     int aDuration,
   811     int aDuration,
   799     TSatAppDialogActionType type,
   812     TSatAppDialogActionType type, 
   800     bool aModal,
   813     bool aModal/* = true*/,
   801     HbDialog::DismissPolicy aDismissPolicy)
   814     HbDialog::DismissPolicy aDismissPolicy/* = HbDialog::NoDismiss*/)
   802 {
   815 {
   803     TFLOGSTRING("SATAPP: SatAppUiProvider::composeDialog call")
   816     TFLOGSTRING("SATAPP: SatAppUiProvider::composeDialog call")
   804 
   817 
   805     dlg->setModal(aModal);
   818     dlg->setModal(aModal);
   806     dlg->setDismissPolicy(aDismissPolicy);
   819     dlg->setDismissPolicy(aDismissPolicy);
   807     if (aDuration){
   820     if (aDuration){
   808         dlg->setTimeout(aDuration);
   821         dlg->setTimeout(aDuration);
   809     } else {
   822     } else {
   810         dlg->setTimeout(HbDialog::NoTimeout);
   823         dlg->setTimeout(HbDialog::NoTimeout);
   811     }
   824     }
   812 
   825     
   813     HbAction *primaryAction = 0;
   826     dlg->clearActions();
   814     HbAction *secondaryAction = 0;
   827     HbAction *primaryAction = new HbAction(dlg);
   815 
   828     dlg->addAction(primaryAction);
       
   829     bool ret = connect(primaryAction, SIGNAL(triggered()),
       
   830                        this, SLOT(userPrimaryResponse()));
       
   831     TFLOGSTRING2("SATAPP: SatAppUiProvider::composeDialog \
       
   832         primaryAction=%d", ret)   
       
   833     
       
   834     HbAction *secondaryAction = new HbAction(dlg);
       
   835     dlg->addAction(secondaryAction);
       
   836     ret = connect(secondaryAction, SIGNAL(triggered()),
       
   837                   this, SLOT(userSecondaryResponse()));
       
   838     TFLOGSTRING2("SATAPP: SatAppUiProvider::composeDialog \
       
   839         secondaryAction=%d", ret)     
       
   840     
   816     if (ESatDialogDisplayText == type){
   841     if (ESatDialogDisplayText == type){
   817         primaryAction = new HbAction(hbTrId("txt_sat_general_ok"), dlg);
   842         primaryAction->setText(hbTrId("txt_sat_general_ok"));
   818         secondaryAction = new HbAction(hbTrId("txt_sat_general_back"), dlg);
   843         secondaryAction->setText(hbTrId("txt_sat_general_back"));
   819         TFLOGSTRING("SATAPP: SatAppUiProvider::composeDialog \
   844         TFLOGSTRING("SATAPP: SatAppUiProvider::composeDialog \
   820             ESatDialogDisplayText")
   845             ESatDialogDisplayText")
   821     } else if (ESatDialogGetInput == type){
   846     } else if (ESatDialogGetInput == type){
   822         secondaryAction = new HbAction(hbTrId("txt_sat_general_cancel"), dlg);
   847         primaryAction->setText(hbTrId("txt_sat_general_ok"));
       
   848         primaryAction->setEnabled(false);
       
   849         secondaryAction->setText(hbTrId("txt_sat_general_cancel"));
   823         TFLOGSTRING("SATAPP: SatAppUiProvider::composeDialog \
   850         TFLOGSTRING("SATAPP: SatAppUiProvider::composeDialog \
   824             ESatDialogGetInput")
   851             ESatDialogGetInput")
   825     } else if (ESatDialogGetInkey == type){
   852     } else if (ESatDialogGetInkey == type){
   826         secondaryAction = new HbAction(hbTrId("txt_sat_general_cancel"), dlg);
   853         primaryAction->setText(hbTrId("txt_sat_general_ok"));
       
   854         primaryAction->setEnabled(false);
       
   855         secondaryAction->setText(hbTrId("txt_sat_general_cancel"));
   827         TFLOGSTRING("SATAPP: SatAppUiProvider::composeDialog \
   856         TFLOGSTRING("SATAPP: SatAppUiProvider::composeDialog \
   828             ESatDialogGetInkey")
   857             ESatDialogGetInkey")
   829     } else if (ESatDialogGetYesNo == type){
   858     } else if (ESatDialogGetYesNo == type){
   830         primaryAction = new HbAction(hbTrId("txt_sat_general_yes"), dlg);
   859         primaryAction->setText(hbTrId("txt_sat_general_yes"));
   831         secondaryAction = new HbAction(hbTrId("txt_sat_general_no"), dlg);
   860         secondaryAction->setText(hbTrId("txt_sat_general_no"));
   832         TFLOGSTRING("SATAPP: SatAppUiProvider::composeDialog \
   861         TFLOGSTRING("SATAPP: SatAppUiProvider::composeDialog \
   833             ESatDialogGetYesNo")
   862             ESatDialogGetYesNo")
   834     } else if (ESatDialogGetDigitalRsp == type){
   863     } else if (ESatDialogGetDigitalRsp == type){
   835         secondaryAction = new HbAction(hbTrId("txt_sat_general_cancel"), dlg);
   864         dlg->removeAction(primaryAction);
       
   865         secondaryAction->setText(hbTrId("txt_sat_general_cancel"));
   836         TFLOGSTRING("SATAPP: SatAppUiProvider::composeDialog \
   866         TFLOGSTRING("SATAPP: SatAppUiProvider::composeDialog \
   837             ESatDialogGetDigitalRsp")
   867             ESatDialogGetDigitalRsp")
   838     } else if (ESatDialogSetUpCall == type){
   868     } else if (ESatDialogSetUpCall == type){
   839         primaryAction = new HbAction(hbTrId("txt_sat_general_call"), dlg);
   869         primaryAction->setText(hbTrId("txt_sat_general_call"));
   840         secondaryAction = new HbAction(hbTrId("txt_sat_general_cancel"), dlg);
   870         secondaryAction->setText(hbTrId("txt_sat_general_cancel"));
   841         TFLOGSTRING("SATAPP: SatAppUiProvider::composeDialog \
   871         TFLOGSTRING("SATAPP: SatAppUiProvider::composeDialog \
   842             ESatDialogSetUpCall")
   872             ESatDialogSetUpCall")
   843     } else if (ESatDialogConfirmSend == type){
   873     } else if (ESatDialogConfirmSend == type){
   844         primaryAction = new HbAction(hbTrId("txt_sat_general_send"), dlg);
   874         primaryAction->setText(hbTrId("txt_sat_general_send"));
   845         secondaryAction = new HbAction(hbTrId("txt_sat_general_cancel"), dlg);
   875         secondaryAction->setText(hbTrId("txt_sat_general_cancel"));
   846         TFLOGSTRING("SATAPP: SatAppUiProvider::composeDialog \
   876         TFLOGSTRING("SATAPP: SatAppUiProvider::composeDialog \
   847             ESatDialogConfirmSend")
   877             ESatDialogConfirmSend")
   848     }else if (ESatDialogConfirmBip == type){
   878     } else if (ESatDialogConfirmBip == type){
   849         primaryAction = new HbAction(hbTrId("txt_sat_general_ok"), dlg);
   879         primaryAction->setText(hbTrId("txt_sat_general_ok"));
   850         secondaryAction = new HbAction(hbTrId("txt_sat_general_cancel"), dlg);
   880         secondaryAction->setText(hbTrId("txt_sat_general_cancel"));
   851         TFLOGSTRING("SATAPP: SatAppUiProvider::composeDialog \
   881         TFLOGSTRING("SATAPP: SatAppUiProvider::composeDialog \
   852             ESatDialogConfirmBip")
   882             ESatDialogConfirmBip")
   853     }
   883     }
   854 
   884     
   855     if (primaryAction) {
       
   856         bool ret = connect(
       
   857             primaryAction, SIGNAL(triggered()),
       
   858             this, SLOT(userPrimaryResponse()));
       
   859         TFLOGSTRING2("SATAPP: SatAppUiProvider::composeDialog \
       
   860             primaryAction=%d", ret)
       
   861     }
       
   862     dlg->setPrimaryAction(primaryAction);
       
   863 
       
   864     if (secondaryAction) {
       
   865         bool ret = connect(
       
   866             secondaryAction, SIGNAL(triggered()),
       
   867             this, SLOT(userSecondaryResponse()));
       
   868         TFLOGSTRING2("SATAPP: SatAppUiProvider::composeDialog \
       
   869             secondaryAction=%d", ret)
       
   870     }
       
   871     dlg->setSecondaryAction(secondaryAction);
       
   872 
       
   873     TFLOGSTRING("SATAPP: SatAppUiProvider::composeDialog exit")
   885     TFLOGSTRING("SATAPP: SatAppUiProvider::composeDialog exit")
   874 }
   886 }
   875 
   887 
   876 // ----------------------------------------------------------------------------
   888 // ----------------------------------------------------------------------------
   877 // docmlLoader
   889 // docmlLoader
   971     if (mWaitNote) {
   983     if (mWaitNote) {
   972         delete mWaitNote;
   984         delete mWaitNote;
   973         mWaitNote = 0;
   985         mWaitNote = 0;
   974     }
   986     }
   975     mWaitNote = new HbProgressDialog(HbProgressDialog::WaitDialog);
   987     mWaitNote = new HbProgressDialog(HbProgressDialog::WaitDialog);
   976     mWaitNote->removeAction(mWaitNote->primaryAction());
   988     mWaitNote->clearActions();
   977     if (aText.length()) {
   989     if (aText.length()) {
   978         if (!aSelfExplanatoryIcon)  {
   990         if (!aSelfExplanatoryIcon)  {
   979             TFLOGSTRING("SATAPP: SatAppUiProvider::showSsWaitNote !Icon")
   991             TFLOGSTRING("SATAPP: SatAppUiProvider::showSsWaitNote !Icon")
   980             mWaitNote->setText(aText);
   992             mWaitNote->setText(aText);
   981         } else {
   993         } else {
  1001     if (mWaitNote) {
  1013     if (mWaitNote) {
  1002         delete mWaitNote;
  1014         delete mWaitNote;
  1003         mWaitNote = 0;
  1015         mWaitNote = 0;
  1004     }
  1016     }
  1005     mWaitNote = new HbProgressDialog(HbProgressDialog::WaitDialog);
  1017     mWaitNote = new HbProgressDialog(HbProgressDialog::WaitDialog);
  1006     mWaitNote->removeAction(mWaitNote->primaryAction());
  1018     mWaitNote->clearActions();
  1007     mWaitNote->setText(hbTrId("txt_sat_wait_note_without_delay"));
  1019     mWaitNote->setText(hbTrId("txt_sat_wait_note_without_delay"));
  1008     mWaitNote->show();
  1020     mWaitNote->show();
  1009     TFLOGSTRING("SATAPP: SatAppUiProvider::showWaitNoteWithoutDelay exit")
  1021     TFLOGSTRING("SATAPP: SatAppUiProvider::showWaitNoteWithoutDelay exit")
  1010 }
  1022 }
  1011 
  1023 
  1015 // ----------------------------------------------------------------------------
  1027 // ----------------------------------------------------------------------------
  1016 //
  1028 //
  1017 void SatAppUiProvider::showSsErrorNote()
  1029 void SatAppUiProvider::showSsErrorNote()
  1018 {
  1030 {
  1019     TFLOGSTRING("SATAPP: SatAppUiProvider::showSsErrorNote")
  1031     TFLOGSTRING("SATAPP: SatAppUiProvider::showSsErrorNote")
  1020     HbMessageBox *msgBox = new HbMessageBox(HbMessageBox::MessageTypeInformation);
  1032     HbMessageBox::warning(hbTrId("txt_sat_sendss_error_note"));
  1021     msgBox->setText(hbTrId("txt_sat_sendss_error_note"));
       
  1022     DialogWaiter waiter;
       
  1023     msgBox->open(&waiter, SLOT(done(HbAction *)));
       
  1024     waiter.wait();
       
  1025     delete msgBox;
       
  1026     msgBox = NULL;
       
  1027     TFLOGSTRING("SATAPP: SatAppUiProvider::showSsErrorNote exit")
  1033     TFLOGSTRING("SATAPP: SatAppUiProvider::showSsErrorNote exit")
  1028 }
  1034 }
  1029 
  1035 
  1030 // ----------------------------------------------------------------------------
  1036 // ----------------------------------------------------------------------------
  1031 // showConfirmOpenChannelQuery
  1037 // showConfirmOpenChannelQuery
  1039     QString title = aText;
  1045     QString title = aText;
  1040     if (!aText.length()){
  1046     if (!aText.length()){
  1041         title = hbTrId("txt_sat_openchannel_confirm_note");
  1047         title = hbTrId("txt_sat_openchannel_confirm_note");
  1042     }
  1048     }
  1043 
  1049 
  1044     mConfirmBipQuery = new HbMessageBox();
  1050     mConfirmBipQuery = new HbMessageBox(HbMessageBox::MessageTypeQuestion);
  1045     if(mConfirmBipQuery) {
  1051     if(mConfirmBipQuery) {
  1046         // Sets the "Yes"-action/button
  1052         // Sets the "Yes"-action/button
  1047         mConfirmBipQuery->setText(title);
  1053         mConfirmBipQuery->setText(title);    
  1048         composeDialog(mConfirmBipQuery, 0, ESatDialogConfirmBip);
  1054         composeDialog(mConfirmBipQuery, 0, ESatDialogConfirmBip);
  1049 
  1055 
  1050         TFLOGSTRING("SATAPP: SatAppUiProvider::showConfirmOpenChannelQuery before open")
  1056         TFLOGSTRING("SATAPP: SatAppUiProvider::showConfirmOpenChannelQuery before open")
  1051         DialogWaiter waiter;
  1057         DialogWaiter waiter;
  1052         mConfirmBipQuery->open(&waiter, SLOT(done(HbAction *)));
  1058         mConfirmBipQuery->open(&waiter, SLOT(done(HbAction *)));
  1093     if (!mWaitNote) {
  1099     if (!mWaitNote) {
  1094         mWaitNote = new HbProgressDialog(HbProgressDialog::WaitDialog);
  1100         mWaitNote = new HbProgressDialog(HbProgressDialog::WaitDialog);
  1095         mWaitNote->setText(aText);
  1101         mWaitNote->setText(aText);
  1096 
  1102 
  1097         //remove the default cancel softkey
  1103         //remove the default cancel softkey
  1098         bool ret = connect(mWaitNote->primaryAction(), SIGNAL(triggered()),
  1104         bool ret = connect(mWaitNote->actions().at(0), SIGNAL(triggered()),
  1099                            this, SLOT(cancelResponse()));
  1105                            this, SLOT(cancelResponse()));
  1100         TFLOGSTRING2("SATAPP: SatAppUiProvider::showDtmfWaitNote \
  1106         TFLOGSTRING2("SATAPP: SatAppUiProvider::showDtmfWaitNote \
  1101         primaryAction=%d", ret)
  1107         primaryAction=%d", ret)
  1102     
  1108     
  1103         mWaitNote->show();
  1109         mWaitNote->show();
  1114 // ----------------------------------------------------------------------------
  1120 // ----------------------------------------------------------------------------
  1115 //
  1121 //
  1116 void SatAppUiProvider::showMoSmControlNote(const QString &aText)
  1122 void SatAppUiProvider::showMoSmControlNote(const QString &aText)
  1117 {
  1123 {
  1118     TFLOGSTRING("SATAPP: SatAppUiProvider::showMoSmControlNote")
  1124     TFLOGSTRING("SATAPP: SatAppUiProvider::showMoSmControlNote")
  1119     HbMessageBox *msgBox = new HbMessageBox(HbMessageBox::MessageTypeInformation);
  1125     HbMessageBox::information(aText);
  1120     msgBox->setText(aText);
       
  1121     msgBox->setTimeout(KMoSmControlTimeOut);
       
  1122     DialogWaiter waiter;
       
  1123     msgBox->open(&waiter, SLOT(done(HbAction *)));
       
  1124     waiter.wait();
       
  1125     delete msgBox;
       
  1126     TFLOGSTRING("SATAPP: SatAppUiProvider::showMoSmControlNote exit")
  1126     TFLOGSTRING("SATAPP: SatAppUiProvider::showMoSmControlNote exit")
  1127 
  1127 
  1128 }
  1128 }
  1129 
  1129 
  1130 // ----------------------------------------------------------------------------
  1130 // ----------------------------------------------------------------------------
  1137     if (mWaitNote) {
  1137     if (mWaitNote) {
  1138         delete mWaitNote;
  1138         delete mWaitNote;
  1139         mWaitNote = 0;
  1139         mWaitNote = 0;
  1140     }   
  1140     }   
  1141     mWaitNote = new HbProgressDialog(HbProgressDialog::WaitDialog);
  1141     mWaitNote = new HbProgressDialog(HbProgressDialog::WaitDialog);
  1142     mWaitNote->removeAction(mWaitNote->primaryAction());
  1142     mWaitNote->clearActions();
  1143     mWaitNote->setText(aText);
  1143     mWaitNote->setText(aText);
  1144     mWaitNote->show();
  1144     mWaitNote->show();
  1145     TFLOGSTRING("SATAPP: SatAppUiProvider::showCloseChannelWaitNote exit")
  1145     TFLOGSTRING("SATAPP: SatAppUiProvider::showCloseChannelWaitNote exit")
  1146 }
  1146 }
  1147 
  1147 
  1151 // ----------------------------------------------------------------------------
  1151 // ----------------------------------------------------------------------------
  1152 //
  1152 //
  1153 void SatAppUiProvider::showSatInfoNote(const QString &aText)
  1153 void SatAppUiProvider::showSatInfoNote(const QString &aText)
  1154 {
  1154 {
  1155     TFLOGSTRING("SATAPP: SatAppUiProvider::showSatInfoNote")
  1155     TFLOGSTRING("SATAPP: SatAppUiProvider::showSatInfoNote")
  1156     HbMessageBox *msgBox = new HbMessageBox(HbMessageBox::MessageTypeInformation);
  1156     HbMessageBox::information(aText);
  1157     msgBox->setText(aText);
       
  1158     DialogWaiter waiter;
       
  1159     msgBox->open(&waiter, SLOT(done(HbAction *)));
       
  1160     waiter.wait();
       
  1161     delete msgBox;
       
  1162     msgBox = 0;
       
  1163     TFLOGSTRING("SATAPP: SatAppUiProvider::showSatInfoNote exit")
  1157     TFLOGSTRING("SATAPP: SatAppUiProvider::showSatInfoNote exit")
  1164 }
  1158 }
  1165 
  1159 
  1166 // End of file
  1160 // End of file