View Single Post
Posts: 55 | Thanked: 72 times | Joined on Nov 2009
#10
Originally Posted by x-rated View Post
- What's the <po> tag anyway?
The <po> tag specifies a gettext translation domain. Software that provides support for multiple languages needs some way to look up the correct strings to use for specific messages in the current language. gettext represents one of the most popular such systems (by far the most popular in the Linux and FOSS world, and on other UNIX systems). gettext can take a string like "powerup_memainmenu_poweroff" (which appears in the "name" attribute of one of the default menuitem entries) and turn it into "Switch off!" in English. <po>osso-powerup-shutdown</po> tells systemui to go look in the osso-powerup-shutdown translation files, such as /usr/share/locale/en_US/LC_MESSAGES/osso-powerup-shutdown.mo . The abbreviation "po" comes from the file extension .po used as the source of the translation files; the .mo files represent a compressed format used to minimize storage space and make string lookups fast. For an example of a .po file, you can look at the osso-powerup-shutdown.po file that the systemui strings come from. For more information on gettext, check out the gettext manual.

Originally Posted by x-rated View Post
- Are those <title> and <po> in the beginning of systemui.xml (but not callui.xml) used for something?
I wondered that myself. powerup_application_title doesn't appear in any .mo file on my N900.

Originally Posted by x-rated View Post
- How exactly does this <callback> work, what do the parameters mean?
<callback> makes a D-Bus call. The attributes on that tag specify the interface to use and the method to call on that interface, and the <argument> child elements of <callback> specify the arguments of that method. For more information on D-Bus, take a look at http://dbus.freedesktop.org/doc/dbus-tutorial.html , and for some examples of some of the D-Bus methods supported by the phone, look at http://wiki.maemo.org/Phone_control .

For another example of <callback>, and a worked example of creating a menu item that uses most of the systemui features, take a look at my thread about adding an "End call" item.

I'll probably end up creating a wiki page documenting the systemui XML format, unless someone points out some existing documentation that we've both failed to find (on display in the bottom of a locked filing cabinet stuck in a disused lavatory with a sign on the door saying "Beware of The Leopard" ).
 

The Following 5 Users Say Thank You to josh For This Useful Post: