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
Malte L
gajim-plugins
Commits
55f32fb2
Commit
55f32fb2
authored
Feb 24, 2019
by
Philipp Hörist
Browse files
[omemo] Add search to Key Dialog
parent
a9d10991
Changes
2
Hide whitespace changes
Inline
Side-by-side
omemo/gtk/key.py
View file @
55f32fb2
...
...
@@ -94,6 +94,9 @@ class KeyDialog(Gtk.Dialog):
self
.
show_all
()
def
_filter_func
(
self
,
row
,
_user_data
):
search_text
=
self
.
_ui
.
search
.
get_text
()
if
search_text
and
search_text
.
lower
()
not
in
str
(
row
.
jid
):
return
False
if
self
.
_show_inactive
:
return
True
return
row
.
active
...
...
@@ -111,6 +114,9 @@ class KeyDialog(Gtk.Dialog):
return
-
1
if
row1
.
trust
>
row2
.
trust
else
1
return
0
def
_on_search_changed
(
self
,
_entry
):
self
.
_ui
.
list
.
invalidate_filter
()
def
update
(
self
):
self
.
_ui
.
list
.
foreach
(
self
.
_ui
.
list
.
remove
)
self
.
_load_fingerprints
(
self
.
_own_jid
)
...
...
omemo/gtk/key.ui
View file @
55f32fb2
...
...
@@ -61,6 +61,20 @@ you have to install python-qrcode</property>
</object>
</child>
</object>
<object
class=
"GtkPopover"
id=
"search_popover"
>
<property
name=
"can_focus"
>
False
</property>
<child>
<object
class=
"GtkSearchEntry"
id=
"search"
>
<property
name=
"visible"
>
True
</property>
<property
name=
"can_focus"
>
True
</property>
<property
name=
"caps_lock_warning"
>
False
</property>
<property
name=
"primary_icon_name"
>
edit-find-symbolic
</property>
<property
name=
"primary_icon_activatable"
>
False
</property>
<property
name=
"primary_icon_sensitive"
>
False
</property>
<signal
name=
"search-changed"
handler=
"_on_search_changed"
swapped=
"no"
/>
</object>
</child>
</object>
<object
class=
"GtkGrid"
id=
"grid"
>
<property
name=
"visible"
>
True
</property>
<property
name=
"can_focus"
>
False
</property>
...
...
@@ -193,7 +207,25 @@ you have to install python-qrcode</property>
</packing>
</child>
<child>
<placeholder/>
<object
class=
"GtkMenuButton"
>
<property
name=
"visible"
>
True
</property>
<property
name=
"can_focus"
>
True
</property>
<property
name=
"receives_default"
>
True
</property>
<property
name=
"halign"
>
end
</property>
<property
name=
"valign"
>
center
</property>
<property
name=
"popover"
>
search_popover
</property>
<child>
<object
class=
"GtkImage"
>
<property
name=
"visible"
>
True
</property>
<property
name=
"can_focus"
>
False
</property>
<property
name=
"icon_name"
>
edit-find-symbolic
</property>
</object>
</child>
</object>
<packing>
<property
name=
"left_attach"
>
1
</property>
<property
name=
"top_attach"
>
0
</property>
</packing>
</child>
</object>
</interface>
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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