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
6b54d8cb
Commit
6b54d8cb
authored
Jun 30, 2015
by
Fabio Bas
Browse files
Fixed issues
parent
02dcaff3
Changes
2
Hide whitespace changes
Inline
Side-by-side
cockatrice/src/window_main.cpp
View file @
6b54d8cb
...
@@ -307,9 +307,7 @@ void MainWindow::loginError(Response::ResponseCode r, QString reasonStr, quint32
...
@@ -307,9 +307,7 @@ void MainWindow::loginError(Response::ResponseCode r, QString reasonStr, quint32
break
;
break
;
}
}
case
Response
::
RespUsernameInvalid
:
{
case
Response
::
RespUsernameInvalid
:
{
QString
errorStr
;
QMessageBox
::
critical
(
this
,
tr
(
"Error"
),
extractInvalidUsernameMessage
(
reasonStr
));
extractInvalidUsernameMessage
(
reasonStr
,
errorStr
);
QMessageBox
::
critical
(
this
,
tr
(
"Error"
),
errorStr
);
break
;
break
;
}
}
case
Response
::
RespRegistrationRequired
:
case
Response
::
RespRegistrationRequired
:
...
@@ -335,9 +333,9 @@ void MainWindow::loginError(Response::ResponseCode r, QString reasonStr, quint32
...
@@ -335,9 +333,9 @@ void MainWindow::loginError(Response::ResponseCode r, QString reasonStr, quint32
actConnect
();
actConnect
();
}
}
void
MainWindow
::
extractInvalidUsernameMessage
(
QString
&
in
,
QString
&
out
)
QString
MainWindow
::
extractInvalidUsernameMessage
(
QString
&
in
)
{
{
out
=
tr
(
"Invalid username."
)
+
"<br/>"
;
QString
out
=
tr
(
"Invalid username."
)
+
"<br/>"
;
QStringList
rules
=
in
.
split
(
QChar
(
'|'
));
QStringList
rules
=
in
.
split
(
QChar
(
'|'
));
if
(
rules
.
size
()
==
7
)
if
(
rules
.
size
()
==
7
)
{
{
...
@@ -357,12 +355,14 @@ void MainWindow::extractInvalidUsernameMessage(QString & in, QString & out)
...
@@ -357,12 +355,14 @@ void MainWindow::extractInvalidUsernameMessage(QString & in, QString & out)
rules
.
at
(
6
).
toHtmlEscaped
()
rules
.
at
(
6
).
toHtmlEscaped
()
#endif
#endif
)
+
"</li>"
;
)
+
"</li>"
;
if
(
rules
.
at
(
5
).
toInt
()
>
0
)
if
(
rules
.
at
(
5
).
toInt
()
==
0
)
out
+=
"<li>"
+
tr
(
"the first character can't be a punctuation"
)
+
"</li>"
;
out
+=
"<li>"
+
tr
(
"the first character can't be a punctuation"
)
+
"</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."
);
}
}
return
out
;
}
}
void
MainWindow
::
registerError
(
Response
::
ResponseCode
r
,
QString
reasonStr
,
quint32
endTime
)
void
MainWindow
::
registerError
(
Response
::
ResponseCode
r
,
QString
reasonStr
,
quint32
endTime
)
...
@@ -396,9 +396,7 @@ void MainWindow::registerError(Response::ResponseCode r, QString reasonStr, quin
...
@@ -396,9 +396,7 @@ void MainWindow::registerError(Response::ResponseCode r, QString reasonStr, quin
break
;
break
;
}
}
case
Response
::
RespUsernameInvalid
:
{
case
Response
::
RespUsernameInvalid
:
{
QString
errorStr
;
QMessageBox
::
critical
(
this
,
tr
(
"Error"
),
extractInvalidUsernameMessage
(
reasonStr
));
extractInvalidUsernameMessage
(
reasonStr
,
errorStr
);
QMessageBox
::
critical
(
this
,
tr
(
"Error"
),
errorStr
);
break
;
break
;
}
}
case
Response
::
RespRegistrationFailed
:
case
Response
::
RespRegistrationFailed
:
...
...
cockatrice/src/window_main.h
View file @
6b54d8cb
...
@@ -109,7 +109,7 @@ public:
...
@@ -109,7 +109,7 @@ public:
protected:
protected:
void
closeEvent
(
QCloseEvent
*
event
);
void
closeEvent
(
QCloseEvent
*
event
);
void
changeEvent
(
QEvent
*
event
);
void
changeEvent
(
QEvent
*
event
);
void
extractInvalidUsernameMessage
(
QString
&
in
,
QString
&
out
);
QString
extractInvalidUsernameMessage
(
QString
&
in
);
};
};
#endif
#endif
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