add a unity indicator applet

Bug #1174755 reported by Martin Bruns
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Tunnel Manager
Fix Released
Wishlist
Brandon Williams

Bug Description

Hi,

would be nice to have a unit indicator applet for ubuntu 13.04 and higher.

Kind Regards
M

Tags: wishlist
Revision history for this message
Brandon Williams (opensource-subakutty) wrote :

I don't want to limit usability for those who don't use unity, and so don't want to drop the existing status icon. If I can find a way to figure out which one to use, then I might do add an indicator in the near future.

Why do you specifically reference "13.04 and higher"? Does unity no longer support regular status icons? I'm still running 12.04 myself.

Changed in tunnelmanager:
importance: Undecided → Wishlist
status: New → Confirmed
assignee: nobody → Brandon Williams (opensource-subakutty)
Revision history for this message
Brandon Williams (opensource-subakutty) wrote :

Looking at the release notes for 13.04, I see the problem now. Ubuntu has decided to make it harder for application developers to right programs that work well outside of an Ubuntu environment. We now have to write special indicator code to make it work on Ubuntu and still maintain statusicon code to provide the same functionality for non-Unity platforms. Seems like the opposite of "Unity" to me.

Oh well, I'll try to take of this in the not-too-distant future.

At least it should be enough to branch based on the availability of the appindicator python module. The indicator module understands that it should fall back to a statusicon if the appindicator subsystem is not present.

Revision history for this message
Brandon Williams (opensource-subakutty) wrote :

Committed a fix in revision 74.

Changed in tunnelmanager:
status: Confirmed → Fix Committed
Revision history for this message
Brandon Williams (opensource-subakutty) wrote :

Committed a fix to the fix in revision 75.

Changed in tunnelmanager:
status: Fix Committed → Fix Released
Revision history for this message
Martin Bruns (martin-konahina) wrote :

Since Ubuntu 13.10 this is nolonger working.

The menu of the indicator does not show up.

Revision history for this message
Brandon Williams (opensource-subakutty) wrote :

Martin,

Please try starting the application from the command line and attempt to use the indicator. Is there any useful error output? I'm guessing that they must have changed something about the interface, and hopefully whatever it is can be identified from the error output.

Thanks,
--Brandon

Revision history for this message
Brandon Williams (opensource-subakutty) wrote :

Changed status to "incomplete" while I wait for further information. I don't have an install of 13.10 to test/debug with.

Changed in tunnelmanager:
status: Fix Released → Incomplete
Revision history for this message
Martin Bruns (martin-konahina) wrote :

Hi Brandon,

there is one line poping up if I enable the icon in the systray (the one with self.menu at the end),

