Display the message count when selecting different folders

This commit is contained in:
Pierre Pronchery 2010-10-22 01:13:36 +00:00
parent 12f10e2939
commit 28f062ee27
3 changed files with 71 additions and 30 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: 2010-10-05 23:43+0200\n" "POT-Creation-Date: 2010-10-22 03:12+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"
@ -117,11 +117,11 @@ msgstr "Attacher"
msgid " - Compose" msgid " - Compose"
msgstr "" msgstr ""
#: ../src/compose.c:194 ../src/mailer.c:550 #: ../src/compose.c:194 ../src/mailer.c:565
msgid " From: " msgid " From: "
msgstr " De: " msgstr " De: "
#: ../src/compose.c:207 ../src/mailer.c:551 #: ../src/compose.c:207 ../src/mailer.c:566
msgid " To: " msgid " To: "
msgstr " À: " msgstr " À: "
@ -133,7 +133,7 @@ msgstr ""
msgid " BCC: " msgid " BCC: "
msgstr "" msgstr ""
#: ../src/compose.c:246 ../src/mailer.c:549 #: ../src/compose.c:246 ../src/mailer.c:564
msgid " Subject: " msgid " Subject: "
msgstr " Sujet: " msgstr " Sujet: "
@ -241,107 +241,120 @@ msgstr "Mailer"
msgid "Folders" msgid "Folders"
msgstr "Dossiers" msgstr "Dossiers"
#: ../src/mailer.c:449 #: ../src/mailer.c:445
#, c-format
msgid "%s/%s: %d %s"
msgstr ""
#: ../src/mailer.c:448
msgid "messages"
msgstr "messages"
#: ../src/mailer.c:448
msgid "message"
msgstr "message"
#: ../src/mailer.c:463
msgid "Subject" msgid "Subject"
msgstr "Sujet" msgstr "Sujet"
#: ../src/mailer.c:451 #: ../src/mailer.c:465
msgid "From" msgid "From"
msgstr "De" msgstr "De"
#: ../src/mailer.c:453 #: ../src/mailer.c:467
msgid "To" msgid "To"
msgstr "À" msgstr "À"
#: ../src/mailer.c:455 #: ../src/mailer.c:469
msgid "Date" msgid "Date"
msgstr "Date" msgstr "Date"
#: ../src/mailer.c:552 #: ../src/mailer.c:567
msgid " Date: " msgid " Date: "
msgstr " Date: " msgstr " Date: "
#: ../src/mailer.c:672 ../src/mailer.c:677 #: ../src/mailer.c:701 ../src/mailer.c:706
msgid "Error" msgid "Error"
msgstr "Erreur" msgstr "Erreur"
#: ../src/mailer.c:830 #: ../src/mailer.c:887
msgid "Mailer preferences" msgid "Mailer preferences"
msgstr "Préférences de Mailer" msgstr "Préférences de Mailer"
#: ../src/mailer.c:865 #: ../src/mailer.c:923
msgid "Enabled" msgid "Enabled"
msgstr "Actif" msgstr "Actif"
#: ../src/mailer.c:869 #: ../src/mailer.c:927
msgid "Name" msgid "Name"
msgstr "Nom" msgstr "Nom"
#: ../src/mailer.c:873 #: ../src/mailer.c:931
msgid "Type" msgid "Type"
msgstr "Type" msgstr "Type"
#: ../src/mailer.c:897 #: ../src/mailer.c:955
msgid "Accounts" msgid "Accounts"
msgstr "Comptes" msgstr "Comptes"
#: ../src/mailer.c:904 #: ../src/mailer.c:962
msgid "Messages font:" msgid "Messages font:"
msgstr "Police des messages:" msgstr "Police des messages:"
#: ../src/mailer.c:914 #: ../src/mailer.c:972
msgid "Display" msgid "Display"
msgstr "Affichage" msgstr "Affichage"
#: ../src/mailer.c:996 #: ../src/mailer.c:1054
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:1151 ../src/mailer.c:1429 #: ../src/mailer.c:1209 ../src/mailer.c:1487
msgid "Account name" msgid "Account name"
msgstr "Nom du compte" msgstr "Nom du compte"
#: ../src/mailer.c:1158 #: ../src/mailer.c:1216
msgid "Your name" msgid "Your name"
msgstr "Votre nom" msgstr "Votre nom"
#: ../src/mailer.c:1165 #: ../src/mailer.c:1223
msgid "e-mail address" msgid "e-mail address"
msgstr "Adresse e-mail" msgstr "Adresse e-mail"
#: ../src/mailer.c:1172 #: ../src/mailer.c:1230
msgid "Type of account" msgid "Type of account"
msgstr "Type de compte" msgstr "Type de compte"
#: ../src/mailer.c:1321 #: ../src/mailer.c:1379
msgid "Choose file" msgid "Choose file"
msgstr "Choisir un fichier" msgstr "Choisir un fichier"
#: ../src/mailer.c:1498 #: ../src/mailer.c:1556
msgid "hidden" msgid "hidden"
msgstr "masqué" msgstr "masqué"
#: ../src/mailer.c:1532 #: ../src/mailer.c:1590
msgid "Yes" msgid "Yes"
msgstr "Oui" msgstr "Oui"
#: ../src/mailer.c:1532 #: ../src/mailer.c:1590
msgid "No" msgid "No"
msgstr "Non" msgstr "Non"
#: ../src/mailer.c:1560 #: ../src/mailer.c:1618
msgid "Account type " msgid "Account type "
msgstr "Type de compte " msgstr "Type de compte "
#: ../src/mailer.c:1561 #: ../src/mailer.c:1619
msgid " active\n" msgid " active\n"
msgstr " actif\n" msgstr " actif\n"
#: ../src/mailer.c:1605 #: ../src/mailer.c:1663
msgid "Edit account: " msgid "Edit account: "
msgstr "Modification du compte: " msgstr "Modification du compte: "
#: ../src/mailer.c:1671 #: ../src/mailer.c:1730
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"

