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
b0813124
Commit
b0813124
authored
19 years ago
by
nkour
Browse files
Options
Downloads
Patches
Plain Diff
if unkonwn so no image. ? confuses the user that Gajim does not understand this service
parent
cbc29739
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/disco.py
+8
-9
8 additions, 9 deletions
src/disco.py
with
8 additions
and
9 deletions
src/disco.py
+
8
−
9
View file @
b0813124
...
...
@@ -235,7 +235,7 @@ class ServicesCache:
if
not
self
.
_cbs
[
cbkey
]:
del
self
.
_cbs
[
cbkey
]
def
get_icon
(
self
,
widget
,
identities
=
[]):
def
get_icon
(
self
,
identities
=
[]):
'''
Return the icon for an agent.
'''
# Grab the first identity with an icon
for
identity
in
identities
:
...
...
@@ -252,15 +252,14 @@ class ServicesCache:
cat
=
type
=
0
info
=
_agent_type_info
[(
0
,
0
)]
filename
=
info
[
1
]
if
not
filename
:
# we don't have an image to show for this type
return
# Use the cache if possible
if
filename
in
_icon_cache
:
return
_icon_cache
[
filename
]
# Or load it
if
filename
:
filepath
=
os
.
path
.
join
(
gajim
.
DATA_DIR
,
'
pixmaps/agents
'
,
filename
)
pix
=
gtk
.
gdk
.
pixbuf_new_from_file
(
filepath
)
else
:
pix
=
widget
.
render_icon
(
gtk
.
STOCK_DIALOG_QUESTION
,
gtk
.
ICON_SIZE_DND
)
filepath
=
os
.
path
.
join
(
gajim
.
DATA_DIR
,
'
pixmaps
'
,
'
agents
'
,
filename
)
pix
=
gtk
.
gdk
.
pixbuf_new_from_file
(
filepath
)
# Store in cache
_icon_cache
[
filename
]
=
pix
return
pix
...
...
@@ -716,7 +715,7 @@ class AgentBrowser:
'
%s</span>
\n
%s
'
%
(
name
,
self
.
_get_agent_address
()))
# Add an icon to the banner.
pix
=
self
.
cache
.
get_icon
(
self
.
window
.
services_treeview
,
identities
)
pix
=
self
.
cache
.
get_icon
(
identities
)
self
.
window
.
banner_icon
.
set_from_pixbuf
(
pix
)
self
.
window
.
banner_icon
.
show
()
...
...
@@ -1279,7 +1278,7 @@ class ToplevelAgentBrowser(AgentBrowser):
# Put it in the 'other' category for now
cat_args
=
(
'
other
'
,)
# Set the pixmap for the row
pix
=
self
.
cache
.
get_icon
(
self
.
window
.
services_treeview
,
identities
)
pix
=
self
.
cache
.
get_icon
(
identities
)
# Put it in the right category
cat
=
self
.
_find_category
(
*
cat_args
)
if
not
cat
:
...
...
@@ -1311,7 +1310,7 @@ class ToplevelAgentBrowser(AgentBrowser):
self
.
_update_progressbar
()
# Search for an icon and category we can display
pix
=
self
.
cache
.
get_icon
(
self
.
window
.
services_treeview
,
identities
)
pix
=
self
.
cache
.
get_icon
(
identities
)
for
identity
in
identities
:
try
:
cat
,
type
=
identity
[
'
category
'
],
identity
[
'
type
'
]
...
...
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