basiclocationinfodisplay/blid/ui/src/CBlidMainControl.cpp
branchRCL_3
changeset 5 41042d2af523
parent 3 3c271c9e6618
child 16 8173571d354e
equal deleted inserted replaced
3:3c271c9e6618 5:41042d2af523
    82 //CBlidMainControl::CBlidMainControl()
    82 //CBlidMainControl::CBlidMainControl()
    83 // First phase constructor, can not leave
    83 // First phase constructor, can not leave
    84 // ---------------------------------------------------------
    84 // ---------------------------------------------------------
    85 //
    85 //
    86 CBlidMainControl::CBlidMainControl(CAlfEnv& aEnv, CBlidBaseView& aView) :
    86 CBlidMainControl::CBlidMainControl(CAlfEnv& aEnv, CBlidBaseView& aView) :
    87     CAlfControl(), iEnv(aEnv), iView(aView)
    87     CAlfControl(), iEnv(aEnv), iView(aView), isAccessoryRequired(EFalse)
    88     {
    88     {
    89     iOnlineMode = EFalse;
    89     iOnlineMode = EFalse;
    90     }
    90     }
    91 
    91 
    92 // ---------------------------------------------------------
    92 // ---------------------------------------------------------
   347                  */
   347                  */
   348                 if (iView.IsForeGroundApp())
   348                 if (iView.IsForeGroundApp())
   349                     {
   349                     {
   350                     iView.ActivateSatelliteViewL();
   350                     iView.ActivateSatelliteViewL();
   351                     }
   351                     }
   352                 break;
       
   353                 }
   352                 }
   354             case KErrNotFound:
   353             break;
       
   354             }
       
   355         case KErrNotFound:
   355             // No module (PSY) selected or invalid PSY
   356             // No module (PSY) selected or invalid PSY
   356                 {
   357                 {
   357                 iOnlineMode = EFalse;
   358                 iOnlineMode = EFalse;
   358                 // Notify not module selected
       
   359                 //            if (iPSYTimeoutCount == 0)
       
   360                 //                {
       
   361                 if (iView.IsForeGroundApp())
   359                 if (iView.IsForeGroundApp())
   362                     {
   360                     {
   363                     iLocation->StopRequesting();
   361                     iLocation->StopRequesting();
   364                     TCallBack callback(MessageQueryCallBack, this);
   362                     TCallBack callback(MessageQueryCallBack, this);
   365                     result
   363                     result
   366                             = DispMsgQueryWithLinkL(R_BLID_NOPSY_ENABLED,
   364                             = DispMsgQueryWithLinkL(R_BLID_NOGPS_FOUND,
   367                                     R_BLID_ERROR_NO_PSY,
   365                                     R_BLID_NOGPS_FOUND_TEXT,
   368                                     R_BLID_SELECT_POSITIONING_METHOD, ETrue,
   366                                     R_BLID_SELECT_POSITIONING_METHOD, ETrue,
   369                                     callback);
   367                                     callback);
   370                     if (result == EBlidSoftkeyRetry)
   368                     if (result == EBlidSoftkeyRetry)
   371                         {
   369                         {
   372                         iLocation->StartRequesting();
   370                         iLocation->StartRequesting();
   397                     if (iLocation->IsSatCapablePsyAvailable())
   395                     if (iLocation->IsSatCapablePsyAvailable())
   398                         {
   396                         {
   399                         iLocation->StopRequesting();
   397                         iLocation->StopRequesting();
   400                         iOnlineMode = EFalse;
   398                         iOnlineMode = EFalse;
   401                         TCallBack callback(MessageQueryCallBack, this);
   399                         TCallBack callback(MessageQueryCallBack, this);
   402                         result = DispMsgQueryWithLinkL(R_BLID_NOGPS_FOUND,
   400                         result = DispMsgQueryWithLinkL(R_BLID_NOPSY_ENABLED,
   403                                 R_BLID_NOGPS_FOUND_TEXT,
   401                                 R_BLID_ERROR_NO_PSY,
   404                                 R_BLID_SELECT_POSITIONING_METHOD, ETrue,
   402                                 R_BLID_SELECT_POSITIONING_METHOD, ETrue,
   405                                 callback);
   403                                 callback);
   406                         if (result == EBlidSoftkeyRetry)
   404                         if (result == EBlidSoftkeyRetry)
   407                             {
   405                             {
   408                             iLocation->StartRequesting();
   406                             iLocation->StartRequesting();
   416                     // GPS un-available
   414                     // GPS un-available
   417                     else if (iView.IsForeGroundApp())
   415                     else if (iView.IsForeGroundApp())
   418                         {
   416                         {
   419                         iLocation->StopRequesting();
   417                         iLocation->StopRequesting();
   420                         TCallBack callback(MessageQueryCallBack, this);
   418                         TCallBack callback(MessageQueryCallBack, this);
   421                         DispMsgQueryWithLinkL(R_BLID_NOGPS_FOUND,
   419                         isAccessoryRequired = ETrue;
       
   420                         result = DispMsgQueryWithLinkL(R_BLID_NOGPS_FOUND,
   422                                 R_BLID_NOGPS_AVAILABLE_TEXT,
   421                                 R_BLID_NOGPS_AVAILABLE_TEXT,
   423                                 R_BLID_SELECT_POSITIONING_METHOD, EFalse,
   422                                 R_BLID_SELECT_POSITIONING_METHOD, EFalse,
   424                                 callback);
   423                                 callback);
   425                         iView.ExitMainApplicationL(EEikCmdExit);
   424                         if (result == EAknSoftkeyOk)
       
   425                             {
       
   426                             iView.ExitMainApplicationL(EEikCmdExit);
       
   427                             }
   426                         }
   428                         }
   427                     else
   429                     else
   428                         {
   430                         {
   429                         BlidNotes::iGPSUnavailableDisplayed = ETrue;
   431                         BlidNotes::iGPSUnavailableDisplayed = ETrue;
   430                         }
   432                         }
   431                     CBlidBaseContainer::SetGPSAvailability(EFalse);
   433                     CBlidBaseContainer::SetGPSAvailability(EFalse);
   432                     }
   434                     }
   433                 break;
   435                 break;
   434 
   436 
   435                 }
       
   436             }
   437             }
   437         }
   438         }
   438     }
   439     }
   439 
   440 
   440 // ----------------------------------------------------
   441 // ----------------------------------------------------
   504 
   505 
   505     if (!iLinkText)
   506     if (!iLinkText)
   506         {
   507         {
   507         iLinkText = env->AllocReadResourceL(aLinkText);
   508         iLinkText = env->AllocReadResourceL(aLinkText);
   508         }
   509         }
   509 
       
   510     if (!iMsgQText)
   510     if (!iMsgQText)
   511         {
   511         {
   512         iMsgQText = HBufC::NewL(iMsgQueryText->Length() + KNewLine().Length()
   512         if (aLinkShow != EFalse)
   513                 + KOpeningLinkTag().Length() + iLinkText->Length()
   513             {
   514                 + KClosingLinkTag().Length());
   514             iMsgQText = HBufC::NewL(iMsgQueryText->Length()
       
   515                     + KNewLine().Length() + KOpeningLinkTag().Length()
       
   516                     + iLinkText->Length() + KClosingLinkTag().Length());
       
   517             }
       
   518         else
       
   519             {
       
   520             iMsgQText = HBufC::NewL(iMsgQueryText->Length()
       
   521                     + KNewLine().Length() + KOpeningLinkTag().Length());
       
   522             }
   515         }
   523         }
   516 
   524 
   517     iMsgQText->Des().Copy(*iMsgQueryText);
   525     iMsgQText->Des().Copy(*iMsgQueryText);
   518     iMsgQText->Des().Append(KNewLine);
   526     iMsgQText->Des().Append(KNewLine);
   519     if (aLinkShow)
   527     if (!isAccessoryRequired)
   520         {
   528         {
   521         iMsgQText->Des().Append(KOpeningLinkTag);
   529         iMsgQText->Des().Append(KOpeningLinkTag);
   522         iMsgQText->Des().Append(*iLinkText);
   530         iMsgQText->Des().Append(*iLinkText);
   523         iMsgQText->Des().Append(KClosingLinkTag);
   531         iMsgQText->Des().Append(KClosingLinkTag);
   524         }
   532         }
   542 
   550 
   543     msgDlg->Heading()->SetTextL(*iHeadPaneText);
   551     msgDlg->Heading()->SetTextL(*iHeadPaneText);
   544 
   552 
   545     msgDlg->SetLink(aCallBack);
   553     msgDlg->SetLink(aCallBack);
   546 
   554 
   547     msgDlg->ButtonGroupContainer().SetCommandSetL(
   555     if (!isAccessoryRequired)
   548             R_BLID_INFOPOPUP_SOFTKEYS_RETRY__EXIT);
   556         {
       
   557         msgDlg->ButtonGroupContainer().SetCommandSetL(
       
   558                 R_BLID_INFOPOPUP_SOFTKEYS_RETRY__EXIT);
       
   559         }
       
   560     else
       
   561         {
       
   562         msgDlg->ButtonGroupContainer().SetCommandSetL(
       
   563                 R_BLID_INFOPOPUP_SOFTKEYS_EXIT);
       
   564         }
   549     isDialogLaunched = ETrue;
   565     isDialogLaunched = ETrue;
   550     TInt retval = msgDlg->RunLD();
   566     TInt retval = msgDlg->RunLD();
   551     if (isDialogLaunched)
   567     if (isDialogLaunched)
   552         {
   568         {
   553         msgDlg = NULL;
   569         msgDlg = NULL;