Re: GnomeURIEntry



El mar, 24-09-2002 a las 23:44, Matthias Warkus escribió:
> Hi,
> 
> I've noticed that, while there are widgets to select local files
> (GtkFileSelection and GnomeFileEntry), there is no widget to enter
> URIs. GNOME-VFS--enabled programs must currently use either a simple
> GtkEntry or a GnomeEntry to let the user enter a location.
> 
> I think it would be nice if there were a GnomeURIEntry widget that is
> tailored to have the user enter both local and remote URIs. It would
> be derived from GnomeFileEntry and offer these additional features:

Galeon2 has a widget that already does some of these.

> 
> - show local files selected via "Browse..." button as file: URIs to
>   give the user a hint that the entry will accept URIs, not just file
>   names
> 
> - accept URI drops from all relevant sources (Nautilus, major Web
>   browsers, maybe other GnomeURIEntry widgets)

Not yet, but planned (and easy to use)

> - have a URI drag source to the left of the entry maybe? Would be
>   another hint that the entry accepts URIs
> 

In galeon, this is a separate widget, but it has already been suggested
to mix it with the entry. Ideally, we would like to put in inside the
entry, like mozilla. 


> - do history autocompletion

Already does this. Also, I think it should do TAB completion (like bash)
for local URIs. This is on my TODO list for galeon.

Current implementation sorts history matches based in the last time it
was visited and how often the site is visited.

It is designed so that you can plug different "completion sources"
(Galeon's history, local filesystem, bookmarked sites...)

> - maybe support some kind of global Bookmarks/Favorites system, which
>   we'll probably have some day (?)

for autocompletion? (this can be easily added, I will add bookmark
autocompletion for galeon soon).

> - offer Web-browser-like heuristics to complete incomplete URIs, i.e.
>   if we can't stat() it as a local path and the part before the first
>   slash looks like a FTP host name, prepend "ftp://";, in other
>   cases prepend "http://";; if it seems like the domain name is
>   without a host name, guess it's "www." etc. etc.

In galeon, this is handled by the autocompletion with a set of "common
prefixes". It works good enough, IMO. More complex heuristics are
possible, but easy to get wrong.

> - expose the currently selected URI through two different properties,
>   something like "uri" (type GnomeVFSURI*) and "uri-string" (type
>   gchararray)

This is not currently done, but it's very easy to add.

> 
> - have an "enable-browse" boolean property (defaults to TRUE); if
>   FALSE, the entry wouldn't show a browse button and work essentially
>   like a Web browser's URL line -- use this for entries where people
>   will hardly ever enter a local file, e.g. in an "Add RDF source"
>   requester
> 
> All kinds of applications that support URIs through GNOME-VFS could
> use GnomeURIEntry in place of GnomeFileEntry.
> 
> There could also be a dialog widget GnomeURISelection derived from
> GtkFileSelection -- essentially a file selector with abovementioned
> additional URI functionality added in so it will select URIs and not
> just files. I reckon the latter would be a stopgap as we'll have a
> nice new GNOME file selector Real Soon Now (they're working on it in
> libegg, aren't they?), which will probably also turn out URIs and not
> just local path strings.
> 
> As soon as the dust has settled on my book, I'll have free time to
> work on this myself... I'd just like to know whether you, too, think
> GnomeURIEntry (and, possibly, GnomeURISelection) would make sense. 
> 

I think it would be good if Galeon's URI entry could be adapted for this
and used, instead of a new widget. Some of the work is already done,
cleaning the code a bit and implementing the missing features should not
be a lot of work.

I could work on this too, but don't think that i can do this for 2.2 (I
need to finish some other things in galeon too).

If people are interested, I can write some docs for my code and move it
to libegg.



-- 
Ricardo Fernández Pascual
ric users sourceforge net
Murcia. España.




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