apengine/apsettingsplugin/src/utilities.cpp
changeset 23 7ec726f93df1
parent 20 9c97ad6591ae
child 25 d840bfde7d40
child 27 489cf6208544
equal deleted inserted replaced
20:9c97ad6591ae 23:7ec726f93df1
     1 /*
       
     2 * Copyright (c) 2004 Nokia Corporation and/or its subsidiary(-ies). 
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description: 
       
    15 *      Implementation of utilities functions.   
       
    16 *      
       
    17 *
       
    18 */
       
    19 
       
    20 
       
    21 // INCLUDE FILES
       
    22 #include "utilities.h"
       
    23 
       
    24 #include <ErrorUI.h>
       
    25 #include <AknGlobalNote.h>
       
    26 #include <StringLoader.h>
       
    27 #include <ApSettingsPluginRsc.rsg>
       
    28 
       
    29 // ================= MEMBER FUNCTIONS =======================
       
    30 
       
    31 // ---------------------------------------------------------
       
    32 // Utilities::ShowErrorNote
       
    33 // ---------------------------------------------------------
       
    34 //
       
    35 void Utilities::ShowErrorNote(TInt aErrorCode)
       
    36     {
       
    37     TBool errorNoteShowed = EFalse;
       
    38         
       
    39     TRAPD(error, errorNoteShowed = ShowErrorNoteL(aErrorCode));
       
    40             
       
    41     if(error || !errorNoteShowed) 
       
    42         {
       
    43         TRAP_IGNORE( ShowGeneralErrorNoteL() );
       
    44         }    
       
    45     }
       
    46 
       
    47 // ---------------------------------------------------------
       
    48 // Utilities::ShowErrorNoteL
       
    49 // ---------------------------------------------------------
       
    50 //
       
    51 TBool Utilities::ShowErrorNoteL(TInt aErrorCode)
       
    52     {
       
    53     CErrorUI* errorUi = CErrorUI::NewLC();
       
    54     
       
    55     TBool errorNoteShowed = errorUi->ShowGlobalErrorNoteL( aErrorCode );
       
    56     
       
    57     CleanupStack::PopAndDestroy( errorUi );
       
    58         
       
    59     return errorNoteShowed;
       
    60     }    
       
    61 
       
    62 // ---------------------------------------------------------
       
    63 // Utilities::ShowGeneralErrorNoteL
       
    64 // ---------------------------------------------------------
       
    65 //
       
    66 void Utilities::ShowGeneralErrorNoteL()
       
    67     {
       
    68     HBufC *msg = StringLoader::LoadLC( R_QTN_ERR_OS_GENERAL );
       
    69 
       
    70     CAknGlobalNote *note = CAknGlobalNote::NewLC();
       
    71     
       
    72     
       
    73     note->ShowNoteL( EAknGlobalErrorNote, *msg );
       
    74 
       
    75 
       
    76     CleanupStack::PopAndDestroy( note );
       
    77     CleanupStack::PopAndDestroy( msg );
       
    78     }