Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Donald Haase
Cockatrice
Commits
d2af7ff9
Commit
d2af7ff9
authored
Jul 14, 2015
by
woogerboy21
Browse files
Merge pull request #1254 from ZeldaZach/fix_1248
require pass & email confirmation
parents
f1cafa06
c29bf1ae
Changes
2
Hide whitespace changes
Inline
Side-by-side
cockatrice/src/dlg_register.cpp
View file @
d2af7ff9
...
@@ -4,6 +4,7 @@
...
@@ -4,6 +4,7 @@
#include
<QGridLayout>
#include
<QGridLayout>
#include
<QHBoxLayout>
#include
<QHBoxLayout>
#include
<QDialogButtonBox>
#include
<QDialogButtonBox>
#include
<QMessageBox>
#include
<QDebug>
#include
<QDebug>
#include
"dlg_register.h"
#include
"dlg_register.h"
...
@@ -33,10 +34,19 @@ DlgRegister::DlgRegister(QWidget *parent)
...
@@ -33,10 +34,19 @@ DlgRegister::DlgRegister(QWidget *parent)
passwordLabel
->
setBuddy
(
passwordEdit
);
passwordLabel
->
setBuddy
(
passwordEdit
);
passwordEdit
->
setEchoMode
(
QLineEdit
::
Password
);
passwordEdit
->
setEchoMode
(
QLineEdit
::
Password
);
passwordConfirmationLabel
=
new
QLabel
(
tr
(
"Password (again):"
));
passwordConfirmationEdit
=
new
QLineEdit
();
passwordConfirmationLabel
->
setBuddy
(
passwordConfirmationEdit
);
passwordConfirmationEdit
->
setEchoMode
(
QLineEdit
::
Password
);
emailLabel
=
new
QLabel
(
tr
(
"Email:"
));
emailLabel
=
new
QLabel
(
tr
(
"Email:"
));
emailEdit
=
new
QLineEdit
();
emailEdit
=
new
QLineEdit
();
emailLabel
->
setBuddy
(
emailEdit
);
emailLabel
->
setBuddy
(
emailEdit
);
emailConfirmationLabel
=
new
QLabel
(
tr
(
"Email (again):"
));
emailConfirmationEdit
=
new
QLineEdit
();
emailConfirmationLabel
->
setBuddy
(
emailConfirmationEdit
);
genderLabel
=
new
QLabel
(
tr
(
"Pronouns:"
));
genderLabel
=
new
QLabel
(
tr
(
"Pronouns:"
));
genderEdit
=
new
QComboBox
();
genderEdit
=
new
QComboBox
();
genderLabel
->
setBuddy
(
genderEdit
);
genderLabel
->
setBuddy
(
genderEdit
);
...
@@ -69,14 +79,18 @@ DlgRegister::DlgRegister(QWidget *parent)
...
@@ -69,14 +79,18 @@ DlgRegister::DlgRegister(QWidget *parent)
grid
->
addWidget
(
playernameEdit
,
2
,
1
);
grid
->
addWidget
(
playernameEdit
,
2
,
1
);
grid
->
addWidget
(
passwordLabel
,
3
,
0
);
grid
->
addWidget
(
passwordLabel
,
3
,
0
);
grid
->
addWidget
(
passwordEdit
,
3
,
1
);
grid
->
addWidget
(
passwordEdit
,
3
,
1
);
grid
->
addWidget
(
emailLabel
,
4
,
0
);
grid
->
addWidget
(
passwordConfirmationLabel
,
4
,
0
);
grid
->
addWidget
(
emailEdit
,
4
,
1
);
grid
->
addWidget
(
passwordConfirmationEdit
,
4
,
1
);
grid
->
addWidget
(
genderLabel
,
5
,
0
);
grid
->
addWidget
(
emailLabel
,
5
,
0
);
grid
->
addWidget
(
genderEdit
,
5
,
1
);
grid
->
addWidget
(
emailEdit
,
5
,
1
);
grid
->
addWidget
(
countryLabel
,
6
,
0
);
grid
->
addWidget
(
emailConfirmationLabel
,
6
,
0
);
grid
->
addWidget
(
countryEdit
,
6
,
1
);
grid
->
addWidget
(
emailConfirmationEdit
,
6
,
1
);
grid
->
addWidget
(
realnameLabel
,
7
,
0
);
grid
->
addWidget
(
genderLabel
,
7
,
0
);
grid
->
addWidget
(
realnameEdit
,
7
,
1
);
grid
->
addWidget
(
genderEdit
,
7
,
1
);
grid
->
addWidget
(
countryLabel
,
8
,
0
);
grid
->
addWidget
(
countryEdit
,
8
,
1
);
grid
->
addWidget
(
realnameLabel
,
9
,
0
);
grid
->
addWidget
(
realnameEdit
,
9
,
1
);
QDialogButtonBox
*
buttonBox
=
new
QDialogButtonBox
(
QDialogButtonBox
::
Ok
|
QDialogButtonBox
::
Cancel
);
QDialogButtonBox
*
buttonBox
=
new
QDialogButtonBox
(
QDialogButtonBox
::
Ok
|
QDialogButtonBox
::
Cancel
);
connect
(
buttonBox
,
SIGNAL
(
accepted
()),
this
,
SLOT
(
actOk
()));
connect
(
buttonBox
,
SIGNAL
(
accepted
()),
this
,
SLOT
(
actOk
()));
...
@@ -94,6 +108,17 @@ DlgRegister::DlgRegister(QWidget *parent)
...
@@ -94,6 +108,17 @@ DlgRegister::DlgRegister(QWidget *parent)
void
DlgRegister
::
actOk
()
void
DlgRegister
::
actOk
()
{
{
if
(
passwordEdit
->
text
()
!=
passwordConfirmationEdit
->
text
())
{
QMessageBox
::
critical
(
this
,
tr
(
"Registration Warning"
),
tr
(
"Your passwords do not match, please try again."
));
return
;
}
else
if
(
emailConfirmationEdit
->
text
()
!=
emailEdit
->
text
())
{
QMessageBox
::
critical
(
this
,
tr
(
"Registration Warning"
),
tr
(
"Your email addresses do not match, please try again."
));
return
;
}
QSettings
settings
;
QSettings
settings
;
settings
.
beginGroup
(
"server"
);
settings
.
beginGroup
(
"server"
);
settings
.
setValue
(
"hostname"
,
hostEdit
->
text
());
settings
.
setValue
(
"hostname"
,
hostEdit
->
text
());
...
...
cockatrice/src/dlg_register.h
View file @
d2af7ff9
...
@@ -25,8 +25,8 @@ private slots:
...
@@ -25,8 +25,8 @@ private slots:
void
actOk
();
void
actOk
();
void
actCancel
();
void
actCancel
();
private:
private:
QLabel
*
hostLabel
,
*
portLabel
,
*
playernameLabel
,
*
passwordLabel
,
*
email
Label
,
*
genderLabel
,
*
countryLabel
,
*
realnameLabel
;
QLabel
*
hostLabel
,
*
portLabel
,
*
playernameLabel
,
*
passwordLabel
,
*
passwordConfirmationLabel
,
*
emailLabel
,
*
emailConfirmation
Label
,
*
genderLabel
,
*
countryLabel
,
*
realnameLabel
;
QLineEdit
*
hostEdit
,
*
portEdit
,
*
playernameEdit
,
*
passwordEdit
,
*
email
Edit
,
*
realnameEdit
;
QLineEdit
*
hostEdit
,
*
portEdit
,
*
playernameEdit
,
*
passwordEdit
,
*
passwordConfirmationEdit
,
*
emailEdit
,
*
emailConfirmation
Edit
,
*
realnameEdit
;
QComboBox
*
genderEdit
,
*
countryEdit
;
QComboBox
*
genderEdit
,
*
countryEdit
;
};
};
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment