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
1d210e57
Commit
1d210e57
authored
Jul 03, 2015
by
Zach H
Browse files
show all rules
parent
6b54d8cb
Changes
1
Hide whitespace changes
Inline
Side-by-side
cockatrice/src/window_main.cpp
View file @
1d210e57
...
@@ -339,26 +339,29 @@ QString MainWindow::extractInvalidUsernameMessage(QString & in)
...
@@ -339,26 +339,29 @@ QString MainWindow::extractInvalidUsernameMessage(QString & in)
QStringList
rules
=
in
.
split
(
QChar
(
'|'
));
QStringList
rules
=
in
.
split
(
QChar
(
'|'
));
if
(
rules
.
size
()
==
7
)
if
(
rules
.
size
()
==
7
)
{
{
out
+=
tr
(
"The username must respect these rules:"
)
+
"<br/><ul>"
out
+=
tr
(
"Your username must respect these rules:"
)
+
"<br><ul>"
;
+
"<li>"
+
tr
(
"length between %1 and %2 characters"
).
arg
(
rules
.
at
(
0
)).
arg
(
rules
.
at
(
1
))
+
"</li>"
;
if
(
rules
.
at
(
2
).
toInt
()
>
0
)
out
+=
"<li>"
+
tr
(
"is %1 - %2 characters long"
).
arg
(
rules
.
at
(
0
)).
arg
(
rules
.
at
(
1
))
+
"</li>"
;
out
+=
"<li>"
+
tr
(
"it can contain lowercase characters"
)
+
"</li>"
;
out
+=
"<li>"
+
tr
(
"can %1 contain lowercase characters"
).
arg
((
rules
.
at
(
2
).
toInt
()
>
0
)
?
""
:
tr
(
"NOT"
))
+
"</li>"
;
if
(
rules
.
at
(
3
).
toInt
()
>
0
)
out
+=
"<li>"
+
tr
(
"can %1 contain uppercase characters"
).
arg
((
rules
.
at
(
3
).
toInt
()
>
0
)
?
""
:
tr
(
"NOT"
))
+
"</li>"
;
out
+=
"<li>"
+
tr
(
"it can contain uppercase characters"
)
+
"</li>"
;
out
+=
"<li>"
+
tr
(
"can %1 contain numeric characters"
).
arg
((
rules
.
at
(
4
).
toInt
()
>
0
)
?
""
:
tr
(
"NOT"
))
+
"</li>"
;
if
(
rules
.
at
(
4
).
toInt
()
>
0
)
out
+=
"<li>"
+
tr
(
"it can contain numeric characters"
)
+
"</li>"
;
if
(
rules
.
at
(
6
).
size
()
>
0
)
if
(
rules
.
at
(
6
).
size
()
>
0
)
{
out
+=
"<li>"
+
tr
(
"it can contain the following punctuation: %1"
).
arg
(
out
+=
"<li>"
+
tr
(
"can contain the following punctuation: %1"
).
arg
(
#if QT_VERSION < 0x050000
#if QT_VERSION < 0x050000
Qt
::
escape
(
rules
.
at
(
6
))
Qt
::
escape
(
rules
.
at
(
6
))
#else
#else
rules
.
at
(
6
).
toHtmlEscaped
()
rules
.
at
(
6
).
toHtmlEscaped
()
#endif
#endif
)
+
"</li>"
;
)
+
"</li>"
;
if
(
rules
.
at
(
5
).
toInt
()
==
0
)
}
out
+=
"<li>"
+
tr
(
"the first character can't be a punctuation"
)
+
"</li>"
;
out
+=
"<li>"
+
tr
(
"first character can %1 be a punctuation mark"
).
arg
((
rules
.
at
(
5
).
toInt
()
==
0
)
?
""
:
tr
(
"NOT"
))
+
"</li>"
;
out
+=
"</ul>"
;
out
+=
"</ul>"
;
}
else
{
}
else
{
out
+=
tr
(
"You may only use A-Z, a-z, 0-9, _, ., and - in your username."
);
out
+=
tr
(
"You may only use A-Z, a-z, 0-9, _, ., and - in your username."
);
}
}
...
...
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