Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
nheko
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Nheko Reborn
nheko
Commits
813790e6
Commit
813790e6
authored
4 years ago
by
Nicolas Werner
Browse files
Options
Downloads
Patches
Plain Diff
Improve Login and Register page hinting
parent
197f702d
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/LoginPage.cpp
+14
-0
14 additions, 0 deletions
src/LoginPage.cpp
src/RegisterPage.cpp
+10
-1
10 additions, 1 deletion
src/RegisterPage.cpp
src/ui/TextField.cpp
+4
-1
4 additions, 1 deletion
src/ui/TextField.cpp
with
28 additions
and
2 deletions
src/LoginPage.cpp
+
14
−
0
View file @
813790e6
...
...
@@ -81,6 +81,14 @@ LoginPage::LoginPage(QWidget *parent)
matrixid_input_
=
new
TextField
(
this
);
matrixid_input_
->
setLabel
(
tr
(
"Matrix ID"
));
matrixid_input_
->
setPlaceholderText
(
tr
(
"e.g @joe:matrix.org"
));
matrixid_input_
->
setToolTip
(
tr
(
"Your login name. A mxid should start with @ followed by the user id. After the user "
"id you need to include your server name after a :.
\n
You can also put your homeserver "
"address there, if your server doesn't support .well-known lookup.
\n
Example: "
"@user:server.my
\n
If Nheko fails to discover your homeserver, it will show you a "
"field to enter the server manually."
));
matrixid_input_
->
setValidator
(
new
QRegularExpressionValidator
(
QRegularExpression
(
"@.+?:.{3,}"
),
this
));
spinner_
=
new
LoadingIndicator
(
this
);
spinner_
->
setFixedHeight
(
40
);
...
...
@@ -97,13 +105,19 @@ LoginPage::LoginPage(QWidget *parent)
password_input_
=
new
TextField
(
this
);
password_input_
->
setLabel
(
tr
(
"Password"
));
password_input_
->
setEchoMode
(
QLineEdit
::
Password
);
password_input_
->
setToolTip
(
"Your password."
);
deviceName_
=
new
TextField
(
this
);
deviceName_
->
setLabel
(
tr
(
"Device name"
));
deviceName_
->
setToolTip
(
tr
(
"A name for this device, which will be shown to others, when verifying your devices. "
"If none is provided, a random string is used for privacy purposes."
));
serverInput_
=
new
TextField
(
this
);
serverInput_
->
setLabel
(
"Homeserver address"
);
serverInput_
->
setPlaceholderText
(
"matrix.org"
);
serverInput_
->
setToolTip
(
tr
(
"The address that can be used to contact you homeservers "
"client API.
\n
Example: https://server.my:8787"
));
serverInput_
->
hide
();
serverLayout_
=
new
QHBoxLayout
();
...
...
This diff is collapsed.
Click to expand it.
src/RegisterPage.cpp
+
10
−
1
View file @
813790e6
...
...
@@ -85,17 +85,26 @@ RegisterPage::RegisterPage(QWidget *parent)
username_input_
=
new
TextField
();
username_input_
->
setLabel
(
tr
(
"Username"
));
username_input_
->
setValidator
(
new
QRegularExpressionValidator
(
QRegularExpression
(
"[a-z0-9._=/-]+"
),
this
));
username_input_
->
setToolTip
(
tr
(
"The username must not be empty, and must contain only the "
"characters a-z, 0-9, ., _, =, -, and /."
));
password_input_
=
new
TextField
();
password_input_
->
setLabel
(
tr
(
"Password"
));
password_input_
->
setEchoMode
(
QLineEdit
::
Password
);
password_input_
->
setToolTip
(
tr
(
"Please choose a secure password. The exact requirements "
"for password strength may depend on your server"
));
password_confirmation_
=
new
TextField
();
password_confirmation_
->
setLabel
(
tr
(
"Password confirmation"
));
password_confirmation_
->
setEchoMode
(
QLineEdit
::
Password
);
server_input_
=
new
TextField
();
server_input_
->
setLabel
(
tr
(
"Home Server"
));
server_input_
->
setLabel
(
tr
(
"Homeserver"
));
server_input_
->
setToolTip
(
tr
(
"A server that allows registration. Since matrix is decentralized, you need to first "
"find a server you can register on or host your own."
));
form_layout_
->
addWidget
(
username_input_
,
Qt
::
AlignHCenter
,
nullptr
);
form_layout_
->
addWidget
(
password_input_
,
Qt
::
AlignHCenter
,
nullptr
);
...
...
This diff is collapsed.
Click to expand it.
src/ui/TextField.cpp
+
4
−
1
View file @
813790e6
...
...
@@ -147,7 +147,10 @@ QColor
TextField
::
underlineColor
()
const
{
if
(
!
underline_color_
.
isValid
())
{
return
QPalette
().
color
(
QPalette
::
Highlight
);
if
(
hasAcceptableInput
()
||
!
isModified
())
return
QPalette
().
color
(
QPalette
::
Highlight
);
else
return
Qt
::
red
;
}
return
underline_color_
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment