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
a4b65e9a
Commit
a4b65e9a
authored
4 years ago
by
Nico
Browse files
Options
Downloads
Patches
Plain Diff
Listen only on enter in all classes
parent
3c3e4d1e
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/add_contact.py
+8
-13
8 additions, 13 deletions
briar-gtk/briar_gtk/containers/add_contact.py
briar-gtk/briar_gtk/containers/login.py
+4
-7
4 additions, 7 deletions
briar-gtk/briar_gtk/containers/login.py
with
12 additions
and
20 deletions
briar-gtk/briar_gtk/containers/add_contact.py
+
8
−
13
View file @
a4b65e9a
...
...
@@ -29,7 +29,7 @@ class AddContactContainer(Container):
self
.
_setup_add_contact_flow_stack
()
self
.
_setup_add_contact_flow_headers
()
self
.
_setup_link_
keystroke
_listener
()
self
.
_setup_link_
enter
_listener
()
def
_load_content
(
self
):
contacts
=
Contacts
(
APP
().
api
)
...
...
@@ -46,15 +46,12 @@ class AddContactContainer(Container):
add_contact_flow_headers
.
show_all
()
APP
().
window
.
set_titlebar
(
add_contact_flow_headers
)
def
_setup_link_
keystroke
_listener
(
self
):
def
_setup_link_
enter
_listener
(
self
):
their_link_entry
=
self
.
builder
.
get_object
(
"
their_link_entry
"
)
their_link_entry
.
connect
(
"
key-press-event
"
,
self
.
_link_keystroke
)
their_link_entry
.
connect
(
"
activate
"
,
self
.
_on_link_enter
)
# pylint: disable=unused-argument
def
_link_keystroke
(
self
,
widget
,
event
):
if
event
.
hardware_keycode
!=
36
and
event
.
hardware_keycode
!=
104
:
return
def
_on_link_enter
(
self
,
widget
):
self
.
on_links_next_pressed
(
None
)
# pylint: disable=unused-argument
...
...
@@ -90,20 +87,18 @@ class AddContactContainer(Container):
self
.
add_contact_flow_stack
.
set_visible_child
(
alias_page
)
self
.
_focus_alias_entry
()
self
.
_setup_alias_
keystroke
_listener
()
self
.
_setup_alias_
enter
_listener
()
def
_focus_alias_entry
(
self
):
alias_entry
=
self
.
builder
.
get_object
(
"
alias_entry
"
)
alias_entry
.
grab_focus
()
def
_setup_alias_
keystroke
_listener
(
self
):
def
_setup_alias_
enter
_listener
(
self
):
alias_entry
=
self
.
builder
.
get_object
(
"
alias_entry
"
)
alias_entry
.
connect
(
"
key-press-event
"
,
self
.
_alias_
keystroke
)
alias_entry
.
connect
(
"
activate
"
,
self
.
_
on_
alias_
enter
)
# pylint: disable=unused-argument
def
_alias_keystroke
(
self
,
widget
,
event
):
if
event
.
hardware_keycode
!=
36
and
event
.
hardware_keycode
!=
104
:
return
def
_on_alias_enter
(
self
,
widget
):
self
.
on_add_contact_pressed
(
None
)
# pylint: disable=unused-argument
...
...
This diff is collapsed.
Click to expand it.
briar-gtk/briar_gtk/containers/login.py
+
4
−
7
View file @
a4b65e9a
...
...
@@ -25,7 +25,7 @@ class LoginContainer(Container):
self
.
_setup_login_flow_stack
()
self
.
_setup_login_flow_headers
()
self
.
_setup_
keystroke
_listener
()
self
.
_setup_
enter
_listener
()
def
_setup_login_flow_stack
(
self
):
self
.
login_flow_stack
=
self
.
builder
.
get_object
(
self
.
STACK_NAME
)
...
...
@@ -37,15 +37,12 @@ class LoginContainer(Container):
login_flow_headers
.
show_all
()
self
.
_window
.
set_titlebar
(
login_flow_headers
)
def
_setup_
keystroke
_listener
(
self
):
def
_setup_
enter
_listener
(
self
):
password_entry
=
self
.
builder
.
get_object
(
"
password_entry
"
)
password_entry
.
connect
(
"
key-press-event
"
,
self
.
_password_keystroke
)
password_entry
.
connect
(
"
activate
"
,
self
.
_on_password_enter
)
# pylint: disable=unused-argument
def
_password_keystroke
(
self
,
widget
,
event
):
if
event
.
hardware_keycode
!=
36
and
event
.
hardware_keycode
!=
104
:
return
def
_on_password_enter
(
self
,
widget
):
self
.
on_login_pressed
(
None
)
# pylint: disable=unused-argument
...
...
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