photosgallery/viewframework/uiutilities/src/glxprogressindicator.cpp
branchRCL_3
changeset 23 b023a8d2866a
parent 19 420f6808bf21
equal deleted inserted replaced
21:f9e827349359 23:b023a8d2866a
   126 //
   126 //
   127 inline void CGlxProgressIndicator::DisplayProgressBarL()
   127 inline void CGlxProgressIndicator::DisplayProgressBarL()
   128     {
   128     {
   129     TRACER("CGlxProgressIndicator::DisplayProgressBarL");
   129     TRACER("CGlxProgressIndicator::DisplayProgressBarL");
   130     TInt itemsLeft = iUiUtility->GetItemsLeftCount();
   130     TInt itemsLeft = iUiUtility->GetItemsLeftCount();
   131     GLX_LOG_INFO1("itemsLeft in DisplayProgressBarL = %d",iFinalCount);
   131     GLX_LOG_INFO2("DisplayProgressBarL itemsLeft (%d),iFinalCount (%d) ",
       
   132             itemsLeft,iFinalCount);
   132     UpdateProgressBar();
   133     UpdateProgressBar();
   133     if (!itemsLeft)
   134     if (!itemsLeft && (itemsLeft != KErrNotReady))
   134         {
   135         {
       
   136         // stop TNM daemon once all the imgs are processed.
       
   137         iUiUtility->StopTNMDaemon();
   135         if (iProgressbarTicker->IsActive())
   138         if (iProgressbarTicker->IsActive())
   136             {
   139             {
   137             iProgressbarTicker->Cancel();
   140             iProgressbarTicker->Cancel();
   138             }
   141             }
   139         StartProgressNoteL(iFinalCount, EFalse);
   142         StartProgressNoteL(iFinalCount, EFalse);
   145 // -----------------------------------------------------------------------------
   148 // -----------------------------------------------------------------------------
   146 //
   149 //
   147 void CGlxProgressIndicator::StartProgressNoteL(TInt aFinalValue, TBool aShow)
   150 void CGlxProgressIndicator::StartProgressNoteL(TInt aFinalValue, TBool aShow)
   148     {
   151     {
   149     TRACER("CGlxProgressIndicator::StartProgressNoteL()");
   152     TRACER("CGlxProgressIndicator::StartProgressNoteL()");
       
   153     //for MMC insert case need to know the count.so start Daemon.
       
   154     iUiUtility->StartTNMDaemon();
       
   155 
   150     TInt itemsLeft = iUiUtility->GetItemsLeftCount();
   156     TInt itemsLeft = iUiUtility->GetItemsLeftCount();
   151     if (aShow)
   157     if (aShow)
   152         {
   158         {
   153         if (!iProgressDialog)
   159         if (!iProgressDialog)
   154             {
   160             {
   227     {
   233     {
   228     TRACER("CGlxProgressIndicator::CalculateDisplayBarIncrement()");
   234     TRACER("CGlxProgressIndicator::CalculateDisplayBarIncrement()");
   229 
   235 
   230     TInt itemsLeft = iUiUtility->GetItemsLeftCount();
   236     TInt itemsLeft = iUiUtility->GetItemsLeftCount();
   231 
   237 
   232     if (iFinalCount < itemsLeft)
   238     if ((iFinalCount < itemsLeft) && (itemsLeft != KErrNotReady))
   233         {
   239         {
   234         iProgressInfo->SetFinalValue(itemsLeft);
   240         iProgressInfo->SetFinalValue(itemsLeft);
   235         iFinalCount = itemsLeft;
   241         iFinalCount = itemsLeft;
   236         }
   242         }
       
   243     GLX_LOG_INFO1("CalculateDisplayBarIncrement = %d ",
       
   244             (iFinalCount - itemsLeft));
       
   245     // If TNM is still in harvesting mode, return 0.
       
   246     // When the actual count is coming return the difference to update the info-bar
   237     
   247     
   238     GLX_LOG_INFO1("CalculateDisplayBarIncrement = %d ",(iFinalCount - itemsLeft));
   248     GLX_LOG_INFO1("CalculateDisplayBarIncrement = %d ",(iFinalCount - itemsLeft));
   239     return (iFinalCount - itemsLeft);
   249     return ((itemsLeft == KErrNotReady) ? 0 :(iFinalCount - itemsLeft));
   240     }
   250     }
   241 
   251 
   242 // -----------------------------------------------------------------------------
   252 // -----------------------------------------------------------------------------
   243 // ShowProgressbar
   253 // ShowProgressbar
   244 // -----------------------------------------------------------------------------
   254 // -----------------------------------------------------------------------------
   245 //
   255 //
   246 void EXPORT_C CGlxProgressIndicator::ShowProgressbarL()
   256 void EXPORT_C CGlxProgressIndicator::ShowProgressbarL()
   247     {
   257     {
   248     TRACER("CGlxProgressIndicator::ShowProgressbarL");
   258     TRACER("CGlxProgressIndicator::ShowProgressbarL");
   249     TInt itemsLeft = iUiUtility->GetItemsLeftCount();
   259     TInt itemsLeft = iUiUtility->GetItemsLeftCount();
   250     GLX_DEBUG3("ShowProgressbarL itemsLeft(%d), iFinalCount(%d)", itemsLeft, 
   260     GLX_DEBUG3("ShowProgressbarL itemsLeft(%d), iFinalCount(%d)", itemsLeft,
   251             iFinalCount);
   261             iFinalCount);
   252 
   262 
   253     if (iFinalCount < itemsLeft)
   263     if (iFinalCount < itemsLeft)
   254         {
   264         {
   255         /*
   265         /*
   256          *if user is in List view and inserts the MMC,update the total count 
   266          *if user is in List view and inserts the MMC,update the total count 
   257          */
   267          */
   258         iFinalCount = itemsLeft;
   268         iFinalCount = itemsLeft;
   259         }
   269         }
   260     if (iFinalCount)
   270 
       
   271     if ((itemsLeft == KErrNotReady) || iFinalCount)
   261         {
   272         {
   262         StartProgressNoteL(iFinalCount, ETrue);
   273         StartProgressNoteL(iFinalCount, ETrue);
   263         if (!iProgressbarTicker)
   274         if (!iProgressbarTicker)
   264             {
   275             {
   265             iProgressbarTicker = CPeriodic::NewL(CActive::EPriorityStandard);
   276             iProgressbarTicker = CPeriodic::NewL(CActive::EPriorityStandard);
   283 // -----------------------------------------------------------------------------
   294 // -----------------------------------------------------------------------------
   284 //
   295 //
   285 EXPORT_C void CGlxProgressIndicator::DismissProgressDialog()
   296 EXPORT_C void CGlxProgressIndicator::DismissProgressDialog()
   286     {
   297     {
   287     TRACER("CGlxProgressIndicator::DismissProgressDialog");
   298     TRACER("CGlxProgressIndicator::DismissProgressDialog");
   288     
   299 
   289     if(iProgressDialog)
   300     if (iProgressDialog)
   290         {
   301         {
   291         TRAP_IGNORE(iProgressDialog->ProcessFinishedL());
   302         TRAP_IGNORE(iProgressDialog->ProcessFinishedL());
   292         }
   303         }
   293     }
   304     }
   294 
   305