22 #include "fmoperationservice.h" |
22 #include "fmoperationservice.h" |
23 #include "fmbackupconfigloader.h" |
23 #include "fmbackupconfigloader.h" |
24 #include "fmbkupengine.h" |
24 #include "fmbkupengine.h" |
25 #include "fmoperationbase.h" |
25 #include "fmoperationbase.h" |
26 #include "fmcommon.h" |
26 #include "fmcommon.h" |
27 |
27 #include "fmdlgutils.h" |
28 #include <hbmessagebox.h> |
|
29 |
28 |
30 FmBackupRestoreHandler::FmBackupRestoreHandler( QObject *parent ) : QObject( parent ), mBackupConfigLoader( 0 ) |
29 FmBackupRestoreHandler::FmBackupRestoreHandler( QObject *parent ) : QObject( parent ), mBackupConfigLoader( 0 ) |
31 { |
30 { |
32 mBkupEngine = new FmBkupEngine( this ); |
31 mBkupEngine = new FmBkupEngine( this ); |
33 |
32 |
35 |
34 |
36 connect( mBkupEngine, SIGNAL( notifyPreparing( bool ) ), this, SLOT( onNotifyPreparing( bool ) ), Qt::QueuedConnection ); |
35 connect( mBkupEngine, SIGNAL( notifyPreparing( bool ) ), this, SLOT( onNotifyPreparing( bool ) ), Qt::QueuedConnection ); |
37 connect( mBkupEngine, SIGNAL( notifyStart( bool, int) ), this, SLOT( onNotifyStart( bool, int ) ), Qt::QueuedConnection ); |
36 connect( mBkupEngine, SIGNAL( notifyStart( bool, int) ), this, SLOT( onNotifyStart( bool, int ) ), Qt::QueuedConnection ); |
38 connect( mBkupEngine, SIGNAL( notifyUpdate(int) ), this, SLOT( onNotifyUpdate(int) ), Qt::QueuedConnection ); |
37 connect( mBkupEngine, SIGNAL( notifyUpdate(int) ), this, SLOT( onNotifyUpdate(int) ), Qt::QueuedConnection ); |
39 connect( mBkupEngine, SIGNAL( notifyFinish(int) ), |
38 connect( mBkupEngine, SIGNAL( notifyFinish(int) ), |
40 this, SLOT( onNotifyFinish(int) ), Qt::QueuedConnection ); |
39 this, SLOT( onNotifyFinish(int) ), Qt::DirectConnection ); |
41 connect( mBkupEngine, SIGNAL( notifyMemoryLow(int, int& ) ), |
40 connect( mBkupEngine, SIGNAL( notifyMemoryLow(int, int& ) ), |
42 this, SLOT( onNotifyMemoryLow(int, int&) ) ); |
41 this, SLOT( onNotifyMemoryLow(int, int&) ) ); |
43 connect( mBkupEngine, SIGNAL( notifyBackupFilesExist( bool& )), this, SLOT( onNotifyBackupFilesExist( bool& ))); |
42 connect( mBkupEngine, SIGNAL( notifyBackupFilesExist( bool& )), this, SLOT( onNotifyBackupFilesExist( bool& ))); |
44 |
43 |
45 } |
44 } |
71 { |
70 { |
72 Q_UNUSED( operationBackup ); |
71 Q_UNUSED( operationBackup ); |
73 mCurrentProcess = ProcessBackup; |
72 mCurrentProcess = ProcessBackup; |
74 bool ret = mBkupEngine->startBackup( backupConfigLoader()->driversAndOperationList(), |
73 bool ret = mBkupEngine->startBackup( backupConfigLoader()->driversAndOperationList(), |
75 backupConfigLoader()->backupCategoryList(), |
74 backupConfigLoader()->backupCategoryList(), |
76 mBkupEngine->BackupSettingsL()->targetDrive(), |
75 operationBackup->targetDrive(), // targetDrive is stored in FmOperationBackup |
77 mBkupEngine->BackupSettingsL()->content() ); |
76 operationBackup->content() ); // content is stored in FmOperationBackup |
78 |
77 |
79 if( !ret ) { |
78 if( !ret ) { |
80 mCurrentProcess = ProcessNone; |
79 mCurrentProcess = ProcessNone; |
81 } |
80 } |
82 return ret; |
81 return ret; |
107 { |
106 { |
108 userError = FmErrNone; |
107 userError = FmErrNone; |
109 if( memoryValue < FmEstimateLowerLimit ) { |
108 if( memoryValue < FmEstimateLowerLimit ) { |
110 userError = FmErrDiskFull; |
109 userError = FmErrDiskFull; |
111 } else if( memoryValue < FmEstimateUpperLimit ) { |
110 } else if( memoryValue < FmEstimateUpperLimit ) { |
112 if ( !HbMessageBox::question( "memory low, continue?" ) ){ |
111 if ( !FmDlgUtils::question( "memory low, continue?" ) ){ |
113 userError = FmErrCancel; |
112 userError = FmErrCancel; |
114 } |
113 } |
115 } |
114 } |
116 } |
115 } |
117 void FmBackupRestoreHandler::onNotifyBackupFilesExist( bool &isContinue ) |
116 void FmBackupRestoreHandler::onNotifyBackupFilesExist( bool &isContinue ) |
118 { |
117 { |
119 if ( HbMessageBox::question( "some bacup files exist, continue?" ) ) |
118 if ( FmDlgUtils::question( "some backup files exist, continue?" ) ) |
120 { |
119 { |
121 isContinue = true; |
120 isContinue = true; |
122 } |
121 } |
123 else |
122 else |
124 { |
123 { |