Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
G
gajim-plugins
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
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
gajim
gajim-plugins
Commits
a6a2e35e
Commit
a6a2e35e
authored
12 years ago
by
Dicson
Browse files
Options
Downloads
Patches
Plain Diff
ClientsIconsPlugin. Do not add clients info to self contacts
parent
09aa762d
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
clients_icons/clients_icons.py
+21
-14
21 additions, 14 deletions
clients_icons/clients_icons.py
with
21 additions
and
14 deletions
clients_icons/clients_icons.py
+
21
−
14
View file @
a6a2e35e
...
...
@@ -208,28 +208,21 @@ class ClientsIconsPlugin(GajimPlugin):
contacts_dict
[
contact
.
priority
].
append
(
contact
)
else
:
contacts_dict
[
contact
.
priority
]
=
[
contact
]
# set label
label
=
gtk
.
Label
()
label
.
set_alignment
(
0
,
0
)
if
num_resources
>
1
:
label
.
set_markup
(
_
(
'
Clients:
'
))
else
:
if
contact
.
show
==
'
offline
'
:
return
label
.
set_markup
(
_
(
'
Client:
'
))
contact_keys
=
sorted
(
contacts_dict
.
keys
())
contact_keys
.
reverse
()
#fill clients table
self
.
table
=
gtk
.
Table
(
4
,
1
)
self
.
table
.
set_property
(
'
column-spacing
'
,
2
)
first_place
=
vcard_current_row
=
vcard_table
.
get_property
(
'
n-rows
'
)
vcard_table
.
attach
(
label
,
1
,
2
,
vcard_current_row
,
vcard_current_row
+
1
,
gtk
.
FILL
,
gtk
.
FILL
|
gtk
.
EXPAND
,
0
,
0
)
contact_keys
=
sorted
(
contacts_dict
.
keys
())
contact_keys
.
reverse
()
vcard_current_row
=
0
for
priority
in
contact_keys
:
for
acontact
in
contacts_dict
[
priority
]:
caps
=
acontact
.
client_caps
.
_node
caps_image
,
client_name
=
self
.
get_icon
(
caps
,
acontact
)
if
not
caps_image
:
return
caps_image
.
set_alignment
(
0
,
0
)
self
.
table
.
attach
(
caps_image
,
1
,
2
,
vcard_current_row
,
vcard_current_row
+
1
,
gtk
.
FILL
,
...
...
@@ -240,7 +233,18 @@ class ClientsIconsPlugin(GajimPlugin):
self
.
table
.
attach
(
label
,
2
,
3
,
vcard_current_row
,
vcard_current_row
+
1
,
gtk
.
FILL
|
gtk
.
EXPAND
,
0
,
0
,
0
)
vcard_current_row
+=
1
#set clients table to tooltip
# set label
label
=
gtk
.
Label
()
label
.
set_alignment
(
0
,
0
)
if
num_resources
>
1
:
label
.
set_markup
(
_
(
'
Clients:
'
))
else
:
if
contact
.
show
==
'
offline
'
:
return
label
.
set_markup
(
_
(
'
Client:
'
))
vcard_table
.
attach
(
label
,
1
,
2
,
first_place
,
first_place
+
1
,
gtk
.
FILL
,
gtk
.
FILL
|
gtk
.
EXPAND
,
0
,
0
)
# set clients table to tooltip
vcard_table
.
attach
(
self
.
table
,
2
,
3
,
first_place
,
first_place
+
1
,
gtk
.
FILL
,
vertical_fill
,
0
,
0
)
...
...
@@ -254,6 +258,9 @@ class ClientsIconsPlugin(GajimPlugin):
gtk
.
FILL
|
gtk
.
EXPAND
,
3
,
3
)
def
get_icon
(
self
,
caps
,
contact
=
None
):
if
contact
.
jid
in
gajim
.
get_our_jids
():
return
None
,
None
if
not
caps
:
return
gtk
.
image_new_from_pixbuf
(
self
.
default_pixbuf
),
_
(
'
Unknown
'
)
...
...
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