Merge branch 'master' of https://git.maemo.org/projects/qtmeetings
[qtmeetings] / src / UserInterface / Utils / PasswordDialog.cpp
index 3a8590f..064c7d3 100644 (file)
@@ -1,4 +1,5 @@
 #include "PasswordDialog.h"
+
 #include <QLineEdit>
 #include <QPushButton>
 #include <QVBoxLayout>
@@ -13,12 +14,6 @@ PasswordDialog::PasswordDialog( const QString &aPassword, const QString &aText,
        setWindowTitle( aTitle.isNull() ? tr( "Enter password" ) : aTitle );
        setModal( true );
 
-       // Store the password hash to iPasswordHash
-       // ( aPassword should be allready encoded )
-//     QCryptographicHash *hash = new QCryptographicHash( QCryptographicHash::Md5 );
-//     hash->addData( aPassword.toUtf8() );
-//     iPasswordHash = hash->result();
-//     delete hash;
        iPasswordHash = aPassword.toUtf8();
 
        /* Create the layout:
@@ -33,12 +28,9 @@ PasswordDialog::PasswordDialog( const QString &aPassword, const QString &aText,
 
        QVBoxLayout *layout = new QVBoxLayout;
 
-       if ( !aText.isNull() )
-       {
-               QLabel *text = new QLabel( aText );
-               layout->addWidget( text );
-               layout->addStretch();
-       }
+       iText = new QLabel( aText );
+       layout->addWidget( iText );
+       layout->addStretch();
 
        iPasswordEdit = new QLineEdit;
        iPasswordEdit->setEchoMode( QLineEdit::Password );
@@ -55,19 +47,16 @@ PasswordDialog::PasswordDialog( const QString &aPassword, const QString &aText,
        layout->addSpacing( 5 );
        layout->addLayout( buttonLayout );
 
-       // Connect the buttons pressed signals to corresponding slots
-       connect( buttonOK, SIGNAL( pressed() ), this, SLOT( okButtonPressed() ) );
-       connect( buttonCancel, SIGNAL( pressed() ), this, SLOT( cancelButtonPressed() ) );
+       // Connect the user action signals to corresponding slots
+       connect( buttonOK, SIGNAL( released() ), this, SLOT( okButtonPressed() ) );
+       connect( buttonCancel, SIGNAL( released() ), this, SLOT( cancelButtonPressed() ) );
 
        // Enable the layout
        setLayout( layout );
-       
-       show();
 }
 
 PasswordDialog::~PasswordDialog()
 {
-       close();
 }
 
 void PasswordDialog::okButtonPressed()
@@ -103,3 +92,8 @@ void PasswordDialog::cancelButtonPressed()
        emit passwordEntered( PasswordDialog::Canceled );
 }
 
+void PasswordDialog::update( const QString &aText )
+{
+       qDebug() << "PasswordDialog::update()";
+       iText->setText( aText );
+}