Commit ded997c1 authored by Jan Djärv's avatar Jan Djärv
Browse files

* gtkutil.c (xg_get_file_with_chooser): Handle local files only.

Set current folder in file chooser if default_filename is a
directory.
parent 02c1e496
2004-12-07 Jan Dj,Ad(Brv <jan.h.d@swipnet.se>
* gtkutil.c (xg_get_file_with_chooser): Handle local files only.
Set current folder in file chooser if default_filename is a
directory.
2004-12-05 Stefan Monnier <monnier@iro.umontreal.ca>
 
* regex.c (GET_UNSIGNED_NUMBER): Signal an error when reaching the end.
......
......@@ -1200,6 +1200,7 @@ xg_get_file_with_chooser (f, prompt, default_filename,
GTK_STOCK_OPEN : GTK_STOCK_OK),
GTK_RESPONSE_OK,
NULL);
gtk_file_chooser_set_local_only (GTK_FILE_CHOOSER (filewin), TRUE);
if (default_filename)
{
......@@ -1207,16 +1208,20 @@ xg_get_file_with_chooser (f, prompt, default_filename,
struct gcpro gcpro1;
GCPRO1 (file);
file = build_string (default_filename);
/* File chooser does not understand ~/... in the file name. It must be
an absolute name starting with /. */
if (default_filename[0] != '/')
{
file = Fexpand_file_name (build_string (default_filename), Qnil);
default_filename = SDATA (file);
}
file = Fexpand_file_name (file, Qnil);
gtk_file_chooser_set_filename (GTK_FILE_CHOOSER (filewin),
default_filename);
default_filename = SDATA (file);
if (Ffile_directory_p (file))
gtk_file_chooser_set_current_folder (GTK_FILE_CHOOSER (filewin),
default_filename);
else
gtk_file_chooser_set_filename (GTK_FILE_CHOOSER (filewin),
default_filename);
UNGCPRO;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment