summaryrefslogtreecommitdiff
path: root/noncore/net/mail/libmailwrapper/logindialog.cpp
blob: d2c6a072cef983b19e8f5af180fc785283bd49db (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#include <qlineedit.h>

#include "logindialog.h"

LoginDialog::LoginDialog( QString user, QString pass, QWidget *parent, const char *name, bool modal, WFlags flags )
    : LoginDialogUI( parent, name, modal, flags )
{
    userLine->setText( user );
    passLine->setText( pass );
    _user = user;
    _pass = pass;

    if ( user.isEmpty() ) {
        userLine->setFocus();
    } else {
        passLine->setFocus();
    }
}

void LoginDialog::accept()
{
    _user.replace( 0, _user.length(), userLine->text() );
    _pass.replace( 0, _pass.length(), passLine->text() );

    QDialog::accept();
}