Re: Call for a Gnome Media Center



Ross Burton <ross <at> burtonini.com> writes:

> 
> On Wed, 2007-02-14 at 10:56 +0100, Christian F.K. Schaller wrote:
> > As for a shared database this might be a good idea, but I will leave
> > that up to application writers to decide, for me a good start would be
> > that all Music applications for instance tried hard to get people to
> > save their Music under $HOME/Music for instance. That way when you
> > start
> > another Music application or Elisa you don't need to specify which
> > directory to look for Music inn. Similar conventions would be good for
> > pictures and movies and album/dvd cover art. 
> 
> Just last week I got a bug report and a patch for this in Sound Juicer.
> It hard-codes the default location to save files as ~/Music/.  Now, my
> question is this: do I commit this, or do we need a more powerful system
> that handles i18n?  I'm sure a Persian GNOME user would not like their
> music in ~/Music/.  One quick solution is to translate the string
> "Music"... is that enough?
> 
> Ross

Hi all,
  I'm a long time lurker and would like to propose an idea to solve this issue
acting at the file_choser level and using a new .desktop file key.

Applications should have a X-GNOME-MetaType[*] line in their .desktop file.
The list of possible values is well defined: music, image, document, video,
archive, project.
For example:
 Rhythmbox -> X-GNOME-MetaType=music
 OO.o -> X-GNOME-MetaType=document
 The GIMP -> X-GNOME-MetaType=image
 EOG -> X-GNOME-MetaType=image
 FileRoller -> X-GNOME-MetaType=archive
 Anjuta -> X-GNOME-MetaType=project

Then all the magic happens within the file chooser (not the application!); when
called, it chooses which folder to show you following this order of preference:
 1. the folder which was last used for this operation (opening/saving) in the
current application session;
 2. the folder intended for this kind of files, if any (e.g. ~/Music/);
 3. $HOME

Point 2 is the one requiring more discussion.
Let's suppose we're the GIMP and have X-GNOME-MetaType=image; then the
*file_chooser* should try to find out which is the folder where the user puts
his images.
At first it looks inside ~/.local/default-dirs/ and sees if it can find a
symbolic link named "images".  For example: ~/.local/default-dirs/images ->
~/Images.
If it can't find it, then it asks the user:
  ________________________________________________________
 |______________________________________________________X_|
 |                                                        |
 |  It is the first time you save an image. Where do you  |
 |  want to put this kind of files, by default?           |
 |           _______________                              |
 |        o | ~/Images      |                             |
 |          '~~~~~~~~~~~~~~~'                             |
 |        o Nowhere in particular             _________   |
 |                                           | X Close |  |
 |                                           '~~~~~~~~~'  |
 '~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~'

The proposed "~/Images" should really be its localized equivalent.
The choice "Nowhere in particular" means $HOME.
Let's suppose the user changes the proposed default to "~/Graphics"; then a
symbolic link is created: ~/.gtk-dirs/images -> ~/Graphics.

All this could happen without the app even knowing and would only require
changes is .desktop files and in the file chooser.
If an application needs more control, a new gobject property called metatype
could be added to the file_chooser (containing a value in GTK_METATYPE_MUSIC,
GTK_METATYPE_IMAGE, GTK_METATYPE_DOCUMENT, GTK_METATYPE_VIDEO,
GTK_METATYPE_ARCHIVE, GTK_METATYPE_PROJECT etc.).  This setting would prevail on
the one in the .desktop file.


PROs:
 * Not intrusive and easy to implement.
 * All changes are done at the gtk level (inside the file_chooser); applications
remain untouched.
 * Flexible, since everybody can give the name he wants to his folders.
 * Doesn't use gconf and could also be proposed to KDE people.
 * Everything just works whether the user does a "mv ~/Graphics ~/MyPhotos",
since the link in .local/default-dirs becomes dangling and the file_chooser
shows again its question about the Images dir. (checking for renames through
inotify would also be good, of course...)
 * Command line tools could reach those folders through .local/default-dirs links.
 * Nautilus could trivially assign an automatic emblem to those special folders.

Just my 2 cents.
Hi again,
  robepisc


[*] what I call "metatype", here, is not the MIME type, since we don't care if a
document is a .rtf, a .doc or a .odf file; what we care is it is a "Document". 
Note however that the metatype could probably be inferred from the MimeType. So
X-GNOME-MetaType could not even be necessary.






[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]