[Gambas-user] New system tray icon protocol support, new episode.

Jussi Lahtinen jussi.lahtinen at ...626...
Sun Jul 5 21:34:25 CEST 2015


Maybe I have misunderstood something...
If I don't check the gb.gui.trayicon, I will get "cannot load the class
'Trayicon'".
If I do check the gb.gui.trayicon, I will get other error, see the
screenshot.


[System]
Gambas=3.7.90
OperatingSystem=Linux
Kernel=3.13.0-37-generic
Architecture=x86_64
Distribution=Linux Mint 17.1 Rebecca
Desktop=GNOME
Theme=Gtk
Language=en_US.UTF-8
Memory=7985M
[Libraries]
Cairo=libcairo.so.2.11301.0
Curl=libcurl.so.4.3.0
DBus=libdbus-1.so.3.7.6
GStreamer=libgstreamer-0.10.so.0.30.0
GStreamer=libgstreamer-1.0.so.0.204.0
GTK+3=libgtk-3.so.0.1000.8
GTK+=libgtk-x11-2.0.so.0.2400.23
OpenGL=libGL.so.1.2.0
Poppler=libpoppler.so.44.0.0
Qt4=libQtCore.so.4.8.6
Qt5=libQt5Core.so.5.2.1
SDL=libSDL-1.2.so.0.11.4

This is with revision 7173.


Jussi



On Sat, Jul 4, 2015 at 3:32 PM, Benoît Minisini <
gambas at ...1...> wrote:

> Le 30/06/2015 21:33, Adrien Prokopowicz a écrit :
> >
> > Well, I think the only reliable way to tell is to actually check the
> > session bus to see if the StatusNotifierHost is present.
> >
> > What don't you like in having to load gb.dbus to do the check ?
> > I understand you don't want to load the component "for nothing" if
> > the check fails, but in some way it is also loaded whether or not
> > you are using TrayIcons in your programs, so ...
> >
> > There are so many cases to test, I feel that if we somehow sort it out,
> > the whole environment-testing/dynamic-loading process would be
> > way cooler than the final TrayIcon feature itself. :)
> > (Not mentioning the work already done for that, i.e. the whole DBus
> > overhaul, and the "Optional Classes" interpreter feature, which
> > are both really cool).
>
> Done in the last revisions: now the trayicon is managed by a dedicated
> component, 'gb.gui.trayicon', that loads 'gb.dbus', check if a
> StatusNotifierHost has been registered. If yes, it loads
> 'gb.dbus.trayicon', otherwise it lets the gui component declare the old
> implementation.
>
> >
> >> In the meantime I investigated with Unity... They actually use a DBus
> >> protocol completly different from the KDE one, but apparently QT apps
> >> using sni-qt (like vlc) know how to deal with that. I will try to look
> >> into the sni-qt source code to understand the magic behind that.
> >>
> >> Of course, don't expect to find any good documentation about that Unity
> >> protocol (a.k.a. libappindicator).
> >>
> >
> >   From what I've saw in the sni-qt source code, it only relies on the
> > Unity-like protocol (which is also supported by KDE) :
> > the path sent to the StatusNotifierWatcher is hard-coded to be
> > "/org/kde/statusnotifieritem/<id>".
> >
> > Also, if you need me to test some more things, just tell. :)
>
> The Unity and KDE protocol are actually really different: Unity requires
> a status icon to have a menu, otherwise it does not display it. As soon
> as your application has more than one icon, you have to use a completely
> different way of declaring your DBus objects between Unity and KDE...
>
> 'appindicator', 'statusnotifier' and 'dbusmenu' are really three pieces
> of badly designed almost undocumented shit that required me one week of
> reverse engineering! But now it works more or less, so I'm happy. :-)
>
> --
> Benoît Minisini
>
>
> ------------------------------------------------------------------------------
> Don't Limit Your Business. Reach for the Cloud.
> GigeNET's Cloud Solutions provide you with the tools and support that
> you need to offload your IT needs and focus on growing your business.
> Configured For All Businesses. Start Your Cloud Today.
> https://www.gigenetcloud.com/
> _______________________________________________
> Gambas-user mailing list
> Gambas-user at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gambas-user
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: GAlarm-0.1.53.tar.gz
Type: application/x-gzip
Size: 43094 bytes
Desc: not available
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20150705/271e5702/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Screenshot from 2015-07-05 22:24:14.png
Type: image/png
Size: 13160 bytes
Desc: not available
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20150705/271e5702/attachment.png>


More information about the User mailing list