Commit 6f6bb905 authored by Sven Neumann's avatar Sven Neumann Committed by Sven Neumann

for load and save errors, use a GtkMessageDialog and make it transient for

2006-08-10  Sven Neumann  <sven@gimp.org>

	* app/tools/gimpimagemaptool.c: for load and save errors, use a
	GtkMessageDialog and make it transient for the tool dialog.

	* app/tools/gimpvectortool.c: use gimp_message().
parent 056c8f77
2006-08-10 Sven Neumann <neumann@jpk.com>
2006-08-10 Sven Neumann <sven@gimp.org>
* app/tools/gimpimagemaptool.c: for load and save errors, use a
GtkMessageDialog and make it transient for the tool dialog.
* app/tools/gimpvectortool.c: use gimp_message().
2006-08-10 Sven Neumann <sven@gimp.org>
......
......@@ -36,6 +36,7 @@
#include "core/gimpimage-pick-color.h"
#include "core/gimpimagemap.h"
#include "core/gimppickable.h"
#include "core/gimpprogress.h"
#include "core/gimpprojection.h"
#include "core/gimptoolinfo.h"
......@@ -96,7 +97,9 @@ static void gimp_image_map_tool_save_ext_clicked (GtkWidget *widget,
static void gimp_image_map_tool_settings_dialog (GimpImageMapTool *im_tool,
const gchar *title,
gboolean save);
static void gimp_image_map_tool_error_dialog (GimpImageMapTool *tool,
const gchar *format,
...) G_GNUC_PRINTF(2,3);
static void gimp_image_map_tool_notify_preview (GObject *config,
GParamSpec *pspec,
GimpImageMapTool *im_tool);
......@@ -580,11 +583,13 @@ gimp_image_map_tool_load_save (GimpImageMapTool *tool,
if (! file)
{
g_message (save ?
_("Could not open '%s' for writing: %s") :
_("Could not open '%s' for reading: %s"),
gimp_filename_to_utf8 (filename),
g_strerror (errno));
const gchar *format = save ?
_("Could not open '%s' for writing: %s") :
_("Could not open '%s' for reading: %s");
gimp_image_map_tool_error_dialog (tool, format,
gimp_filename_to_utf8 (filename),
g_strerror (errno));
return;
}
......@@ -598,8 +603,10 @@ gimp_image_map_tool_load_save (GimpImageMapTool *tool,
}
else if (! gimp_image_map_tool_settings_load (tool, file, &error))
{
g_message (_("Error reading '%s': %s"),
gimp_filename_to_utf8 (filename), error->message);
gimp_image_map_tool_error_dialog (tool,
_("Error reading '%s': %s"),
gimp_filename_to_utf8 (filename),
error->message);
g_error_free (error);
}
......@@ -776,3 +783,30 @@ gimp_image_map_tool_settings_dialog (GimpImageMapTool *tool,
gtk_widget_show (tool->settings_dialog);
}
static void
gimp_image_map_tool_error_dialog (GimpImageMapTool *tool,
const gchar *format,
...)
{
GtkWidget *dialog;
gchar *text;
va_list args;
va_start (args, format);
text = g_strdup_vprintf (format, args);
va_end (args);
dialog = gtk_message_dialog_new (GTK_WINDOW (tool->shell),
GTK_DIALOG_DESTROY_WITH_PARENT,
GTK_MESSAGE_ERROR,
GTK_BUTTONS_OK,
text);
g_free (text);
g_signal_connect_swapped (dialog, "response",
G_CALLBACK (gtk_widget_destroy),
dialog);
gtk_widget_show (dialog);
}
......@@ -36,6 +36,7 @@
#include "core/gimpimage.h"
#include "core/gimpimage-undo-push.h"
#include "core/gimplist.h"
#include "core/gimpprogress.h"
#include "core/gimptoolinfo.h"
#include "core/gimpundo.h"
#include "core/gimpundostack.h"
......@@ -1891,7 +1892,9 @@ gimp_vector_tool_stroke_vectors (GimpVectorTool *vector_tool,
if (! active_drawable)
{
g_message (_("There is no active layer or channel to stroke to"));
gimp_message (image->gimp,
GIMP_PROGRESS (GIMP_TOOL (vector_tool)->display),
_("There is no active layer or channel to stroke to"));
return;
}
......
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