filemanager/src/filemanager/src/fmfileview.cpp
changeset 46 d58987eac7e8
parent 37 15bc28c9dd51
equal deleted inserted replaced
37:15bc28c9dd51 46:d58987eac7e8
   197 	//set stretch factor to file browser widget, so that it could fully cover the client area.
   197 	//set stretch factor to file browser widget, so that it could fully cover the client area.
   198 	vLayout->setStretchFactor( mWidget, 1 );
   198 	vLayout->setStretchFactor( mWidget, 1 );
   199 
   199 
   200 	setLayout( vLayout );
   200 	setLayout( vLayout );
   201 	
   201 	
   202     connect( mWidget, SIGNAL( startSearch( const QString&,  const QString& ) ),
   202     connect( mWidget, SIGNAL( startSearch( QString ) ),
   203              this, SLOT( startSearch( const QString&, const QString& ) ) );
   203              this, SLOT( startSearch( QString ) ) );
   204     connect( mWidget, SIGNAL( setEmptyMenu( bool ) ),
   204     connect( mWidget, SIGNAL( setEmptyMenu( bool ) ),
   205              this, SLOT( on_mainWidget_setEmptyMenu( bool ) ) );
   205              this, SLOT( on_mainWidget_setEmptyMenu( bool ) ) );
   206     connect( mWidget, SIGNAL( setTitle( const QString & ) ),
   206     connect( mWidget, SIGNAL( setTitle( QString ) ),
   207              this, SLOT( on_mainWidget_setTitle( const QString & ) ) );
   207              this, SLOT( on_mainWidget_setTitle( QString ) ) );
   208 }
   208 }
   209 
   209 
   210 void FmFileView::initToolBar()
   210 void FmFileView::initToolBar()
   211 {
   211 {
   212     toolBar()->clearActions();
   212     toolBar()->clearActions();
   254 	mWidget->setSelectable( enable );
   254 	mWidget->setSelectable( enable );
   255 }
   255 }
   256 
   256 
   257 void FmFileView::infoNoFileSelected()
   257 void FmFileView::infoNoFileSelected()
   258 {
   258 {
   259 	FmDlgUtils::information( hbTrId("No File/Folder selected" ) );
   259 	FmDlgUtils::warning( hbTrId("No File/Folder selected" ) );
   260 }
   260 }
   261 
   261 
   262 #ifdef FM_CHANGE_ORIENT_ENABLE
   262 #ifdef FM_CHANGE_ORIENT_ENABLE
   263 void FmFileView::on_rotateAction_triggered()
   263 void FmFileView::on_rotateAction_triggered()
   264 {
   264 {
   301                 case FmErrNone:
   301                 case FmErrNone:
   302                     // no error, do not show note to user
   302                     // no error, do not show note to user
   303                     break;
   303                     break;
   304                 case FmErrAlreadyStarted:
   304                 case FmErrAlreadyStarted:
   305                     // last operation have not finished
   305                     // last operation have not finished
   306                     FmDlgUtils::information( hbTrId( "Operatin already started!" ) );
   306                     FmDlgUtils::warning( hbTrId( "Operatin already started!" ) );
   307                     break;
   307                     break;
   308                 case FmErrWrongParam:
   308                 case FmErrWrongParam:
   309                     FmDlgUtils::information( hbTrId( "Wrong parameters!" ) );
   309                     FmDlgUtils::warning( hbTrId( "Wrong parameters!" ) );
   310                     break;
   310                     break;
   311                 default:
   311                 default:
   312                     FmDlgUtils::information( hbTrId( "Operation fail to start!" ) );
   312                     FmDlgUtils::warning( hbTrId( "Operation fail to start!" ) );
   313             }
   313             }
   314             setSelectable( false );
   314             setSelectable( false );
   315         }
   315         }
   316     }
   316     }
   317 }
   317 }
   339                 case FmErrNone:
   339                 case FmErrNone:
   340                     // no error, do not show note to user
   340                     // no error, do not show note to user
   341                     break;
   341                     break;
   342                 case FmErrAlreadyStarted:
   342                 case FmErrAlreadyStarted:
   343                     // last operation have not finished
   343                     // last operation have not finished
   344                     FmDlgUtils::information( hbTrId( "Operatin already started!" ) );
   344                     FmDlgUtils::warning( hbTrId( "Operatin already started!" ) );
   345                     break;
   345                     break;
   346                 case FmErrWrongParam:
   346                 case FmErrWrongParam:
   347                     FmDlgUtils::information( hbTrId( "Wrong parameters!" ) );
   347                     FmDlgUtils::warning( hbTrId( "Wrong parameters!" ) );
   348                     break;
   348                     break;
   349                 default:
   349                 default:
   350                     FmDlgUtils::information( hbTrId( "Operation fail to start!" ) );
   350                     FmDlgUtils::warning( hbTrId( "Operation fail to start!" ) );
   351             }
   351             }
   352             setSelectable( false );
   352             setSelectable( false );
   353         }
   353         }
   354     }
   354     }
   355 
   355 
   377                 case FmErrNone:
   377                 case FmErrNone:
   378                     // no error, do not show note to user
   378                     // no error, do not show note to user
   379                     break;
   379                     break;
   380                 case FmErrAlreadyStarted:
   380                 case FmErrAlreadyStarted:
   381                     // last operation have not finished
   381                     // last operation have not finished
   382                     FmDlgUtils::information( hbTrId( "Operatin already started!" ) );
   382                     FmDlgUtils::warning( hbTrId( "Operatin already started!" ) );
   383                     break;
   383                     break;
   384                 case FmErrWrongParam:
   384                 case FmErrWrongParam:
   385                     FmDlgUtils::information( hbTrId( "Wrong parameters!" ) );
   385                     FmDlgUtils::warning( hbTrId( "Wrong parameters!" ) );
   386                     break;
   386                     break;
   387                 default:
   387                 default:
   388                     FmDlgUtils::information( hbTrId( "Operation fail to start!" ) );
   388                     FmDlgUtils::warning( hbTrId( "Operation fail to start!" ) );
   389             }
   389             }
   390             setSelectable( false );
   390             setSelectable( false );
   391         }
   391         }
   392     }
   392     }
   393 }
   393 }
   409             QString newTargetPath = FmUtils::fillPathWithSplash(
   409             QString newTargetPath = FmUtils::fillPathWithSplash(
   410                 dir.absolutePath() ) + dirName;
   410                 dir.absolutePath() ) + dirName;
   411             QString errString;
   411             QString errString;
   412             // check if name/path is available for use
   412             // check if name/path is available for use
   413             if( !FmUtils::checkNewFolderOrFile( dirName, newTargetPath, errString ) ) {
   413             if( !FmUtils::checkNewFolderOrFile( dirName, newTargetPath, errString ) ) {
   414                 FmDlgUtils::information( errString );
   414                 FmDlgUtils::warning( errString, HbMessageBox::Ok, true );
   415                 continue;
   415                 continue;
   416             }
   416             }
   417             if( !dir.mkdir( dirName ) ) {
   417             if( !dir.mkdir( dirName ) ) {
   418                 FmDlgUtils::information( hbTrId("Operation failed!") );
   418                 FmDlgUtils::warning( hbTrId("Operation failed!") );
   419             }
   419             }
   420             break;
   420             break;
   421         }
   421         }
   422         
   422         
   423     }
   423     }
   469 void FmFileView::on_sortTypeAction_triggered()
   469 void FmFileView::on_sortTypeAction_triggered()
   470 {
   470 {
   471     mWidget->sortFiles( FmFileBrowseWidget::ESortByType );
   471     mWidget->sortFiles( FmFileBrowseWidget::ESortByType );
   472 }
   472 }
   473 
   473 
   474 void FmFileView::startSearch( const QString &targetPath, const QString &criteria )
   474 void FmFileView::startSearch( const QString &criteria )
   475 {    
   475 {    
   476     if ( !criteria.isEmpty() && !targetPath.isEmpty() ) {
   476     if ( !criteria.isEmpty() ) {
   477         FmViewManager::viewManager()->createFindView( criteria, targetPath );
   477         QString targetPath( mWidget->currentPath().filePath() );
       
   478         FmViewManager::viewManager()->createFindView( criteria, QStringList()<<targetPath );
   478     }
   479     }
   479 }
   480 }
   480 
   481 
   481 void FmFileView::removeToolBarAction()
   482 void FmFileView::removeToolBarAction()
   482 {
   483 {