30 Aug 2010 federico   » (Master)

Mon 2010/Aug/30

  • Rooting the file chooser

    Christian Hammond has been working on a very cool branch of GtkFileChooser to let you define roots for the file dialog. Normally, this is what my file chooser looks like — it lets me browse anything on my file system:

    Unrooted filechooser

    In the following screenshot, the file chooser has been rooted to show only my $HOME. Note that no volumes or shortcuts that are outsideof my $HOME show up in the shortcuts pane.

    Filechooser rooted to $HOME

    The API makes it easy.

    GSList *roots;
    
    roots = g_slist_append (NULL, "file:///home/federico");
    gtk_file_chooser_set_root_uris (chooser, roots);

    And in the following example, the filechooser has been constrained to my $HOME and to /tmp:

    Filechooser rooted to $HOME and /tmp

    This is basically the infrastructure we need to support proper lockdown in the file chooser. At some point it may be interesting for sysadmins to say, "don't let users wander in the filesystem, but constrain them to their home directory, the corporate shares and their USB stick".

    This is bug 609886 - multiroot support for GtkFileChooser.

    The patches are not quite ready yet (in particular, passing a GSList of strings is not very nice for language bindings, I think), but it should be easy to fix for production. Any volunteers?

Syndicated 2010-08-30 14:36:00 from Federico Mena-Quintero - Activity Log

Latest blog entries     Older blog entries

New Advogato Features

New HTML Parser: The long-awaited libxml2 based HTML parser code is live. It needs further work but already handles most markup better than the original parser.

Keep up with the latest Advogato features by reading the Advogato status blog.

If you're a C programmer with some spare time, take a look at the mod_virgule project page and help us with one of the tasks on the ToDo list!