photosgallery/viewframework/uiutilities/src/glxprogressindicator.cpp
branchRCL_3
changeset 35 420f6808bf21
parent 30 a60acebbbd9d
child 56 b023a8d2866a
equal deleted inserted replaced
32:78ad99c24f08 35:420f6808bf21
    28 
    28 
    29 // ---------------------------------------------------------
    29 // ---------------------------------------------------------
    30 // CGlxProgressIndicator::NewL
    30 // CGlxProgressIndicator::NewL
    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     TRACER("CGlxProgressIndicator::NewL()");
    37     CGlxProgressIndicator* self = CGlxProgressIndicator::NewLC
    37     CGlxProgressIndicator* self = CGlxProgressIndicator::NewLC(
    38                                                 (aGlxGridViewNotifyObserver);
    38             aGlxGridViewNotifyObserver);
    39     CleanupStack::Pop(self);
    39     CleanupStack::Pop(self);
    40     return self;
    40     return self;
    41     }
    41     }
    42 
    42 
    43 // ---------------------------------------------------------
    43 // ---------------------------------------------------------
    44 // CGlxProgressIndicator::NewLC
    44 // CGlxProgressIndicator::NewLC
    45 // ---------------------------------------------------------
    45 // ---------------------------------------------------------
    46 //  
    46 //  
    47 CGlxProgressIndicator* CGlxProgressIndicator::NewLC
    47 CGlxProgressIndicator* CGlxProgressIndicator::NewLC(
    48                     (MDialogDismisedObserver& aGlxGridViewNotifyObserver)
    48         MDialogDismisedObserver& aGlxGridViewNotifyObserver)
    49     {
    49     {
    50     TRACER("CGlxProgressIndicator::NewLC()");
    50     TRACER("CGlxProgressIndicator::NewLC()");
    51     CGlxProgressIndicator* self = new(ELeave)
    51     CGlxProgressIndicator* self = new (ELeave) CGlxProgressIndicator(
    52                     CGlxProgressIndicator(aGlxGridViewNotifyObserver);
    52             aGlxGridViewNotifyObserver);
    53     CleanupStack::PushL(self);
    53     CleanupStack::PushL(self);
    54     self->ConstructL();
    54     self->ConstructL();
    55     return self;
    55     return self;
    56     }
    56     }
    57 
    57 
    58 // ---------------------------------------------------------
    58 // ---------------------------------------------------------
    59 // CGlxProgressIndicator::CGlxProgressIndicator
    59 // CGlxProgressIndicator::CGlxProgressIndicator
    60 // ---------------------------------------------------------
    60 // ---------------------------------------------------------
    61 // 
    61 // 
    62 CGlxProgressIndicator::CGlxProgressIndicator
    62 CGlxProgressIndicator::CGlxProgressIndicator(
    63           (MDialogDismisedObserver& aGlxGridViewNotifyObserver)
    63         MDialogDismisedObserver& aGlxGridViewNotifyObserver) :
    64                     :iGlxGridViewNotifyObserver(aGlxGridViewNotifyObserver)
    64     iGlxGridViewNotifyObserver(aGlxGridViewNotifyObserver)
    65     {
    65     {
    66     }
    66     }
    67 
    67 
    68 // ---------------------------------------------------------
    68 // ---------------------------------------------------------
    69 // CGlxProgressIndicator::~CGlxProgressIndicator
    69 // CGlxProgressIndicator::~CGlxProgressIndicator
    92 // ---------------------------------------------------------
    92 // ---------------------------------------------------------
    93 //
    93 //
    94 void CGlxProgressIndicator::ConstructL()
    94 void CGlxProgressIndicator::ConstructL()
    95     {
    95     {
    96     TRACER("CGlxProgressIndicator::ConstructL()");
    96     TRACER("CGlxProgressIndicator::ConstructL()");
       
    97     
       
    98     iUiUtility = CGlxUiUtility::UtilityL();
       
    99     
    97     iUiUtility->StartTNMDaemon();
   100     iUiUtility->StartTNMDaemon();
    98 
   101 
    99     if (!iProgressbarTicker)
   102     if (!iProgressbarTicker)
   100         {
   103         {
   101         iProgressbarTicker = CPeriodic::NewL(CActive::EPriorityStandard);
   104         iProgressbarTicker = CPeriodic::NewL(CActive::EPriorityStandard);
   139 
   142 
   140 // -----------------------------------------------------------------------------
   143 // -----------------------------------------------------------------------------
   141 // StartProgressNoteL
   144 // StartProgressNoteL
   142 // -----------------------------------------------------------------------------
   145 // -----------------------------------------------------------------------------
   143 //
   146 //
   144 void CGlxProgressIndicator::StartProgressNoteL(TInt aFinalValue,TBool aShow)
   147 void CGlxProgressIndicator::StartProgressNoteL(TInt aFinalValue, TBool aShow)
   145     {
   148     {
   146     TRACER("CGlxProgressIndicator::StartProgressNoteL()");
   149     TRACER("CGlxProgressIndicator::StartProgressNoteL()");
   147     TInt itemsLeft = iUiUtility->GetItemsLeftCount();
   150     TInt itemsLeft = iUiUtility->GetItemsLeftCount();
   148     if (aShow)
   151     if (aShow)
   149         {
   152         {
   241 // -----------------------------------------------------------------------------
   244 // -----------------------------------------------------------------------------
   242 //
   245 //
   243 void EXPORT_C CGlxProgressIndicator::ShowProgressbarL()
   246 void EXPORT_C CGlxProgressIndicator::ShowProgressbarL()
   244     {
   247     {
   245     TRACER("CGlxProgressIndicator::ShowProgressbarL");
   248     TRACER("CGlxProgressIndicator::ShowProgressbarL");
   246     iUiUtility->StartTNMDaemon();
       
   247     TInt itemsLeft = iUiUtility->GetItemsLeftCount();
   249     TInt itemsLeft = iUiUtility->GetItemsLeftCount();
   248 
   250     GLX_DEBUG3("ShowProgressbarL itemsLeft(%d), iFinalCount(%d)", itemsLeft, 
   249     GLX_LOG_INFO1("ShowProgressbar itemsLeft = %d ",itemsLeft);
   251             iFinalCount);
   250     GLX_LOG_INFO1("ShowProgressbar iFinalCount = %d ",iFinalCount);
   252 
   251     if (iFinalCount < itemsLeft)
   253     if (iFinalCount < itemsLeft)
   252         {
   254         {
   253         /*
   255         /*
   254          *if user is in List view and inserts the MMC,update the total count 
   256          *if user is in List view and inserts the MMC,update the total count 
   255          */
   257          */
   288         {
   290         {
   289         TRAP_IGNORE(iProgressDialog->ProcessFinishedL());
   291         TRAP_IGNORE(iProgressDialog->ProcessFinishedL());
   290         }
   292         }
   291     }
   293     }
   292 
   294 
       
   295 // -----------------------------------------------------------------------------
       
   296 // ControlTNDaemon
       
   297 // -----------------------------------------------------------------------------
       
   298 //
       
   299 EXPORT_C void CGlxProgressIndicator::ControlTNDaemon(TBool aStatus)
       
   300     {
       
   301     TRACER("CGlxProgressIndicator::ControlTNDaemon");
       
   302     GLX_DEBUG2("CGlxProgressIndicator::ControlTNDaemon(%d)", aStatus);
       
   303     if (aStatus)
       
   304         {
       
   305         iUiUtility->StartTNMDaemon();
       
   306         }
       
   307     else
       
   308         {
       
   309         iUiUtility->StopTNMDaemon();
       
   310         }
       
   311     }