GNOME Bugzilla – Bug 619818
Port applets to libpanel-applet3
Last modified: 2011-09-08 19:04:55 UTC
Now that the dbus libpanel-applet port has been merged into git master, applets should be ported to the new API. I've already ported most of the applets, see this branch updated to current git master: http://cgit.freedesktop.org/~carlosgc/gnome-applets/log/?h=libpanel-applet-dbus-merge python applets like invest-applet depend on bug #619796.
Rather than updating the gnome-python-desktop bindings, wouldn't it make more sense to provide gobject-introspection support for libpanel-applet, and migrate the Python applets to use PyGI instead? That seems to be the direction Python bindings are going, these days...
introspection support added to gnome-panel, see bug#622341
Could someone review the branch, please? It would be nice to merge it for 2.31.4, gnome-panel still supports bonobo applets, so python applets should still work.
I'm looking at it now.
The patch generally looks fine (aside from the obvious FIXMEs around gnome_trigger_do() which I'm not sure worked anyway), but I haven't actually tested it yet since jhbuild is playing silly buggers on me.
Yes, the FIXME is because battstat is using libgnome api which was removed as dependency, so it's actually another issue.
Callum: any news on the review? Do you need help for this?
A dislocated finger has been reducing my incentive to type at the end of the day, so I haven't got very far with it. The patch looks OK and I have got it to compile OK, but I'm still in the process of setting up a gnome3 environment to run it in. If someone can confirm it actually runs, I'd be happy about it being committed to master.
You don't really need a gnome3 environment, libpanel-applet-3 doesn't require gtk+ 3. You only need gnome-panel from git master.
If I may ask, will this patch make gnome 2.32 or postponed till 3.0?
It doesn't depend on gtk3 so there's no need to delay this. I guess it depends on what the panel is going to do, if gnome-panel 2.32 is released from 2.30 branch we'll have to wait or merge this into master and release 2.32 from 2.30 branch too. But gnome-panel doesn't depend on gtk3 either so, vuntz?
There's no reason to wait for GTK+ 3, and it'll be nice to have the dbus-based library for 2.32.
Small request: can the changes in git.gnome.org/cgit/gnome-applets head branch be merged into http://cgit.freedesktop.org/~carlosgc/gnome-applets/log/?h=libpanel-applet-dbus-merge so that people can test this?
I've rebased the branch with current master: http://cgit.freedesktop.org/~carlosgc/gnome-applets/log/?h=libpanel-applet-dbus-merge
I tested the libpanel-applet-dbus-merge branch with current gnome-panel master. I tested most of the applets, those that compile by default: - geyes - sticky notes - trash - gweather - accessx-status - cpufreq - char picker - battstat - invest I can confirm that these applets work with the current gnome-panel master, i.e., they show up in the panel and can be used. First, I deinstalled gnome-applets. Then I compiled and installed gnome-panel and gnome-applets, started the panel with gnome-panel --replace, and added above applets to the panel.
I have to add that the drive mount applet was loaded without a problem, but it did not show an icon. I don't know if this is the usual behavior.
I repeated the tests in the same way as noted above. After the previous test screwed up my original panel (re-installing did not help), I moved to another virtual box and use snapshots now. Now I also got mini-commander and mixer-applet compiled. However, I could not get the modem-lights applet compiled. The configure script seems to deactivate it in any case. When adding the mini commander to the panel, it does not show up, there is no error reported on console or in a dialog. There is also no respective process running. The multiload applet loads, but the applet shows something only for a moment. With right-clicking on the proper region I could get into the properties dialog. There: - No resource is selected by default (this is why nothing is shown). - The processor is grayed out and not selected so its selection cannot be changed (probably it should be activated by default). - Selecting resources displays respective chart, but it is completely black, because background and plot color are both black. - Actually, all colors are set to black. When modified, charts work fine. So there seems to be a default settings problem with this applet. All other applets show up nicely and work (from a superficial point of view). With the broken ones, I could not find any problem from looking at the diffs.
(In reply to comment #11) > It doesn't depend on gtk3 so there's no need to delay this. I guess it depends > on what the panel is going to do, if gnome-panel 2.32 is released from 2.30 > branch we'll have to wait or merge this into master and release 2.32 from 2.30 > branch too. But gnome-panel doesn't depend on gtk3 either so, vuntz? Actually the applets from gnome-applets 2.30 will work still on gnome-panel 2.31.91 from Git head.
test results: 1) configure: error: invalid feature name: battstat=yes configure: error: invalid feature name: cpufreq=yes eventhough --disable-battstat and --disable-cpufreq are configure options (I'm on a desktop so these applets aren't necessary). 2) mixer applet works! that's one of the important ones. 3) minicommander applet doesn't show in panel. I'm not sure if it loaded or not. 4) system monitor applet works.
I've just merged the libpanel-applet-dbus-merge branch into master.
I've also noticed that sometimes after adding an applet it doesn't appear in the panel, killing the panel so that it's reloaded, makes the applet visible again, so I think it's a gnome-panel issue.
If I build gnome-panel without bonobo support, gnome-applets won't build configure: error: Package requirements (libpanelapplet-2.0 >= 2.13.4) were not met: No package 'libpanelapplet-2.0' found
if I edit out libpanelapplet-2.0 from gnome-applets configure.in I get: null_applet.c:27:21: fatal error: gtk/gtk.h: No such file or directory
Carlos, looks like only mini-commander and null_appler fail to build with libpanelappler-2.0 not found.
Make distcheck does not work with the recently merged code. The mini-commander does not find a file in this case. I cannot find a way to fix this right now.
The file mini-commander/src/org.gnome.panel.applet.MiniCommanderAppletFactory.service.in is not copied during distcheck into gnome-applets-2.31.*/_build/mini-commander/src, and I have no idea why it is working for all other applets but not for this one. I do not see how to correct this in the Makefile.am files. The file is listed in EXTRA_DIST, so it should be copied.
The reason is that tar stops archiving the dist files because the above mentioned file is too long (max. 99 chars allowed). Any idea how to fix this?
(In reply to comment #27) > The reason is that tar stops archiving the dist files because the above > mentioned file is too long (max. 99 chars allowed). Any idea how to fix this? In configure.in, use the tar-ustar option for AM_INIT_AUTOMAKE. Here's an example: AM_INIT_AUTOMAKE([1.9 no-dist-gzip dist-bzip2 tar-ustar -Wno-portability])
Yes, I just found that: http://noisebleed.blogetery.com/2010/02/27/tar-file-name-is-too-long-max-99/ So I guess moving gnome-applets from automake 1.8 to 1.9 in order to use this option is ok. I will then do that now.
I still cannot make distcheck. All po/*.po files contain references to */GNOME_*Applet.xml files, which do not exist anymore. But distcheck somehow looks for those files, and this is the only place they are mentioned anymore. But I do not know how to update those .po files, i.e., how to regenerate them on the current code so that the removed files disappear. Any help?
You need to update po/POTFILES.in and po/POTFILES.skip.
Thanks a lot for the help, I made it in time. The gnome-applets with the dbus-merge were released as 2.31.90.1 in the Gnome 2.31.90 release (1st beta of 2.32).
*** Bug 571880 has been marked as a duplicate of this bug. ***
Can this be closed, then?
Well, the invest-applet is not yet using the new API. I think I will work on that after the 2.32 release. If this bug does not depend on that, I think it can be closed.
One quick question, speaking as an LFS user who'd rather not build libbonobo and friends unnecessarily. If invest-applet is now the only thing still requiring the libpanelapplet-2.0 API, would it be reasonable to simply not build that applet if gnome-panel has been built without it? Is that something that could be slipped in before 2.32? Or if too late, for 2.32.1?
(In reply to comment #36) > One quick question, speaking as an LFS user who'd rather not build libbonobo > and friends unnecessarily. If invest-applet is now the only thing still > requiring the libpanelapplet-2.0 API, would it be reasonable to simply not > build that applet if gnome-panel has been built without it? > > Is that something that could be slipped in before 2.32? Or if too late, for > 2.32.1? at least null_applet and mini-commander will fail to build if you build compile gnome-panel with libpanelapplet-2.0 and hack out the dependency of libpanelapplet-2.0 from gnome-applets. I'm just a user like yourself. However, it will automatically disable invest applet from building. Can a developer check why this happens?
I meant if you compile gnome-panel "without" libpanelapplet-2.0 sorry for the typo.
null_applet should be easily portable to libpanel-applet-3.0, I would guess.
I am currently working on the invest migration to lib panel applet 3, but for this I need the respective python bindings. How do I get them?
(In reply to comment #40) > I am currently working on the invest migration to lib panel applet 3, but for > this I need the respective python bindings. How do I get them? Via introspection in recent PyGtk.
Created attachment 174207 [details] [review] Patch to port null applet to new API This only ports it to use the new API, but while writing the patch, I came to the oafiid's thing. So, since we won't be having applets loaded via Bonobo, should we just remove that list and start over? That is, no deprecated applets now, and we'll be adding the newly deprecated ones (in the future)?
Rodrigo: you can simulate applets loaded via bonobo with the BonoboId key in the .panel-applet file. This is what you likely need to keep the current feature. See /usr/share/gnome-panel/applets/org.gnome.panel.Wncklet.panel-applet for an example.
Created attachment 174314 [details] [review] Updated patch to add all deprecated BonoboId's
mini commander appler installs /usr/lib/bonobo/servers/GNOME_MiniCommanderApplet.server That means it needs to be ported as well?
I have a problem with migrating the invest applet to libpanel-applet3. Simply creating a new PanelApplet.Applet() causes a segfault: import pygtk pygtk.require('2.0') from gi.repository import PanelApplet if __name__ == '__main__': applet = PanelApplet.Applet() has the following output: .../testapp.py:6: Warning: g_closure_set_marshal: assertion `closure != NULL' failed applet = PanelApplet.Applet() (testapp.py:9042): GLib-GIO-CRITICAL **: g_dbus_connection_register_object: assertion `G_IS_DBUS_CONNECTION (connection)' failed Segmentation fault What is the matter here?
Sorry Enrico, I should have told you: I'm working on fixing the null applet and the invest applet to use the new libpanel-applet. The null applet seems to work ok, but are not that lucky yet with the invest applet. So, I've just pushed my work to wip/dont-use-deprecated (http://git.gnome.org/browse/gnome-applets/log/?h=wip/dont-use-deprecated) I think you need to use PanelApplet.Applet.factory_main rather than creating the PanelApplet yourself, but that doesn't work for me neither, so please have a look at the branch I just pushed
Does that branch work for you? On my system it freezes with warnings: ./invest-applet.py -w -d Running uninstalled invest, modifying PYTHONPATH 2010-11-30 15:50:10.640267: Debugging enabled 2010-11-30 15:50:10.640529: Data Dir: /usr/share/gnome-applets/invest-applet 2010-11-30 15:50:10.640592: Detected PROXY: None /usr/lib/pymodules/python2.6/gtk-2.0/gi/module.py:121: Warning: cannot register existing type `GtkWidget' g_type = info.get_g_type() /usr/lib/pymodules/python2.6/gtk-2.0/gi/module.py:121: Warning: g_type_add_interface_static: assertion `G_TYPE_IS_INSTANTIATABLE (instance_type)' failed g_type = info.get_g_type() /usr/lib/pymodules/python2.6/gtk-2.0/gi/module.py:121: Warning: cannot register existing type `GtkBuildable' g_type = info.get_g_type() /usr/lib/pymodules/python2.6/gtk-2.0/gi/module.py:121: Warning: g_type_interface_add_prerequisite: assertion `G_TYPE_IS_INTERFACE (interface_type)' failed g_type = info.get_g_type() /usr/lib/pymodules/python2.6/gtk-2.0/gi/module.py:121: Warning: g_once_init_leave: assertion `initialization_value != 0' failed g_type = info.get_g_type() /usr/lib/pymodules/python2.6/gtk-2.0/gi/module.py:125: Warning: g_type_get_qdata: assertion `node != NULL' failed type_ = g_type.pytype The applet dumps the warnings at this line app = Gtk.Window(Gtk.WindowType.toplevel) and then freezes.
It doesn't work for me, but I don't get those errors. I get though a: AttributeError: type object 'GtkWindowType' has no attribute 'toplevel' even though, after looking at the gir from GTK, that's how the GTK_WINDOW_TOPLEVEL enum value is generated. Also, please note that you need the latest commit to gnome-panel, which I pushed to fix the generation of factory_main. Also, does the null_applet part look ok to you in that branch? If so, can we push it to master?
*** Bug 636478 has been marked as a duplicate of this bug. ***
I've commited the patch for null_applet. Looks like mini-commander also needs work though.
What is remaining here?
The invest applet part is what is missing.
Here's how to write an applet in python (to help port invest applet): from gi.repository import Gtk from gi.repository import PanelApplet def applet_fill(applet): label = Gtk.Label("My applet in Python") applet.add(label) applet.show_all() def applet_factory(applet, iid, data): if iid != "TestApplet": return False applet_fill(applet) return True PanelApplet.Applet.factory_main("TestAppletFactory", PanelApplet.Applet.__gtype__, applet_factory, None)
[Not a GNOME3 release blocker according to release team meeting on March 03, 2011. => Removing flag]
I want to give you an update on the gnome-applets migration to libpanel-applet3. The invest applet is migrated and mainly working. You can find the latest version in the wip/dont-use-deprecated branch. The packaging of gnome-applets also works, but I had to deactivate mixer-applet and mini-commander from packaging as they currently do not compile. I will create bug reports for those soon. I am heading with this work for the Gnome 3.1 release as I think bringing the gnome-applets back to Gnome for 3.0 is not be possible (due to organizational and time contraints).
I have merged the wip/dont-use-deprecated branch that were used to port the invest applet to libpanel-applet3 and gtk3 into git master. The applet nicely works for me, also does distcheck work again, the first time since the 2.91.3 release. Please test the invest applet and all others.
Btw., this is what was needed to port the invest applet. Quite some changes... http://git.gnome.org/browse/gnome-applets/commit/?id=92d0dcf62dfcd60c8e87f64213c14f7f786627fe
Can we close this bug now then?
Enrico: Can this be closed, or what is missing?
I think this bug can finally be closed.