14.04 libmessaging-menu lacks an example of how to use the features that used to be provided by python-indicate in 12.04

Bug #1315384 reported by Jochen Fahrner
56
This bug affects 31 people
Affects Status Importance Assigned to Milestone
Messaging Menu
In Progress
Low
Charles Kerr
indicator-messages (Ubuntu)
Fix Released
Undecided
Unassigned
libindicate (Ubuntu)
Won't Fix
Undecided
Unassigned

Bug Description

Install python-indicate and libindicate-doc. Run:

python /usr/share/doc/libindicate/examples/im-client.py

An entry should appear in message indicator, but does not. That worked in 12.04 but is broken in 14.04.

ProblemType: Bug
DistroRelease: Ubuntu 14.04
Package: python-indicate 12.10.1-0ubuntu3
ProcVersionSignature: Ubuntu 3.13.0-24.46-generic 3.13.9
Uname: Linux 3.13.0-24-generic x86_64
ApportVersion: 2.14.1-0ubuntu3
Architecture: amd64
CurrentDesktop: Unity
Date: Fri May 2 15:22:27 2014
InstallationDate: Installed on 2014-05-01 (1 days ago)
InstallationMedia: Ubuntu 14.04 LTS "Trusty Tahr" - Release amd64 (20140417)
SourcePackage: libindicate
UpgradeStatus: No upgrade log present (probably fresh install)

Related branches

Revision history for this message
Jochen Fahrner (jofa) wrote :
Revision history for this message
Noseong Park (behack) wrote :

This is true. I also have the same problem. Please correct this.

Revision history for this message
Jochen Fahrner (jofa) wrote :

Noseong, please mark this bug that it affects you (at the left top), so it gets confirmed.

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in libindicate (Ubuntu):
status: New → Confirmed
Revision history for this message
Lukas (lukas-ribisch) wrote :

I was able to reproduce the bug both using the mentioned demo (im-client.py) and by using the Gajim libnotify plugin - neither works.

Revision history for this message
Noseong Park (behack) wrote :

Because of this bug, gm-notify indicator is not shown.

Changed in libindicate:
status: New → Confirmed
Revision history for this message
Lars Karlitski (larsu) wrote :

libindicate has been deprecated in favor of libmessaging-menu in Quantal (12.10), becasue we couldn't use libindicate on the phone. Porting to libmessaging-menu is fairly simple. Let me know if you need any pointers.

Note that this might change again when we switch to Unity8, which will most likely have a Qt/QML API as part of the SDK. Sorry about that.

Revision history for this message
Jochen Fahrner (jofa) wrote :

Lars, do you have some pointer how libmessaging-menu is used in python? I will try to port the Gajim plugin "Ubuntu Ayatana Integration" to libmessaging-menu.

Revision history for this message
Noseong Park (behack) wrote :

Please teach me. I will port gm-notify to libmessaging-menu.

Revision history for this message
Noseong Park (behack) wrote :

There is no python binding yet for libmessaging-menu.

Revision history for this message
Jochen Fahrner (jofa) wrote :

Noseong, here is a demo in python:
https://bugs.launchpad.net/ubuntu/+source/indicator-messages/+bug/1040259/comments/17

But I need more documentation about that.

Revision history for this message
Jochen Fahrner (jofa) wrote :

The link above does not show the attachment. See here at comment #17
https://bugs.launchpad.net/ubuntu/+source/indicator-messages/+bug/1040259

Revision history for this message
Noseong Park (behack) wrote :

I could make the gm-notify work well after creating a python wrapper library of libmessaging-menu. Please see https://bugs.launchpad.net/ubuntu/+source/gm-notify/+bug/1310490

Revision history for this message
Lars Karlitski (larsu) wrote :

libmessaging-menu already comes with python bindings through gobject-introspection. Unfortunately the online documentation seems to have been taken down. The libmessaging-menu-dev package contains the C documentation (viewable with devhelp), which maps 1:1 to the python API.

