Re: [Gajim-devel] [patch] attach notification to systray
Norbert Tretkowski wrote: > * Yann Le Boulanger wrote: >> Norbert Tretkowski wrote: >>> * Le Boulanger Yann wrote: If some ppl want to test, here is the patch to apply. >>> Any plans to include this patch in one of the next releases? >> where is this patch ? > > http://article.gmane.org/gmane.network.jabber.gajim.devel/10 > > Norbert > > ___ > Gajim-devel mailing list > Gajim-devel@gajim.org > https://lists.gajim.org/cgi-bin/listinfo/gajim-devel > The problem is that we want to switch to gtk.StatusIcon to use systray, and this patch won't work anymore. This statusicon is not a widget, so we can't know its position / size in the screen. -- Yann ___ Gajim-devel mailing list Gajim-devel@gajim.org https://lists.gajim.org/cgi-bin/listinfo/gajim-devel
Re: [Gajim-devel] [patch] attach notification to systray
* Yann Le Boulanger wrote: > Norbert Tretkowski wrote: >> * Le Boulanger Yann wrote: >>> If some ppl want to test, here is the patch to apply. >> >> Any plans to include this patch in one of the next releases? > > where is this patch ? http://article.gmane.org/gmane.network.jabber.gajim.devel/10 Norbert ___ Gajim-devel mailing list Gajim-devel@gajim.org https://lists.gajim.org/cgi-bin/listinfo/gajim-devel
Re: [Gajim-devel] [patch] attach notification to systray
Norbert Tretkowski wrote: > * Le Boulanger Yann wrote: >> If some ppl want to test, here is the patch to apply. > > Any plans to include this patch in one of the next releases? > > Norbert > where is this patch ? -- Yann ___ Gajim-devel mailing list Gajim-devel@gajim.org https://lists.gajim.org/cgi-bin/listinfo/gajim-devel
Re: [Gajim-devel] [patch] attach notification to systray
* Le Boulanger Yann wrote: > If some ppl want to test, here is the patch to apply. Any plans to include this patch in one of the next releases? Norbert ___ Gajim-devel mailing list Gajim-devel@gajim.org https://lists.gajim.org/cgi-bin/listinfo/gajim-devel
Re: [Gajim-devel] [patch] attach notification to systray
On 2/25/06, Le Boulanger Yann <[EMAIL PROTECTED]> wrote: > Notification window should appear just below systray icon,> http://www.0d.be/files/gajim-new-message-notification.png> Arg what a silly man I am. Indentation error. Shame on me. Now it works,but there is a pb:when a second popup has to be displayed, it's over the first one. So i'mnot sure it's good to apply that.What do other think ? Maybe second should display after first will hide..-- Remigiusz Dymecki[EMAIL PROTECTED] ___ Gajim-devel mailing list Gajim-devel@gajim.org https://lists.gajim.org/cgi-bin/listinfo/gajim-devel
Re: [Gajim-devel] [patch] attach notification to systray
Le Boulanger Yann wrote: Frederic Peters wrote: Le Boulanger Yann wrote: I've modified it a bit, but here it does nothing. my taskbar is on top, systray on the right. I suppose it is supposed to put the notification window on top right ? Notification window should appear just below systray icon, http://www.0d.be/files/gajim-new-message-notification.png Arg what a silly man I am. Indentation error. Shame on me. Now it works, but there is a pb: when a second popup has to be displayed, it's over the first one. So i'm not sure it's good to apply that. What do other think ? If some ppl want to test, here is the patch to apply. Index: src/notify.py === --- src/notify.py (revision 5505) +++ src/notify.py (working copy) @@ -146,6 +146,21 @@ (name, version, version, spec_version) = self.notif.GetServerInformation() except: version = '0.3.1' + + hints = {} + if gajim.interface.systray_enabled and gajim.interface.systray.t: + x, y = gajim.interface.systray.t.window.get_origin() + w, h = gajim.interface.systray.t.size_request() + x += w/2 + if y < 100: +# top-panel +y += h + else: +# bottom-panel +y -= h + hints['x'] = x + hints['y'] = y + if version.startswith('0.2'): try: self.id = self.notif.Notify(dbus.String(_('Gajim')), @@ -160,12 +175,12 @@ self.id = self.notif.Notify(dbus.String(_('Gajim')), dbus.UInt32(0), dbus.String(path_to_image), dbus.String(event_type), dbus.String(text), (dbus.String(ntype), - dbus.String(event_type)), {}, dbus.UInt32(timeout*1000)) + dbus.String(event_type)), hints, dbus.UInt32(timeout*1000)) else: self.id = self.notif.Notify(dbus.String(_('Gajim')), dbus.String(path_to_image), dbus.UInt32(0), dbus.String(event_type), dbus.String(text), dbus.String(''), - {}, dbus.UInt32(timeout*1000)) + hints, dbus.UInt32(timeout*1000)) notification_response_manager.attach_to_interface() notification_response_manager.pending[self.id] = self ___ Gajim-devel mailing list Gajim-devel@gajim.org https://lists.gajim.org/cgi-bin/listinfo/gajim-devel
Re: [Gajim-devel] [patch] attach notification to systray
Frederic Peters wrote: Le Boulanger Yann wrote: I've modified it a bit, but here it does nothing. my taskbar is on top, systray on the right. I suppose it is supposed to put the notification window on top right ? Notification window should appear just below systray icon, http://www.0d.be/files/gajim-new-message-notification.png Arg what a silly man I am. Indentation error. Shame on me. Now it works, but there is a pb: when a second popup has to be displayed, it's over the first one. So i'm not sure it's good to apply that. What do other think ? -- Yann ___ Gajim-devel mailing list Gajim-devel@gajim.org https://lists.gajim.org/cgi-bin/listinfo/gajim-devel
Re: [Gajim-devel] [patch] attach notification to systray
Andrew Sayman wrote: > This seems like the sort of thing that the GNOME notification daemon should > handle. The reason that x and y values are in the hints section is because > they're optional. The point of moving to a more generic system like > notification-daemon is that stuff like this can be handled by the daemon and > not > gajim. This should certainly be handled by the notification daemon and it may be so in the future but the thing is gajim looks like it does its best today to support different notification systems, I feld using a maximum of their current features seemed to match this goal. Regards, Frederic ___ Gajim-devel mailing list Gajim-devel@gajim.org https://lists.gajim.org/cgi-bin/listinfo/gajim-devel
Re: [Gajim-devel] [patch] attach notification to systray
-BEGIN PGP SIGNED MESSAGE- Hash: RIPEMD160 Frederic Peters wrote: > Hello, > > I'll first thanks you for gajim. > > I've been musing with GNOME notification daemon recently and patched > gajim so it attachs its notifiations under the systray icon (if > present). This seems like the sort of thing that the GNOME notification daemon should handle. The reason that x and y values are in the hints section is because they're optional. The point of moving to a more generic system like notification-daemon is that stuff like this can be handled by the daemon and not gajim. -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.2.1 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFD/O3iyDerq+PlXg8RA2ZlAJ9tmFgeIks4VDvw5LrLgsPSl0Q0DwCfVirm Y6AsTQ6i0zlZlVrfaVm1RXo= =lSGA -END PGP SIGNATURE- ___ Gajim-devel mailing list [EMAIL PROTECTED] https://lists.gajim.org/cgi-bin/listinfo/gajim-devel
Re: [Gajim-devel] [patch] attach notification to systray
Frederic Peters wrote: > Hello, > > I'll first thanks you for gajim. > > I've been musing with GNOME notification daemon recently and patched > gajim so it attachs its notifiations under the systray icon (if > present). This seems like the sort of thing that the GNOME notification daemon should handle. The reason that x and y values are in the hints section is because they're optional. The point of moving to a more generic system like notification-daemon is that stuff like this can be handled by the daemon and not gajim. ___ Gajim-devel mailing list [EMAIL PROTECTED] https://lists.gajim.org/cgi-bin/listinfo/gajim-devel
Re: [Gajim-devel] [patch] attach notification to systray
Le Boulanger Yann wrote: > I've modified it a bit, but here it does nothing. my taskbar is on top, > systray on the right. I suppose it is supposed to put the notification > window on top right ? Notification window should appear just below systray icon, http://www.0d.be/files/gajim-new-message-notification.png I don't know why it would fail, is hints filled with correct values ? It may also be due do notification-daemon version, I'm running this version : bus = dbus.SessionBus() notify_service = bus.get_object('org.freedesktop.Notifications', '/org/freedesktop/Notifications') notify_interface = dbus.Interface(notify_service, 'org.freedesktop.Notifications') print notify_interface.getProgramInformation() [u'Notification Daemon', u'Galago Project', u'0.3.4', u'0.9'] I have been testing notification window positioning with the following call to notify_interface: notify_interface.Notify('test', 0, '', 'Title', 'Message', [], {'x': 400, 'y': 20}, -1) Hope it helps, Frederic ___ Gajim-devel mailing list [EMAIL PROTECTED] https://lists.gajim.org/cgi-bin/listinfo/gajim-devel
Re: [Gajim-devel] [patch] attach notification to systray
Frederic Peters wrote: Hello, I'll first thanks you for gajim. I've been musing with GNOME notification daemon recently and patched gajim so it attachs its notifiations under the systray icon (if present). This is done on 0.9.1 since it is what I use here but I ported my patch to current SVN version (although I didn't test this one). It is a bit ugly since src/notify.py must then know about current systray icon (so it can calculate x,y to position the window) but I couldn't find another way (and probably don't know enough about gajim internals to it properly). Anyway here it is attached and keep up the good work. Regards, Frederic I've modified it a bit, but here it does nothing. my taskbar is on top, systray on the right. I suppose it is supposed to put the notification window on top right ? Yann Index: notify.py === --- notify.py (revision 5496) +++ notify.py (working copy) @@ -148,6 +148,21 @@ (name, version, version, spec_version) = self.notif.GetServerInformation() except: version = '0.3.1' + + hints = {} + if gajim.interface.systray_enabled and gajim.interface.systray.t: + x, y = gajim.interface.systray.t.window.get_origin() + w, h = gajim.interface.systray.t.size_request() + x += w/2 + if y < 100: + # top-panel + y += h + else: + # bottom-panel + y -= h + hints['x'] = x + hints['y'] = y + if version.startswith('0.2'): try: self.id = self.notif.Notify(dbus.String(_('Gajim')), @@ -162,12 +177,12 @@ self.id = self.notif.Notify(dbus.String(_('Gajim')), dbus.UInt32(0), dbus.String(path_to_image), dbus.String(event_type), dbus.String(text), (dbus.String(ntype), - dbus.String(event_type)), {}, dbus.UInt32(timeout*1000)) + dbus.String(event_type)), hints, dbus.UInt32(timeout*1000)) else: self.id = self.notif.Notify(dbus.String(_('Gajim')), dbus.String(path_to_image), dbus.UInt32(0), dbus.String(event_type), dbus.String(text), dbus.String(''), - {}, dbus.UInt32(timeout*1000)) + hints, dbus.UInt32(timeout*1000)) notification_response_manager.attach_to_interface() notification_response_manager.pending[self.id] = self ___ Gajim-devel mailing list [EMAIL PROTECTED] https://lists.gajim.org/cgi-bin/listinfo/gajim-devel
[Gajim-devel] [patch] attach notification to systray
Hello, I'll first thanks you for gajim. I've been musing with GNOME notification daemon recently and patched gajim so it attachs its notifiations under the systray icon (if present). This is done on 0.9.1 since it is what I use here but I ported my patch to current SVN version (although I didn't test this one). It is a bit ugly since src/notify.py must then know about current systray icon (so it can calculate x,y to position the window) but I couldn't find another way (and probably don't know enough about gajim internals to it properly). Anyway here it is attached and keep up the good work. Regards, Frederic Index: src/notify.py === --- src/notify.py (révision 5480) +++ src/notify.py (copie de travail) @@ -147,6 +147,22 @@ (name, version, version, spec_version) = self.notif.GetServerInformation() except: version = '0.3.1' + + import systray + hints = {} + if systray.current_systray and systray.current_systray.t: + x, y = systray.current_systray.t.window.get_origin() + w, h = systray.current_systray.t.size_request() + x += w/2 + if y < 100: + # top-panel + y += h + else: + # bottom-panel + y -= h + hints['x'] = x + hints['y'] = y + if version.startswith('0.2'): try: self.id = self.notif.Notify(dbus.String(_('Gajim')), @@ -160,11 +176,11 @@ if version >= ( 0, 3, 2): self.id = self.notif.Notify(dbus.String(_('Gajim')), dbus.UInt32(0), dbus.String(path_to_image), dbus.String(event_type), - dbus.String(text), ( dbus.String(ntype), dbus.String(event_type) ), {}, dbus.UInt32(timeout*1000)) + dbus.String(text), ( dbus.String(ntype), dbus.String(event_type) ), events, dbus.UInt32(timeout*1000)) else: self.id = self.notif.Notify(dbus.String(_('Gajim')), dbus.String(path_to_image), dbus.UInt32(0), dbus.String(event_type), - dbus.String(text), dbus.String(''), {}, dbus.UInt32(timeout*1000)) + dbus.String(text), dbus.String(''), events, dbus.UInt32(timeout*1000)) notification_response_manager.attach_to_interface() notification_response_manager.pending[self.id] = self Index: src/systray.py === --- src/systray.py (révision 5480) +++ src/systray.py (copie de travail) @@ -53,6 +53,8 @@ GTKGUI_GLADE = 'gtkgui.glade' +current_systray = None + class Systray: '''Class for icon in the notification area This class is both base class (for systraywin32.py) and normal class @@ -68,6 +70,9 @@ self.systray_context_menu = self.xml.get_widget('systray_context_menu') self.xml.signal_autoconnect(self) + global current_systray + current_systray = self + def set_img(self): if len(self.jids) > 0: state = 'message' ___ Gajim-devel mailing list [EMAIL PROTECTED] https://lists.gajim.org/cgi-bin/listinfo/gajim-devel