filebrowser/ui/src/enginewrapper.cpp
changeset 28 4cc0d1a608c1
parent 27 271e901a9423
child 31 e7a04a6385be
--- a/filebrowser/ui/src/enginewrapper.cpp	Fri May 14 16:10:39 2010 +0300
+++ b/filebrowser/ui/src/enginewrapper.cpp	Tue Jun 01 14:40:54 2010 +0300
@@ -36,6 +36,7 @@
     : mEngine(0),
     mFilesFound(),
     mSettings(0),
+    mProgressDialog(0),
     mWaitDialog(0)
 {
 }
@@ -48,6 +49,9 @@
         TRAP_IGNORE(mEngine->DeActivateEngineL());
         delete mEngine;
     } 
+    if (mProgressDialog)
+        delete mProgressDialog;
+
     if (mWaitDialog)
         delete mWaitDialog;
 }
@@ -730,6 +734,38 @@
     Notifications::showConfirmationNote(qText, aNoTimeout);
 }
 
+void EngineWrapper::ShowProgressDialog(const TDesC& aDescText, TInt aMinimum, TInt aMaximum )
+{
+    const QString qText = QString::fromUtf16(aDescText.Ptr(), aDescText.Length());
+    if (!mProgressDialog) {
+        mProgressDialog = new HbProgressDialog(HbProgressDialog::WaitDialog);
+        QObject::connect(mProgressDialog, SIGNAL(cancelled ()), this, SLOT(progressDialogCancelled()));
+    }
+
+    mProgressDialog->setText(qText);
+    mProgressDialog->setMinimum(aMinimum);
+    mProgressDialog->setMaximum(aMaximum);
+    mEngine->FileUtils()->SetAllowProcessing(true);
+    mProgressDialog->show();
+}
+
+void EngineWrapper::CancelProgressDialog()
+{
+    if (mProgressDialog)
+        mProgressDialog->cancel();
+}
+
+void EngineWrapper::SetProgressValue(TInt aValue)
+{
+    if (mProgressDialog)
+        mProgressDialog->setProgressValue(aValue);
+}
+
+void EngineWrapper::progressDialogCancelled()
+{
+    mEngine->FileUtils()->DialogDismissedL();
+}
+
 void EngineWrapper::ShowWaitDialog(const TDesC& aDescText)
 {
     const QString qText = QString::fromUtf16(aDescText.Ptr(), aDescText.Length());