Also set the From field when replying

This commit is contained in:
Pierre Pronchery 2011-07-14 02:04:48 +00:00
parent 73c4228509
commit d938a0f1e6
4 changed files with 53 additions and 34 deletions

View File

@ -7,7 +7,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: Mailer 0.0.0\n" "Project-Id-Version: Mailer 0.0.0\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2011-07-14 03:41+0200\n" "POT-Creation-Date: 2011-07-14 04:04+0200\n"
"PO-Revision-Date: 2010-10-02 23:25+0200\n" "PO-Revision-Date: 2010-10-02 23:25+0200\n"
"Last-Translator: Pierre Pronchery <khorben@defora.org>\n" "Last-Translator: Pierre Pronchery <khorben@defora.org>\n"
"Language-Team: French\n" "Language-Team: French\n"
@ -157,28 +157,28 @@ msgstr "De: "
msgid "Subject: " msgid "Subject: "
msgstr "Sujet: " msgstr "Sujet: "
#: ../src/compose.c:573 #: ../src/compose.c:586
msgid "Attach file..." msgid "Attach file..."
msgstr "Joindre un fichier..." msgstr "Joindre un fichier..."
#: ../src/compose.c:661 ../src/compose.c:665 ../src/mailer.c:845 #: ../src/compose.c:674 ../src/compose.c:678 ../src/mailer.c:845
#: ../src/mailer.c:849 #: ../src/mailer.c:849
msgid "Error" msgid "Error"
msgstr "Erreur" msgstr "Erreur"
#: ../src/compose.c:780 #: ../src/compose.c:793
msgid "Sending mail..." msgid "Sending mail..."
msgstr "Envoi du message..." msgstr "Envoi du message..."
#: ../src/compose.c:787 #: ../src/compose.c:800
msgid "Progress: " msgid "Progress: "
msgstr "Progression : " msgstr "Progression : "
#: ../src/compose.c:1051 ../src/compose.c:1060 #: ../src/compose.c:1064 ../src/compose.c:1073
msgid "Warning" msgid "Warning"
msgstr "Attention" msgstr "Attention"
#: ../src/compose.c:1054 #: ../src/compose.c:1067
msgid "" msgid ""
"There are unsaved changes.\n" "There are unsaved changes.\n"
"Are you sure you want to close?" "Are you sure you want to close?"
@ -358,108 +358,108 @@ msgstr ""
msgid "Mailer - View source" msgid "Mailer - View source"
msgstr "Mailer - Source" msgstr "Mailer - Source"
#: ../src/mailer.c:1120 #: ../src/mailer.c:1125
msgid "Re: " msgid "Re: "
msgstr "Re: " msgstr "Re: "
#: ../src/mailer.c:1314 #: ../src/mailer.c:1319
msgid "Mailer preferences" msgid "Mailer preferences"
msgstr "Préférences de Mailer" msgstr "Préférences de Mailer"
#: ../src/mailer.c:1358 #: ../src/mailer.c:1363
msgid "Enabled" msgid "Enabled"
msgstr "Actif" msgstr "Actif"
#: ../src/mailer.c:1362 #: ../src/mailer.c:1367
msgid "Name" msgid "Name"
msgstr "Nom" msgstr "Nom"
#: ../src/mailer.c:1366 #: ../src/mailer.c:1371
msgid "Type" msgid "Type"
msgstr "Type" msgstr "Type"
#: ../src/mailer.c:1390 #: ../src/mailer.c:1395
msgid "Accounts" msgid "Accounts"
msgstr "Comptes" msgstr "Comptes"
#: ../src/mailer.c:1397 #: ../src/mailer.c:1402
msgid "Messages font:" msgid "Messages font:"
msgstr "Police des messages:" msgstr "Police des messages:"
#: ../src/mailer.c:1407 #: ../src/mailer.c:1412
msgid "Display" msgid "Display"
msgstr "Affichage" msgstr "Affichage"
#: ../src/mailer.c:1485 #: ../src/mailer.c:1490
msgid "No account plug-in available" msgid "No account plug-in available"
msgstr "Aucun greffon de compte disponible" msgstr "Aucun greffon de compte disponible"
#: ../src/mailer.c:1640 ../src/mailer.c:1928 #: ../src/mailer.c:1645 ../src/mailer.c:1933
msgid "Account name" msgid "Account name"
msgstr "Nom du compte" msgstr "Nom du compte"
#: ../src/mailer.c:1647 #: ../src/mailer.c:1652
msgid "Your name" msgid "Your name"
msgstr "Votre nom" msgstr "Votre nom"
#: ../src/mailer.c:1654 #: ../src/mailer.c:1659
msgid "e-mail address" msgid "e-mail address"
msgstr "Adresse e-mail" msgstr "Adresse e-mail"
#: ../src/mailer.c:1661 #: ../src/mailer.c:1666
msgid "Type of account" msgid "Type of account"
msgstr "Type de compte" msgstr "Type de compte"
#: ../src/mailer.c:1817 #: ../src/mailer.c:1822
msgid "Choose file" msgid "Choose file"
msgstr "Choisir un fichier" msgstr "Choisir un fichier"
#: ../src/mailer.c:1999 #: ../src/mailer.c:2004
msgid "hidden" msgid "hidden"
msgstr "masqué" msgstr "masqué"
#: ../src/mailer.c:2033 #: ../src/mailer.c:2038
msgid "Yes" msgid "Yes"
msgstr "Oui" msgstr "Oui"
#: ../src/mailer.c:2033 #: ../src/mailer.c:2038
msgid "No" msgid "No"
msgstr "Non" msgstr "Non"
#: ../src/mailer.c:2061 #: ../src/mailer.c:2066
msgid "Account type " msgid "Account type "
msgstr "Type de compte " msgstr "Type de compte "
#: ../src/mailer.c:2062 #: ../src/mailer.c:2067
msgid " active\n" msgid " active\n"
msgstr " actif\n" msgstr " actif\n"
#: ../src/mailer.c:2106 #: ../src/mailer.c:2111
msgid "Edit account: " msgid "Edit account: "
msgstr "Modification du compte: " msgstr "Modification du compte: "
#: ../src/mailer.c:2169 #: ../src/mailer.c:2174
msgid "An error occured while saving preferences" msgid "An error occured while saving preferences"
msgstr "Une erreur est survenue pendant la sauvegarde des préférences" msgstr "Une erreur est survenue pendant la sauvegarde des préférences"
#: ../src/mailer.c:2347 ../src/mailer.c:2351 #: ../src/mailer.c:2352 ../src/mailer.c:2356
msgid "Question" msgid "Question"
msgstr "Question" msgstr "Question"
#: ../src/mailer.c:2401 #: ../src/mailer.c:2406
#, c-format #, c-format
msgid "%s/%s: %d %s" msgid "%s/%s: %d %s"
msgstr "%s/%s: %d %s" msgstr "%s/%s: %d %s"
#: ../src/mailer.c:2404 #: ../src/mailer.c:2409
msgid "messages" msgid "messages"
msgstr "messages" msgstr "messages"
#: ../src/mailer.c:2404 #: ../src/mailer.c:2409
msgid "message" msgid "message"
msgstr "message" msgstr "message"
#: ../src/mailer.c:2407 #: ../src/mailer.c:2412
msgid "Ready" msgid "Ready"
msgstr "Prêt" msgstr "Prêt"

