Commit 1464d905 authored by Thomas Guillem's avatar Thomas Guillem

qt: display the default username in login dialog

parent 06b23fcb
...@@ -111,6 +111,8 @@ void DialogHandler::requestLogin (void *value) ...@@ -111,6 +111,8 @@ void DialogHandler::requestLogin (void *value)
grid->addWidget (new QLabel (qfu(data->message)), 0, 0, 1, 2); grid->addWidget (new QLabel (qfu(data->message)), 0, 0, 1, 2);
QLineEdit *userLine = new QLineEdit; QLineEdit *userLine = new QLineEdit;
if (data->default_username != NULL)
userLine->setText(qtr(data->default_username));
grid->addWidget (new QLabel (qtr("Username")), 1, 0); grid->addWidget (new QLabel (qtr("Username")), 1, 0);
grid->addWidget (userLine, 1, 1); grid->addWidget (userLine, 1, 1);
...@@ -131,6 +133,10 @@ void DialogHandler::requestLogin (void *value) ...@@ -131,6 +133,10 @@ void DialogHandler::requestLogin (void *value)
panel->setLayout (grid); panel->setLayout (grid);
layout->addWidget (panel); layout->addWidget (panel);
/* focus on passLine if the username is already set */
if (data->default_username != NULL)
passLine->setFocus();
/* OK, Cancel buttons */ /* OK, Cancel buttons */
QDialogButtonBox *buttonBox = new QDialogButtonBox; QDialogButtonBox *buttonBox = new QDialogButtonBox;
QPushButton *okButton = new QPushButton( "&Ok" ); QPushButton *okButton = new QPushButton( "&Ok" );
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment