Tuesday 5 October 2010

The new control-center and you

URI scheme handlers

In the past, handlers for specific URI schemes lived in GConf. This caused multiple problems:
  • it would cause problems when 2 applications tried to lay claim to the same URI schemes (say both Banshee and Rhythmbox wanted to handle the "itpc" scheme), because GConf would expect only one schema (thus one application) to handle a particular key.
  • when the key was set, by the preferred applications for example, the key would lack important information to make things like startup notification work (or even whether it works), the application name, icon, etc.
  • and for schemes where a desktop-wide modules (such as gnome-vfs, as listed above) would own the key, you'd still need to add a separate file to have the application added to the Preferred Applications control-center applet.
We now use mime-types for all this. If you wanted to handle the aforementioned "itpc" URI scheme, you'd just need to say you handle the "x-scheme-handler/itpc" mime-type. This also means you could easily switch between applications handling a URI scheme, as you would a filetype.

You can track the feature, and its usage in bug 631433.

Non-panels in the dog house

For GNOME 3.0, the control-center "capplets" got turned into panels in a new shell. In addition to porting your old preferences application to being a control-center panel (see gnome-bluetooth, gnome-media, gnome-power-manager and others for a show-and-tell), you'll need to make a few changes to your .desktop file.

You'll need to add the "X-GNOME-Settings-Panel" category. If your dialogue is a panel, but lacks this category, it will show up under "Other" in the shell. If your preferences are not a panel but you try to cheat, you'll get a warning, and be removed from the shell altogether.

1 comment:

Rodney Dawes said...

All I can say is, it's about damn time. I filed a bug asking for this to get done 7 years ago, and it was just put out as WONTFIX, IIRC.