Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Briar GTK
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
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
briar
Briar GTK
Commits
f07e8304
Commit
f07e8304
authored
5 years ago
by
Nico
Browse files
Options
Downloads
Patches
Plain Diff
Introduce show_error_message function in registration
parent
ebf80890
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
briar-gtk/briar_gtk/containers/registration.py
+19
-14
19 additions, 14 deletions
briar-gtk/briar_gtk/containers/registration.py
briar-gtk/data/ui/registration.ui
+0
-1
0 additions, 1 deletion
briar-gtk/data/ui/registration.ui
with
19 additions
and
15 deletions
briar-gtk/briar_gtk/containers/registration.py
+
19
−
14
View file @
f07e8304
...
...
@@ -54,11 +54,11 @@ class RegistrationContainer(Container):
self
.
proceed_from_nickname
()
def
proceed_from_nickname
(
self
):
nickname_error_label
=
self
.
builder
.
get_object
(
"
nickname_error_label
"
)
if
self
.
_nickname_is_empty
():
nickname_error_
label
.
show
(
)
self
.
_show_
nickname_error_
message
(
_
(
"
Please enter a nickname
"
)
)
return
nickname_error_label
.
hide
()
error_label
=
self
.
builder
.
get_object
(
"
nickname_error_label
"
)
error_label
.
hide
()
self
.
_show_passwords_page
()
def
_nickname_is_empty
(
self
):
...
...
@@ -92,14 +92,13 @@ class RegistrationContainer(Container):
def
on_create_account_pressed
(
self
):
if
self
.
_password_is_empty
():
self
.
_show_error_message
(
_
(
"
Please enter a password
"
))
self
.
_show_
passwords_
error_message
(
_
(
"
Please enter a password
"
))
return
if
not
self
.
_passwords_match
():
self
.
_show_error_message
(
_
(
"
The passwords do not match
"
))
self
.
_show_
passwords_
error_message
(
_
(
"
The passwords do not match
"
))
return
passwords_error_label
=
self
.
builder
.
get_object
(
"
passwords_error_label
"
)
passwords_error_label
.
hide
()
error_label
=
self
.
builder
.
get_object
(
"
passwords_error_label
"
)
error_label
.
hide
()
self
.
_show_loading_animation
()
self
.
_register
()
...
...
@@ -130,11 +129,17 @@ class RegistrationContainer(Container):
GLib
.
idle_add
(
function
)
def
_registration_failed
(
self
):
self
.
_show_error_message
(
_
(
"
Couldn
'
t register account
"
))
self
.
_show_
passwords_
error_message
(
_
(
"
Couldn
'
t register account
"
))
self
.
_show_passwords_page
()
def
_show_error_message
(
self
,
error_message
):
passwords_error_label
=
self
.
builder
.
get_object
(
"
passwords_error_label
"
)
passwords_error_label
.
set_label
(
error_message
)
passwords_error_label
.
show
()
def
_show_nickname_error_message
(
self
,
error_message
):
error_label
=
self
.
builder
.
get_object
(
"
nickname_error_label
"
)
self
.
_show_error_message
(
error_label
,
error_message
)
def
_show_passwords_error_message
(
self
,
error_message
):
error_label
=
self
.
builder
.
get_object
(
"
passwords_error_label
"
)
self
.
_show_error_message
(
error_label
,
error_message
)
def
_show_error_message
(
self
,
error_label
,
error_message
):
error_label
.
set_label
(
error_message
)
error_label
.
show
()
This diff is collapsed.
Click to expand it.
briar-gtk/data/ui/registration.ui
+
0
−
1
View file @
f07e8304
...
...
@@ -79,7 +79,6 @@
<property
name=
"visible"
>
False
</property>
<property
name=
"can_focus"
>
False
</property>
<property
name=
"no_show_all"
>
True
</property>
<property
name=
"label"
translatable=
"yes"
>
The nickname may not be empty.
</property>
<property
name=
"wrap"
>
True
</property>
<property
name=
"wrap_mode"
>
PANGO_WRAP_WORD_CHAR
</property>
<style>
...
...
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