18 |
18 |
19 #include "fmbackupview.h" |
19 #include "fmbackupview.h" |
20 #include "fmbackupwidget.h" |
20 #include "fmbackupwidget.h" |
21 #include "fmviewmanager.h" |
21 #include "fmviewmanager.h" |
22 #include "fmoperationbase.h" |
22 #include "fmoperationbase.h" |
23 |
23 #include "fmdlgutils.h" |
24 |
24 |
25 #include <QApplication> |
25 #include <QApplication> |
26 |
26 |
27 #include <hbaction.h> |
27 #include <hbaction.h> |
28 #include <hbtoolbar.h> |
28 #include <hbtoolbar.h> |
29 #include <hbmenu.h> |
29 #include <hbmenu.h> |
30 #include <hbmainwindow.h> |
30 #include <hbmainwindow.h> |
31 #include <hbmessagebox.h> |
|
32 |
|
33 |
31 |
34 FmBackupView::FmBackupView() : FmViewBase( EBackupView ) |
32 FmBackupView::FmBackupView() : FmViewBase( EBackupView ) |
35 { |
33 { |
36 setTitle( tr( "Backup" ) ); |
34 setTitle( hbTrId( "Backup" ) ); |
37 |
35 |
38 initToolBar(); |
36 initToolBar(); |
39 initMainWidget(); |
37 initMainWidget(); |
40 initMenu(); |
38 initMenu(); |
41 mOperationService = FmViewManager::viewManager()->operationService(); |
39 mOperationService = FmViewManager::viewManager()->operationService(); |
89 } |
87 } |
90 |
88 |
91 void FmBackupView::on_leftAction_triggered() |
89 void FmBackupView::on_leftAction_triggered() |
92 { |
90 { |
93 int ret = mOperationService->asyncBackup(); |
91 int ret = mOperationService->asyncBackup(); |
|
92 FmLogger::log( "FmBackupView_asyncBackup: ret= " + QString::number(ret) ); |
94 switch( ret ) |
93 switch( ret ) |
95 { |
94 { |
96 case FmErrNone: |
95 case FmErrNone: |
97 break; |
96 break; |
98 case FmErrWrongParam: |
97 case FmErrWrongParam: |
99 HbMessageBox::information( QString( hbTrId("Operation canceled with wrong param!") ) ); |
98 FmDlgUtils::information( QString( hbTrId("Operation canceled with wrong param!") ) ); |
100 break; |
99 break; |
101 case FmErrAlreadyStarted: |
100 case FmErrAlreadyStarted: |
102 HbMessageBox::information( QString( hbTrId("Operation canceled because already started!") ) ); |
101 FmDlgUtils::information( QString( hbTrId("Operation canceled because already started!") ) ); |
103 break; |
102 break; |
104 case FmErrPathNotFound: |
103 case FmErrPathNotFound: |
105 HbMessageBox::information( QString( hbTrId("Operation canceled because can not find target drive!") ) ); |
104 FmDlgUtils::information( QString( hbTrId("Operation canceled because can not find target path or drive is not available!") ) ); |
106 break; |
105 break; |
107 case FmErrAlreadyExists: |
106 case FmErrAlreadyExists: |
108 HbMessageBox::information( QString( hbTrId("backup canceled") ) ); |
107 FmDlgUtils::information( QString( hbTrId("backup canceled") ) ); |
109 break; |
108 break; |
110 default: |
109 default: |
111 HbMessageBox::information( QString( hbTrId("backup failed") ) ); |
110 FmDlgUtils::information( QString( hbTrId("backup failed") ) ); |
112 break; |
111 break; |
113 } |
112 } |
114 } |
113 } |
115 #ifdef FM_CHANGE_ORIENT_ENABLE |
114 #ifdef FM_CHANGE_ORIENT_ENABLE |
116 void FmBackupView::on_rotateAction_triggered() |
115 void FmBackupView::on_rotateAction_triggered() |
137 void FmBackupView::removeToolBarAction() |
136 void FmBackupView::removeToolBarAction() |
138 { |
137 { |
139 toolBar()->removeAction( mToolBarAction ); |
138 toolBar()->removeAction( mToolBarAction ); |
140 } |
139 } |
141 |
140 |
|
141 void FmBackupView::refreshBackupDate() |
|
142 { |
|
143 mMainWidget->updateBackupDate(); |
|
144 } |
|
145 |
|
146 void FmBackupView::refreshModel( const QString& path ) |
|
147 { |
|
148 if( !path.isEmpty() ) { |
|
149 // ignore non-empty refresh signal as it means change of folder/file, not drive. |
|
150 return; |
|
151 } |
|
152 mMainWidget->refreshModel(); |
|
153 } |