filemanager/src/filemanager/src/backuprestore/fmrestoreview.cpp
changeset 16 ada7962b4308
parent 14 1957042d8c7e
child 21 15299bc55001
child 25 b7bfdea70ca2
child 37 15bc28c9dd51
equal deleted inserted replaced
14:1957042d8c7e 16:ada7962b4308
    31 
    31 
    32 
    32 
    33 
    33 
    34 FmRestoreView::FmRestoreView(): FmViewBase( ERestoreView )
    34 FmRestoreView::FmRestoreView(): FmViewBase( ERestoreView )
    35 {
    35 {
    36 	setTitle( tr( "Restore" ) );
    36 	setTitle( hbTrId( "Restore" ) );
    37 
    37 
    38 	initMainWidget();
    38 	initMainWidget();
    39 	initToolBar();
    39 	initToolBar();
    40 	initMenu();
    40 	initMenu();
    41     adjustActions();
    41     adjustActions();
    53 {
    53 {
    54 #ifdef FM_CHANGE_ORIENT_ENABLE
    54 #ifdef FM_CHANGE_ORIENT_ENABLE
    55     HbAction *action = 0;
    55     HbAction *action = 0;
    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 	mRestoreAction = new HbAction( this );
    62 	mRestoreAction = new HbAction( this );
    63     mRestoreAction->setObjectName( "restoreAction" );
    63     mRestoreAction->setObjectName( "restoreAction" );
    64     mRestoreAction->setText( tr( "Restore data" ) );
    64     mRestoreAction->setText( hbTrId( "Restore data" ) );
    65     menu()->addAction( mRestoreAction );
    65     menu()->addAction( mRestoreAction );
    66 }
    66 }
    67 
    67 
    68 void FmRestoreView::initMainWidget()
    68 void FmRestoreView::initMainWidget()
    69 {
    69 {
    75 
    75 
    76 void FmRestoreView::initToolBar()
    76 void FmRestoreView::initToolBar()
    77 {
    77 {
    78 	mLeftAction = new HbAction( this );
    78 	mLeftAction = new HbAction( this );
    79     mLeftAction->setObjectName( "leftAction" );
    79     mLeftAction->setObjectName( "leftAction" );
    80     mLeftAction->setText( tr( "Restore" ) );
    80     mLeftAction->setText( hbTrId( "Restore" ) );
    81     toolBar()->addAction( mLeftAction );
    81     toolBar()->addAction( mLeftAction );
    82     
    82     
    83     toolBar()->setOrientation( Qt::Horizontal );
    83     toolBar()->setOrientation( Qt::Horizontal );
    84 }
    84 }
    85 
    85 
    90     for ( int i( 0 ); i < items.count(); ++i )
    90     for ( int i( 0 ); i < items.count(); ++i )
    91        {
    91        {
    92        selection |= ( ( quint64 ) 1 ) << ( items[ i ] );
    92        selection |= ( ( quint64 ) 1 ) << ( items[ i ] );
    93        }
    93        }
    94                    
    94                    
    95     mOperationService->asyncRestore( selection );
    95     int ret = mOperationService->asyncRestore( selection );
       
    96     switch( ret )
       
    97     {
       
    98     case FmErrNone:
       
    99         break;
       
   100     case FmErrWrongParam:
       
   101         HbMessageBox::information( QString( hbTrId("Operation canceled with wrong param!") ) );
       
   102         break;
       
   103     case FmErrAlreadyStarted:
       
   104         HbMessageBox::information( QString( hbTrId("Operation canceled because already started!") ) );
       
   105         break;
       
   106     default:
       
   107         HbMessageBox::information(tr("restore failed"));
       
   108         break;
       
   109     }
    96 }
   110 }
    97 
   111 
    98 #ifdef FM_CHANGE_ORIENT_ENABLE
   112 #ifdef FM_CHANGE_ORIENT_ENABLE
    99 void FmRestoreView::on_rotateAction_triggered()
   113 void FmRestoreView::on_rotateAction_triggered()
   100 {
   114 {