So here's a half baked proposal.  Make of it what you will.  I am
beginning to see why it is quite complicated.

The current file chooser stays the same by default, except that a
label is added somewhere that reads "Type a filename" or whatever (to
give some kind of visual cue that you can type a filename to it).
This isn't essential to my proposal, but I think that the cue should
be there in any case.

Also by default, starting to type a filename pops up a filename entry,
as currently done.  However, there's one additional little checkbox
named "Dock With Chooser" or the like.  If this is checked, the
filename entry (and checkbox) immediately integrates with the chooser,
and stays there until/unless Dock With Chooser is unchecked.  This
state is saved, so the next time the chooser pops up it's in the same
state as it last was.

Therefore, if Dock With Chooser is not checked, everything behaves
exactly as it does now.  If it is checked, the main dialog has a tab
completing pathname entry box.

What happens when Dock With Chooser is selected?  Let's start with
some definitions:

* A "filename" refers to the base name component of a path (i. e. what
  "basename" returns).

* A "dirname" refers to the directory component of a path (i. e. what
  "dirname" returns, with a path component separator appended).

* A "pathname" refers to the concatenation of a (possibly empty)
  directory name with a (possibly empty) filename

The "focus" (or whatever it's called in this situation -- it's not the
window receiving focus, but rather the active widget) is the same as
usual, but if you start typing, focus is switched to the text entry
box.  The entry box starts with an empty pathname.

Next, some definitions:

How does tab work?  Here are the cases:

1) If the entry box contains an empty pathname, tab always goes to the
   next widget.

2) If the most recent action was switching into the entry box, tab
   simply switches to the next widget.

3) If the most recent action was typing something into the entry box,
   tab attempts to complete as much as it can.  The next tab switches
   to the next widget (i. e. two tabs in a row switches out).

   Alternatively, tab only completes as far as a single directory
   name.  Typing tab again completes as much as it can within the next
   directory, and then the next tab switches out.

I was also thinking that the normal tab order should simply skip the
entry box, so the only ways to use the entry box are to either click
in it with the mouse or start typing.  That's also an alternative.

(Have I missed anything?)

A few more things:

1) If the dirname in the entry box is empty, any filename is
   interpreted relative to the otherwise selected directory.

2) If the dirname in the entry box is not empty, the directory of the
   entire file chooser is dynamically set to the dirname of the entry
   box (e. g. as a path component is typed or erased, the directory of
   the file chooser changes on the fly).

3) Selecting another directory with any other widget replaces any
   directory component typed into the chooser, but leaves the file
   component intact.  Thus, if I've typed /foo/bar.j into the browser,
   and then select /home/rlk, "/foo/" is erased from the entry widget,
   leaving "/foo/bar.j".

4) Selecting a filename with other widgets in the chooser erases any
   filename in the widget, and replaces it component with the filename
   selected.  Thus, if I've typed /foo/bar.j into the entry box, the
   directory of the entire chooser has been changed to /foo.  If I now
   select "baz.jpg" via any other means, the entry box receives the
   text "/foo/baz.jpg".

No doubt I've missed some things, but this is a starting point.

Robert Krawitz                                     <[EMAIL PROTECTED]>

Tall Clubs International  -- or 1-888-IM-TALL-2
Member of the League for Programming Freedom -- mail [EMAIL PROTECTED]
Project lead for Gimp Print   --

"Linux doesn't dictate how I work, I dictate how Linux works."
--Eric Crampton
Gimp-developer mailing list

Reply via email to