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
norstbox
gajim
Commits
ca5a7586
Commit
ca5a7586
authored
18 years ago
by
nkour
Browse files
Options
Downloads
Patches
Plain Diff
commit statusicon.py
parent
2a59b00d
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
src/statusicon.py
+67
-0
67 additions, 0 deletions
src/statusicon.py
with
67 additions
and
0 deletions
src/statusicon.py
0 → 100644
+
67
−
0
View file @
ca5a7586
## statusicon.py
##
## Copyright (C) 2006 Nikos Kouremenos <kourem@gmail.com>
##
## This program is free software; you can redistribute it and/or
## modify it under the terms of the GNU General Public License
## as published by the Free Software Foundation; either version 2
## of the License, or (at your option) any later version.
##
## This program is distributed in the hope that it will be useful,
## but WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
## GNU General Public License for more details.
##
import
gtk
import
gobject
import
systray
from
common
import
gajim
from
common
import
helpers
class
StatusIcon
(
systray
.
Systray
):
'''
Class for the notification area icon
'''
#FIXME: when we migrate to GTK 2.10 stick only to this class
# (move base stuff from systray.py and rm it)
#NOTE: gtk api does NOT allow:
# leave, enter motion notify
# and can't do cool tooltips we use
def
__init__
(
self
):
systray
.
Systray
.
__init__
(
self
)
self
.
status_icon
=
gtk
.
StatusIcon
()
def
show_icon
(
self
):
self
.
status_icon
.
connect
(
'
activate
'
,
self
.
on_status_icon_left_clicked
)
self
.
status_icon
.
connect
(
'
popup-menu
'
,
self
.
on_status_icon_right_clicked
)
self
.
set_img
()
self
.
status_icon
.
props
.
visible
=
True
def
on_status_icon_right_clicked
(
self
,
widget
,
event_button
,
event_time
):
self
.
make_menu
(
event_button
,
event_time
)
def
hide_icon
(
self
):
self
.
status_icon
.
props
.
visible
=
False
def
on_status_icon_left_clicked
(
self
,
widget
):
self
.
on_left_click
()
def
set_img
(
self
):
'''
apart from image, I also update tooltip text
'
if not gajim.interface.systray_enabled:
return
text = helpers.get_notification_icon_tooltip_text()
self.status_icon.set_tooltip(text)
if gajim.events.get_nb_systray_events():
state =
'
message
'
else:
state = self.status
#FIXME: do not always use 16x16 (ask actually used size and use that)
image = gajim.interface.roster.jabber_state_images[
'
16
'
][state]
if image.get_storage_type() == gtk.IMAGE_PIXBUF:
self.status_icon.props.pixbuf = image.get_pixbuf()
#FIXME: oops they forgot to support GIF animation?
#or they were lazy to get it to work under Windows! WTF!
#elif image.get_storage_type() == gtk.IMAGE_ANIMATION:
# self.img_tray.set_from_animation(image.get_animation())
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