[gimp: 12/27] app: Improve save and export error messages
- From: Martin Nordholts <martinn src gnome org>
- To: svn-commits-list gnome org
- Subject: [gimp: 12/27] app: Improve save and export error messages
- Date: Sat, 16 May 2009 07:25:22 -0400 (EDT)
commit 64f7d9b93bcba2ba32b3f276ec189899a32cf973
Author: Martin Nordholts <martinn src gnome org>
Date: Sat Apr 25 21:46:25 2009 +0200
app: Improve save and export error messages
---
app/dialogs/file-save-dialog.c | 45 ++++++++++++++++++++++++++++++++--------
1 files changed, 36 insertions(+), 9 deletions(-)
diff --git a/app/dialogs/file-save-dialog.c b/app/dialogs/file-save-dialog.c
index 8557428..a973bc7 100644
--- a/app/dialogs/file-save-dialog.c
+++ b/app/dialogs/file-save-dialog.c
@@ -73,7 +73,8 @@ static gchar * file_save_dialog_get_uri (GimpFileDialog *dialo
static GSList * file_save_dialog_get_procs (GimpFileDialog *dialog,
Gimp *gimp);
static void file_save_dialog_unknown_ext_msg (GimpFileDialog *dialog,
- Gimp *gimp);
+ Gimp *gimp,
+ const gchar *basename);
static gboolean file_save_dialog_use_extension (GtkWidget *save_dialog,
const gchar *uri);
@@ -378,7 +379,7 @@ file_save_dialog_check_uri (GtkWidget *save_dialog,
GIMP_LOG (SAVE_DIALOG,
"unable to figure save_proc, bailing out");
- file_save_dialog_unknown_ext_msg (dialog, gimp);
+ file_save_dialog_unknown_ext_msg (dialog, gimp, basename);
g_free (uri);
g_free (basename);
@@ -411,7 +412,7 @@ file_save_dialog_check_uri (GtkWidget *save_dialog,
GIMP_LOG (SAVE_DIALOG,
"basename has no useful extension, bailing out");
- file_save_dialog_unknown_ext_msg (dialog, gimp);
+ file_save_dialog_unknown_ext_msg (dialog, gimp, basename);
g_free (uri);
g_free (basename);
@@ -548,13 +549,39 @@ file_save_dialog_get_procs (GimpFileDialog *dialog,
static void
file_save_dialog_unknown_ext_msg (GimpFileDialog *dialog,
- Gimp *gimp)
+ Gimp *gimp,
+ const gchar *basename)
{
- gimp_message (gimp, G_OBJECT (dialog), GIMP_MESSAGE_WARNING,
- _("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."));
+ GimpPlugInProcedure *proc_in_other_group;
+
+ proc_in_other_group =
+ file_procedure_find ((dialog->export ?
+ gimp->plug_in_manager->save_procs :
+ gimp->plug_in_manager->export_procs),
+ basename,
+ NULL);
+
+ if (dialog->export && proc_in_other_group)
+ {
+ gimp_message (gimp, G_OBJECT (dialog), GIMP_MESSAGE_WARNING,
+ _("You can use this dialog to export to various file formats. "
+ "If you want to save the image to the GIMP XCF format, use "
+ "Fileâ??Save instead."));
+ }
+ else if (! dialog->export && proc_in_other_group)
+ {
+ gimp_message (gimp, G_OBJECT (dialog), GIMP_MESSAGE_WARNING,
+ _("You can use this dialog to save to the GIMP XCF "
+ "format. Use Fileâ??Export to export to other file formats."));
+ }
+ else
+ {
+ gimp_message (gimp, G_OBJECT (dialog), GIMP_MESSAGE_WARNING,
+ _("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."));
+ }
}
static gboolean
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]