Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
gajim
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
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
Weblate
gajim
Commits
8f239a4b
Commit
8f239a4b
authored
18 years ago
by
dkirov
Browse files
Options
Downloads
Patches
Plain Diff
moved completion definition in a function
get_completion_liststore in gtkgui_helpers
parent
37a65bd7
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
src/dialogs.py
+2
-15
2 additions, 15 deletions
src/dialogs.py
src/gtkgui_helpers.py
+19
-0
19 additions, 0 deletions
src/gtkgui_helpers.py
with
21 additions
and
15 deletions
src/dialogs.py
+
2
−
15
View file @
8f239a4b
...
...
@@ -997,20 +997,10 @@ class NewChatDialog(InputDialog):
title
=
_
(
'
Start Chat
'
)
prompt_text
=
_
(
'
Fill in the jid, or nick of the contact you would like
\n
to send a chat message to:
'
)
InputDialog
.
__init__
(
self
,
title
,
prompt_text
,
is_modal
=
False
)
# create the completion model for input_entry
completion
=
gtk
.
EntryCompletion
()
liststore
=
gtk
.
ListStore
(
gtk
.
gdk
.
Pixbuf
,
str
)
render_pixbuf
=
gtk
.
CellRendererPixbuf
()
completion
.
pack_start
(
render_pixbuf
,
expand
=
False
)
completion
.
add_attribute
(
render_pixbuf
,
'
pixbuf
'
,
0
)
render_text
=
gtk
.
CellRendererText
()
completion
.
pack_start
(
render_text
,
expand
=
True
)
completion
.
add_attribute
(
render_text
,
'
text
'
,
1
)
completion
.
set_property
(
'
text_column
'
,
1
)
# add all contacts to the model
self
.
completion_dict
=
{}
liststore
=
gtkgui_helpers
.
get_completion_liststore
(
self
.
input_entry
)
# add all contacts to the model
for
jid
in
gajim
.
contacts
.
get_jid_list
(
account
):
contact
=
gajim
.
contacts
.
get_contact_with_highest_priority
(
account
,
jid
)
self
.
completion_dict
[
jid
]
=
contact
...
...
@@ -1027,9 +1017,6 @@ class NewChatDialog(InputDialog):
img
=
gajim
.
interface
.
roster
.
jabber_state_images
[
'
16
'
][
contact
.
show
]
liststore
.
append
((
img
.
get_pixbuf
(),
jid
))
completion
.
set_model
(
liststore
)
self
.
input_entry
.
set_completion
(
completion
)
self
.
ok_handler
=
self
.
new_chat_response
okbutton
=
self
.
xml
.
get_widget
(
'
okbutton
'
)
okbutton
.
connect
(
'
clicked
'
,
self
.
on_okbutton_clicked
)
...
...
This diff is collapsed.
Click to expand it.
src/gtkgui_helpers.py
+
19
−
0
View file @
8f239a4b
...
...
@@ -50,6 +50,25 @@ def get_glade(file_name, root = None):
file_path
=
os
.
path
.
join
(
GLADE_DIR
,
file_name
)
return
gtk
.
glade
.
XML
(
file_path
,
root
=
root
,
domain
=
i18n
.
APP
)
def
get_completion_liststore
(
entry
):
'''
create a completion model for entry widget
completion list consists of (Pixbuf, Text) rows
'''
completion
=
gtk
.
EntryCompletion
()
liststore
=
gtk
.
ListStore
(
gtk
.
gdk
.
Pixbuf
,
str
)
render_pixbuf
=
gtk
.
CellRendererPixbuf
()
completion
.
pack_start
(
render_pixbuf
,
expand
=
False
)
completion
.
add_attribute
(
render_pixbuf
,
'
pixbuf
'
,
0
)
render_text
=
gtk
.
CellRendererText
()
completion
.
pack_start
(
render_text
,
expand
=
True
)
completion
.
add_attribute
(
render_text
,
'
text
'
,
1
)
completion
.
set_property
(
'
text_column
'
,
1
)
completion
.
set_model
(
liststore
)
entry
.
set_completion
(
completion
)
return
liststore
def
popup_emoticons_under_button
(
menu
,
button
,
parent_win
):
'''
pops emoticons menu under button, which is in parent_win
'''
window_x1
,
window_y1
=
parent_win
.
get_origin
()
...
...
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