author | nemo |
Mon, 25 Feb 2013 10:53:33 -0500 | |
branch | icegun |
changeset 8570 | cbd25e677446 |
parent 8434 | 4821897a0f10 |
child 8444 | 75db7bb8dce8 |
child 8824 | fe9eacd390f2 |
permissions | -rw-r--r-- |
6910
ea058558c68b
add a checkbox for the password field prompt (issue 316)
Stepan777
parents:
diff
changeset
|
1 |
/* |
ea058558c68b
add a checkbox for the password field prompt (issue 316)
Stepan777
parents:
diff
changeset
|
2 |
* Hedgewars, a free turn based strategy game |
6952 | 3 |
* Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr@gmail.com> |
6910
ea058558c68b
add a checkbox for the password field prompt (issue 316)
Stepan777
parents:
diff
changeset
|
4 |
* |
ea058558c68b
add a checkbox for the password field prompt (issue 316)
Stepan777
parents:
diff
changeset
|
5 |
* This program is free software; you can redistribute it and/or modify |
ea058558c68b
add a checkbox for the password field prompt (issue 316)
Stepan777
parents:
diff
changeset
|
6 |
* it under the terms of the GNU General Public License as published by |
ea058558c68b
add a checkbox for the password field prompt (issue 316)
Stepan777
parents:
diff
changeset
|
7 |
* the Free Software Foundation; version 2 of the License |
ea058558c68b
add a checkbox for the password field prompt (issue 316)
Stepan777
parents:
diff
changeset
|
8 |
* |
ea058558c68b
add a checkbox for the password field prompt (issue 316)
Stepan777
parents:
diff
changeset
|
9 |
* This program is distributed in the hope that it will be useful, |
ea058558c68b
add a checkbox for the password field prompt (issue 316)
Stepan777
parents:
diff
changeset
|
10 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
ea058558c68b
add a checkbox for the password field prompt (issue 316)
Stepan777
parents:
diff
changeset
|
11 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
ea058558c68b
add a checkbox for the password field prompt (issue 316)
Stepan777
parents:
diff
changeset
|
12 |
* GNU General Public License for more details. |
ea058558c68b
add a checkbox for the password field prompt (issue 316)
Stepan777
parents:
diff
changeset
|
13 |
* |
ea058558c68b
add a checkbox for the password field prompt (issue 316)
Stepan777
parents:
diff
changeset
|
14 |
* You should have received a copy of the GNU General Public License |
ea058558c68b
add a checkbox for the password field prompt (issue 316)
Stepan777
parents:
diff
changeset
|
15 |
* along with this program; if not, write to the Free Software |
ea058558c68b
add a checkbox for the password field prompt (issue 316)
Stepan777
parents:
diff
changeset
|
16 |
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA |
ea058558c68b
add a checkbox for the password field prompt (issue 316)
Stepan777
parents:
diff
changeset
|
17 |
*/ |
ea058558c68b
add a checkbox for the password field prompt (issue 316)
Stepan777
parents:
diff
changeset
|
18 |
|
ea058558c68b
add a checkbox for the password field prompt (issue 316)
Stepan777
parents:
diff
changeset
|
19 |
#include <QLineEdit> |
ea058558c68b
add a checkbox for the password field prompt (issue 316)
Stepan777
parents:
diff
changeset
|
20 |
#include <QDialogButtonBox> |
ea058558c68b
add a checkbox for the password field prompt (issue 316)
Stepan777
parents:
diff
changeset
|
21 |
#include <QPushButton> |
ea058558c68b
add a checkbox for the password field prompt (issue 316)
Stepan777
parents:
diff
changeset
|
22 |
#include <QGridLayout> |
ea058558c68b
add a checkbox for the password field prompt (issue 316)
Stepan777
parents:
diff
changeset
|
23 |
#include <QCheckBox> |
ea058558c68b
add a checkbox for the password field prompt (issue 316)
Stepan777
parents:
diff
changeset
|
24 |
#include <QLabel> |
ea058558c68b
add a checkbox for the password field prompt (issue 316)
Stepan777
parents:
diff
changeset
|
25 |
|
ea058558c68b
add a checkbox for the password field prompt (issue 316)
Stepan777
parents:
diff
changeset
|
26 |
#include "input_password.h" |
ea058558c68b
add a checkbox for the password field prompt (issue 316)
Stepan777
parents:
diff
changeset
|
27 |
|
8181 | 28 |
HWPasswordDialog::HWPasswordDialog(QWidget* parent) : QDialog(parent) |
6910
ea058558c68b
add a checkbox for the password field prompt (issue 316)
Stepan777
parents:
diff
changeset
|
29 |
{ |
8181 | 30 |
setWindowTitle(tr("Login")); |
8434 | 31 |
|
8181 | 32 |
QString titleLabelText = "To connect to the server, please log in.\n\nIf you don't have an account on www.hedgewars.org,\njust enter your nickname."; |
33 |
QString nickLabelText = "Nickname:"; |
|
34 |
QString passLabelText = "Password:"; |
|
6910
ea058558c68b
add a checkbox for the password field prompt (issue 316)
Stepan777
parents:
diff
changeset
|
35 |
|
ea058558c68b
add a checkbox for the password field prompt (issue 316)
Stepan777
parents:
diff
changeset
|
36 |
QGridLayout * layout = new QGridLayout(this); |
ea058558c68b
add a checkbox for the password field prompt (issue 316)
Stepan777
parents:
diff
changeset
|
37 |
|
8181 | 38 |
QLabel * titleLabel = new QLabel(this); |
39 |
titleLabel->setText(titleLabelText); |
|
40 |
layout->addWidget(titleLabel, 0, 0); |
|
8434 | 41 |
|
8181 | 42 |
QLabel * nickLabel = new QLabel(this); |
43 |
nickLabel->setText(nickLabelText); |
|
44 |
layout->addWidget(nickLabel, 1, 0); |
|
8434 | 45 |
|
8181 | 46 |
leNickname = new QLineEdit(this); |
47 |
leNickname->setEchoMode(QLineEdit::Normal); |
|
48 |
layout->addWidget(leNickname, 2, 0); |
|
8434 | 49 |
|
8181 | 50 |
QLabel * passLabel = new QLabel(this); |
51 |
passLabel->setText(passLabelText); |
|
52 |
layout->addWidget(passLabel, 3, 0); |
|
6910
ea058558c68b
add a checkbox for the password field prompt (issue 316)
Stepan777
parents:
diff
changeset
|
53 |
|
ea058558c68b
add a checkbox for the password field prompt (issue 316)
Stepan777
parents:
diff
changeset
|
54 |
lePassword = new QLineEdit(this); |
ea058558c68b
add a checkbox for the password field prompt (issue 316)
Stepan777
parents:
diff
changeset
|
55 |
lePassword->setEchoMode(QLineEdit::Password); |
8181 | 56 |
layout->addWidget(lePassword, 4, 0); |
6910
ea058558c68b
add a checkbox for the password field prompt (issue 316)
Stepan777
parents:
diff
changeset
|
57 |
|
ea058558c68b
add a checkbox for the password field prompt (issue 316)
Stepan777
parents:
diff
changeset
|
58 |
cbSave = new QCheckBox(this); |
ea058558c68b
add a checkbox for the password field prompt (issue 316)
Stepan777
parents:
diff
changeset
|
59 |
cbSave->setText(QCheckBox::tr("Save password")); |
8181 | 60 |
layout->addWidget(cbSave, 5, 0); |
6910
ea058558c68b
add a checkbox for the password field prompt (issue 316)
Stepan777
parents:
diff
changeset
|
61 |
|
ea058558c68b
add a checkbox for the password field prompt (issue 316)
Stepan777
parents:
diff
changeset
|
62 |
QDialogButtonBox* dbbButtons = new QDialogButtonBox(this); |
8364
fbc9bcc6c39d
Added "New account" button when connectiong to the official server
vitiv <nikita.utiu@gmail.com>
parents:
8181
diff
changeset
|
63 |
pbNewAccount = dbbButtons->addButton(QString("New Account"), QDialogButtonBox::ActionRole); |
6910
ea058558c68b
add a checkbox for the password field prompt (issue 316)
Stepan777
parents:
diff
changeset
|
64 |
QPushButton * pbOK = dbbButtons->addButton(QDialogButtonBox::Ok); |
ea058558c68b
add a checkbox for the password field prompt (issue 316)
Stepan777
parents:
diff
changeset
|
65 |
QPushButton * pbCancel = dbbButtons->addButton(QDialogButtonBox::Cancel); |
8181 | 66 |
layout->addWidget(dbbButtons, 6, 0); |
6910
ea058558c68b
add a checkbox for the password field prompt (issue 316)
Stepan777
parents:
diff
changeset
|
67 |
|
ea058558c68b
add a checkbox for the password field prompt (issue 316)
Stepan777
parents:
diff
changeset
|
68 |
connect(pbOK, SIGNAL(clicked()), this, SLOT(accept())); |
ea058558c68b
add a checkbox for the password field prompt (issue 316)
Stepan777
parents:
diff
changeset
|
69 |
connect(pbCancel, SIGNAL(clicked()), this, SLOT(reject())); |
7795
ba32d3f9e567
set window modality also for custom dialogs, small text changes
koda
parents:
6952
diff
changeset
|
70 |
|
ba32d3f9e567
set window modality also for custom dialogs, small text changes
koda
parents:
6952
diff
changeset
|
71 |
this->setWindowModality(Qt::WindowModal); |
6910
ea058558c68b
add a checkbox for the password field prompt (issue 316)
Stepan777
parents:
diff
changeset
|
72 |
} |