and there is one line popping up in case I right click on the systray icon (the one with We're ignoring it. at the end).

: ~ $ tunnelmanager
/usr/lib/python2.7/dist-packages/TunnelManager/StatusIcon.py:72: Warning: /build/buildd/glib2.0-2.38.0/./gobject/gsignal.c:2475: signal 'child-added' is invalid for instance '0x1766790' of type 'GtkMenu'
  self.indicator.set_menu(self.menu)

(tunnelmanager:30264): LIBDBUSMENU-GLIB-WARNING **: About to Show called on an item wihtout submenus. We're ignoring it.

(tunnelmanager:30264): LIBDBUSMENU-GLIB-WARNING **: About to Show called on an item wihtout submenus. We're ignoring it.
/usr/lib/python2.7/dist-packages/TunnelManager/StatusIcon.py:72: Warning: /build/buildd/glib2.0-2.38.0/./gobject/gsignal.c:2475: signal 'child-added' is invalid for instance '0x1766c70' of type 'GtkMenu'
  self.indicator.set_menu(self.menu)

(tunnelmanager:30264): LIBDBUSMENU-GLIB-WARNING **: About to Show called on an item wihtout submenus. We're ignoring it.

(tunnelmanager:30264): LIBDBUSMENU-GLIB-WARNING **: About to Show called on an item wihtout submenus. We're ignoring it.

Kind Regards
Martin

Revision history for this message
Brandon Williams (opensource-subakutty) wrote :

Thanks. That was very helpful. Looks like the problem is libappindicator bug 1203888.

Revision history for this message
Brandon Williams (opensource-subakutty) wrote :

Please download the attached indicator.py and execute it from the command line.

It will generate an indicator with the envelope icon. If you click the indicator, it will show a menu that includes an item to reload the menu. Click that, and you should see output describing a bunch of gtk.MenuItem objects that are being removed from the menu when it gets reloaded. If you click the indicator again, you should see the menu.

Please let me know whether this test app appears to work. If it does, then I think I have a simple one-line fix that I can submit to work around the recent breakage in libappindicator.

Revision history for this message
Martin Bruns (martin-konahina) wrote :

Hi,

it is working fine as long as I do NOT click the reload menu entry.

was that your expectation?

python ./Downloads/indicator.py
load
./Downloads/indicator.py:34: Warning: /build/buildd/glib2.0-2.38.0/./gobject/gsignal.c:2475: signal 'child-added' is invalid for instance '0x2e6a130' of type 'GtkMenu'
  ind.set_menu(menu)
Test-undermenu - 0
Test-undermenu - 1
Test-undermenu - 2
Test-undermenu - 4
Test-undermenu - 5
Test-undermenu - 6
Test-undermenu - 0
Test-undermenu - 1
reload
<gtk.MenuItem object at 0x2d2b050 (GtkMenuItem at 0x2e6f020)>
<gtk.MenuItem object at 0x2d2b050 (GtkMenuItem at 0x2e6f0d0)>
<gtk.MenuItem object at 0x2d2b050 (GtkMenuItem at 0x2e6f180)>
<gtk.MenuItem object at 0x2d25fa0 (GtkMenuItem at 0x2e6f230)>
<gtk.MenuItem object at 0x2d2b050 (GtkMenuItem at 0x2e6f2e0)>
<gtk.MenuItem object at 0x2d2b050 (GtkMenuItem at 0x2e6f390)>
<gtk.MenuItem object at 0x2d2b050 (GtkMenuItem at 0x2e6f440)>

(indicator.py:13171): LIBDBUSMENU-GLIB-WARNING **: About to Show called on an item wihtout submenus. We're ignoring it.
^CTraceback (most recent call last):
  File "./Downloads/indicator.py", line 49, in <module>
    gtk.main()
KeyboardInterrupt

Kind Regards
Martin

Revision history for this message
Brandon Williams (opensource-subakutty) wrote :

It's my intention that clicking reload menu will rebuild the menu. The output shows that the reload callback ran. What happens when you click reload? Do you end up with no menu content after clicking that item? If that's the case, then I'll have to do something a bit more.

Revision history for this message
Martin Bruns (martin-konahina) wrote :

HI,

yes the menu does not work anymore when I click on the reload menuitem.

Basically it is fine as long as I'm not clicking reload. When I click on reload then the problem is as with the current version of the tunnelmanager.

M

Revision history for this message
Brandon Williams (opensource-subakutty) wrote :

Thanks for your continued help in trying to resolve this.

I've uploaded another test script. The indicator menu with this one has three different reload items.

1. the one that we've already tried; not working
2. a variation on #1 that probably won't work, but it's worth a try
3. completely replace the existing menu with a new one

I think #3 is the one that's most likely to work, and #2 is less likely, but would be nice since it's a little closer to how it's currently implemented.

If you could give these new attempts a try I would appreciate it.

Revision history for this message
Martin Bruns (martin-konahina) wrote :

Hi Brandon,

only menu 3 is working.

reload-3
./indicator_001.py:65: Warning: /build/buildd/glib2.0-2.38.0/./gobject/gsignal.c:2475: signal 'child-added' is invalid for instance '0x29307b0' of type 'GtkMenu'
  ind.set_menu(menu)
reload-3
./indicator_001.py:65: Warning: /build/buildd/glib2.0-2.38.0/./gobject/gsignal.c:2475: signal 'child-added' is invalid for instance '0x2930950' of type 'GtkMenu'
  ind.set_menu(menu)
reload-3
./indicator_001.py:65: Warning: /build/buildd/glib2.0-2.38.0/./gobject/gsignal.c:2475: signal 'child-added' is invalid for instance '0x2930af0' of type 'GtkMenu'
  ind.set_menu(menu)

reload-2
<gtk.MenuItem object at 0x27f3a50 (GtkMenuItem at 0x295fd00)>
<gtk.MenuItem object at 0x27ecf50 (GtkMenuItem at 0x295fdb0)>
<gtk.MenuItem object at 0x27f3a50 (GtkMenuItem at 0x295fe60)>

(indicator_001.py:4610): LIBDBUSMENU-GLIB-WARNING **: About to Show called on an item wihtout submenus. We're ignoring it.

(indicator_001.py:4610): LIBDBUSMENU-GLIB-WARNING **: About to Show called on an item wihtout submenus. We're ignoring it.

Kind Regards
Martin

Revision history for this message
Brandon Williams (opensource-subakutty) wrote :

As long as one of them is working, then I've got a fix I can implement. I'll try to take care of that at some point over the coming week.

Thanks for your help Martin!

Revision history for this message
Brandon Williams (opensource-subakutty) wrote :

I have just uploaded tunnelmanager-0.7.7.2 to the SSH Tunnel Manager downloads page. I think that it will work around the indicator menu issue. Please try it out when you have a chance and let me know if it works for you now. If it does, I'll submit the changes to the repository and upload the new package to my PPA.

Changed in tunnelmanager:
status: Incomplete → In Progress
Revision history for this message
Martin Bruns (martin-konahina) wrote :

HI,

it is working now with version 0.7.7.2.

Thanks
M

Revision history for this message
Brandon Williams (opensource-subakutty) wrote :

Thanks for all your help!

I've submitted the new version to my ppa and pushed the code changes to launchpad.

Changed in tunnelmanager:
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

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