Commit 2f2301c9 authored by Michael Natterer's avatar Michael Natterer 😴 Committed by Michael Natterer

derive it from GtkFileChooser instead of GtkFileSelection.

2004-04-15  Michael Natterer  <mitch@gimp.org>

	* app/widgets/gimpfiledialog.[ch]: derive it from GtkFileChooser
	instead of GtkFileSelection.

	* app/gui/file-dialog-utils.c
	* app/gui/file-open-dialog.c
	* app/gui/file-save-dialog.c
	* app/widgets/gimpthumbbox.c: changed accordingly.

	* app/gui/gradients-commands.c
	* app/gui/vectors-commands.c
	* app/tools/gimpimagemaptool.c
	* app/widgets/gimperrorconsole.c
	* app/widgets/gimptexteditor.c
	* libgimpwidgets/gimpfileentry.c: use file choosers instead of
	file selectors.
parent de8c6a51
2004-04-15 Michael Natterer <mitch@gimp.org>
* app/widgets/gimpfiledialog.[ch]: derive it from GtkFileChooser
instead of GtkFileSelection.
* app/gui/file-dialog-utils.c
* app/gui/file-open-dialog.c
* app/gui/file-save-dialog.c
* app/widgets/gimpthumbbox.c: changed accordingly.
* app/gui/gradients-commands.c
* app/gui/vectors-commands.c
* app/tools/gimpimagemaptool.c
* app/widgets/gimperrorconsole.c
* app/widgets/gimptexteditor.c
* libgimpwidgets/gimpfileentry.c: use file choosers instead of
file selectors.
2004-04-15 Michael Natterer <mitch@gimp.org>
* configure.in: depend on glib 2.4.0, gtk+ 2.4.0, pangoft2 1.4.0
......
......@@ -61,9 +61,9 @@ gradients_save_as_pov_ray_cmd_callback (GtkWidget *widget,
static void
gradients_save_as_pov_query (GimpContainerEditor *editor)
{
GimpGradient *gradient;
GtkFileSelection *filesel;
gchar *title;
GimpGradient *gradient;
GtkFileChooser *chooser;
gchar *title;
gradient = gimp_context_get_gradient (editor->view->context);
......@@ -73,34 +73,41 @@ gradients_save_as_pov_query (GimpContainerEditor *editor)
title = g_strdup_printf (_("Save '%s' as POV-Ray"),
GIMP_OBJECT (gradient)->name);
filesel = GTK_FILE_SELECTION (gtk_file_selection_new (title));
chooser = GTK_FILE_CHOOSER
(gtk_file_chooser_dialog_new (title, NULL,
GTK_FILE_CHOOSER_ACTION_SAVE,
GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
GTK_STOCK_SAVE, GTK_RESPONSE_OK,
NULL));
g_free (title);
gtk_window_set_screen (GTK_WINDOW (filesel),
gtk_window_set_screen (GTK_WINDOW (chooser),
gtk_widget_get_screen (GTK_WIDGET (editor)));
gtk_window_set_role (GTK_WINDOW (filesel), "gimp-gradient-save-pov");
gtk_window_set_position (GTK_WINDOW (filesel), GTK_WIN_POS_MOUSE);
gtk_container_set_border_width (GTK_CONTAINER (filesel), 6);
gtk_container_set_border_width (GTK_CONTAINER (filesel->button_area), 4);
gtk_window_set_role (GTK_WINDOW (chooser), "gimp-gradient-save-pov");
gtk_window_set_position (GTK_WINDOW (chooser), GTK_WIN_POS_MOUSE);
g_signal_connect (filesel, "response",
g_signal_connect (chooser, "response",
G_CALLBACK (gradients_save_as_pov_response),
gradient);
g_signal_connect (chooser, "delete_event",
G_CALLBACK (gtk_true),
NULL);
g_object_ref (gradient);
g_signal_connect_object (filesel, "destroy",
g_signal_connect_object (chooser, "destroy",
G_CALLBACK (g_object_unref),
gradient,
G_CONNECT_SWAPPED);
gimp_help_connect (GTK_WIDGET (filesel), gimp_standard_help_func,
gimp_help_connect (GTK_WIDGET (chooser), gimp_standard_help_func,
GIMP_HELP_GRADIENT_SAVE_AS_POV, NULL);
gtk_widget_show (GTK_WIDGET (filesel));
gtk_widget_show (GTK_WIDGET (chooser));
}
static void
......@@ -113,7 +120,7 @@ gradients_save_as_pov_response (GtkWidget *dialog,
const gchar *filename;
GError *error = NULL;
filename = gtk_file_selection_get_filename (GTK_FILE_SELECTION (dialog));
filename = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (dialog));
if (! gimp_gradient_save_as_pov (gradient, filename, &error))
{
......
......@@ -645,7 +645,7 @@ vectors_import_response (GtkWidget *dialog,
const gchar *filename;
GError *error = NULL;
filename = gtk_file_selection_get_filename (GTK_FILE_SELECTION (dialog));
filename = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (dialog));
if (gimp_vectors_import_file (gimage, filename, FALSE, FALSE, &error))
{
......@@ -667,34 +667,37 @@ static void
vectors_import_query (GimpImage *gimage,
GtkWidget *parent)
{
GtkFileSelection *filesel;
GtkFileChooser *chooser;
filesel =
GTK_FILE_SELECTION (gtk_file_selection_new (_("Import Paths from SVG")));
chooser = GTK_FILE_CHOOSER
(gtk_file_chooser_dialog_new (_("Import Paths from SVG"), NULL,
GTK_FILE_CHOOSER_ACTION_OPEN,
g_object_weak_ref (G_OBJECT (gimage),
(GWeakNotify) gtk_widget_destroy, filesel);
GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
GTK_STOCK_OPEN, GTK_RESPONSE_OK,
gtk_window_set_screen (GTK_WINDOW (filesel),
gtk_widget_get_screen (parent));
NULL));
g_object_weak_ref (G_OBJECT (gimage), (GWeakNotify) gtk_widget_destroy,
chooser);
gtk_window_set_role (GTK_WINDOW (filesel), "gimp-vectors-import");
gtk_window_set_position (GTK_WINDOW (filesel), GTK_WIN_POS_MOUSE);
gtk_window_set_screen (GTK_WINDOW (chooser),
gtk_widget_get_screen (parent));
gtk_container_set_border_width (GTK_CONTAINER (filesel), 6);
gtk_container_set_border_width (GTK_CONTAINER (filesel->button_area), 4);
gtk_window_set_role (GTK_WINDOW (chooser), "gimp-vectors-import");
gtk_window_set_position (GTK_WINDOW (chooser), GTK_WIN_POS_MOUSE);
g_signal_connect (filesel, "response",
g_signal_connect (chooser, "response",
G_CALLBACK (vectors_import_response),
gimage);
g_signal_connect (filesel, "delete_event",
g_signal_connect (chooser, "delete_event",
G_CALLBACK (gtk_true),
NULL);
/* FIXME: add a proper file selector
and controls for merge and scale options */
gtk_widget_show (GTK_WIDGET (filesel));
gtk_widget_show (GTK_WIDGET (chooser));
}
......@@ -712,7 +715,7 @@ vectors_export_response (GtkWidget *dialog,
const gchar *filename;
GError *error = NULL;
filename = gtk_file_selection_get_filename (GTK_FILE_SELECTION (dialog));
filename = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (dialog));
if (! gimp_vectors_export_file (gimage, NULL, filename, &error))
{
......@@ -731,29 +734,32 @@ vectors_export_query (GimpImage *gimage,
GimpVectors *vectors,
GtkWidget *parent)
{
GtkFileSelection *filesel;
GtkFileChooser *chooser;
filesel =
GTK_FILE_SELECTION (gtk_file_selection_new (_("Export Path to SVG")));
chooser = GTK_FILE_CHOOSER
(gtk_file_chooser_dialog_new (_("Export Path to SVG"), NULL,
GTK_FILE_CHOOSER_ACTION_SAVE,
g_object_weak_ref (G_OBJECT (gimage),
(GWeakNotify) gtk_widget_destroy, filesel);
GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
GTK_STOCK_SAVE, GTK_RESPONSE_OK,
gtk_window_set_screen (GTK_WINDOW (filesel),
gtk_widget_get_screen (parent));
NULL));
g_object_weak_ref (G_OBJECT (gimage), (GWeakNotify) gtk_widget_destroy,
chooser);
gtk_window_set_role (GTK_WINDOW (filesel), "gimp-vectors-export");
gtk_window_set_position (GTK_WINDOW (filesel), GTK_WIN_POS_MOUSE);
gtk_window_set_screen (GTK_WINDOW (chooser),
gtk_widget_get_screen (parent));
gtk_container_set_border_width (GTK_CONTAINER (filesel), 6);
gtk_container_set_border_width (GTK_CONTAINER (filesel->button_area), 4);
gtk_window_set_role (GTK_WINDOW (chooser), "gimp-vectors-export");
gtk_window_set_position (GTK_WINDOW (chooser), GTK_WIN_POS_MOUSE);
g_signal_connect (filesel, "response",
g_signal_connect (chooser, "response",
G_CALLBACK (vectors_export_response),
gimage);
g_signal_connect (filesel, "delete_event",
g_signal_connect (chooser, "delete_event",
G_CALLBACK (gtk_true),
NULL);
gtk_widget_show (GTK_WIDGET (filesel));
gtk_widget_show (GTK_WIDGET (chooser));
}
......@@ -37,7 +37,6 @@ file_dialog_show (GtkWidget *dialog,
gimp_item_factories_set_sensitive ("<Image>", "/File/Save a Copy...", FALSE);
gtk_window_set_screen (GTK_WINDOW (dialog), gtk_widget_get_screen (parent));
gtk_widget_grab_focus (GTK_FILE_SELECTION (dialog)->selection_entry);
gtk_window_present (GTK_WINDOW (dialog));
}
......
......@@ -86,8 +86,6 @@ file_open_dialog_show (Gimp *gimp,
gtk_window_set_screen (GTK_WINDOW (fileload),
gtk_widget_get_screen (parent));
gtk_widget_grab_focus (GTK_FILE_SELECTION (fileload)->selection_entry);
gtk_window_present (GTK_WINDOW (fileload));
}
......@@ -101,12 +99,13 @@ file_open_dialog_create (Gimp *gimp,
GtkWidget *dialog;
dialog = gimp_file_dialog_new (gimp, gimp->load_procs,
GTK_FILE_CHOOSER_ACTION_OPEN,
menu_factory, "<Load>",
_("Open Image"), "gimp-file-open",
GTK_STOCK_OPEN,
GIMP_HELP_FILE_OPEN);
gtk_file_selection_set_select_multiple (GTK_FILE_SELECTION (dialog), TRUE);
gtk_file_chooser_set_select_multiple (GTK_FILE_CHOOSER (dialog), TRUE);
gimp_dialog_factory_add_foreign (global_dialog_factory,
"gimp-file-open-dialog",
......@@ -124,11 +123,8 @@ file_open_dialog_response (GtkWidget *open_dialog,
gint response_id,
Gimp *gimp)
{
GtkFileSelection *fs;
gchar **selections;
gchar *uri;
const gchar *entered_filename;
gint i;
GSList *uris;
GSList *list;
if (response_id != GTK_RESPONSE_OK)
{
......@@ -136,83 +132,33 @@ file_open_dialog_response (GtkWidget *open_dialog,
return;
}
fs = GTK_FILE_SELECTION (open_dialog);
selections = gtk_file_selection_get_selections (fs);
if (selections == NULL)
return;
entered_filename = gtk_entry_get_text (GTK_ENTRY (fs->selection_entry));
if (g_file_test (selections[0], G_FILE_TEST_IS_DIR))
{
if (selections[0][strlen (selections[0]) - 1] != G_DIR_SEPARATOR)
{
gchar *s = g_strconcat (selections[0], G_DIR_SEPARATOR_S, NULL);
gtk_file_selection_set_filename (fs, s);
g_free (s);
}
else
{
gtk_file_selection_set_filename (fs, selections[0]);
}
g_strfreev (selections);
return;
}
if (strstr (entered_filename, "://"))
{
/* try with the entered filename if it looks like an URI */
uri = g_strdup (entered_filename);
}
else
{
uri = g_filename_to_uri (selections[0], NULL, NULL);
}
uris = gtk_file_chooser_get_uris (GTK_FILE_CHOOSER (open_dialog));
gtk_widget_set_sensitive (open_dialog, FALSE);
if (file_open_dialog_open_image (open_dialog,
gimp,
uri,
entered_filename,
GIMP_FILE_DIALOG (open_dialog)->file_proc))
for (list = uris; list; list = g_slist_next (list))
{
gtk_widget_hide (open_dialog);
}
g_free (uri);
/*
* Now deal with multiple selections from the filesel list
*/
gchar *filename = g_filename_from_uri (list->data, NULL, NULL);
for (i = 1; selections[i] != NULL; i++)
{
if (g_file_test (selections[i], G_FILE_TEST_IS_REGULAR))
{
uri = g_filename_to_uri (selections[i], NULL, NULL);
if (file_open_dialog_open_image (open_dialog,
if (g_file_test (filename, G_FILE_TEST_IS_REGULAR))
{
if (file_open_dialog_open_image (open_dialog,
gimp,
uri,
uri,
list->data,
list->data,
GIMP_FILE_DIALOG (open_dialog)->file_proc))
{
gtk_widget_hide (open_dialog);
}
}
g_free (uri);
}
g_free (filename);
}
g_strfreev (selections);
gtk_widget_set_sensitive (open_dialog, TRUE);
g_slist_foreach (uris, (GFunc) g_free, NULL);
g_slist_free (uris);
}
static gboolean
......
......@@ -147,6 +147,7 @@ file_save_dialog_create (Gimp *gimp,
GtkWidget *save_dialog;
save_dialog = gimp_file_dialog_new (gimp, gimp->save_procs,
GTK_FILE_CHOOSER_ACTION_SAVE,
menu_factory, "<Save>",
_("Save Image"), "gimp-file-save",
GTK_STOCK_SAVE,
......@@ -168,10 +169,9 @@ file_save_dialog_response (GtkWidget *save_dialog,
gint response_id,
Gimp *gimp)
{
GtkFileSelection *fs;
const gchar *filename;
const gchar *raw_filename;
gchar *uri;
GtkFileChooser *chooser = GTK_FILE_CHOOSER (save_dialog);
gchar *uri;
gchar *filename;
if (response_id != GTK_RESPONSE_OK)
{
......@@ -179,34 +179,13 @@ file_save_dialog_response (GtkWidget *save_dialog,
return;
}
fs = GTK_FILE_SELECTION (save_dialog);
uri = gtk_file_chooser_get_uri (chooser);
filename = gtk_file_selection_get_filename (fs);
raw_filename = gtk_entry_get_text (GTK_ENTRY (fs->selection_entry));
g_assert (filename && raw_filename);
uri = g_filename_to_uri (filename, NULL, NULL);
filename = g_filename_from_uri (uri, NULL, NULL);
if (g_file_test (filename, G_FILE_TEST_EXISTS))
{
if (g_file_test (filename, G_FILE_TEST_IS_DIR))
{
if (filename[strlen (filename) - 1] != G_DIR_SEPARATOR)
{
gchar *s = g_strconcat (filename, G_DIR_SEPARATOR_S, NULL);
gtk_file_selection_set_filename (fs, s);
g_free (s);
}
else
{
gtk_file_selection_set_filename (fs, filename);
}
}
else
{
file_save_overwrite (save_dialog, uri, raw_filename);
}
file_save_overwrite (save_dialog, uri, uri);
}
else
{
......@@ -217,7 +196,7 @@ file_save_dialog_response (GtkWidget *save_dialog,
if (file_save_dialog_save_image (save_dialog,
dialog->gimage,
uri,
raw_filename,
uri,
dialog->file_proc,
dialog->set_uri_and_proc,
dialog->set_image_clean))
......@@ -229,6 +208,7 @@ file_save_dialog_response (GtkWidget *save_dialog,
}
g_free (uri);
g_free (filename);
}
typedef struct _OverwriteData OverwriteData;
......
......@@ -37,7 +37,6 @@ file_dialog_show (GtkWidget *dialog,
gimp_item_factories_set_sensitive ("<Image>", "/File/Save a Copy...", FALSE);
gtk_window_set_screen (GTK_WINDOW (dialog), gtk_widget_get_screen (parent));
gtk_widget_grab_focus (GTK_FILE_SELECTION (dialog)->selection_entry);
gtk_window_present (GTK_WINDOW (dialog));
}
......
......@@ -86,8 +86,6 @@ file_open_dialog_show (Gimp *gimp,
gtk_window_set_screen (GTK_WINDOW (fileload),
gtk_widget_get_screen (parent));
gtk_widget_grab_focus (GTK_FILE_SELECTION (fileload)->selection_entry);
gtk_window_present (GTK_WINDOW (fileload));
}
......@@ -101,12 +99,13 @@ file_open_dialog_create (Gimp *gimp,
GtkWidget *dialog;
dialog = gimp_file_dialog_new (gimp, gimp->load_procs,
GTK_FILE_CHOOSER_ACTION_OPEN,
menu_factory, "<Load>",
_("Open Image"), "gimp-file-open",
GTK_STOCK_OPEN,
GIMP_HELP_FILE_OPEN);
gtk_file_selection_set_select_multiple (GTK_FILE_SELECTION (dialog), TRUE);
gtk_file_chooser_set_select_multiple (GTK_FILE_CHOOSER (dialog), TRUE);
gimp_dialog_factory_add_foreign (global_dialog_factory,
"gimp-file-open-dialog",
......@@ -124,11 +123,8 @@ file_open_dialog_response (GtkWidget *open_dialog,
gint response_id,
Gimp *gimp)
{
GtkFileSelection *fs;
gchar **selections;
gchar *uri;
const gchar *entered_filename;
gint i;
GSList *uris;
GSList *list;
if (response_id != GTK_RESPONSE_OK)
{
......@@ -136,83 +132,33 @@ file_open_dialog_response (GtkWidget *open_dialog,
return;
}
fs = GTK_FILE_SELECTION (open_dialog);
selections = gtk_file_selection_get_selections (fs);
if (selections == NULL)
return;
entered_filename = gtk_entry_get_text (GTK_ENTRY (fs->selection_entry));
if (g_file_test (selections[0], G_FILE_TEST_IS_DIR))
{
if (selections[0][strlen (selections[0]) - 1] != G_DIR_SEPARATOR)
{
gchar *s = g_strconcat (selections[0], G_DIR_SEPARATOR_S, NULL);
gtk_file_selection_set_filename (fs, s);
g_free (s);
}
else
{
gtk_file_selection_set_filename (fs, selections[0]);
}
g_strfreev (selections);
return;
}
if (strstr (entered_filename, "://"))
{
/* try with the entered filename if it looks like an URI */
uri = g_strdup (entered_filename);
}
else
{
uri = g_filename_to_uri (selections[0], NULL, NULL);
}
uris = gtk_file_chooser_get_uris (GTK_FILE_CHOOSER (open_dialog));
gtk_widget_set_sensitive (open_dialog, FALSE);
if (file_open_dialog_open_image (open_dialog,
gimp,
uri,
entered_filename,
GIMP_FILE_DIALOG (open_dialog)->file_proc))
for (list = uris; list; list = g_slist_next (list))
{
gtk_widget_hide (open_dialog);
}
g_free (uri);
/*
* Now deal with multiple selections from the filesel list
*/
gchar *filename = g_filename_from_uri (list->data, NULL, NULL);
for (i = 1; selections[i] != NULL; i++)
{
if (g_file_test (selections[i], G_FILE_TEST_IS_REGULAR))
{
uri = g_filename_to_uri (selections[i], NULL, NULL);
if (file_open_dialog_open_image (open_dialog,
if (g_file_test (filename, G_FILE_TEST_IS_REGULAR))
{
if (file_open_dialog_open_image (open_dialog,
gimp,
uri,
uri,
list->data,
list->data,
GIMP_FILE_DIALOG (open_dialog)->file_proc))
{
gtk_widget_hide (open_dialog);
}
}
g_free (uri);
}
g_free (filename);
}
g_strfreev (selections);
gtk_widget_set_sensitive (open_dialog, TRUE);
g_slist_foreach (uris, (GFunc) g_free, NULL);
g_slist_free (uris);
}
static gboolean
......
......@@ -147,6 +147,7 @@ file_save_dialog_create (Gimp *gimp,
GtkWidget *save_dialog;
save_dialog = gimp_file_dialog_new (gimp, gimp->save_procs,
GTK_FILE_CHOOSER_ACTION_SAVE,
menu_factory, "<Save>",
_("Save Image"), "gimp-file-save",
GTK_STOCK_SAVE,
......@@ -168,10 +169,9 @@ file_save_dialog_response (GtkWidget *save_dialog,
gint response_id,
Gimp *gimp)
{
GtkFileSelection *fs;
const gchar *filename;
const gchar *raw_filename;
gchar *uri;
GtkFileChooser *chooser = GTK_FILE_CHOOSER (save_dialog);
gchar *uri;
gchar *filename;
if (response_id != GTK_RESPONSE_OK)
{
......@@ -179,34 +179,13 @@ file_save_dialog_response (GtkWidget *save_dialog,
return;
}
fs = GTK_FILE_SELECTION (save_dialog);
uri = gtk_file_chooser_get_uri (chooser);
filename = gtk_file_selection_get_filename (fs);
raw_filename = gtk_entry_get_text (GTK_ENTRY (fs->selection_entry));
g_assert (filename && raw_filename);
uri = g_filename_to_uri (filename, NULL, NULL);
filename = g_filename_from_uri (uri, NULL, NULL);
if (g_file_test (filename, G_FILE_TEST_EXISTS))
{
if (g_file_test (filename, G_FILE_TEST_IS_DIR))
{
if (filename[strlen (filename) - 1] != G_DIR_SEPARATOR)
{
gchar *s = g_strconcat (filename, G_DIR_SEPARATOR_S, NULL);
gtk_file_selection_set_filename (fs, s);
g_free (s);
}
else
{
gtk_file_selection_set_filename (fs, filename);
}
}
else
{
file_save_overwrite (save_dialog, uri, raw_filename);
}
file_save_overwrite (save_dialog, uri, uri);
}
else
{
......@@ -217,7 +196,7 @@ file_save_dialog_response (GtkWidget *save_dialog,
if (file_save_dialog_save_image (save_dialog,
dialog->gimage,
uri,
raw_filename,
uri,
dialog->file_proc,
dialog->set_uri_and_proc,
dialog->set_image_clean))
......@@ -229,6 +208,7 @@ file_save_dialog_response (GtkWidget *save_dialog,
}
g_free (uri);
g_free (filename);
}
typedef struct _OverwriteData OverwriteData;
......
......@@ -61,9 +61,9 @@ gradients_save_as_pov_ray_cmd_callback (GtkWidget *widget,
static void
gradients_save_as_pov_query (GimpContainerEditor *editor)
{
GimpGradient *gradient;
GtkFileSelection *filesel;
gchar *title;
GimpGradient *gradient;
GtkFileChooser *chooser;
gchar *title;
gradient = gimp_context_get_gradient (editor->view->context);
......@@ -73,34 +73,41 @@ gradients_save_as_pov_query (GimpContainerEditor *editor)
title = g_strdup_printf (_("Save '%s' as POV-Ray"),
GIMP_OBJECT (gradient)->name);
filesel = GTK_FILE_SELECTION (gtk_file_selection_new (title));
chooser = GTK_FILE_CHOOSER
(gtk_file_chooser_dialog_new (title, NULL,
GTK_FILE_CHOOSER_ACTION_SAVE,
GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
GTK_STOCK_SAVE, GTK_RESPONSE_OK,
NULL));
g_free (title);
gtk_window_set_screen (GTK_WINDOW (filesel),
gtk_window_set_screen (GTK_WINDOW (chooser),
gtk_widget_get_screen (GTK_WIDGET (editor)));
gtk_window_set_role (GTK_WINDOW (filesel), "gimp-gradient-save-pov");
gtk_window_set_position (GTK_WINDOW (filesel), GTK_WIN_POS_MOUSE);
gtk_container_set_border_width (GTK_CONTAINER (filesel), 6);
gtk_container_set_border_width (GTK_CONTAINER (filesel->button_area), 4);
gtk_window_set_role (GTK_WINDOW (chooser), "gimp-gradient-save-pov");
gtk_window_set_position (GTK_WINDOW (chooser), GTK_WIN_POS_MOUSE);
g_signal_connect (filesel, "response",
g_signal_connect (chooser, "response",
G_CALLBACK (gradients_save_as_pov_response),
gradient);
g_signal_connect (chooser, "delete_event",
G_CALLBACK (gtk_true),
NULL);
g_object_ref (gradient);
g_signal_connect_object (filesel, "destroy",
g_signal_connect_object (chooser, "destroy",
G_CALLBACK (g_object_unref),
gradient,
G_CONNECT_SWAPPED);
gimp_help_connect (GTK_WIDGET (filesel), gimp_standard_help_func,
gimp_help_connect (GTK_WIDGET (chooser), gimp_standard_help_func,
GIMP_HELP_GRADIENT_SAVE_AS_POV, NULL);
gtk_widget_show (GTK_WIDGET (filesel));
gtk_widget_show (GTK_WIDGET (chooser));
}
static void
......@@ -113,7 +120,7 @@ gradients_save_as_pov_response (GtkWidget *dialog,
const gchar *filename;
GError *error = NULL;
filename = gtk_file_selection_get_filename (GTK_FILE_SELECTION (dialog));
filename = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (dialog));
if (! gimp_gradient_save_as_pov (gradient, filename, &error))
{
......
......@@ -645,7 +645,7 @@ vectors_import_response (GtkWidget *dialog,
const gchar *filename;
GError *error = NULL;
filename = gtk_file_selection_get_filename (GTK_FILE_SELECTION (dialog));
filename = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (dialog));