phonesettings/cpphonesettingsplugins/cptelephonyutils/src/cpplugincommon.cpp
changeset 72 c76a0b1755b9
parent 64 6aaf0276100e
child 76 cfea66083b62
equal deleted inserted replaced
64:6aaf0276100e 72:c76a0b1755b9
    57 bool Tools::videoSupported()
    57 bool Tools::videoSupported()
    58 {
    58 {
    59     return XQSysInfo::isSupported(KFeatureIdCsVideoTelephony);
    59     return XQSysInfo::isSupported(KFeatureIdCsVideoTelephony);
    60 }
    60 }
    61 
    61 
    62 /*!
       
    63   Tools::errorCodeTextMapping.
       
    64  */
       
    65 bool Tools::errorCodeTextMapping(const int errorcode, QString &errorText)
       
    66 {
       
    67     DPRINT;
       
    68     errorText.clear();
       
    69     bool errorTextFound(true);
       
    70 
       
    71     switch(errorcode){
       
    72         case KErrGsmSSSubscriptionViolation:
       
    73             errorText = hbTrId("txt_phone_info_barring_operation_not_successful");
       
    74             break;
       
    75         case KErrGsmSSUnknownSubscriber:
       
    76         case KErrGsmSSAbsentSubscriber:
       
    77         case KErrGsmSSIllegalOperation:
       
    78         case KErrGsmSSIllegalSubscriber:
       
    79         case KErrGsmSSIllegalEquipment:
       
    80         case KErrGsmSSCallBarred:
       
    81         case KErrGsmSSDataMissing:
       
    82             errorText = hbTrId("txt_phone_info_not_allowed");
       
    83             break;
       
    84         case KErrGsmSSIncompatibility:
       
    85             errorText = hbTrId("txt_phone_info_conflict_error");
       
    86             break;
       
    87         case KErrGsmSSSystemFailure:
       
    88             errorText = hbTrId("txt_phone_info_result_unknown");
       
    89             break;
       
    90         case KErrGsmSSUnexpectedDataValue:
       
    91         case KErrGsmSSResourcesUnavailable:
       
    92             errorText = hbTrId("txt_phone_info_request_rejected");
       
    93             break;
       
    94         case KErrGsmSSNegativePasswordCheck:
       
    95         case KErrGsmSSPasswordRegistrationFailure:
       
    96             errorText = hbTrId("Password error");
       
    97             break;
       
    98         case KErrGsmSSPasswordAttemptsViolation:
       
    99             errorText = hbTrId("txt_phone_info_barring_password_blocked");
       
   100             break;
       
   101         case KErrGsmSMSNoNetworkService:
       
   102         case KErrGsmNoService:
       
   103             errorText = hbTrId("No network coverage");
       
   104             break;
       
   105         case KErrSsActivationDataLost:
       
   106             errorText = hbTrId("Check network services");
       
   107             break;
       
   108         case KErrGsmOfflineOpNotAllowed:
       
   109             if(XQSysInfo::isSupported(KFeatureIdOfflineMode)){
       
   110                 XQSettingsManager *xqsettingsManager = new XQSettingsManager();
       
   111                 XQSettingsKey key(XQSettingsKey::TargetPublishAndSubscribe,
       
   112                         KPSUidBluetoothSapConnectionState.iUid,
       
   113                         KBTSapConnectionState);
       
   114                 QVariant startupValue = xqsettingsManager->readItemValue(key);
       
   115                 int value = startupValue.toInt();
       
   116                 delete xqsettingsManager;
       
   117                 xqsettingsManager = NULL;
       
   118                 if (value == EBTSapConnected){
       
   119                     errorText = hbTrId("Operation not possible in SIM access profile mode");
       
   120                 } else {
       
   121                     errorText = hbTrId("Operation not possible in Off-line mode");
       
   122                 }
       
   123             } else {
       
   124                 errorText = hbTrId("txt_phone_info_request_not_completed");
       
   125             }
       
   126             break;
       
   127         case KErrGsmSSUnknownAlphabet:
       
   128             errorText = hbTrId("txt_phone_info_invalid_phone_number");
       
   129             break;
       
   130         default:
       
   131             errorText = hbTrId("txt_phone_info_request_not_completed");
       
   132             break;
       
   133     }
       
   134 
       
   135     return errorTextFound;
       
   136 }
       
   137 
       
   138 CpSettingsWrapper::CpSettingsWrapper(QObject *parent): 
    62 CpSettingsWrapper::CpSettingsWrapper(QObject *parent): 
   139     QObject(parent),
    63     QObject(parent),
   140     m_settings(NULL),
    64     m_settings(NULL),
   141     m_deviceInfo(NULL)
    65     m_deviceInfo(NULL)
   142 {
    66 {