filebrowser/ui/src/enginewrapper.cpp
changeset 31 e7a04a6385be
parent 28 4cc0d1a608c1
child 51 b048e15729d6
equal deleted inserted replaced
30:d8e625c87f33 31:e7a04a6385be
    17 
    17 
    18 #include "enginewrapper.h"
    18 #include "enginewrapper.h"
    19 #include "engine.h"
    19 #include "engine.h"
    20 #include "FBFileUtils.h"
    20 #include "FBFileUtils.h"
    21 #include "notifications.h"
    21 #include "notifications.h"
    22 #include "filebrowserview.h"
    22 #include "fbfileview.h"
    23 #include "searchview.h"
    23 #include "searchview.h"
    24 #include "filebrowsersettings.h"
    24 #include "filebrowsersettings.h"
    25 #include "settingsview.h"
    25 #include "settingsview.h"
    26 
    26 
    27 #include <HbProgressDialog>
    27 #include <HbProgressDialog>
   737 void EngineWrapper::ShowProgressDialog(const TDesC& aDescText, TInt aMinimum, TInt aMaximum )
   737 void EngineWrapper::ShowProgressDialog(const TDesC& aDescText, TInt aMinimum, TInt aMaximum )
   738 {
   738 {
   739     const QString qText = QString::fromUtf16(aDescText.Ptr(), aDescText.Length());
   739     const QString qText = QString::fromUtf16(aDescText.Ptr(), aDescText.Length());
   740     if (!mProgressDialog) {
   740     if (!mProgressDialog) {
   741         mProgressDialog = new HbProgressDialog(HbProgressDialog::WaitDialog);
   741         mProgressDialog = new HbProgressDialog(HbProgressDialog::WaitDialog);
   742         QObject::connect(mProgressDialog, SIGNAL(cancelled ()), this, SLOT(progressDialogCancelled()));
   742         QObject::connect(mProgressDialog, SIGNAL(cancelled()), this, SLOT(progressDialogCancelled()));
   743     }
   743     }
   744 
   744 
   745     mProgressDialog->setText(qText);
   745     mProgressDialog->setText(qText);
   746     mProgressDialog->setMinimum(aMinimum);
   746     mProgressDialog->setMinimum(aMinimum);
   747     mProgressDialog->setMaximum(aMaximum);
   747     mProgressDialog->setMaximum(aMaximum);
   749     mProgressDialog->show();
   749     mProgressDialog->show();
   750 }
   750 }
   751 
   751 
   752 void EngineWrapper::CancelProgressDialog()
   752 void EngineWrapper::CancelProgressDialog()
   753 {
   753 {
   754     if (mProgressDialog)
   754     if (mProgressDialog) {
       
   755         QObject::disconnect(mProgressDialog, SIGNAL(cancelled()), this, SLOT(progressDialogCancelled()));
   755         mProgressDialog->cancel();
   756         mProgressDialog->cancel();
       
   757         QObject::connect(mProgressDialog, SIGNAL(cancelled()), this, SLOT(progressDialogCancelled()));
       
   758     }
   756 }
   759 }
   757 
   760 
   758 void EngineWrapper::SetProgressValue(TInt aValue)
   761 void EngineWrapper::SetProgressValue(TInt aValue)
   759 {
   762 {
   760     if (mProgressDialog)
   763     if (mProgressDialog)
   769 void EngineWrapper::ShowWaitDialog(const TDesC& aDescText)
   772 void EngineWrapper::ShowWaitDialog(const TDesC& aDescText)
   770 {
   773 {
   771     const QString qText = QString::fromUtf16(aDescText.Ptr(), aDescText.Length());
   774     const QString qText = QString::fromUtf16(aDescText.Ptr(), aDescText.Length());
   772     if (!mWaitDialog) {
   775     if (!mWaitDialog) {
   773         mWaitDialog = new HbProgressDialog(HbProgressDialog::WaitDialog);
   776         mWaitDialog = new HbProgressDialog(HbProgressDialog::WaitDialog);
   774         QObject::connect(mWaitDialog, SIGNAL(cancelled ()), this, SLOT(waitDialogCancelled()));
   777         QObject::connect(mWaitDialog, SIGNAL(cancelled()), this, SLOT(waitDialogCancelled()));
   775     }
   778     }
   776 
   779 
   777     mWaitDialog->setText(qText);
   780     mWaitDialog->setText(qText);
   778     mEngine->FileUtils()->SetAllowProcessing(true);
   781     mEngine->FileUtils()->SetAllowProcessing(true);
   779     //mWaitDialog->setAttribute(Qt::WA_DeleteOnClose);
   782     //mWaitDialog->setAttribute(Qt::WA_DeleteOnClose);