photosgallery/viewframework/uiutilities/src/glxprogressindicator.cpp
branchRCL_3
changeset 13 bcb43dc84c44
parent 12 ce1c7ad1f18b
child 14 2dac0fdba72b
equal deleted inserted replaced
12:ce1c7ad1f18b 13:bcb43dc84c44
    31 // ---------------------------------------------------------
    31 // ---------------------------------------------------------
    32 //  
    32 //  
    33 EXPORT_C CGlxProgressIndicator* CGlxProgressIndicator::NewL
    33 EXPORT_C CGlxProgressIndicator* CGlxProgressIndicator::NewL
    34                     (MDialogDismisedObserver& aGlxGridViewNotifyObserver)
    34                     (MDialogDismisedObserver& aGlxGridViewNotifyObserver)
    35     {
    35     {
       
    36     TRACER("CGlxProgressIndicator::NewL()");
    36     CGlxProgressIndicator* self = CGlxProgressIndicator::NewLC
    37     CGlxProgressIndicator* self = CGlxProgressIndicator::NewLC
    37                                                 (aGlxGridViewNotifyObserver);
    38                                                 (aGlxGridViewNotifyObserver);
    38     CleanupStack::Pop(self);
    39     CleanupStack::Pop(self);
    39     return self;
    40     return self;
    40     }
    41     }
    44 // ---------------------------------------------------------
    45 // ---------------------------------------------------------
    45 //  
    46 //  
    46 CGlxProgressIndicator* CGlxProgressIndicator::NewLC
    47 CGlxProgressIndicator* CGlxProgressIndicator::NewLC
    47                     (MDialogDismisedObserver& aGlxGridViewNotifyObserver)
    48                     (MDialogDismisedObserver& aGlxGridViewNotifyObserver)
    48     {
    49     {
    49     
    50     TRACER("CGlxProgressIndicator::NewLC()");
    50     CGlxProgressIndicator* self = new(ELeave)
    51     CGlxProgressIndicator* self = new(ELeave)
    51                     CGlxProgressIndicator(aGlxGridViewNotifyObserver);
    52                     CGlxProgressIndicator(aGlxGridViewNotifyObserver);
    52     CleanupStack::PushL(self);
    53     CleanupStack::PushL(self);
    53     self->ConstructL();
    54     self->ConstructL();
    54     return self;
    55     return self;
    68 // CGlxProgressIndicator::~CGlxProgressIndicator
    69 // CGlxProgressIndicator::~CGlxProgressIndicator
    69 // ---------------------------------------------------------
    70 // ---------------------------------------------------------
    70 //
    71 //
    71 CGlxProgressIndicator::~CGlxProgressIndicator()
    72 CGlxProgressIndicator::~CGlxProgressIndicator()
    72     {
    73     {
       
    74     TRACER("CGlxProgressIndicator::~CGlxProgressIndicator()");
    73     if (iProgressbarTicker && iProgressbarTicker->IsActive())
    75     if (iProgressbarTicker && iProgressbarTicker->IsActive())
    74         {
    76         {
    75         iProgressbarTicker->Cancel();
    77         iProgressbarTicker->Cancel();
    76         delete iProgressbarTicker;
    78         delete iProgressbarTicker;
    77         }
    79         }
    94 // CGlxProgressIndicator::ConstructL
    96 // CGlxProgressIndicator::ConstructL
    95 // ---------------------------------------------------------
    97 // ---------------------------------------------------------
    96 //
    98 //
    97 void CGlxProgressIndicator::ConstructL()
    99 void CGlxProgressIndicator::ConstructL()
    98     {
   100     {
       
   101     TRACER("CGlxProgressIndicator::ConstructL()");
    99     CGlxUiUtility* uiUtility = CGlxUiUtility::UtilityL();
   102     CGlxUiUtility* uiUtility = CGlxUiUtility::UtilityL();
   100     CleanupClosePushL(*uiUtility);
   103     CleanupClosePushL(*uiUtility);
   101     TRAPD(err,uiUtility->StartTNMDaemonL());
   104     TRAPD(err,uiUtility->StartTNMDaemonL());
   102 
   105 
   103     if(err != KErrNone)
   106     if(err != KErrNone)
   198         iProgressDialog->RunLD();
   201         iProgressDialog->RunLD();
   199         }
   202         }
   200     else
   203     else
   201         {
   204         {
   202         iProgressDialog->ProcessFinishedL();
   205         iProgressDialog->ProcessFinishedL();
       
   206         iGlxGridViewNotifyObserver.HandleDialogDismissedL();
   203         if(iProgressDialog)
   207         if(iProgressDialog)
   204             {
   208             {
   205             iProgressDialog = NULL;
   209             iProgressDialog = NULL;
   206             iProgressInfo = NULL;
   210             iProgressInfo = NULL;
   207             }
   211             }
   241     uiUtility->StopTNMDaemonL();
   245     uiUtility->StopTNMDaemonL();
   242     CleanupStack::PopAndDestroy(uiUtility);
   246     CleanupStack::PopAndDestroy(uiUtility);
   243     if(iProgressbarTicker)
   247     if(iProgressbarTicker)
   244         {
   248         {
   245         iProgressbarTicker->Cancel();
   249         iProgressbarTicker->Cancel();
   246         delete iProgressbarTicker;
       
   247         iProgressbarTicker = NULL;
   250         iProgressbarTicker = NULL;
   248         }
   251         }
   249 
   252 
   250     if (aButtonId == EAknSoftkeyCancel)
       
   251         {
       
   252         // cancel any process in here 
       
   253         iGlxGridViewNotifyObserver.HandleDialogDismissedL();
       
   254         }
       
   255     if(iProgressDialog)
   253     if(iProgressDialog)
   256         {
   254         {
   257         iProgressDialog = NULL;
   255         iProgressDialog = NULL;
   258         iProgressInfo = NULL;
   256         iProgressInfo = NULL;
   259         }    
   257         }