GitLab repository storage has been migrated to hashed layout. Please contact Infrastructure team if you notice any issues with repositories or hooks.

Commit d725502c authored by Sven Neumann's avatar Sven Neumann Committed by Sven Neumann

add a shortcut to the filechooser that points to the user's folder.

2004-09-28  Sven Neumann  <sven@gimp.org>

	* app/tools/gimpimagemaptool.c (gimp_image_map_tool_settings_dialog):
	add a shortcut to the filechooser that points to the user's folder.

	* app/actions/vectors-commands.c: added a file filter to the SVG
	import dialog.
parent fadd9ca0
2004-09-28 Sven Neumann <sven@gimp.org>
* app/tools/gimpimagemaptool.c (gimp_image_map_tool_settings_dialog):
add a shortcut to the filechooser that points to the user's folder.
* app/actions/vectors-commands.c: added a file filter to the SVG
import dialog.
2004-09-27 Sven Neumann <sven@gimp.org>
* app/widgets/gimpthumbbox.c (gimp_thumb_box_new): added some
......
......@@ -618,6 +618,7 @@ vectors_new_vectors_response (GtkWidget *widget,
if (vectors_name)
g_free (vectors_name);
vectors_name =
g_strdup (gtk_entry_get_text (GTK_ENTRY (options->name_entry)));
......@@ -657,37 +658,48 @@ static void
vectors_import_query (GimpImage *gimage,
GtkWidget *parent)
{
GtkFileChooser *chooser;
GtkWidget *dialog;
GtkFileFilter *filter;
chooser = GTK_FILE_CHOOSER
(gtk_file_chooser_dialog_new (_("Import Paths from SVG"), NULL,
GTK_FILE_CHOOSER_ACTION_OPEN,
dialog = gtk_file_chooser_dialog_new (_("Import Paths from SVG"), NULL,
GTK_FILE_CHOOSER_ACTION_OPEN,
GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
GTK_STOCK_OPEN, GTK_RESPONSE_OK,
GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
GTK_STOCK_OPEN, GTK_RESPONSE_OK,
NULL));
NULL);
g_object_weak_ref (G_OBJECT (gimage), (GWeakNotify) gtk_widget_destroy,
chooser);
g_object_weak_ref (G_OBJECT (gimage),
(GWeakNotify) gtk_widget_destroy, dialog);
gtk_window_set_screen (GTK_WINDOW (chooser),
gtk_widget_get_screen (parent));
gtk_window_set_screen (GTK_WINDOW (dialog), gtk_widget_get_screen (parent));
gtk_window_set_role (GTK_WINDOW (chooser), "gimp-vectors-import");
gtk_window_set_position (GTK_WINDOW (chooser), GTK_WIN_POS_MOUSE);
gtk_window_set_role (GTK_WINDOW (dialog), "gimp-vectors-import");
gtk_window_set_position (GTK_WINDOW (dialog), GTK_WIN_POS_MOUSE);
g_signal_connect (chooser, "response",
g_signal_connect (dialog, "response",
G_CALLBACK (vectors_import_response),
gimage);
g_signal_connect (chooser, "delete_event",
g_signal_connect (dialog, "delete_event",
G_CALLBACK (gtk_true),
NULL);
/* FIXME: add a proper file selector
and controls for merge and scale options */
filter = gtk_file_filter_new ();
gtk_file_filter_set_name (filter, _("All Files (*.*)"));
gtk_file_filter_add_pattern (filter, "*");
gtk_file_chooser_add_filter (GTK_FILE_CHOOSER (dialog), filter);
filter = gtk_file_filter_new ();
gtk_file_filter_set_name (filter, _("Scalable SVG image (*.svg)"));
gtk_file_filter_add_pattern (filter, "*.svg");
gtk_file_filter_add_mime_type (filter, "image/svg+xml");
gtk_file_chooser_add_filter (GTK_FILE_CHOOSER (dialog), filter);
gtk_file_chooser_set_filter (GTK_FILE_CHOOSER (dialog), filter);
/* FIXME: add controls for merge and scale options */
gtk_widget_show (GTK_WIDGET (chooser));
gtk_widget_show (dialog);
}
static void
......@@ -723,34 +735,34 @@ vectors_export_query (GimpImage *gimage,
GimpVectors *vectors,
GtkWidget *parent)
{
GtkFileChooser *chooser;
GtkWidget *dialog;
chooser = GTK_FILE_CHOOSER
(gtk_file_chooser_dialog_new (_("Export Path to SVG"), NULL,
GTK_FILE_CHOOSER_ACTION_SAVE,
dialog = gtk_file_chooser_dialog_new (_("Export Path to SVG"), NULL,
GTK_FILE_CHOOSER_ACTION_SAVE,
GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
GTK_STOCK_SAVE, GTK_RESPONSE_OK,
GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
GTK_STOCK_SAVE, GTK_RESPONSE_OK,
NULL));
NULL);
g_object_weak_ref (G_OBJECT (gimage), (GWeakNotify) gtk_widget_destroy,
chooser);
g_object_weak_ref (G_OBJECT (gimage),
(GWeakNotify) gtk_widget_destroy, dialog);
gtk_window_set_screen (GTK_WINDOW (chooser),
gtk_widget_get_screen (parent));
gtk_window_set_screen (GTK_WINDOW (dialog), gtk_widget_get_screen (parent));
gtk_window_set_role (GTK_WINDOW (chooser), "gimp-vectors-export");
gtk_window_set_position (GTK_WINDOW (chooser), GTK_WIN_POS_MOUSE);
gtk_window_set_role (GTK_WINDOW (dialog), "gimp-vectors-export");
gtk_window_set_position (GTK_WINDOW (dialog), GTK_WIN_POS_MOUSE);
g_signal_connect (chooser, "response",
g_signal_connect (dialog, "response",
G_CALLBACK (vectors_export_response),
gimage);
g_signal_connect (chooser, "delete_event",
g_signal_connect (dialog, "delete_event",
G_CALLBACK (gtk_true),
NULL);
gtk_widget_show (GTK_WIDGET (chooser));
/* FIXME: add control for saving all or just the active vectors */
gtk_widget_show (dialog);
}
static void
......
......@@ -585,6 +585,7 @@ gimp_image_map_tool_settings_dialog (GimpImageMapTool *tool,
{
GimpImageMapOptions *options;
GtkFileChooser *chooser;
gchar *folder;
g_return_if_fail (GIMP_IS_IMAGE_MAP_TOOL (tool));
......@@ -630,23 +631,22 @@ gimp_image_map_tool_settings_dialog (GimpImageMapTool *tool,
G_CALLBACK (gtk_true),
NULL);
if (GIMP_IMAGE_MAP_TOOL_GET_CLASS (tool)->settings_name)
folder = g_build_filename (gimp_directory (),
GIMP_IMAGE_MAP_TOOL_GET_CLASS (tool)->settings_name,
NULL);
if (folder)
gtk_file_chooser_add_shortcut_folder (chooser, folder, NULL);
options = GIMP_IMAGE_MAP_OPTIONS (GIMP_TOOL (tool)->tool_info->tool_options);
if (options->settings)
{
gtk_file_chooser_set_filename (chooser, options->settings);
}
else if (GIMP_IMAGE_MAP_TOOL_GET_CLASS (tool)->settings_name)
{
gchar *tmp;
tmp = g_build_filename (gimp_directory (),
GIMP_IMAGE_MAP_TOOL_GET_CLASS (tool)->settings_name,
NULL);
gtk_file_chooser_set_filename (chooser, options->settings);
else
gtk_file_chooser_set_current_folder (chooser, folder);
gtk_file_chooser_set_current_folder (chooser, tmp);
g_free (tmp);
}
g_free (folder);
gimp_help_connect (tool->settings_dialog, gimp_standard_help_func,
GIMP_TOOL (tool)->tool_info->help_id, NULL);
......
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