Re: [PATCH] Add Pathbar to Nautilus Browser



On Wed, 2005-07-06 at 00:17 +0100, Jamie McCracken wrote:
> Jamie McCracken wrote:
> > Having integrated the GtkFileChooser places into Nautilus, I have now 
> > done a patch to add the pathbar too. Screenshots can be found on my blog 
> > (see link in footer)
> > 
> > I have left the location bar as is (its handy for those that wanna 
> > CTRL+L occasionally or those that want a persistent type in interface). 
> > The new pathbar, unlike the other toolbars, is to the right of the 
> > sidebar so as to make it much neater and more consistent with the file 
> > chooser whilst keeping the window more compact. It can also be toggled 
> > with Ctrl+P.
> > 
> > I have used a modfied version of the GTK pathbar and have done the bare 
> > minimum to it to get it to work in Nautilus. The following changes have 
> > been implemented:
> > 
> > 1) All gtk private stuff is removed
> > 2) Replaced GtkFilePath with char *
> > 3) Replaced GtkFileSystem and related functions with equivalent 
> > Gnome-VFS ones
> > 4) Added folder icon to ordinary button folders
> > 5) Namespaced it all.
> > 6) Made the code consistent with Nauitlus' coding standards
> > 
> > Other than that it is identical to the file chooser's.
> > 
> > (note I haven't tested on HEAD because its not available on anon CVS - 
> > latest on there is 23rd June. I expect the Makefile to fail on patching 
> > on HEAD so simply add nautilus-pathbar.c and .h to it manually)
>
> I missed a bit on this patch.
> 
> I forgot to add a check to see if a uri exists to 
> nautilus_path_bar_set_path.
> 
> Please use attached file for patch review

First a bit on the general UI. I don't want to have the pathbar in
addition to the location bar, I want it to replace the location bar. For
a long time a major goal of nautilus has been to avoid displaying
pathnames (as in absolute pathnames or uris) in the UI. Going from
location bar will help with this. It will also help us look less like a
web browser, which is nice, as that can confuse people at times.

Of course, we can't totally remove the location bar, as its needed for
typing in addresses, and some people still might want it. What we'll do
is put the path bar and the location bar in the same place, but only
show one at a time. Normally we show the pathbar, but on "go ->
Location" in the menu (or ctrl+l) we temporarily show the location bar,
similarly to how this is handled when the location bar is not visible.

Lets also add a preference (hidden for the moment) to allow people to
always have the location bar instead of the pathbar.

Comments about the code:

strings are not translated

It doesn't handle the desktop-is-home preference

file_path_exists does synchronous i/o, which is a no-no in nautilus. Why
do you have to check for the file existance here?

The root icon for non file:/// uris is always a folder (I think). It
should use the real icon that nautilus uses for it, i.e. gotten from
nautilus_icon_factory_get_icon_for_file(). See for instance the location
menu in spatial mode that uses this and what icon it uses for
"computer:///".

We should really re-root for all volumes too, not only the homedir. This
means you won't see /mnt/media/cdrom, but only
  [{cdicon} cdrom name][folder1][folder2]
Maybe we can wait a bit with implementing this so that we can get
something in first, but this would be really nice.

The gtk+ pathbar code you used isn't the latest version. Gtk+ HEAD has a
different behaviour, primary wrt rerooting. It:
* only re-roots to the desktop
* allows you to scroll left when things are re-rooted
We should update the code to this version.

Why did you add folder icons to normal folders? That seems to use a lot
of space for something that isn't really needed.

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
 Alexander Larsson                                            Red Hat, Inc 
                   alexl redhat com    alla lysator liu se 
He's an immortal chivalrous cop whom everyone believes is mad. She's a 
chain-smoking impetuous research scientist descended from a line of powerful 
witches. They fight crime! 




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