From 7efced56877a0b35e6a2e88729f62c697c2e23e0 Mon Sep 17 00:00:00 2001 From: Federico Mena Quintero Date: Thu, 13 Mar 2008 00:45:58 +0000 Subject: [PATCH] Present an error if we can't load the folder during explicit completion Signed-off-by: Federico Mena Quintero svn path=/trunk/; revision=19851 --- gtk/gtkfilechooserentry.c | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/gtk/gtkfilechooserentry.c b/gtk/gtkfilechooserentry.c index 097f46b61a..edda9f9f10 100644 --- a/gtk/gtkfilechooserentry.c +++ b/gtk/gtkfilechooserentry.c @@ -1264,11 +1264,26 @@ load_directory_get_folder_callback (GtkFileSystemHandle *handle, chooser_entry->load_folder_handle = NULL; - /* FIXME: if there was an error *AND* we had a pending explicit completion, beep and pop up a - * tooltip to say that the folder could not be loaded. - */ + if (error) + { + LoadCompleteAction old_load_complete_action; - /* FIXME: if error, remove the current tooltip ("making completion list") */ + old_load_complete_action = chooser_entry->load_complete_action; + + clear_completions (chooser_entry); + + if (old_load_complete_action == LOAD_COMPLETE_EXPLICIT_COMPLETION) + { + /* Since this came from explicit user action (Tab completion), we'll present errors visually */ + char *msg; + + beep (chooser_entry); + + msg = g_strdup_printf (_("Could not load folder: %s"), error->message); + pop_up_completion_feedback (chooser_entry, msg); + g_free (msg); + } + } if (cancelled || error) goto out;