DefaultApplicationPriorities

Differences between revisions 1 and 16 (spanning 15 versions)
Revision 1 as of 2009-06-02 13:04:43
Size: 2528
Editor: ANancy-258-1-2-114
Comment:
Revision 16 as of 2009-08-03 21:09:00
Size: 6624
Editor: 89
Comment:
Deletions are marked like this. Additions are marked like this.
Line 4: Line 4:
 * '''Created''':  * '''Created''': 2009-06-02
Line 6: Line 6:
 * '''Packages affected''':  * '''Packages affected''': shared-mime-info, glib
Line 10: Line 10:
The specification describes how the current static association between mimetypes and applications will be changed for something dynamic The specification describes how the static list shipped with the distribution and describing the application to use for a mimetype will be changed to a dynamic one
Line 20: Line 20:
Coding the default application for a mimetype in the distribution limit the distributors flexibility in their software choices The static list used currently doesn't allow distributors to change a default application easily (vendors installing a commercial DVD players probably want this one to be used by default)
Line 24: Line 24:
== Assumptions ==  * Daniel decides to buy a better DVD player than the one coming with Ubuntu, it goes on the Canonical store and buy a commercial player there, this one should be used once installed
 * Vincent works for a company which use Ubuntu on their computer, the employees there need pdf editing which is something evince doesn't do though, they install their own pdf viewer and editor and want it to be used by default
Line 28: Line 29:
You can have subsections that better describe specific parts of the issue.  * The .desktop files will have an optional InitialPreference=<Priority> (similar key to what KDE is using), a default priority will be used if there is no such key
 * The priorities to use will be described in a policy document stored on wiki.ubuntu.com, an email describing the policy will be sent to the ubuntu lists
 * `/usr/share/applications/defaults.list` will not be shipped with new version but still read for compatibility reason (it is symlinked to `/etc/gnome/defaults.list`, which will be removed on upgrades if unmodified).
 * The cache format will be changed to list priorities, the cache filename need to be changed to reflect the compatibility breakage
 * The categories will be used to prefer the application matching the desktop when there are several choices (ie GNOME category when using GNOME)
 * The shared-mime-info update-desktop-database tool will be updated to write the new cache
 * glib needs to be update to understand the new format
Line 30: Line 37:
== Implementation ==

This section should describe a plan of action (the "how") to implement the changes discussed. Could include subsections like:

=== UI Changes ===

Should cover changes required to the UI, or specific UI that is required to implement this

=== Code Changes ===

Code changes should include an overview of what needs to change, and in some cases even the specific details.
The priority order will be:
 * mimeapps.list for sysadmin
 * defaults.list for distro and compatibility
 * mimeinfo.cache autobuilt
Line 44: Line 44:
Include:
 * data migration, if any
 * redirects from old URLs to new ones, if any
 * how users will be pointed to the new way of doing things, if necessary.
There is no migration required, a new cache will be used and the previous defaults.list still used for compatibility
Line 51: Line 48:
It's important that we are able to test new features, and demonstrate them to users. Use this section to describe a short plan that anybody can follow that demonstrates the feature is working. This can then be used during testing, and to show off after release. Please add an entry to http://testcases.qa.ubuntu.com/Coverage/NewFeatures for tracking test coverage.  * Double click on a video in nautilus and verify that totem is launched
 * Install a player using a higher priority number
 * Double click on a video in nautilus and verify that the new player is launched
