From b11f03cfd52444db5eadcd0093a689cdf0ff7947 Mon Sep 17 00:00:00 2001 From: Pierre Pronchery Date: Fri, 30 Apr 2010 04:36:56 +0000 Subject: [PATCH] Some bugfixes --- po/fr.po | 116 ++++++++++++++++++++++++++-------------------------- src/phone.c | 29 +++++++++++-- 2 files changed, 83 insertions(+), 62 deletions(-) diff --git a/po/fr.po b/po/fr.po index 75be2fe..12973f8 100644 --- a/po/fr.po +++ b/po/fr.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Phone 0.0.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2010-04-30 04:59+0200\n" +"POT-Creation-Date: 2010-04-30 06:35+0200\n" "PO-Revision-Date: 2010-04-24 02:07+0200\n" "Last-Translator: Pierre Pronchery \n" "Language-Team: French\n" @@ -16,119 +16,119 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" -#: ../src/gsm.c:107 +#: ../src/gsm.c:108 msgid "Phone failure" msgstr "Défaillance du téléphone" -#: ../src/gsm.c:108 +#: ../src/gsm.c:109 msgid "No connection to phone" msgstr "Pas de connexion au téléphone" -#: ../src/gsm.c:109 ../src/gsm.c:143 +#: ../src/gsm.c:110 ../src/gsm.c:144 msgid "Operation not allowed" msgstr "Opération non autorisée" -#: ../src/gsm.c:110 ../src/gsm.c:144 +#: ../src/gsm.c:111 ../src/gsm.c:145 msgid "Operation not supported" msgstr "Opération non supportée" -#: ../src/gsm.c:111 ../src/gsm.c:146 +#: ../src/gsm.c:112 ../src/gsm.c:147 msgid "SIM not inserted" msgstr "SIM non insérée" -#: ../src/gsm.c:112 ../src/gsm.c:147 +#: ../src/gsm.c:113 ../src/gsm.c:148 msgid "SIM PIN required" msgstr "Code SIM PIN requis" -#: ../src/gsm.c:113 +#: ../src/gsm.c:114 msgid "SIM PUK required" msgstr "Code PUK requis" -#: ../src/gsm.c:114 +#: ../src/gsm.c:115 msgid "SIM failure" msgstr "Défaillance SIM" -#: ../src/gsm.c:115 +#: ../src/gsm.c:116 msgid "SIM busy" msgstr "SIM occupée" -#: ../src/gsm.c:116 +#: ../src/gsm.c:117 msgid "SIM wrong" msgstr "SIM erronée" -#: ../src/gsm.c:117 +#: ../src/gsm.c:118 msgid "Incorrect password" msgstr "Mot de passe incorrect" -#: ../src/gsm.c:118 +#: ../src/gsm.c:119 msgid "SIM PIN2 required" msgstr "Code SIM PIN2 requis" -#: ../src/gsm.c:119 +#: ../src/gsm.c:120 msgid "SIM PUK2 required" msgstr "Code SIM PUK2 requis" -#: ../src/gsm.c:120 +#: ../src/gsm.c:121 msgid "Memory full" msgstr "Mémoire pleine" -#: ../src/gsm.c:121 +#: ../src/gsm.c:122 msgid "Invalid index" msgstr "Index invalide" -#: ../src/gsm.c:122 +#: ../src/gsm.c:123 msgid "Not found" msgstr "Non trouvé" -#: ../src/gsm.c:123 +#: ../src/gsm.c:124 msgid "Memory failure" msgstr "Défaillance mémoire" -#: ../src/gsm.c:124 +#: ../src/gsm.c:125 msgid "Text string too long" msgstr "Texte trop long" -#: ../src/gsm.c:125 +#: ../src/gsm.c:126 msgid "Invalid characters in text string" msgstr "Caractère invalide dans le texte" -#: ../src/gsm.c:126 +#: ../src/gsm.c:127 msgid "Dial string too long" msgstr "Le numéro composé est trop long" -#: ../src/gsm.c:127 +#: ../src/gsm.c:128 msgid "Invalid characters in dial string" msgstr "Caractères invalides dans le numéro" -#: ../src/gsm.c:128 +#: ../src/gsm.c:129 msgid "No network service" msgstr "Pas de couverture réseau" -#: ../src/gsm.c:129 +#: ../src/gsm.c:130 msgid "Network timeout" msgstr "Délai d'attente du réseau dépassé" -#: ../src/gsm.c:130 +#: ../src/gsm.c:131 msgid "Network not allowed - emergency calls only" msgstr "Réseau non autorisé - appels d'urgence uniquement" -#: ../src/gsm.c:141 +#: ../src/gsm.c:142 msgid "ME failure" msgstr "Défaillance ME" -#: ../src/gsm.c:142 +#: ../src/gsm.c:143 msgid "SMS service of ME reserved" msgstr "Service SMS du ME réservé" -#: ../src/gsm.c:145 +#: ../src/gsm.c:146 msgid "Invalid PDU mode parameter" msgstr "Paramètre de mode PDU invalide" -#: ../src/gsm.c:319 +#: ../src/gsm.c:320 msgid ": Unknown baudrate" msgstr ": Débit inconnu" -#: ../src/gsm.c:692 +#: ../src/gsm.c:693 msgid "Event not handled" msgstr "Événement non géré" @@ -136,102 +136,102 @@ msgstr "Événement non géré" msgid "Usage: phone -b baudrate -d device -r retry\n" msgstr "" -#: ../src/phone.c:134 +#: ../src/phone.c:136 msgid "Phone" msgstr "Téléphone" -#: ../src/phone.c:146 +#: ../src/phone.c:148 msgid "Initializing..." msgstr "Initialisation..." -#: ../src/phone.c:190 ../src/phone.c:195 +#: ../src/phone.c:192 ../src/phone.c:197 msgid "Error" msgstr "Erreur" -#: ../src/phone.c:398 -msgid "Write message" -msgstr "Écrire un message" - -#: ../src/phone.c:478 +#: ../src/phone.c:444 msgid "Enter" msgstr "Entrer" -#: ../src/phone.c:480 +#: ../src/phone.c:446 msgid "Skip" msgstr "Ignorer" -#: ../src/phone.c:491 +#: ../src/phone.c:457 msgid "Enter SIM PIN code" msgstr "Entrer le code SIM PIN" -#: ../src/phone.c:520 +#: ../src/phone.c:486 msgid "Contacts" msgstr "Contacts" -#: ../src/phone.c:527 ../src/phone.c:622 ../src/phone.c:661 +#: ../src/phone.c:493 ../src/phone.c:588 ../src/phone.c:627 msgid "Call" msgstr "Appeler" -#: ../src/phone.c:537 +#: ../src/phone.c:503 msgid "Write" msgstr "Écrire" -#: ../src/phone.c:557 +#: ../src/phone.c:523 msgid "Contact" msgstr "Contact" -#: ../src/phone.c:587 +#: ../src/phone.c:553 msgid "Dialer" msgstr "Composer" -#: ../src/phone.c:594 +#: ../src/phone.c:560 msgid "Signal:" msgstr "Signal :" -#: ../src/phone.c:624 +#: ../src/phone.c:590 msgid "Hang up" msgstr "Raccrocher" -#: ../src/phone.c:654 +#: ../src/phone.c:620 msgid "Messages" msgstr "Messages" -#: ../src/phone.c:667 +#: ../src/phone.c:633 msgid "New message" msgstr "Nouveau message" -#: ../src/phone.c:673 +#: ../src/phone.c:639 msgid "Reply" msgstr "Répondre" -#: ../src/phone.c:691 +#: ../src/phone.c:657 msgid "Inbox" msgstr "Reçus" -#: ../src/phone.c:698 +#: ../src/phone.c:664 msgid "Sent" msgstr "Envoyés" -#: ../src/phone.c:715 +#: ../src/phone.c:681 msgid "Message" msgstr "Message" -#: ../src/phone.c:859 +#: ../src/phone.c:710 +msgid "Write message" +msgstr "Écrire un message" + +#: ../src/phone.c:893 msgid "Unknown" msgstr "Inconnu" -#: ../src/phone.c:867 +#: ../src/phone.c:896 msgid "Registering..." msgstr "Enregistrement..." -#: ../src/phone.c:870 +#: ../src/phone.c:899 msgid "Denied" msgstr "Refusé" -#: ../src/phone.c:873 +#: ../src/phone.c:902 msgid "SIM check..." msgstr "Vérification SIM..." -#: ../src/phone.c:877 +#: ../src/phone.c:906 msgid "SIM ready..." msgstr "SIM prête..." diff --git a/src/phone.c b/src/phone.c index 68331f3..67cb7ba 100644 --- a/src/phone.c +++ b/src/phone.c @@ -85,6 +85,8 @@ static GtkWidget * _phone_create_dialpad(Phone * phone, static void _phone_fetch_contacts(Phone * phone, unsigned int start, unsigned int end); +static void _phone_fetch_messages(Phone * phone, unsigned int start, + unsigned int end); static void _phone_set_operator(Phone * phone, char const * operator); static void _phone_set_signal_level(Phone * phone, gdouble level); @@ -819,7 +821,7 @@ static void _phone_fetch_contacts(Phone * phone, unsigned int start, { unsigned int i; - for(i = start; i < end; i+=10) + for(i = start + 10; i < end; i+=10) { gsm_fetch_contacts(phone->gsm, start, i); start = i; @@ -829,6 +831,22 @@ static void _phone_fetch_contacts(Phone * phone, unsigned int start, } +/* phone_fetch_messages */ +static void _phone_fetch_messages(Phone * phone, unsigned int start, + unsigned int end) +{ + unsigned int i; + + for(i = start + 10; i < end; i+=10) + { + gsm_fetch_messages(phone->gsm, start, i); + start = i; + } + if(start < end) + gsm_fetch_messages(phone->gsm, start, end); +} + + /* phone_set_operator */ static void _phone_set_operator(Phone * phone, char const * operator) { @@ -866,12 +884,13 @@ static void _phone_set_signal_level(Phone * phone, gdouble level) static void _phone_set_status(Phone * phone, GSMStatus status) { GSMRegistrationReport report; - char const * operator = _("Unknown"); + char const * operator = NULL; report = GSM_REGISTRATION_REPORT_ENABLE_UNSOLLICITED_WITH_LOCATION; switch(status) { case GSM_STATUS_UNKNOWN: + operator = _("Unknown"); break; case GSM_STATUS_REGISTERING: operator = _("Registering..."); @@ -904,6 +923,8 @@ static void _phone_set_status(Phone * phone, GSMStatus status) gsm_fetch_operator(phone->gsm); return; } + if(operator != NULL) + _phone_set_operator(phone, operator); _phone_set_signal_level(phone, 0.0 / 0.0); if(phone->si_source != 0) { @@ -938,14 +959,14 @@ static int _phone_gsm_event(GSMEvent * event, gpointer data) event->contact_list.end); return 0; case GSM_EVENT_TYPE_MESSAGE_LIST: - _phone_fetch_contacts(phone, event->message_list.start, + _phone_fetch_messages(phone, event->message_list.start, event->message_list.end); return 0; case GSM_EVENT_TYPE_OPERATOR: _phone_set_operator(phone, event->operator.operator); return 0; case GSM_EVENT_TYPE_REGISTRATION: - /* we also get an event about it */ + /* we also get a status update about it */ return 0; case GSM_EVENT_TYPE_SIGNAL_LEVEL: _phone_set_signal_level(phone,