bluetoothengine/btnotif/btdevicedialogplugin/src/btdevicedialoginputwidget.cpp
changeset 57 5ebadcda06cb
parent 42 b72428996822
child 70 f5508c13dfe0
equal deleted inserted replaced
51:625f43ae9362 57:5ebadcda06cb
   136     QVariant param = parameters.value( keyStr );
   136     QVariant param = parameters.value( keyStr );
   137     if ( param.toInt() == EPinInput ) {
   137     if ( param.toInt() == EPinInput ) {
   138         // Numeric value only
   138         // Numeric value only
   139         mInputDialog->setInputMode(HbInputDialog::RealInput);
   139         mInputDialog->setInputMode(HbInputDialog::RealInput);
   140         title = QString(hbTrId("txt_bt_title_pairing_with_1"));
   140         title = QString(hbTrId("txt_bt_title_pairing_with_1"));
   141         // todo: Fixe the multiline problem
   141         // todo: Fix the multiline problem
   142         prompt = QString( hbTrId( "txt_bt_dialog_please_enter_the_passcode_for_1" ) );
   142         prompt = QString( hbTrId( "txt_bt_dialog_please_enter_the_passcode_for_1" ) );
   143     }
   143     }
   144     else {
   144     else {
   145         mLastError = ParameterError;
   145         mLastError = ParameterError;
   146         return;
   146         return;
   163         validator->addField(
   163         validator->addField(
   164                 new QRegExpValidator(
   164                 new QRegExpValidator(
   165                         QRegExp(regExp, Qt::CaseInsensitive), validator ),"");
   165                         QRegExp(regExp, Qt::CaseInsensitive), validator ),"");
   166         mInputDialog->setValidator(validator);
   166         mInputDialog->setValidator(validator);
   167     }else{
   167     }else{
   168     // Minimum requirement is to have at least 1 digit
   168         // Minimum requirement is to have at least 1 digit
   169         regExp = tr("^\\d{1,}$");
   169         regExp = tr("^\\d{1,}$");
   170         HbValidator* validator = new HbValidator(mInputDialog->lineEdit());
   170         HbValidator* validator = new HbValidator(mInputDialog->lineEdit());
   171         validator->addField(
   171         validator->addField(
   172                 new QRegExpValidator(
   172                 new QRegExpValidator(
   173                         QRegExp(regExp, Qt::CaseInsensitive), validator ),"");
   173                         QRegExp(regExp, Qt::CaseInsensitive), validator ),"");
   174         mInputDialog->setValidator(validator);    
   174         mInputDialog->setValidator(validator);    
   175     }
   175     }
   176     // replace % with the miniLength and device name
   176     // replace % with the minimum length and device name
   177     int repls = prompt.count( QString( "%" ) );
   177     int repls = prompt.count( QString( "%" ) );
   178     if ( repls > 1 ) {
   178     if ( repls > 1 ) {
   179         prompt = prompt.arg( param.toString() );
   179         prompt = prompt.arg( param.toString() );
   180     }
   180     }
   181     if ( repls > 0 ) {
   181     if ( repls > 0 ) {