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
eta
gajim
Commits
08a7c45c
Commit
08a7c45c
authored
19 years ago
by
nkour
Browse files
Options
Downloads
Patches
Plain Diff
notification area icon (trayicon) is back for windows!
parent
4aaa36fb
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/gajim.py
+8
-9
8 additions, 9 deletions
src/gajim.py
src/systraywin32.py
+13
-9
13 additions, 9 deletions
src/systraywin32.py
with
21 additions
and
18 deletions
src/gajim.py
+
8
−
9
View file @
08a7c45c
...
...
@@ -1133,15 +1133,14 @@ class Interface:
self
.
systray_enabled
=
False
self
.
systray_capabilities
=
False
if
False
:
#os.name == 'nt':
pass
#try:
# import systraywin32
#except: # user doesn't have trayicon capabilities
# pass
#else:
# self.systray_capabilities = True
# self.systray = systraywin32.SystrayWin32(self)
if
os
.
name
==
'
nt
'
:
try
:
import
systraywin32
except
:
# user doesn't have trayicon capabilities
pass
else
:
self
.
systray_capabilities
=
True
self
.
systray
=
systraywin32
.
SystrayWin32
(
self
)
else
:
try
:
import
egg.trayicon
# use gnomepythonextras trayicon
...
...
This diff is collapsed.
Click to expand it.
src/systraywin32.py
+
13
−
9
View file @
08a7c45c
...
...
@@ -8,6 +8,7 @@
##
## code initially based on
## http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/334779
## with some ideas/help from pysystray.sf.net
##
## Copyright (C) 2003-2005 Gajim Team
##
...
...
@@ -52,8 +53,6 @@ class SystrayWINAPI:
self
.
_oldwndproc
=
win32gui
.
SetWindowLong
(
self
.
_hwnd
,
win32con
.
GWL_WNDPROC
,
self
.
_wndproc
)
gtk_window
.
connect
(
'
unrealize
'
,
self
.
remove
)
def
add_notify_icon
(
self
,
menu
,
hicon
=
None
,
tooltip
=
None
):
"""
Creates a notify icon for the gtk window.
"""
...
...
@@ -152,9 +151,7 @@ class NotifyIcon:
def
_get_nid
(
self
):
"""
Function to initialise & retrieve the NOTIFYICONDATA Structure.
"""
nid
=
(
self
.
_hwnd
,
self
.
_id
,
self
.
_flags
,
self
.
_callbackmessage
,
self
.
_hicon
)
nid
=
list
(
nid
)
nid
=
[
self
.
_hwnd
,
self
.
_id
,
self
.
_flags
,
self
.
_callbackmessage
,
self
.
_hicon
]
if
not
hasattr
(
self
,
'
_tip
'
):
self
.
_tip
=
''
nid
.
append
(
self
.
_tip
)
...
...
@@ -172,7 +169,6 @@ class NotifyIcon:
nid
.
append
(
self
.
_infoflags
)
return
tuple
(
nid
)
def
remove
(
self
):
"""
Removes the tray icon.
"""
...
...
@@ -200,7 +196,7 @@ class NotifyIcon:
def
_redraw
(
self
,
*
args
):
"""
Redraws the tray icon.
"""
self
.
remove
self
.
remove
()
win32gui
.
Shell_NotifyIcon
(
win32gui
.
NIM_ADD
,
self
.
_get_nid
())
...
...
@@ -216,7 +212,15 @@ class SystrayWin32(systray.Systray):
self
.
tray_ico_imgs
=
self
.
load_icos
()
self
.
systray_winapi
=
SystrayWINAPI
(
self
.
plugin
.
roster
.
window
)
#self.plugin.roster.window.realize()
#self.plugin.roster.window.show_all()
w
=
gtk
.
Window
()
# just a window to pass
w
.
realize
()
# realize it so gtk window exists
self
.
systray_winapi
=
SystrayWINAPI
(
w
)
# this fails if you move the window
#self.systray_winapi = SystrayWINAPI(self.plugin.roster.window)
self
.
xml
.
signal_autoconnect
(
self
)
...
...
@@ -233,7 +237,7 @@ class SystrayWin32(systray.Systray):
self
.
set_img
()
def
hide_icon
(
self
):
self
.
systray_winapi
.
remove
_notify_icon
()
self
.
systray_winapi
.
remove
()
def
on_clicked
(
self
,
hwnd
,
message
,
wparam
,
lparam
):
if
lparam
==
win32con
.
WM_RBUTTONUP
:
# Right click
...
...
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