filemanager/src/filemanager/src/components/fmdlgutils.cpp
changeset 27 df183af6b92f
parent 25 b7bfdea70ca2
child 32 39cf9ced4cc4
equal deleted inserted replaced
25:b7bfdea70ca2 27:df183af6b92f
   244     delete cQuery;
   244     delete cQuery;
   245     return ret;
   245     return ret;
   246 }
   246 }
   247 
   247 
   248 bool FmDlgUtils::showTextQuery(
   248 bool FmDlgUtils::showTextQuery(
   249         const QString& title, QString& text, bool isDimPrimaryActionWhenEmpty, int maxLength,
   249         const QString& title, QString& text, QStringList validRegExpStringList,
   250 		const QString &associatedDrives, bool isReturnFalseWhenNoTextChanged )
   250 		int maxLength, const QString &associatedDrives, bool isReturnFalseWhenNoTextChanged )
   251 {
   251 {
   252     bool ret( false );
   252     bool ret( false );
   253     bool ok ( true );                // SK return (out parameter)
   253     bool ok ( true );                // SK return (out parameter)
   254 
   254 
   255     FmSingleTextQuery::Options options( 0 );
   255     FmSingleTextQuery *cQuery = new FmSingleTextQuery();
   256     if( isDimPrimaryActionWhenEmpty ) {
       
   257         options = FmSingleTextQuery::DimPrimereActionWhenEmpty;
       
   258     }
       
   259     FmSingleTextQuery *cQuery = new FmSingleTextQuery( options );
       
   260     if( maxLength != -1 ){
   256     if( maxLength != -1 ){
   261         cQuery->setLineEditMaxLength( maxLength );
   257         cQuery->setLineEditMaxLength( maxLength );
   262     }
   258     }
   263     cQuery->setHeadingWidget( new HbLabel( title ) );
   259     cQuery->setHeadingWidget( new HbLabel( title ) );
       
   260 
       
   261 	cQuery->setRegExpStringList( validRegExpStringList );
   264 
   262 
   265     QString sk1 ( hbTrId ( "txt_common_button_ok" ) );
   263     QString sk1 ( hbTrId ( "txt_common_button_ok" ) );
   266     QString sk2 ( hbTrId ( "txt_common_button_cancel" ) );
   264     QString sk2 ( hbTrId ( "txt_common_button_cancel" ) );
   267 
   265 
   268     if( !sk1.isEmpty() ) {
   266     if( !sk1.isEmpty() ) {
   305 
   303 
   306 bool FmDlgUtils::showSinglePasswordQuery( const QString &title, QString &pwd, int maxLength, const QString &associatedDrives )
   304 bool FmDlgUtils::showSinglePasswordQuery( const QString &title, QString &pwd, int maxLength, const QString &associatedDrives )
   307 {
   305 {
   308     bool ret( false );
   306     bool ret( false );
   309 
   307 
   310     FmSingleTextQuery *cQuery = new FmSingleTextQuery( FmSingleTextQuery::DimPrimereActionWhenEmpty,
   308     FmSingleTextQuery *cQuery = new FmSingleTextQuery( HbLineEdit::Password );
   311             HbLineEdit::Password );
       
   312     if( maxLength != -1 ){
   309     if( maxLength != -1 ){
   313         cQuery->setLineEditMaxLength( maxLength );
   310         cQuery->setLineEditMaxLength( maxLength );
   314     }
   311     }
   315     cQuery->setHeadingWidget( new HbLabel( title ) );
   312     cQuery->setHeadingWidget( new HbLabel( title ) );
   316 
   313     cQuery->setRegExpStringList( QStringList( Regex_ValidUnEmpty ) );
   317     QString sk1 ( hbTrId("txt_common_button_ok" ) );
   314     QString sk1 ( hbTrId("txt_common_button_ok" ) );
   318     QString sk2 ( hbTrId("txt_common_button_cancel" ) );
   315     QString sk2 ( hbTrId("txt_common_button_cancel" ) );
   319 
   316 
   320     if( !sk1.isEmpty() ) {
   317     if( !sk1.isEmpty() ) {
   321         HbAction *primary = new HbAction( sk1 );
   318         HbAction *primary = new HbAction( sk1 );