Hey! 

I have created a small addition to the attachment bar in the mail
composer.
What it does, is create a additional string to the "1 Attachment" / "2
Attachments" lable in the mail composer attachment bar.
Now it says, "1 Attachment, size of 5k" / "2 Attachments, total size of
100k"

I Personally think its a very handy thing to have, seeing how some SMTP
servers has a limit on how large your mails can be (i was tought
recently). If you have N attached files, it can be messy to know how
much you have attached to the mail.

was unsure how to create a patch for the 3 of the different files, into
1 patch, and since you cant put files on the list, i'll try to describe
where the things are supposed to be ;)

Best regards
/Nicklas

--evolution/composer/e-msg-composer-attachment-bar.h-- 
line 74: gchar* get_attachment_size_string (EMsgComposerAttachmentBar
*bar);
-----

--evolution/composer/e-msg-composer-attachment-bar.c--
line 404: gchar* get_attachment_size_string (EMsgComposerAttachmentBar
*bar) { 
        EMsgComposerAttachmentBarPrivate *priv;
        GList *p;
        gulong size=(gulong)0;
        
        priv = bar->priv;
        
        for (p = priv->attachments; p != NULL; p = p->next) {
                EMsgComposerAttachment *attachment;
                
                attachment = E_MSG_COMPOSER_ATTACHMENT (p->data);
                        
                size = size + (gulong)attachment->size;
        }
        return size_to_string(size);
}

----

--evolution/composer/e-msg-composer.c--
line 2308:      if (attachment_num) {
                gchar *num_text = 
                g_strdup_printf ( ngettext( (gchar *)g_strdup_printf 
                        ("<b>%d</b> Attachment, size of %s",(int)attachment_num,
                        get_attachment_size_string((EMsgComposerAttachmentBar *)
                        composer->attachment_bar)),
                        
                        (gchar *)g_strdup_printf
                        ("<b>%d</b> Attachments, total size of %s",
                        (int)attachment_num, get_attachment_size_string(
                        (EMsgComposerAttachmentBar *)composer->attachment_bar)) 
                        ,attachment_num));
                
                gtk_label_set_markup (GTK_LABEL(
                        composer->attachment_expander_num),num_text);
                                
                g_free (num_text);

                gtk_widget_show (composer->attachment_expander_icon);
                
        } else {
... (same as the old stuff)
----

_______________________________________________
evolution-hackers maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/evolution-hackers

Reply via email to