pkiutilities/CertmanUi/SRC/Certmanuidialogs.cpp
changeset 0 164170e6151a
child 1 d5423fbb4f29
equal deleted inserted replaced
-1:000000000000 0:164170e6151a
       
     1 /*
       
     2 * Copyright (c) 2003-2007 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:   Implementation of class CertManUIDialogs
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 // INCLUDE FILES
       
    20 
       
    21 #include <AknWaitDialog.h>
       
    22 #include <certmanui.rsg>
       
    23 #include "Certmanuidialogs.h"
       
    24 #include "CertManUILogger.h"
       
    25 #include "CertmanuiCommon.h"
       
    26 
       
    27 
       
    28 #ifdef _DEBUG
       
    29 _LIT( KDesCertmanUiFault, "CertmanUi" );
       
    30 #endif
       
    31 
       
    32 // ================= MEMBER FUNCTIONS =======================
       
    33 
       
    34 // ---------------------------------------------------------
       
    35 // CCertManUiDialog::CCertManUiDialogs()
       
    36 // Default c++ constructor
       
    37 // ---------------------------------------------------------
       
    38 CCertManUIWaitDialog::CCertManUIWaitDialog()
       
    39     {
       
    40     iDialog = NULL;
       
    41     }
       
    42 
       
    43 // ---------------------------------------------------------
       
    44 // CCertManUiDialog::~CCertManUiDialogs()
       
    45 // Destructor
       
    46 // ---------------------------------------------------------
       
    47 CCertManUIWaitDialog::~CCertManUIWaitDialog()
       
    48     {
       
    49     if ( iDialog )
       
    50         {
       
    51         delete iDialog;
       
    52         }
       
    53     }
       
    54 
       
    55 //---------------------------------------------------------------
       
    56 // CCertManUiDialog::StartWaitDialogL
       
    57 // Displays wait dialog
       
    58 //---------------------------------------------------------------
       
    59 void CCertManUIWaitDialog::StartWaitDialogL( TInt aDialogSelector )
       
    60     {
       
    61     CERTMANUILOGGER_ENTERFN( "CCertManUIWaitDialog::StartWaitDialogL" );
       
    62     TInt dialog = 0;
       
    63 
       
    64     // If iDisplayed flag is true, but iDialog is NULL we have had leave.
       
    65     // Reset iDisplayed to normalize situation
       
    66     if(iDisplayed && iDialog == NULL)
       
    67         {
       
    68         iDisplayed = EFalse;
       
    69         }
       
    70 
       
    71     if(!iDisplayed)
       
    72         {
       
    73         if( !iDialog )
       
    74            {
       
    75             iDialog = new ( ELeave )CAknWaitDialog( REINTERPRET_CAST(CEikDialog**,
       
    76                 &iDialog), ETrue );	
       
    77            } 
       
    78 
       
    79 
       
    80         //CleanupStack::PushL(TCleanupItem(CleanupWaitDialog, (TAny**)&iDialog));
       
    81 
       
    82         switch(aDialogSelector)
       
    83             {
       
    84             case ECertmanUiDeleteDialog:
       
    85                 LOG_WRITE("Show delete note");
       
    86                 dialog = R_CERTMANUI_DELETE_WAIT_NOTE;
       
    87                 break;
       
    88 
       
    89             case ECertmanUiWaitDialog:
       
    90                 LOG_WRITE("Show wait note");
       
    91                 dialog = R_CERTMANUI_WAIT_NOTE;
       
    92                 break;
       
    93             default:
       
    94                 __ASSERT_DEBUG( EFalse, User::Panic(KDesCertmanUiFault,
       
    95                     EBadDialogSelector));
       
    96                 break;
       
    97             }
       
    98 
       
    99         iDialog->ExecuteLD(dialog);
       
   100         iDisplayed = ETrue;
       
   101         }
       
   102 
       
   103     CERTMANUILOGGER_LEAVEFN( "CCertManUIWaitDialog::StartWaitDialogL" );
       
   104     }
       
   105 
       
   106 //---------------------------------------------------------------
       
   107 // CCertManUiDialog::CloseWaitDialogL
       
   108 // Close wait dialog
       
   109 //---------------------------------------------------------------
       
   110 void CCertManUIWaitDialog::CloseWaitDialogL()
       
   111     {
       
   112     CERTMANUILOGGER_ENTERFN( "CCertManUIWaitDialog::CloseWaitDialogL" );
       
   113 
       
   114     if( iDialog )
       
   115         {
       
   116         iDialog->ProcessFinishedL();
       
   117         //CleanupStack::PopAndDestroy();
       
   118         }
       
   119 
       
   120     iDisplayed = EFalse;
       
   121     CERTMANUILOGGER_LEAVEFN( "CCertManUIWaitDialog::CloseWaitDialogL" );
       
   122     }
       
   123 
       
   124 // ---------------------------------------------------------
       
   125 // CCertManUIWaitDialog::CleanupWaitDialog
       
   126 //
       
   127 // ---------------------------------------------------------
       
   128 void CCertManUIWaitDialog::CleanupWaitDialog(TAny* aAny)
       
   129     {
       
   130     CERTMANUILOGGER_ENTERFN( "CCertManUIWaitDialog::CleanupWaitDialog" );
       
   131 
       
   132     CAknWaitDialog** dialog = (CAknWaitDialog**) aAny;
       
   133     if ( dialog && *dialog )
       
   134         {
       
   135         delete *dialog;
       
   136         }
       
   137     CERTMANUILOGGER_LEAVEFN( "CCertManUIWaitDialog::CleanupWaitDialog" );
       
   138     }
       
   139 
       
   140 
       
   141 // End of file