diff options
Diffstat (limited to 'mail/em-account-editor.c')
-rw-r--r-- | mail/em-account-editor.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/mail/em-account-editor.c b/mail/em-account-editor.c index ce82449fa7..5fd986d938 100644 --- a/mail/em-account-editor.c +++ b/mail/em-account-editor.c @@ -1665,8 +1665,18 @@ emae_setup_service(EMAccountEditor *emae, EMAccountEditorService *service, Glade } if (url->user) gtk_entry_set_text(service->username, url->user); - if (service->pathentry && url->path) - gtk_file_chooser_set_filename (GTK_FILE_CHOOSER (service->pathentry), url->path); + if (service->pathentry) { + GtkFileChooserAction action = GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER; + + if (service->provider && (service->provider->url_flags & CAMEL_URL_NEED_PATH_DIR) == 0) + action = GTK_FILE_CHOOSER_ACTION_OPEN; + + if (action != gtk_file_chooser_get_action (GTK_FILE_CHOOSER (service->pathentry))) + gtk_file_chooser_set_action (GTK_FILE_CHOOSER (service->pathentry), action); + + if (url->path) + gtk_file_chooser_set_filename (GTK_FILE_CHOOSER (service->pathentry), url->path); + } tmp = camel_url_get_param(url, "use_ssl"); if (tmp == NULL) |