diff options
author | Federico Mena Quintero <federico@novell.com> | 2009-09-02 13:43:03 -0500 |
---|---|---|
committer | Benjamin Otte <otte@gnome.org> | 2009-10-15 22:06:15 +0200 |
commit | ccee7ef4fb19097eaa2cbbf4fea94da3dfc89178 (patch) | |
tree | dd4b0815b3ef3fb3b3a8702f740c6e63fb5b1450 /gtk/gtkfilechooserdefault.c | |
parent | 3b8697307523576106e5c38fb4a2a83260cc94ed (diff) | |
download | gtk+-ccee7ef4fb19097eaa2cbbf4fea94da3dfc89178.tar.gz |
Show an error dialog when we can't read the folder's contents
Signed-off-by: Federico Mena Quintero <federico@novell.com>
Diffstat (limited to 'gtk/gtkfilechooserdefault.c')
-rw-r--r-- | gtk/gtkfilechooserdefault.c | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/gtk/gtkfilechooserdefault.c b/gtk/gtkfilechooserdefault.c index dd835e9883..caa201942c 100644 --- a/gtk/gtkfilechooserdefault.c +++ b/gtk/gtkfilechooserdefault.c @@ -6386,6 +6386,29 @@ pending_select_files_process (GtkFileChooserDefault *impl) g_assert (impl->pending_select_files == NULL); } +static void +show_error_on_reading_current_folder (GtkFileChooserDefault *impl, GError *error) +{ + GFileInfo *info; + char *msg; + + info = g_file_query_info (impl->current_folder, + G_FILE_ATTRIBUTE_STANDARD_DISPLAY_NAME, + G_FILE_QUERY_INFO_NONE, + NULL, + NULL); + if (info) + { + msg = g_strdup (_("Could not read the contents of %s"), g_file_info_get_display_name (info)); + g_object_unref (info); + } + else + msg = g_strdup (_("Could not read the contents of the folder")); + + error_message (impl, msg, error->message); + g_free (msg); +} + /* Callback used when the file system model finishes loading */ static void browse_files_model_finished_loading_cb (GtkFileSystemModel *model, @@ -6394,6 +6417,9 @@ browse_files_model_finished_loading_cb (GtkFileSystemModel *model, { profile_start ("start", NULL); + if (error) + show_error_on_reading_current_folder (impl, error); + if (impl->load_state == LOAD_PRELOAD) { load_remove_timer (impl); |