View File

@ -470,6 +470,11 @@ void compose_set_field(Compose * compose, char const * field,
gboolean valid; gboolean valid;
gchar * p; gchar * p;
if(strcmp(field, "From:") == 0)
{
compose_set_from(compose, value);
return;
}
for(valid = gtk_tree_model_get_iter_first(model, &iter); valid == TRUE; for(valid = gtk_tree_model_get_iter_first(model, &iter); valid == TRUE;
valid = gtk_tree_model_iter_next(model, &iter)) valid = gtk_tree_model_iter_next(model, &iter))
{ {
@ -498,6 +503,14 @@ void compose_set_font(Compose * compose, char const * font)
} }
/* compose_set_from */
void compose_set_from(Compose * compose, char const * from)
{
gtk_entry_set_text(GTK_ENTRY(gtk_bin_get_child(GTK_BIN(compose->from))),
from);
}
/* compose_set_modified */ /* compose_set_modified */
void compose_set_modified(Compose * compose, gboolean modified) void compose_set_modified(Compose * compose, gboolean modified)
{ {

View File

@ -35,6 +35,7 @@ void compose_delete(Compose * compose);
void compose_set_field(Compose * compose, char const * field, void compose_set_field(Compose * compose, char const * field,
char const * value); char const * value);
void compose_set_font(Compose * compose, char const * font); void compose_set_font(Compose * compose, char const * font);
void compose_set_from(Compose * compose, char const * from);
void compose_set_modified(Compose * compose, gboolean modified); void compose_set_modified(Compose * compose, gboolean modified);
void compose_set_standalone(Compose * compose, gboolean standalone); void compose_set_standalone(Compose * compose, gboolean standalone);
void compose_set_subject(Compose * compose, char const * subject); void compose_set_subject(Compose * compose, char const * subject);

View File

@ -1102,6 +1102,7 @@ static void _reply_selected(Mailer * mailer, GtkTreeModel * model,
char * date; char * date;
char * from; char * from;
char * subject; char * subject;
char * to;
char * p; char * p;
char const * q; char const * q;
GtkTextBuffer * tbuf; GtkTextBuffer * tbuf;
@ -1111,10 +1112,14 @@ static void _reply_selected(Mailer * mailer, GtkTreeModel * model,
if((compose = compose_new(mailer->config)) == NULL) if((compose = compose_new(mailer->config)) == NULL)
return; /* XXX error message? */ return; /* XXX error message? */
gtk_tree_model_get(model, iter, MHC_DATE_DISPLAY, &date, gtk_tree_model_get(model, iter, MHC_DATE_DISPLAY, &date,
MHC_FROM_EMAIL, &from, MHC_SUBJECT, &subject, -1); MHC_FROM_EMAIL, &from, MHC_SUBJECT, &subject,
MHC_TO_EMAIL, &to, -1);
/* from */ /* from */
if(from != NULL) if(from != NULL)
compose_set_field(compose, "To:", from); compose_set_field(compose, "To:", from);
/* to */
if(to != NULL)
compose_set_from(compose, to);
/* FIXME also set the In-Reply-To field */ /* FIXME also set the In-Reply-To field */
/* subject */ /* subject */
q = N_("Re: "); q = N_("Re: ");