After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 619818 - Port applets to libpanel-applet3
Port applets to libpanel-applet3
Status: RESOLVED FIXED
Product: gnome-applets
Classification: Other
Component: general
unspecified
Other Linux
: Urgent major
: ---
Assigned To: gnome-applets Maintainers
gnome-applets Maintainers
: 571880 636478 (view as bug list)
Depends on: 619796 640968 645730
Blocks: 620830
 
 
Reported: 2010-05-27 12:35 UTC by Carlos Garcia Campos
Modified: 2011-09-08 19:04 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch to port null applet to new API (6.97 KB, patch)
2010-11-10 16:57 UTC, Rodrigo Moya
none Details | Review
Updated patch to add all deprecated BonoboId's (7.12 KB, patch)
2010-11-12 10:01 UTC, Rodrigo Moya
committed Details | Review

Description Carlos Garcia Campos 2010-05-27 12:35:26 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.
Comment 1 Simon Geard 2010-06-07 04:24:15 UTC
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...
Comment 2 Javier Jardón (IRC: jjardon) 2010-06-22 13:20:06 UTC
introspection support added to gnome-panel, see bug#622341
Comment 3 Carlos Garcia Campos 2010-06-25 14:01:49 UTC
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.
Comment 4 Callum McKenzie 2010-06-26 00:39:26 UTC
I'm looking at it now.
Comment 5 Callum McKenzie 2010-06-29 19:28:03 UTC
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.
Comment 6 Carlos Garcia Campos 2010-06-30 07:34:17 UTC
Yes, the FIXME is because battstat is using libgnome api which was removed as dependency, so it's actually another issue.
Comment 7 Vincent Untz 2010-07-13 12:09:11 UTC
Callum: any news on the review? Do you need help for this?
Comment 8 Callum McKenzie 2010-07-13 19:54:32 UTC
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.
Comment 9 Carlos Garcia Campos 2010-07-14 07:44:40 UTC
You don't really need a gnome3 environment, libpanel-applet-3 doesn't require gtk+ 3. You only need gnome-panel from git master.
Comment 10 Hussam Al-Tayeb 2010-08-03 00:27:23 UTC
If I may ask, will this patch make gnome 2.32 or postponed till 3.0?
Comment 11 Carlos Garcia Campos 2010-08-03 06:53:04 UTC
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?
Comment 12 Vincent Untz 2010-08-04 11:43:30 UTC
There's no reason to wait for GTK+ 3, and it'll be nice to have the dbus-based library for 2.32.
Comment 13 Hussam Al-Tayeb 2010-08-10 14:38:01 UTC
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?
Comment 14 Carlos Garcia Campos 2010-08-14 09:23:51 UTC
I've rebased the branch with current master:

http://cgit.freedesktop.org/~carlosgc/gnome-applets/log/?h=libpanel-applet-dbus-merge
Comment 15 Enrico Minack 2010-08-16 19:07:51 UTC
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.
Comment 16 Enrico Minack 2010-08-16 19:59:53 UTC
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.
Comment 17 Enrico Minack 2010-08-18 12:19:03 UTC
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.
Comment 18 Hussam Al-Tayeb 2010-08-18 14:07:53 UTC
(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.
Comment 19 Hussam Al-Tayeb 2010-08-18 14:39:30 UTC
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.
Comment 20 Carlos Garcia Campos 2010-08-18 14:40:23 UTC
I've just merged the libpanel-applet-dbus-merge branch into master.
Comment 21 Carlos Garcia Campos 2010-08-18 14:43:32 UTC
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.
Comment 22 Hussam Al-Tayeb 2010-08-18 14:55:38 UTC
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
Comment 23 Hussam Al-Tayeb 2010-08-18 15:29:42 UTC
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
Comment 24 Hussam Al-Tayeb 2010-08-18 15:51:05 UTC
Carlos, looks like only mini-commander and null_appler fail to build with libpanelappler-2.0 not found.
Comment 25 Enrico Minack 2010-08-18 15:52:18 UTC
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.
Comment 26 Enrico Minack 2010-08-18 16:08:55 UTC
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.
Comment 27 Enrico Minack 2010-08-18 17:04:49 UTC
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?
Comment 28 Vincent Untz 2010-08-18 17:11:07 UTC
(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])
Comment 29 Enrico Minack 2010-08-18 17:16:44 UTC
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.
Comment 30 Enrico Minack 2010-08-18 20:39:45 UTC
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?
Comment 31 Vincent Untz 2010-08-18 20:42:35 UTC
You need to update po/POTFILES.in and po/POTFILES.skip.
Comment 32 Enrico Minack 2010-08-21 11:05:00 UTC
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).
Comment 33 Javier Jardón (IRC: jjardon) 2010-09-11 13:17:21 UTC
*** Bug 571880 has been marked as a duplicate of this bug. ***
Comment 34 Javier Jardón (IRC: jjardon) 2010-09-11 13:17:47 UTC
Can this be closed, then?
Comment 35 Enrico Minack 2010-09-12 12:24:17 UTC
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.
Comment 36 Simon Geard 2010-09-14 09:02:28 UTC
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?
Comment 37 Hussam Al-Tayeb 2010-09-14 09:19:51 UTC
(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?
Comment 38 Hussam Al-Tayeb 2010-09-14 09:21:14 UTC
I meant if you compile gnome-panel "without" libpanelapplet-2.0
sorry for the typo.
Comment 39 Vincent Untz 2010-09-14 09:33:12 UTC
null_applet should be easily portable to libpanel-applet-3.0, I would guess.
Comment 40 Enrico Minack 2010-10-16 19:05:07 UTC
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?
Comment 41 André Klapper 2010-10-17 12:53:53 UTC
(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.
Comment 42 Rodrigo Moya 2010-11-10 16:57:13 UTC
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)?
Comment 43 Vincent Untz 2010-11-11 15:15:38 UTC
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.
Comment 44 Rodrigo Moya 2010-11-12 10:01:18 UTC
Created attachment 174314 [details] [review]
Updated patch to add all deprecated BonoboId's
Comment 45 Hussam Al-Tayeb 2010-11-15 05:41:58 UTC
mini commander appler installs /usr/lib/bonobo/servers/GNOME_MiniCommanderApplet.server
That means it needs to be ported as well?
Comment 46 Enrico Minack 2010-11-23 09:30:36 UTC
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?
Comment 47 Rodrigo Moya 2010-11-23 10:16:39 UTC
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
Comment 48 Enrico Minack 2010-11-30 14:52:29 UTC
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.
Comment 49 Rodrigo Moya 2010-12-01 09:04:08 UTC
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?
Comment 50 Vincent Untz 2011-01-03 06:12:56 UTC
*** Bug 636478 has been marked as a duplicate of this bug. ***
Comment 51 Kjartan Maraas 2011-01-08 22:23:01 UTC
I've commited the patch for null_applet. Looks like mini-commander also needs work though.
Comment 52 Javier Jardón (IRC: jjardon) 2011-02-11 11:49:12 UTC
What is remaining here?
Comment 53 Rodrigo Moya 2011-02-11 12:04:29 UTC
The invest applet part is what is missing.
Comment 54 Vincent Untz 2011-02-24 12:47:31 UTC
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)
Comment 55 André Klapper 2011-03-03 21:01:08 UTC
[Not a GNOME3 release blocker according to release team meeting on March 03, 2011. => Removing flag]
Comment 56 Enrico Minack 2011-04-16 10:34:34 UTC
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).
Comment 57 Enrico Minack 2011-05-07 22:42:30 UTC
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.
Comment 58 Enrico Minack 2011-05-07 22:44:03 UTC
Btw., this is what was needed to port the invest applet. Quite some changes...
http://git.gnome.org/browse/gnome-applets/commit/?id=92d0dcf62dfcd60c8e87f64213c14f7f786627fe
Comment 59 Kjartan Maraas 2011-05-26 13:43:04 UTC
Can we close this bug now then?
Comment 60 André Klapper 2011-09-08 13:11:23 UTC
Enrico: Can this be closed, or what is missing?
Comment 61 Enrico Minack 2011-09-08 19:04:55 UTC
I think this bug can finally be closed.