DefaultApplicationPriorities
2709
Comment:
|
6624
|
Deletions are marked like this. | Additions are marked like this. |
Line 25: | Line 25: |
* Vincent has some w32 exe installers on its disk, those are associated with file-roller by default, he installs wine to be able to install those applications, once installed wine should be the default choice | * 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 30: | Line 30: |
* The priorities to use will be described in a policy document * /usr/share/applications/defaults.list will not be shipped with new version but still read for compatibility reason |
* 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). |
Line 33: | Line 33: |
* The categories will be used to prefer the application matching the desktop when there are several choices (ie GNOME category when using GNOME) | |
Line 35: | Line 36: |
The priority order will be: * mimeapps.list for sysadmin * defaults.list for distro and compatibility * mimeinfo.cache autobuilt |
|
Line 42: | 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 44: | Line 52: |
This need not be added or completed until the specification is nearing beta. | == 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. |
Launchpad Entry: desktop-karmic-default-application-priorities
Created: 2009-06-02
Contributors:
Packages affected: shared-mime-info, glib
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.
DesktopTeam/Specs/Karmic/DefaultApplicationPriorities (last edited 2009-08-04 07:17:14 by 91)