filemanager/src/filemanager/src/backuprestore/fmbackupview.cpp
changeset 16 ada7962b4308
parent 14 1957042d8c7e
child 18 edd66bde63a4
child 25 b7bfdea70ca2
child 37 15bc28c9dd51
equal deleted inserted replaced
14:1957042d8c7e 16:ada7962b4308
    53     HbAction *action = 0;
    53     HbAction *action = 0;
    54     
    54     
    55 #ifdef FM_CHANGE_ORIENT_ENABLE
    55 #ifdef FM_CHANGE_ORIENT_ENABLE
    56 	action = new HbAction( this );
    56 	action = new HbAction( this );
    57     action->setObjectName( "rotateAction" );
    57     action->setObjectName( "rotateAction" );
    58     action->setText( tr( "Change orientation" ) );
    58     action->setText( hbTrId( "Change orientation" ) );
    59     menu()->addAction( action );
    59     menu()->addAction( action );
    60 #endif
    60 #endif
    61 
    61 
    62 	action = new HbAction( this );
    62 	action = new HbAction( this );
    63     action->setObjectName( "backupAction" );
    63     action->setObjectName( "backupAction" );
    64     action->setText( tr( "Start backup" ) );
    64     action->setText( hbTrId( "Start backup" ) );
    65     menu()->addAction( action );
    65     menu()->addAction( action );
    66 
    66 
    67 	action = new HbAction( this );
    67 	action = new HbAction( this );
    68     action->setObjectName( "deleteBackupAction" );
    68     action->setObjectName( "deleteBackupAction" );
    69     action->setText( tr( "Delete backup" ) );
    69     action->setText( hbTrId( "Delete backup" ) );
    70     menu()->addAction( action );
    70     menu()->addAction( action );
    71 
    71 
    72 }
    72 }
    73 
    73 
    74 void FmBackupView::initMainWidget()
    74 void FmBackupView::initMainWidget()
    94     switch( ret )
    94     switch( ret )
    95     {
    95     {
    96     case FmErrNone:
    96     case FmErrNone:
    97         break;
    97         break;
    98     case FmErrWrongParam:
    98     case FmErrWrongParam:
    99         HbMessageBox::information( QString( tr("Operation canceled with wrong param!") ) );
    99         HbMessageBox::information( QString( hbTrId("Operation canceled with wrong param!") ) );
   100         break;
   100         break;
   101     case FmErrAlreadyStarted:
   101     case FmErrAlreadyStarted:
   102         HbMessageBox::information( QString( tr("Operation canceled because already started!") ) );
   102         HbMessageBox::information( QString( hbTrId("Operation canceled because already started!") ) );
       
   103         break;
       
   104     case FmErrPathNotFound:
       
   105         HbMessageBox::information( QString( hbTrId("Operation canceled because can not find target drive!") ) );
       
   106         break;
       
   107     case FmErrAlreadyExists:
       
   108         HbMessageBox::information( QString( hbTrId("backup canceled") ) );
   103         break;
   109         break;
   104     default:
   110     default:
   105         HbMessageBox::information( QString( tr("Operation canceled with error!") ) );
   111         HbMessageBox::information( QString( hbTrId("backup failed") ) );
   106         break;
   112         break;
   107     }
   113     }
   108 }
   114 }
   109 #ifdef FM_CHANGE_ORIENT_ENABLE
   115 #ifdef FM_CHANGE_ORIENT_ENABLE
   110 void FmBackupView::on_rotateAction_triggered()
   116 void FmBackupView::on_rotateAction_triggered()
   118 }
   124 }
   119 #endif //FM_CHANGE_ORIENT_ENABLE
   125 #endif //FM_CHANGE_ORIENT_ENABLE
   120 
   126 
   121 void FmBackupView::on_backupAction_triggered()
   127 void FmBackupView::on_backupAction_triggered()
   122 {
   128 {
   123     int ret = mOperationService->asyncBackup();
   129     on_leftAction_triggered();
   124     switch( ret )
       
   125     {
       
   126     case FmErrNone:
       
   127         break;
       
   128     case FmErrWrongParam:
       
   129         HbMessageBox::information( QString( tr("Operation canceled with wrong param!") ) );
       
   130         break;
       
   131     case FmErrAlreadyStarted:
       
   132         HbMessageBox::information( QString( tr("Operation canceled because already started!") ) );
       
   133         break;
       
   134     default:
       
   135         HbMessageBox::information( QString( tr("Operation canceled with error!") ) );
       
   136         break;
       
   137     }
       
   138 }
   130 }
   139 
   131 
   140 void FmBackupView::on_deleteBackupAction_triggered()
   132 void FmBackupView::on_deleteBackupAction_triggered()
   141 {
   133 {
   142     FmViewManager::viewManager()->createDeleteBackupView();
   134     FmViewManager::viewManager()->createDeleteBackupView();