photosgallery/viewframework/uiutilities/src/glxprogressindicator.cpp
branchRCL_3
changeset 19 420f6808bf21
parent 17 a60acebbbd9d
child 23 b023a8d2866a
--- a/photosgallery/viewframework/uiutilities/src/glxprogressindicator.cpp	Tue May 25 12:42:31 2010 +0300
+++ b/photosgallery/viewframework/uiutilities/src/glxprogressindicator.cpp	Wed Jun 09 09:41:51 2010 +0300
@@ -30,12 +30,12 @@
 // CGlxProgressIndicator::NewL
 // ---------------------------------------------------------
 //  
-EXPORT_C CGlxProgressIndicator* CGlxProgressIndicator::NewL
-                    (MDialogDismisedObserver& aGlxGridViewNotifyObserver)
+EXPORT_C CGlxProgressIndicator* CGlxProgressIndicator::NewL(
+        MDialogDismisedObserver& aGlxGridViewNotifyObserver)
     {
     TRACER("CGlxProgressIndicator::NewL()");
-    CGlxProgressIndicator* self = CGlxProgressIndicator::NewLC
-                                                (aGlxGridViewNotifyObserver);
+    CGlxProgressIndicator* self = CGlxProgressIndicator::NewLC(
+            aGlxGridViewNotifyObserver);
     CleanupStack::Pop(self);
     return self;
     }
@@ -44,12 +44,12 @@
 // CGlxProgressIndicator::NewLC
 // ---------------------------------------------------------
 //  
-CGlxProgressIndicator* CGlxProgressIndicator::NewLC
-                    (MDialogDismisedObserver& aGlxGridViewNotifyObserver)
+CGlxProgressIndicator* CGlxProgressIndicator::NewLC(
+        MDialogDismisedObserver& aGlxGridViewNotifyObserver)
     {
     TRACER("CGlxProgressIndicator::NewLC()");
-    CGlxProgressIndicator* self = new(ELeave)
-                    CGlxProgressIndicator(aGlxGridViewNotifyObserver);
+    CGlxProgressIndicator* self = new (ELeave) CGlxProgressIndicator(
+            aGlxGridViewNotifyObserver);
     CleanupStack::PushL(self);
     self->ConstructL();
     return self;
@@ -59,9 +59,9 @@
 // CGlxProgressIndicator::CGlxProgressIndicator
 // ---------------------------------------------------------
 // 
-CGlxProgressIndicator::CGlxProgressIndicator
-          (MDialogDismisedObserver& aGlxGridViewNotifyObserver)
-                    :iGlxGridViewNotifyObserver(aGlxGridViewNotifyObserver)
+CGlxProgressIndicator::CGlxProgressIndicator(
+        MDialogDismisedObserver& aGlxGridViewNotifyObserver) :
+    iGlxGridViewNotifyObserver(aGlxGridViewNotifyObserver)
     {
     }
 
@@ -94,6 +94,9 @@
 void CGlxProgressIndicator::ConstructL()
     {
     TRACER("CGlxProgressIndicator::ConstructL()");
+    
+    iUiUtility = CGlxUiUtility::UtilityL();
+    
     iUiUtility->StartTNMDaemon();
 
     if (!iProgressbarTicker)
@@ -141,7 +144,7 @@
 // StartProgressNoteL
 // -----------------------------------------------------------------------------
 //
-void CGlxProgressIndicator::StartProgressNoteL(TInt aFinalValue,TBool aShow)
+void CGlxProgressIndicator::StartProgressNoteL(TInt aFinalValue, TBool aShow)
     {
     TRACER("CGlxProgressIndicator::StartProgressNoteL()");
     TInt itemsLeft = iUiUtility->GetItemsLeftCount();
@@ -243,11 +246,10 @@
 void EXPORT_C CGlxProgressIndicator::ShowProgressbarL()
     {
     TRACER("CGlxProgressIndicator::ShowProgressbarL");
-    iUiUtility->StartTNMDaemon();
     TInt itemsLeft = iUiUtility->GetItemsLeftCount();
+    GLX_DEBUG3("ShowProgressbarL itemsLeft(%d), iFinalCount(%d)", itemsLeft, 
+            iFinalCount);
 
-    GLX_LOG_INFO1("ShowProgressbar itemsLeft = %d ",itemsLeft);
-    GLX_LOG_INFO1("ShowProgressbar iFinalCount = %d ",iFinalCount);
     if (iFinalCount < itemsLeft)
         {
         /*
@@ -290,3 +292,20 @@
         }
     }
 
+// -----------------------------------------------------------------------------
+// ControlTNDaemon
+// -----------------------------------------------------------------------------
+//
+EXPORT_C void CGlxProgressIndicator::ControlTNDaemon(TBool aStatus)
+    {
+    TRACER("CGlxProgressIndicator::ControlTNDaemon");
+    GLX_DEBUG2("CGlxProgressIndicator::ControlTNDaemon(%d)", aStatus);
+    if (aStatus)
+        {
+        iUiUtility->StartTNMDaemon();
+        }
+    else
+        {
+        iUiUtility->StopTNMDaemon();
+        }
+    }