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 ""
"Project-Id-Version: Mailer 0.0.0\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"
"Last-Translator: Pierre Pronchery <khorben@defora.org>\n"
"Language-Team: French\n"
@ -117,11 +117,11 @@ msgstr "Attacher"
msgid " - Compose"
msgstr ""
#: ../src/compose.c:194 ../src/mailer.c:550
#: ../src/compose.c:194 ../src/mailer.c:565
msgid " From: "
msgstr " De: "
#: ../src/compose.c:207 ../src/mailer.c:551
#: ../src/compose.c:207 ../src/mailer.c:566
msgid " To: "
msgstr " À: "
@ -133,7 +133,7 @@ msgstr ""
msgid " BCC: "
msgstr ""
#: ../src/compose.c:246 ../src/mailer.c:549
#: ../src/compose.c:246 ../src/mailer.c:564
msgid " Subject: "
msgstr " Sujet: "
@ -241,107 +241,120 @@ msgstr "Mailer"
msgid "Folders"
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"
msgstr "Sujet"
#: ../src/mailer.c:451
#: ../src/mailer.c:465
msgid "From"
msgstr "De"
#: ../src/mailer.c:453
#: ../src/mailer.c:467
msgid "To"
msgstr "À"
#: ../src/mailer.c:455
#: ../src/mailer.c:469
msgid "Date"
msgstr "Date"
#: ../src/mailer.c:552
#: ../src/mailer.c:567
msgid " Date: "
msgstr " Date: "
#: ../src/mailer.c:672 ../src/mailer.c:677
#: ../src/mailer.c:701 ../src/mailer.c:706
msgid "Error"
msgstr "Erreur"
#: ../src/mailer.c:830
#: ../src/mailer.c:887
msgid "Mailer preferences"
msgstr "Préférences de Mailer"
#: ../src/mailer.c:865
#: ../src/mailer.c:923
msgid "Enabled"
msgstr "Actif"
#: ../src/mailer.c:869
#: ../src/mailer.c:927
msgid "Name"
msgstr "Nom"
#: ../src/mailer.c:873
#: ../src/mailer.c:931
msgid "Type"
msgstr "Type"
#: ../src/mailer.c:897
#: ../src/mailer.c:955
msgid "Accounts"
msgstr "Comptes"
#: ../src/mailer.c:904
#: ../src/mailer.c:962
msgid "Messages font:"
msgstr "Police des messages:"
#: ../src/mailer.c:914
#: ../src/mailer.c:972
msgid "Display"
msgstr "Affichage"
#: ../src/mailer.c:996
#: ../src/mailer.c:1054
msgid "No account plug-in available"
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"
msgstr "Nom du compte"
#: ../src/mailer.c:1158
#: ../src/mailer.c:1216
msgid "Your name"
msgstr "Votre nom"
#: ../src/mailer.c:1165
#: ../src/mailer.c:1223
msgid "e-mail address"
msgstr "Adresse e-mail"
#: ../src/mailer.c:1172
#: ../src/mailer.c:1230
msgid "Type of account"
msgstr "Type de compte"
#: ../src/mailer.c:1321
#: ../src/mailer.c:1379
msgid "Choose file"
msgstr "Choisir un fichier"
#: ../src/mailer.c:1498
#: ../src/mailer.c:1556
msgid "hidden"
msgstr "masqué"
#: ../src/mailer.c:1532
#: ../src/mailer.c:1590
msgid "Yes"
msgstr "Oui"
#: ../src/mailer.c:1532
#: ../src/mailer.c:1590
msgid "No"
msgstr "Non"
#: ../src/mailer.c:1560
#: ../src/mailer.c:1618
msgid "Account type "
msgstr "Type de compte "
#: ../src/mailer.c:1561
#: ../src/mailer.c:1619
msgid " active\n"
msgstr " actif\n"
#: ../src/mailer.c:1605
#: ../src/mailer.c:1663
msgid "Edit account: "
msgstr "Modification du compte: "
#: ../src/mailer.c:1671
#: ../src/mailer.c:1730
msgid "An error occured while saving preferences"
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;
GtkListStore * store;
GtkTreePath * path;
int cnt;
char buf[256] = "";
#ifdef DEBUG
fprintf(stderr, "DEBUG: %s()\n", __func__);
@ -405,6 +407,7 @@ static void _on_folders_changed(GtkTreeSelection * selection, gpointer data)
mailer->folder_cur = NULL;
gtk_tree_view_set_model(GTK_TREE_VIEW(mailer->view_headers),
NULL);
mailer_set_status(mailer, "");
return;
}
/* 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);
gtk_tree_view_set_model(GTK_TREE_VIEW(mailer->view_headers),
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)
@ -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 */
/* mailer_error */
int mailer_error(Mailer * mailer, char const * message, int ret)

View File

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