1 /* |
|
2 * Copyright (c) 2008 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: Utils for IMUiServiceTab modules. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 // INCLUDE FILES |
|
20 #include "vimpstutilsnotemapper.h" |
|
21 #include "vimpstutilsdialog.h" |
|
22 #include "vimpstallerrors.h" |
|
23 #include <vimpstuires.rsg> |
|
24 #include <StringLoader.h> |
|
25 #include <eikenv.h> |
|
26 #include "uiservicetabtracer.h" |
|
27 |
|
28 |
|
29 |
|
30 // --------------------------------------------------------- |
|
31 // VIMPSTUtilsNoteMapper::ShowNoteL |
|
32 // (other items were commented in a header). |
|
33 // --------------------------------------------------------- |
|
34 // |
|
35 EXPORT_C void VIMPSTUtilsNoteMapper::ShowNoteL( const TInt aErrorCode, const TDesC& aAdditionalData ) |
|
36 { |
|
37 TRACER_AUTO; |
|
38 TBool ignoreAdditionalData( EFalse ); // Some logical strings are without parameters... |
|
39 TBool errorNote( ETrue ); |
|
40 TBool defaultNote( EFalse ); |
|
41 TInt resourceID( 0 ); |
|
42 TBool confirmationNote( EFalse ); |
|
43 TBool softkeyOk( EFalse ); |
|
44 |
|
45 switch( aErrorCode ) |
|
46 { |
|
47 case EVIMPSTWrongUserIdPassword:// Invalid password or userid |
|
48 { |
|
49 defaultNote = ETrue; |
|
50 errorNote = ETrue; |
|
51 resourceID = R_IM_LOGIN_PASSER_NOTE; |
|
52 ignoreAdditionalData = ETrue; |
|
53 break; |
|
54 } |
|
55 case EVIMPSTSessionExpired: |
|
56 case EVIMPSTNotSupported: |
|
57 { |
|
58 defaultNote = ETrue; |
|
59 errorNote = ETrue; |
|
60 ignoreAdditionalData = ETrue; |
|
61 resourceID = R_IM_ERROR_SERVICE_ERR; |
|
62 break; |
|
63 } |
|
64 case EVIMPSTMultipleErrors: // flowthrough |
|
65 default: // Unknown error -> show general note |
|
66 { |
|
67 defaultNote = ETrue; |
|
68 errorNote = ETrue; |
|
69 ignoreAdditionalData = ETrue; |
|
70 resourceID = R_IM_ERROR_GEN_ERROR; |
|
71 break; |
|
72 } |
|
73 } |
|
74 |
|
75 if( resourceID != 0 ) |
|
76 { |
|
77 if( confirmationNote ) |
|
78 { |
|
79 VIMPSTUtilsDialog::DisplayQueryDialogL( resourceID ); |
|
80 } |
|
81 else |
|
82 { |
|
83 HBufC* prompt = NULL; |
|
84 |
|
85 if( aAdditionalData == KNullDesC || defaultNote || ignoreAdditionalData ) |
|
86 { |
|
87 prompt = CEikonEnv::Static()->AllocReadResourceLC( resourceID ); |
|
88 } |
|
89 else |
|
90 { |
|
91 prompt = StringLoader::LoadLC( resourceID, aAdditionalData ); |
|
92 } |
|
93 |
|
94 if( errorNote ) |
|
95 { |
|
96 VIMPSTUtilsDialog::DisplayErrorNoteL( *prompt, softkeyOk ); |
|
97 } |
|
98 else |
|
99 { |
|
100 VIMPSTUtilsDialog::DisplayNoteDialogL( *prompt ); |
|
101 } |
|
102 |
|
103 CleanupStack::PopAndDestroy( prompt ); |
|
104 } |
|
105 } |
|
106 } |
|
107 |
|
108 // End of File |
|