Commit 9c638c85 authored by Sven Neumann's avatar Sven Neumann Committed by Sven Neumann

use gimp_message().

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

	* app/dialogs/file-save-dialog.c: use gimp_message().

	* app/dialogs/preferences-dialog.c: use a GtkMessageDialog and
	make it transient for the preferences dialog.

	* libgimpwidgets/gimppropwidgets.c
	(gimp_prop_file_chooser_button_notify): use
	gtk_file_chooser_unselect_all() to unset the filename.
parent 6f6bb905
2006-08-10 Sven Neumann <sven@gimp.org>
* app/dialogs/file-save-dialog.c: use gimp_message().
* app/dialogs/preferences-dialog.c: use a GtkMessageDialog and
make it transient for the preferences dialog.
* libgimpwidgets/gimppropwidgets.c
(gimp_prop_file_chooser_button_notify): use
gtk_file_chooser_unselect_all() to unset the filename.
2006-08-10 Sven Neumann <sven@gimp.org>
* app/tools/gimpimagemaptool.c: for load and save errors, use a
......
......@@ -310,10 +310,11 @@ file_save_dialog_check_uri (GtkWidget *save_dialog,
G_STRFUNC);
#endif
g_message (_("The given filename does not have any known "
"file extension. Please enter a known file "
"extension or select a file format from the "
"file format list."));
gimp_message (gimp, GIMP_PROGRESS (save_dialog),
_("The given filename does not have any known "
"file extension. Please enter a known file "
"extension or select a file format from the "
"file format list."));
g_free (uri);
g_free (basename);
return FALSE;
......@@ -351,10 +352,12 @@ file_save_dialog_check_uri (GtkWidget *save_dialog,
/* remote URI */
g_message (_("Saving remote files needs to determine the "
"file format from the file extension. Please "
"enter a file extension that matches the selected "
"file format or enter no file extension at all."));
gimp_message (gimp, GIMP_PROGRESS (save_dialog),
_("Saving remote files needs to determine the "
"file format from the file extension. "
"Please enter a file extension that matches "
"the selected file format or enter no file "
"extension at all."));
g_free (uri);
g_free (basename);
return FALSE;
......
......@@ -79,6 +79,10 @@ static void prefs_response (GtkWidget *widget,
gint response_id,
GtkWidget *dialog);
static void prefs_message (GtkMessageType type,
gboolean destroy,
const gchar *message);
static void prefs_notebook_page_callback (GtkNotebook *notebook,
GtkNotebookPage *page,
guint page_num,
......@@ -352,7 +356,7 @@ prefs_response (GtkWidget *widget,
g_string_append_printf (string, "%s\n", param_spec->name);
}
g_message (string->str);
prefs_message (GTK_MESSAGE_INFO, FALSE, string->str);
g_string_free (string, TRUE);
}
......@@ -549,15 +553,16 @@ prefs_menus_clear_callback (GtkWidget *widget,
if (! menus_clear (gimp, &error))
{
g_message (error->message);
prefs_message (GTK_MESSAGE_ERROR, TRUE, error->message);
g_clear_error (&error);
}
else
{
gtk_widget_set_sensitive (widget, FALSE);
g_message (_("Your keyboard shortcuts will be reset to default values "
"the next time you start GIMP."));
prefs_message (GTK_MESSAGE_INFO, TRUE,
_("Your keyboard shortcuts will be reset to "
"default values the next time you start GIMP."));
}
}
......@@ -622,15 +627,16 @@ prefs_session_clear_callback (GtkWidget *widget,
if (! session_clear (gimp, &error))
{
g_message (error->message);
prefs_message (GTK_MESSAGE_ERROR, TRUE, error->message);
g_clear_error (&error);
}
else
{
gtk_widget_set_sensitive (widget, FALSE);
g_message (_("Your window setup will be reset to default values "
"the next time you start GIMP."));
prefs_message (GTK_MESSAGE_INFO, TRUE,
_("Your window setup will be reset to "
"default values the next time you start GIMP."));
}
}
......@@ -656,15 +662,16 @@ prefs_devices_clear_callback (GtkWidget *widget,
if (! gimp_devices_clear (gimp, &error))
{
g_message (error->message);
prefs_message (GTK_MESSAGE_ERROR, TRUE, error->message);
g_clear_error (&error);
}
else
{
gtk_widget_set_sensitive (widget, FALSE);
g_message (_("Your input device settings will be reset to "
"default values the next time you start GIMP."));
prefs_message (GTK_MESSAGE_INFO, TRUE,
_("Your input device settings will be reset to "
"default values the next time you start GIMP."));
}
}
......@@ -690,15 +697,16 @@ prefs_tool_options_clear_callback (GtkWidget *widget,
if (! gimp_tools_clear (gimp, &error))
{
g_message (error->message);
prefs_message (GTK_MESSAGE_ERROR, TRUE, error->message);
g_clear_error (&error);
}
else
{
gtk_widget_set_sensitive (widget, FALSE);
g_message (_("Your tool options will be reset to "
"default values the next time you start GIMP."));
prefs_message (GTK_MESSAGE_INFO, TRUE,
_("Your tool options will be reset to "
"default values the next time you start GIMP."));
}
}
......@@ -1252,6 +1260,25 @@ prefs_help_func (const gchar *help_id,
gimp_standard_help_func (help_id, NULL);
}
static void
prefs_message (GtkMessageType type,
gboolean destroy_with_parent,
const gchar *message)
{
GtkWidget *dialog;
dialog = gtk_message_dialog_new (GTK_WINDOW (prefs_dialog),
destroy_with_parent ?
GTK_DIALOG_DESTROY_WITH_PARENT : 0,
type, GTK_BUTTONS_OK,
message);
g_signal_connect_swapped (dialog, "response",
G_CALLBACK (gtk_widget_destroy),
dialog);
gtk_widget_show (dialog);
}
static GtkWidget *
prefs_dialog_new (Gimp *gimp,
GimpConfig *config)
......
......@@ -2065,7 +2065,10 @@ gimp_prop_file_chooser_button_notify (GObject *config,
gimp_prop_file_chooser_button_callback,
config);
gtk_file_chooser_set_filename (button, filename);
if (filename)
gtk_file_chooser_set_filename (button, filename);
else
gtk_file_chooser_unselect_all (button);
g_signal_handlers_unblock_by_func (button,
gimp_prop_file_chooser_button_callback,
......
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