View File

@ -395,6 +395,8 @@ static void _on_folders_changed(GtkTreeSelection * selection, gpointer data)
GtkTreeIter iter; GtkTreeIter iter;
GtkListStore * store; GtkListStore * store;
GtkTreePath * path; GtkTreePath * path;
int cnt;
char buf[256] = "";
#ifdef DEBUG #ifdef DEBUG
fprintf(stderr, "DEBUG: %s()\n", __func__); fprintf(stderr, "DEBUG: %s()\n", __func__);
@ -405,6 +407,7 @@ static void _on_folders_changed(GtkTreeSelection * selection, gpointer data)
mailer->folder_cur = NULL; mailer->folder_cur = NULL;
gtk_tree_view_set_model(GTK_TREE_VIEW(mailer->view_headers), gtk_tree_view_set_model(GTK_TREE_VIEW(mailer->view_headers),
NULL); NULL);
mailer_set_status(mailer, "");
return; return;
} }
/* get current folder */ /* get current folder */
@ -435,6 +438,16 @@ static void _on_folders_changed(GtkTreeSelection * selection, gpointer data)
store = account_get_store(mailer->account_cur, mailer->folder_cur); store = account_get_store(mailer->account_cur, mailer->folder_cur);
gtk_tree_view_set_model(GTK_TREE_VIEW(mailer->view_headers), gtk_tree_view_set_model(GTK_TREE_VIEW(mailer->view_headers),
GTK_TREE_MODEL(store)); GTK_TREE_MODEL(store));
if(store != NULL)
{
cnt = gtk_tree_model_iter_n_children(GTK_TREE_MODEL(store),
NULL);
snprintf(buf, sizeof(buf), _("%s/%s: %d %s"),
account_get_name(mailer->account_cur),
mailer->folder_cur->name, cnt,
(cnt > 1) ? _("messages") : _("message"));
}
mailer_set_status(mailer, buf);
} }
static GtkWidget * _new_headers_view(Mailer * mailer) static GtkWidget * _new_headers_view(Mailer * mailer)
@ -659,6 +672,20 @@ char const * mailer_get_config(Mailer * mailer, char const * variable)
} }
/* mailer_set_status */
void mailer_set_status(Mailer * mailer, char const * status)
{
GtkStatusbar * sb;
sb = GTK_STATUSBAR(mailer->statusbar);
if(mailer->statusbar_id != 0)
gtk_statusbar_remove(sb, gtk_statusbar_get_context_id(sb, ""),
mailer->statusbar_id);
mailer->statusbar_id = gtk_statusbar_push(sb,
gtk_statusbar_get_context_id(sb, ""), status);
}
/* useful */ /* useful */
/* mailer_error */ /* mailer_error */
int mailer_error(Mailer * mailer, char const * message, int ret) int mailer_error(Mailer * mailer, char const * message, int ret)

View File

@ -42,6 +42,7 @@ void mailer_delete(Mailer * mailer);
/* accessors */ /* accessors */
char const * mailer_get_config(Mailer * mailer, char const * variable); char const * mailer_get_config(Mailer * mailer, char const * variable);
void mailer_set_status(Mailer * mailer, char const * status);
/* useful */ /* useful */
int mailer_error(Mailer * mailer, char const * message, int ret); int mailer_error(Mailer * mailer, char const * message, int ret);