Monday, 6 May 2013

Re: Fwd: App indicators in Java

Hey Ted thanks for responding. So I've been trying some things by looking at the Ubuntu One source. I did succeed in getting a item in the sync menu. However I'm also trying to implement the on/off button. When its toggled it returns a <GParamBoolean 'paused'> but how do I access the state? I can't seem to get the value from it. So how would I do that.

Also when I toggle the button for the first time my app doesn't seem to get a signal. Only the times after that. Do I need to listen to it in another way? I'm using this at the moment:

self.app.connect("notify::paused", self.sync_stage_change)

Marlin


On Mon, May 6, 2013 at 5:57 AM, Ted Gould <ted@ubuntu.com> wrote:
On Sun, 2013-05-05 at 21:06 +0200, Marlin Cremers wrote:
I'm working on a Java application that needs to integrate with Ubuntu. Because there is not a nice way of integration with Unity I'm using a Python script that creates a app indicator. But I'm looking to integrate with the sync menu that came in Ubuntu 13.04. Is this possible in Python if so. How would I do that? 

For the Sync menu you can use libsync-menu1 to access it and add items.  You might also want to grab libsync-menu-dev.  For the Python bindings we're relying on GObject Introspection for them, so you can add the library like this:

from gi.repository import SyncMenu

You might also look at the Java project to provide GObject Introspection.  I haven't used it myself, but it looks like it's likely to have most of what you'd need completed already:

https://live.gnome.org/JGIR

Ted