Allow absolute filenames in filename entry. Patch from Yevgen Muntyan

2006-05-23  Alexander Larsson  <alexl@redhat.com>

	* gtk/gtkprinteroptionwidget.c (filesave_changed_cb):
	Allow absolute filenames in filename entry.
	Patch from Yevgen Muntyan (#341679)
This commit is contained in:
Alexander Larsson 2006-05-23 08:20:30 +00:00 committed by Alexander Larsson
parent 07d2dd1700
commit f291474c50
3 changed files with 20 additions and 1 deletions

View File

@ -1,3 +1,9 @@
2006-05-23 Alexander Larsson <alexl@redhat.com>
* gtk/gtkprinteroptionwidget.c (filesave_changed_cb):
Allow absolute filenames in filename entry.
Patch from Yevgen Muntyan (#341679)
2006-05-23 Alexander Larsson <alexl@redhat.com>
* gtk/gtk.symbols:

View File

@ -1,3 +1,9 @@
2006-05-23 Alexander Larsson <alexl@redhat.com>
* gtk/gtkprinteroptionwidget.c (filesave_changed_cb):
Allow absolute filenames in filename entry.
Patch from Yevgen Muntyan (#341679)
2006-05-23 Alexander Larsson <alexl@redhat.com>
* gtk/gtk.symbols:

View File

@ -420,7 +420,14 @@ filesave_changed_cb (GtkWidget *w,
directory = gtk_file_chooser_get_current_folder (GTK_FILE_CHOOSER (priv->combo));
file = gtk_entry_get_text (GTK_ENTRY (priv->entry));
value = g_build_filename (directory, file, NULL);
if (g_path_is_absolute (file))
value = g_strdup (file);
#ifdef G_OS_UNIX
else if (file[0] == '~' && file[1] == '/')
value = g_build_filename (g_get_home_dir (), file + 2, NULL);
#endif
else
value = g_build_filename (directory, file, NULL);
if (value)
gtk_printer_option_set (priv->source, value);