Line 53: Line 52:
This need not be added or completed until the specification is nearing beta. == Mail proposal to fdo ==
Line 55: Line 54:
== Unresolved issues == Have a way to dynamically change software associations at distribution level
Line 57: Line 56:
This should highlight any issues that should be addressed in further specifications, and not problems with the specification itself; since any specification with problems cannot be approved. Hello everyone,
Line 59: Line 58:
== BoF agenda and discussion == Right now, GNU/Linux distributions (Debian, Ubuntu, from what I see it seems to apply to Fedora, OpenSuse and Mandrake too…) use a static defaults.list file in $XDG_DATA_DIRS/applications shipped by the distribution for associating a mimetype to a default application.
We currently, for Ubuntu, symlink it to /etc/gnome/defaults.list.
That means that when we set a software as the default distribution default dvd player for example, this means that if a user buy a better player with codec they don't get this one used by default without changing user's personal preferences. We want to change the system to have a priority number rather than a default hardcoded, ie powerdvd would have a higher priority than totem (for Ubuntu for example) so it will be used when installed.
Line 61: Line 62:
Use this section to take notes during the BoF; if you keep it in the approved spec, use it for summarising what was discussed and note any options that were rejected. To handle application priorities, the idea is to rely on the .desktop files having an optional InitialPreference=<Priority> (similar key to what KDE is using), a default priority will be used if there is no such key.
We can setup a 100 priority for defaults application actually in defaults.list for distros, 50 as the default priority if the key is not present in the .desktop file.

This is proposal for changing http://www.freedesktop.org/wiki/Specifications/shared-mime-info-spec and http://www.freedesktop.org/wiki/Specifications/desktop-entry-spec specifications to handle those use cases.
The main goal is to keep retro-compatibility for people who don't want to change their defaults.list. As we don't change the actual layer of user choice in $XDG_DATA_HOME > defaults choice in $XDG_DATA_DIRS/applications, I will just emphasize about defaults.list and the cache:
The priority order would be:
    * mimeapps.list for sysadmin
    * defaults.list for distro and compatibility (at the end, distribution wanted to use this dynamic association will no more ship it)
    * mimeinfo.cache autobuilt

Updating mimeinfo.cache file will be made as of today, when executing the shared-mime-info update-desktop-database tool. It will order the list of desktop file in the same order than the priorities in desktop files.

That would mean with that example:

  application/ogg=gnome-mplayer.desktop;vlc.desktop;kde4-amarok.desktop;mplayer.desktop;rhythmbox.desktop;totem.desktop;

gnome-mplayer.desktop priority < vlc.desktop priority < kde4…

We want also to take into account the current desktop environment. For instance, with this example, if you are running KDE, the distribution default choice (if no user choice is setup) would be totem instead of amarok. To avoid this issue categories will be used to prefer the application matching the desktop when there are several choices (ie KDE category when using KDE and so, amarok will be used in a KDE environment and totem in the GNOME one, if the user doesn't change its own preferences). That would mean that we open the "default candidate" .desktop file to see if we fit the current environment. If not, we head to the previous one of the list, open the .desktop file…
So, the default choice rule (if the user didn't change anything and the distro don't ship a defaults.list for this mime type) will be : the last .desktop application file found, having a category corresponding to my current desktop environment. If no .desktop file with this category is found, we fallback to the last entry.


What do you think about it? I only take a look at glib (more precisely, the gio module) and update-mime-info and the code to write to achieve that goal seems minimal.

Summary

The specification describes how the static list shipped with the distribution and describing the application to use for a mimetype will be changed to a dynamic one

Release Note

This section should include a paragraph describing the end-user impact of this change. It is meant to be included in the release notes of the first release in which it is implemented. (Not all of these will actually be included in the release notes, at the release manager's discretion; but writing them is a useful exercise.)

It is mandatory.

Rationale

The static list used currently doesn't allow distributors to change a default application easily (vendors installing a commercial DVD players probably want this one to be used by default)

User stories

  • Daniel decides to buy a better DVD player than the one coming with Ubuntu, it goes on the Canonical store and buy a commercial player there, this one should be used once installed
  • Vincent works for a company which use Ubuntu on their computer, the employees there need pdf editing which is something evince doesn't do though, they install their own pdf viewer and editor and want it to be used by default

Design

  • The .desktop files will have an optional InitialPreference=<Priority> (similar key to what KDE is using), a default priority will be used if there is no such key

  • The priorities to use will be described in a policy document stored on wiki.ubuntu.com, an email describing the policy will be sent to the ubuntu lists
  • /usr/share/applications/defaults.list will not be shipped with new version but still read for compatibility reason (it is symlinked to /etc/gnome/defaults.list, which will be removed on upgrades if unmodified).

  • The cache format will be changed to list priorities, the cache filename need to be changed to reflect the compatibility breakage
  • The categories will be used to prefer the application matching the desktop when there are several choices (ie GNOME category when using GNOME)
  • The shared-mime-info update-desktop-database tool will be updated to write the new cache
  • glib needs to be update to understand the new format

The priority order will be:

  • mimeapps.list for sysadmin
  • defaults.list for distro and compatibility
  • mimeinfo.cache autobuilt

Migration

There is no migration required, a new cache will be used and the previous defaults.list still used for compatibility

Test/Demo Plan

  • Double click on a video in nautilus and verify that totem is launched
  • Install a player using a higher priority number
  • Double click on a video in nautilus and verify that the new player is launched

Mail proposal to fdo

Have a way to dynamically change software associations at distribution level

Hello everyone,

Right now, GNU/Linux distributions (Debian, Ubuntu, from what I see it seems to apply to Fedora, OpenSuse and Mandrake too…) use a static defaults.list file in $XDG_DATA_DIRS/applications shipped by the distribution for associating a mimetype to a default application. We currently, for Ubuntu, symlink it to /etc/gnome/defaults.list. That means that when we set a software as the default distribution default dvd player for example, this means that if a user buy a better player with codec they don't get this one used by default without changing user's personal preferences. We want to change the system to have a priority number rather than a default hardcoded, ie powerdvd would have a higher priority than totem (for Ubuntu for example) so it will be used when installed.

To handle application priorities, the idea is to rely on the .desktop files having an optional InitialPreference=<Priority> (similar key to what KDE is using), a default priority will be used if there is no such key. We can setup a 100 priority for defaults application actually in defaults.list for distros, 50 as the default priority if the key is not present in the .desktop file.

This is proposal for changing http://www.freedesktop.org/wiki/Specifications/shared-mime-info-spec and http://www.freedesktop.org/wiki/Specifications/desktop-entry-spec specifications to handle those use cases. The main goal is to keep retro-compatibility for people who don't want to change their defaults.list. As we don't change the actual layer of user choice in $XDG_DATA_HOME > defaults choice in $XDG_DATA_DIRS/applications, I will just emphasize about defaults.list and the cache: The priority order would be:

  • mimeapps.list for sysadmin
  • defaults.list for distro and compatibility (at the end, distribution wanted to use this dynamic association will no more ship it)
  • mimeinfo.cache autobuilt

Updating mimeinfo.cache file will be made as of today, when executing the shared-mime-info update-desktop-database tool. It will order the list of desktop file in the same order than the priorities in desktop files.

That would mean with that example:

  • application/ogg=gnome-mplayer.desktop;vlc.desktop;kde4-amarok.desktop;mplayer.desktop;rhythmbox.desktop;totem.desktop;

gnome-mplayer.desktop priority < vlc.desktop priority < kde4…

We want also to take into account the current desktop environment. For instance, with this example, if you are running KDE, the distribution default choice (if no user choice is setup) would be totem instead of amarok. To avoid this issue categories will be used to prefer the application matching the desktop when there are several choices (ie KDE category when using KDE and so, amarok will be used in a KDE environment and totem in the GNOME one, if the user doesn't change its own preferences). That would mean that we open the "default candidate" .desktop file to see if we fit the current environment. If not, we head to the previous one of the list, open the .desktop file… So, the default choice rule (if the user didn't change anything and the distro don't ship a defaults.list for this mime type) will be : the last .desktop application file found, having a category corresponding to my current desktop environment. If no .desktop file with this category is found, we fallback to the last entry.

What do you think about it? I only take a look at glib (more precisely, the gio module) and update-mime-info and the code to write to achieve that goal seems minimal.


CategorySpec

DesktopTeam/Specs/Karmic/DefaultApplicationPriorities (last edited 2009-08-04 07:17:14 by 91)