#include "PasswordDialog.h"
+
#include <QLineEdit>
#include <QPushButton>
#include <QVBoxLayout>
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:
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 );
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()
emit passwordEntered( PasswordDialog::Canceled );
}
+void PasswordDialog::update( const QString &aText )
+{
+ qDebug() << "PasswordDialog::update()";
+ iText->setText( aText );
+}