BUG Community

Welcome! Log In

Forums BUG SDK IMenuProvider.registerMenu

Subscribe to IMenuProvider.registerMenu  19 posts, 6 voices

Log in to reply to this topic
 
Oct 15, 2007 10:28pm
Medium Bug Labs team finsprings 268 posts

I'm not sure I understand how IMenuProvider.registerMenu uses the path I give it. If I give it "BUGer" it ignores it and my menu item appears on the root menu. If I give it "Programs.BUGer" I see BUGer and Programs but I don't see my menu item under there, possible because there's other stuff already under there. Where would you expect user application menu items to live?
Oct 15, 2007 11:09pm
Medium Bug Labs team kgilmer 215 posts

Dave,

Yes you are correct. The com.buglabs.bug.program Servlet is contributing the entire Program menu and as such (the way it currently works) children of Programs cannot be added to by other bundles. To be honest I haven’t given much thought to where user application menus should go…perhaps a top level menu entitled User? I will bring this up in our next meeting. Feel free to do what you think makes the most sense.

Oct 16, 2007 6:45am
Medium Bug Labs team finsprings 268 posts

If I register a menu with a path of "Foo", shouldn’t that create a top-level menu called "Foo"?

Oct 16, 2007 5:16pm
Medium Bug Labs team kgilmer 215 posts

Dave,

Yes it should. The Menu Extender app on BUGnet uses this line to create a menu item:

menu.registerMenu("test", new SimpleMenuNode("test"));
Oct 16, 2007 5:29pm
Medium Bug Labs team finsprings 268 posts

So which of the two "test"s is it using in the top-level menu? It seems odd to have both if it’s only going to use one. I would read that line as creating a top-level menu called test from the path string, with a sub-item under it called test. I think it just creates a single top-level item called test though.

Oct 16, 2007 5:44pm
Medium Bug Labs team finsprings 268 posts

To be clear, if I do:

menu.registerMenu("foo", new SimpleMenuNode("bar"));

then I see a top-level menu item called "bar", and "foo" is ignored, whereas I would have expected to get a top-level entry called "foo" with a sub-entry under it called "bar".
Oct 17, 2007 12:38pm
Medium Bug Labs team kgilmer 215 posts

Dave, your expectations are correct. This is a defect :)

Oct 17, 2007 1:53pm
Img_missing_medium koolatron 52 posts

Yah, I played around with the MenuExtender app the first week I had my hands on the SDK. I wasn't able to get it to do anything really stunning - if you check out the source or browse the javadoc, you'll find that you can indeed register submenus by providing a complete path, a la:

menu.registerMenu("foo.baz", new SimpleMenuNode("bar"));

This creates a menu entry called "foo" in the root, with "baz" under it. "bar" is simply the name of the SimpleMenuNode, which doesn't seem to figure into the entire process much at all. Furthermore, since menu names don't seem to be unique, doing the following:

menu.registerMenu("foo.rab", new SimpleMenuNode("bar"));
menu.registerMenu("foo.baz", new SimpleMenuNode("bar"));


will cause two menus named "foo" to be added to the root, each with one child ("rab" and "baz"), instead of one "foo" with two children.
Oct 17, 2007 5:55pm
Img_missing_medium hzaida 38 posts

Hi Dave,

Thanks again for all of your hard work!

In order to keep track of the defects you are finding, can you please enter a defect report into Bugzilla?

http://bugbeta.com/wiki/index.php/Report_a_Defect

We do not want anything falling through the cracks. ;)

Thanks, Heather

Oct 17, 2007 6:23pm
Medium Bug Labs team finsprings 268 posts

Ok, Heather, bug 18 it is then:
http://bugbeta.com/bugzilla/show_bug.cgi?id=18
Oct 18, 2007 11:33am
Img_missing_medium hzaida 38 posts

Dave,

You rock! Thanks!

Jan 26, 2009 12:38pm
Img_missing_medium Kabada 13 posts

Using the Code from the GPSConfig and Menuextender Apps (which don’t work with the current Bugs) I tried to get my app to register a basic menu, to no avail.

Among the apps I’ve downloaded from BUGnet I haven’t seen even one that succesfully registers with the menu either.

Is the IMenuService not functional in the current production build??
If it is and it’s just me, could someone pls tell me which app on BUGnet has functioning menu registration code?

Jan 26, 2009 1:24pm
Medium Bug Labs team finsprings 268 posts

Kabada
Using the Code from the GPSConfig and Menuextender Apps (which don't work with the current Bugs)


I haven't had any trouble running GPSConfig. What version of the BUG firmware are you using? 1.3?
Jan 26, 2009 1:40pm
Medium Bug Labs team jconnolly 285 posts

Kabada
Using the Code from the GPSConfig and Menuextender Apps (which don't work with the current Bugs) I tried to get my app to register a basic menu, to no avail.


Hi Kabada, I tried GPSConfig on a R1.3 bug and found that the app was able to add a node to the menu. What version are you using? R1.3? One way to tell is ssh root@bug and type uname -a.
Jan 26, 2009 3:25pm
Img_missing_medium Kabada 13 posts

Linux bug 2.6.24.4 #68 PREEMPT Thu Oct 9 17:23:00 EDT 2008 armv6l unknown
That's what the console outputs. Seems to me that should be the 1.3 version.
We only got our 2 Bugs at the company delivered 2-3 weeks ago.
Jan 26, 2009 3:36pm
Medium Bug Labs team jconnolly 285 posts




Yes, you have a R1.3 bug. When you plug the BUGlocate module into the BUGbase, press the select button and the down navbutton, You should see GPS Config there. If not, please ssh into your bug and cat /var/log/concierge.log and post it. Thanks.
Jan 26, 2009 3:46pm
Img_missing_medium Kabada 13 posts

EDIT: OK, I got it to work now after deleting all of the other stuff on the Bug and physically restarting it (as opposed to the concierge restart via console). Sry for the trouble.

A related question: Is there an easy way to access the Menu on the large LCD Module screen? As in actually having the application appear under the Applications Tab of the Menu there?

Jan 26, 2009 4:02pm
Medium Bug Labs team jconnolly 285 posts

Kabada
EDIT: OK, I got it to work now after deleting all of the other stuff on the Bug and physically restarting it (as opposed to the concierge restart via console). Sry for the trouble.


Hm, you shouldn't need to restart concierge to get the menu node to appear...
Kabada

A related question: Is there an easy way to access the Menu on the large LCD Module screen? As in actually having the application appear under the Applications Tab of the Menu there?


You can edit things in the menu but managing the events requires interprocess communication between matchbox and the java runtime. This is not yet built into the API, but if you want to begin experimenting, the relevant files are in /usr/share/applications. You can test it out by navigating to the utilities menu then trying something like:

cp /usr/share/applications/matchbox-terminal.desktop /usr/share/applications/matchbox-terminal2.desktop

You should notice another icon show up for terminal. We're researching some solutions for this (such as java-dbus) to allow user apps to be notified of OS/desktop manager related events. You could however implement your own solution for this. I know I'd love to see it. :wink:
Jan 26, 2009 4:18pm
Img_missing_medium Kabada 13 posts

Thanks again for the quick replies.
I guess I’ll make do with the BaseLCD then, and play around with the easy stuff for a while :)

Log in to reply to this topic
Forums BUG SDK IMenuProvider.registerMenu

Powered by Community Engine