cellular/psuinotes/src/psuiwaitingnotehandler.cpp
changeset 50 2313cb430f28
parent 32 1f002146abb4
child 53 25b8d29b7c59
equal deleted inserted replaced
45:61f927bc9441 50:2313cb430f28
     1 /*
     1 /*
     2  * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
     2  * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
     3  * All rights reserved.
     3  * All rights reserved.
     4  * This component and the accompanying materials are made available
     4  * This component and the accompanying materials are made available
     5  * under the terms of "Eclipse Public License v1.0"
     5  * under the terms of "Eclipse Public License v1.0"
     6  * which accompanies this distribution, and is available
     6  * which accompanies this distribution, and is available
     7  * at the URL "http://www.eclipse.org/legal/epl-v10.html".
     7  * at the URL "http://www.eclipse.org/legal/epl-v10.html".
    27  */
    27  */
    28 PsUiWaitingNoteHandler::PsUiWaitingNoteHandler(PSetCallWaitingWrapper& callWaitingWrapper) :
    28 PsUiWaitingNoteHandler::PsUiWaitingNoteHandler(PSetCallWaitingWrapper& callWaitingWrapper) :
    29     m_callWaitingWrapper(callWaitingWrapper)
    29     m_callWaitingWrapper(callWaitingWrapper)
    30 {
    30 {
    31     DPRINT << ": IN";
    31     DPRINT << ": IN";
    32     
    32 
    33     m_settingsWrapper = new PsUiSettingsWrapper();
    33     m_settingsWrapper = new PsUiSettingsWrapper();
    34     
    34 
    35     QObject::connect(
    35     QObject::connect(
    36         &m_callWaitingWrapper, 
    36         &m_callWaitingWrapper, 
    37         SIGNAL(handleCallWaitingGetStatus(
    37         SIGNAL(handleCallWaitingGetStatus(
    38            PSetCallWaitingWrapper::PsCallWaitingStatus, const QList<unsigned char> &)),
    38            PSetCallWaitingWrapper::PsCallWaitingStatus, const QList<unsigned char> &)),
    39         this, 
    39         this, 
    79     DPRINT << ": IN status: " << status;
    79     DPRINT << ": IN status: " << status;
    80     Q_UNUSED(basicServiceGroupIds);
    80     Q_UNUSED(basicServiceGroupIds);
    81 
    81 
    82     PsUiNotes::instance()->cancelNote(m_activeNoteId);
    82     PsUiNotes::instance()->cancelNote(m_activeNoteId);
    83     
    83     
       
    84     bool alsCaseOnly = false;
       
    85     if (1 == basicServiceGroupIds.count() &&
       
    86         PsUiUtils::AltTele == static_cast<PsUiUtils::BasicServiceGroups>(basicServiceGroupIds.at(0))) {
       
    87         DPRINT << "Status is only for als";
       
    88         alsCaseOnly = true;
       
    89     }
       
    90 
    84     if (PSetCallWaitingWrapper::StatusNotProvisioned == status && 
    91     if (PSetCallWaitingWrapper::StatusNotProvisioned == status && 
    85         m_settingsWrapper->isFeatureCallWaitingDistiquishNotProvisionedEnabled()) {
    92         m_settingsWrapper->isFeatureCallWaitingDistiquishNotProvisionedEnabled()) {
    86         DPRINT << ": not provisioned";
    93         DPRINT << ": not provisioned";
    87         PsUiNotes::instance()->showGlobalNotificationDialog(hbTrId("txt_phone_info_request_not_completed"));
    94         PsUiNotes::instance()->
    88     }
    95             showGlobalNotificationDialog(hbTrId("txt_phone_info_request_not_completed"));
    89     
    96     }  
    90     else if (PSetCallWaitingWrapper::StatusActive == status) {
    97     else if (PSetCallWaitingWrapper::StatusActive == status && !alsCaseOnly ) {
    91         DPRINT << ": status active";
    98         DPRINT << ": status active";
    92         PsUiNotes::instance()->showGlobalNotificationDialog(
    99         PsUiNotes::instance()->showGlobalNotificationDialog(
    93             hbTrId("Call waiting active")); //txt_phone_dpopinfo_call_waiting_active 
   100             hbTrId("txt_phone_dpopinfo_call_waiting_active")); 
    94     }
   101     }
    95     else {
   102     else {
    96         DPRINT << ": status not active";
   103         DPRINT << ": status not active";
    97         PsUiNotes::instance()->showGlobalNotificationDialog(
   104         PsUiNotes::instance()->showGlobalNotificationDialog(
    98             hbTrId("Call waiting not active")); //txt_phone_dpopinfo_call_waiting_not_active      
   105             hbTrId("txt_phone_dpopinfo_call_waiting_not_active"));  
    99     }
   106     }
   100 
   107 
   101     DPRINT << ": OUT";   
   108     DPRINT << ": OUT";   
   102 }
   109 }
   103 
   110 
   128                  PsUiNotes::instance()->showGlobalNotificationDialog(
   135                  PsUiNotes::instance()->showGlobalNotificationDialog(
   129                  hbTrId("txt_phone_info_result_unknown"));
   136                  hbTrId("txt_phone_info_result_unknown"));
   130              break;
   137              break;
   131         }
   138         }
   132       }
   139       }
   133         
   140 
   134     DPRINT << ": OUT";
   141     DPRINT << ": OUT";
   135 }
   142 }
   136 
   143 
   137 /*!
   144 /*!
   138   PsUiWaitingNoteHandler::handleCallWaitingRequesting
   145   PsUiWaitingNoteHandler::handleCallWaitingRequesting
   139  */
   146  */
   140 void PsUiWaitingNoteHandler::handleCallWaitingRequesting( bool ongoing, bool interrupted )
   147 void PsUiWaitingNoteHandler::handleCallWaitingRequesting( bool ongoing, bool interrupted )
   141 {
   148 {
   142     DPRINT << ": IN";
   149     DPRINT << ": IN";
   143     DPRINT << "ongoing:" << ongoing << ", interrupted:" << interrupted;
   150     DPRINT << "ongoing:" << ongoing << ", interrupted:" << interrupted;
   144    
   151 
   145     if (ongoing) {
   152     if (ongoing) {
   146         PsUiNotes::instance()->showGlobalProgressNote(m_activeNoteId, hbTrId("txt_common_info_requesting"));
   153         PsUiNotes::instance()->showGlobalProgressNote(m_activeNoteId, 
       
   154             hbTrId("txt_common_info_requesting"));
   147     }
   155     }
   148       
   156 
   149     if (interrupted) {
   157     if (interrupted) {
   150         PsUiNotes::instance()->cancelNote(m_activeNoteId);
   158         PsUiNotes::instance()->cancelNote(m_activeNoteId);
   151     }
   159     }
   152     
   160 
   153      
       
   154     DPRINT << ": OUT";
   161     DPRINT << ": OUT";
   155 }
   162 }
   156 
   163 
   157 /*!
   164 /*!
   158   PsUiWaitingNoteHandler::handleCallWaitingError
   165   PsUiWaitingNoteHandler::handleCallWaitingError
   159  */
   166  */
   160 void PsUiWaitingNoteHandler::handleCallWaitingError( int error )
   167 void PsUiWaitingNoteHandler::handleCallWaitingError( int error )
   161 {
   168 {
   162     DPRINT << ": IN";
   169     DPRINT << ": IN";
   163     DPRINT << "errorCode:" << error;
   170     DPRINT << "errorCode:" << error;
   164     PsUiNotes::instance()->cancelNote(m_activeNoteId);     
   171     PsUiNotes::instance()->cancelNote(m_activeNoteId);
   165     PsUiNotes::instance()->showGlobalErrorNote(m_activeNoteId, error);
   172     PsUiNotes::instance()->showGlobalErrorNote(m_activeNoteId, error);
   166 
   173 
   167     DPRINT << ": OUT";
   174     DPRINT << ": OUT";
   168 }
   175 }