ui/commandhandlers/commoncommandhandlers/src/glxcommondialogs.cpp
changeset 62 36d93b4dc635
parent 58 383b67fbdb11
child 69 45459746d5e8
equal deleted inserted replaced
58:383b67fbdb11 62:36d93b4dc635
    17 
    17 
    18 #include <glxcommondialogs.h>
    18 #include <glxcommondialogs.h>
    19 
    19 
    20 #include <hbaction.h>
    20 #include <hbaction.h>
    21 #include <QEventLoop>
    21 #include <QEventLoop>
       
    22 const int MAXSTRINGLENGHT = 256; 
    22 
    23 
    23 GlxTextInputDialog::GlxTextInputDialog(bool disableOkForEmptyText) 
    24 GlxTextInputDialog::GlxTextInputDialog(bool disableOkForEmptyText) 
    24     : mDialog ( NULL ),
    25     : mDialog ( NULL ),
    25       mEventLoop ( 0 ),
    26       mEventLoop ( 0 ),
    26       mResult ( false ),
    27       mResult ( false ),
    40     
    41     
    41     mDialog = new HbInputDialog();
    42     mDialog = new HbInputDialog();
    42     mDialog->setPromptText(label);
    43     mDialog->setPromptText(label);
    43     mDialog->setInputMode(HbInputDialog::TextInput);
    44     mDialog->setInputMode(HbInputDialog::TextInput);
    44     mDialog->setValue(text);
    45     mDialog->setValue(text);
       
    46     mDialog->lineEdit(0)->setMaxLength(MAXSTRINGLENGHT);
    45     if(mDisableOkForEmptyText){
    47     if(mDisableOkForEmptyText){
    46         connect(mDialog->lineEdit(0), SIGNAL( textChanged (const QString &) ),
    48         connect(mDialog->lineEdit(0), SIGNAL( textChanged (const QString &) ),
    47                 this, SLOT( textChanged (const QString &)));
    49                 this, SLOT( textChanged (const QString &)));
    48     }
    50     }
    49     mDialog->open( this, SLOT( dialogClosed( HbAction* ) ) ); 
    51     mDialog->open( this, SLOT( dialogClosed( HbAction* ) ) );