From 22c76b0d7487700ea00f5ec131faca887b389cbc Mon Sep 17 00:00:00 2001 From: Rohini S Date: Mon, 16 Jan 2006 07:32:16 +0000 Subject: ** Fixes bug #221270. 2006-01-12 Rohini S ** Fixes bug #221270. * mail-send-recv.c: (format_url), (build_dialog): Changed to display account name in Send/Receive dialog. svn path=/trunk/; revision=31199 --- mail/ChangeLog | 8 +++++++- mail/mail-send-recv.c | 38 ++++++++++++++++++++++++-------------- 2 files changed, 31 insertions(+), 15 deletions(-) diff --git a/mail/ChangeLog b/mail/ChangeLog index 85253bca5f..dd70b33df2 100644 --- a/mail/ChangeLog +++ b/mail/ChangeLog @@ -1,5 +1,11 @@ -2006-01-16 Srinivasa Ragavan +2006-01-12 Rohini S + + ** Fixes bug #221270. + * mail-send-recv.c: (format_url), (build_dialog): + Changed to display account name in Send/Receive dialog. + +2006-01-16 Srinivasa Ragavan * em-format-html-display.c: (em_format_html_display_new): Changed event to scroll_event in rajeev's patch. diff --git a/mail/mail-send-recv.c b/mail/mail-send-recv.c index ec1ab66eaa..2cb6338ab2 100644 --- a/mail/mail-send-recv.c +++ b/mail/mail-send-recv.c @@ -255,19 +255,28 @@ static void operation_status(CamelOperation *op, const char *what, int pc, void static int operation_status_timeout(void *data); static char * -format_url(const char *internal_url) +format_url(const char *internal_url, const char *account_name) { CamelURL *url; char *pretty_url; url = camel_url_new(internal_url, NULL); - if (url->host && *url->host) - pretty_url = g_strdup_printf(_("Server: %s, Type: %s"), url->host, url->protocol); - else if (url->path) - pretty_url = g_strdup_printf(_("Path: %s, Type: %s"), url->path, url->protocol); - else - pretty_url = g_strdup_printf(_("Type: %s"), url->protocol); - + if (account_name) { + if (url->host && *url->host) + pretty_url = g_strdup_printf(_("%s (%s) : %s"), account_name, url->protocol, url->host); + else if (url->path) + pretty_url = g_strdup_printf(_("%s (%s) : %s"), account_name, url->protocol, url->path); + else + pretty_url = g_strdup_printf(_("%s (%s)"), account_name, url->protocol); + } + else { + if (url->host && *url->host) + pretty_url = g_strdup_printf(_("%s : %s"), url->protocol, url->host); + else if (url->path) + pretty_url = g_strdup_printf(_("%s : %s"), url->protocol, url->path); + else + pretty_url = g_strdup_printf(_("%s"), url->protocol); + } camel_url_free(url); return pretty_url; @@ -404,9 +413,9 @@ build_dialog (EAccountList *accounts, CamelFolder *outbox, const char *destinati info->timeout_id = g_timeout_add (STATUS_TIMEOUT, operation_status_timeout, info); recv_icon = e_icon_factory_get_image ("stock_mail-receive", E_ICON_SIZE_LARGE_TOOLBAR); - - pretty_url = format_url (source->url); - label = (GtkLabel *)gtk_label_new (pretty_url); + pretty_url = format_url (source->url, account->name); + label = (GtkLabel *)gtk_label_new (NULL); + gtk_label_set_markup (label, pretty_url); g_free (pretty_url); bar = (GtkProgressBar *)gtk_progress_bar_new (); @@ -457,9 +466,10 @@ build_dialog (EAccountList *accounts, CamelFolder *outbox, const char *destinati info->timeout_id = g_timeout_add (STATUS_TIMEOUT, operation_status_timeout, info); send_icon = e_icon_factory_get_image ("stock_mail-send", E_ICON_SIZE_LARGE_TOOLBAR); - - pretty_url = format_url (destination); - label = (GtkLabel *)gtk_label_new (pretty_url); + pretty_url = format_url (destination, NULL); + label = (GtkLabel *)gtk_label_new (NULL); + gtk_label_set_markup (label, pretty_url); + g_free (pretty_url); bar = (GtkProgressBar *)gtk_progress_bar_new (); -- cgit v1.2.3