Here's a simple example:

from gi.repository import GLib, Gio, MessagingMenu

mmapp = MessagingMenu.App(desktop_id='my-app.desktop')

# make the application appear in the messaging menu. The name and icon are taken from the desktop file above
mmapp.register()

def source_activated(mmapp, source_id):
  print('source {} activated'.format(source_id))

# do something when the user clicks on a source. The source will be removed automatically
mmapp.connect('activate-source', source_activated)

# add a 'source' (a menu item below the application's name) with the name 'Inbox' and a count of 7
icon = Gio.ThemedIcon.new_with_default_fallbacks('my-source-icon')
mmapp.append_source_with_count('inbox', icon, 'Inbox', 7)

# this is not necessary for gtk applications, which start a mainloop in gtk_main()
GLib.MainLoop().run()

Revision history for this message
Jochen Fahrner (jofa) wrote :

Lars, when I run that code standalone it works. But when I do the import MessagingMenu from within a Gajim plugin, I get an ImportError exception. Any ideas what's wrong there?

Charles Kerr (charlesk)
summary: - python-indicate not showing up in message indictor
+ python-indicate not showing up in message indicator
Revision history for this message
Lars Karlitski (larsu) wrote : Re: python-indicate not showing up in message indicator

Jochen: that's strange. Do you import it like other gobject-introspection modules?

  from gi.repository import MessagingMenu

Feel free to ping me about this on freenode (larsu in #ubuntu-desktop).

Revision history for this message
Jochen Fahrner (jofa) wrote :

Yes, I did it the same way. I asked that question to Gajim developers and they answered, it could be because Gajim uses GTK2, while Unity is using GTK3.

Is there some documentation how messaging menu can be used in GTK2? Or is this not possible?

BTW: if python-indicate is no longer working in Trusty, you should remove the package.

Revision history for this message
Lars Karlitski (larsu) wrote :

libmessaging-menu doesn't depend on gtk. It shouldn't matter which gtk version you use as long as glib is up to date.

I agree that the package should be removed.

Revision history for this message
Charles Kerr (charlesk) wrote :

Reassigning to python-indicate since this isn't a bug in libindicate.

Revision history for this message
Charles Kerr (charlesk) wrote :

Ah, for some reason I thought that python-indicate was coming from outside of that repo.

So instead I'm marking as wontfix since libindicate is dead. :)

Possibly Lars' example in comment:14 should be added to a README or examples file in indicator-messages...

Changed in libindicate (Ubuntu):
status: Confirmed → Won't Fix
Changed in libindicate:
status: Confirmed → Won't Fix
summary: - python-indicate not showing up in message indicator
+ python-indicate doesn't work in 14.04
Charles Kerr (charlesk)
affects: libindicate → indicator-messages
Revision history for this message
Jochen Fahrner (jofa) wrote : Re: python-indicate doesn't work in 14.04

Charles, if libindicate ist dead, please remove this package and all dependent packages. It makes no sense to keep non working packages! It confuses everybody.

Canonical should make it clear that libindicate does not longer exist.

Charles Kerr (charlesk)
summary: - python-indicate doesn't work in 14.04
+ 14.04 libmessaging-menu lacks an example of how to use the features that
+ used to be provided by python-indicate in 12.04
Changed in indicator-messages:
status: Won't Fix → In Progress
importance: Undecided → Low
assignee: nobody → Charles Kerr (charlesk)
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package indicator-messages - 13.10.1+14.10.20140611-0ubuntu1

---------------
indicator-messages (13.10.1+14.10.20140611-0ubuntu1) utopic; urgency=low

  [ Charles Kerr ]
  * Add example of using libmessaging-menu from a python client (LP:
    #1315384)
 -- Ubuntu daily release <email address hidden> Wed, 11 Jun 2014 17:23:06 +0000

Changed in indicator-messages (Ubuntu):
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.