Showing a file in the file manager

Federico Mena Quintero federico at ximian.com
Fri May 20 09:12:56 PDT 2011


On Fri, 2011-05-20 at 12:06 +0800, PCMan wrote:

> UI operations:
>  select file in window
>  open folder (this can be better than using mime-type handlers for folders IMO)
>  show properties of selected files
> 
> Is it possible to standardize these common operations?

We can certainly standardize on the UI operations.  What should we use
for the name - org.freedesktop.FileManager1 ?  (numbered for further
additions)

I just threw this together quickly; haven't validated it or anything:

<!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN" 
         "http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd">

<node>
  <interface name="org.freedesktop.FileManager1">
    <method name="ShowFile">
      <arg name="uri" direction="in" type="s"/>
      <arg name="parent_window_id" direction="in" type="x"/>
      <arg name="timestamp" direction="in" type="x"/>
    </method>

    <method name="ShowDirectory">
      <arg name="uri" direction="in" type="s"/>
      <arg name="parent_window_id" direction="in" type="x"/>
      <arg name="timestamp" direction="in" type="x"/>
    </method>
  </interface>
</node>

Both signatures for the ShowFile and ShowDirectory methods are identical
- uri, parent_window_id, timestamp.

The URI is obvious; it's just the thing you want to be shown.

The parent_window_id is the X window that is the nominal "parent" of the
resulting file manager window, for if your file manager wants to do an
animation indicating "this window came from here" (hmmm, do we need
source (x,y) coordinates as well?).

The timestamp is that of the event that caused the command to be
invoked, for startup-notification - so that we can get window stacking
correct.

Do we need a method to show the properties of a file, as PCMan
suggested?  I'm not clear on how this would be used from an application.

(I think we should start with those methods, and only later discuss
whether we need file-management operations like copy/move/delete...
those can get complicated pretty quickly, and I guess our I/O
abstractions already handle most of those, anyway.)

  Federico



More information about the xdg mailing list