Code cleanup

This commit is contained in:
Pierre Pronchery 2012-01-03 08:45:08 +00:00
parent b06b0821e2
commit b40ceb6b47
2 changed files with 119 additions and 126 deletions

100
po/fr.po
View File

@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Phone 0.0.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2012-01-01 14:31+0100\n"
"POT-Creation-Date: 2012-01-03 09:42+0100\n"
"PO-Revision-Date: 2010-04-24 02:07+0200\n"
"Last-Translator: Pierre Pronchery <khorben@defora.org>\n"
"Language-Team: DeforaOS development (French) <devel-fr@lists.defora.org>\n"
@ -47,11 +47,11 @@ msgstr "Brouillons"
msgid "Trash"
msgstr "Corbeille"
#: ../src/phone.c:512 ../src/phone.c:2638
#: ../src/phone.c:512 ../src/phone.c:2631
msgid "System preferences"
msgstr "Préférences système"
#: ../src/phone.c:523 ../src/phone.c:2061
#: ../src/phone.c:523 ../src/phone.c:2054
msgid "Plug-ins"
msgstr "Greffons"
@ -141,8 +141,8 @@ msgstr "Ignorer"
msgid "Contacts"
msgstr "Contacts"
#: ../src/phone.c:1691 ../src/phone.c:1805 ../src/phone.c:1841
#: ../src/phone.c:1956 ../src/phone.c:2314
#: ../src/phone.c:1691 ../src/phone.c:1805 ../src/phone.c:1848
#: ../src/phone.c:1949 ../src/phone.c:2307
msgid "Call"
msgstr "Appeler"
@ -150,7 +150,7 @@ msgstr "Appeler"
msgid "Write"
msgstr "Écrire"
#: ../src/phone.c:1739 ../src/phone.c:2092 ../src/phone.c:2425
#: ../src/phone.c:1739 ../src/phone.c:2085 ../src/phone.c:2418
msgid "Name"
msgstr "Nom"
@ -162,182 +162,182 @@ msgstr "Composer"
msgid "Hang up"
msgstr "Raccrocher"
#: ../src/phone.c:1835
#: ../src/phone.c:1842
msgid "Phone logs"
msgstr "Journal d'appels"
#: ../src/phone.c:1847
#: ../src/phone.c:1853
msgid "Message"
msgstr "Message"
#: ../src/phone.c:1878
#: ../src/phone.c:1880
msgid "Direction"
msgstr "Direction"
#: ../src/phone.c:1883 ../src/phone.c:2002
#: ../src/phone.c:1885 ../src/phone.c:1995
msgid "To/From"
msgstr "Vers/De"
#: ../src/phone.c:1889 ../src/phone.c:2010
#: ../src/phone.c:1889 ../src/phone.c:2003
msgid "Date"
msgstr "Date"
#: ../src/phone.c:1950
#: ../src/phone.c:1943
msgid "Messages"
msgstr "Messages"
#: ../src/phone.c:1961
#: ../src/phone.c:1954
msgid "New message"
msgstr "Nouveau message"
#: ../src/phone.c:1967 ../src/phone.c:2320
#: ../src/phone.c:1960 ../src/phone.c:2313
msgid "Reply"
msgstr "Répondre"
#: ../src/phone.c:2080
#: ../src/phone.c:2073
msgid "Enabled"
msgstr "Activé"
#: ../src/phone.c:2308
#: ../src/phone.c:2301
msgid "Read message"
msgstr "Lire le message"
#: ../src/phone.c:2326
#: ../src/phone.c:2319
msgid "Forward"
msgstr "Transmettre"
#: ../src/phone.c:2400
#: ../src/phone.c:2393
msgid "Telephony settings"
msgstr "Paramètres de téléphonie"
#: ../src/phone.c:2477
#: ../src/phone.c:2470
msgid "missed calls"
msgstr "appels manqués"
#: ../src/phone.c:2477
#: ../src/phone.c:2470
msgid "missed call"
msgstr "appel manqué"
#: ../src/phone.c:2486
#: ../src/phone.c:2479
msgid "new messages"
msgstr "nouveaux messages"
#: ../src/phone.c:2487
#: ../src/phone.c:2480
msgid "new message"
msgstr "nouveau message"
#: ../src/phone.c:2505 ../src/phone.c:3462 ../src/phone.c:3466
#: ../src/phone.c:2498 ../src/phone.c:3455 ../src/phone.c:3459
msgid "Information"
msgstr "Information"
#: ../src/phone.c:2515
#: ../src/phone.c:2508
msgid "Status"
msgstr "État"
#: ../src/phone.c:2539
#: ../src/phone.c:2532
msgid "_View"
msgstr "_Vue"
#: ../src/phone.c:2558
#: ../src/phone.c:2551
msgid "_Read"
msgstr "_Lire"
#: ../src/phone.c:2698
#: ../src/phone.c:2691
msgid "Open file..."
msgstr "Ouvrir fichier..."
#: ../src/phone.c:2881
#: ../src/phone.c:2874
msgid "Write message"
msgstr "Écrire un message"
#: ../src/phone.c:2887
#: ../src/phone.c:2880
msgid "Send"
msgstr "Envoyer"
#: ../src/phone.c:2893
#: ../src/phone.c:2886
msgid "Attach"
msgstr "Joindre"
#: ../src/phone.c:3009
#: ../src/phone.c:3002
msgid "Attach file..."
msgstr "Joindre un fichier..."
#: ../src/phone.c:3081
#: ../src/phone.c:3074
#, c-format
msgid "%d message%s, %d/%d characters"
msgstr "%d message%s, %d/%d caractères"
#: ../src/phone.c:3082
#: ../src/phone.c:3075
msgid "s"
msgstr "s"
#: ../src/phone.c:3146
#: ../src/phone.c:3139
msgid "Sending message..."
msgstr "Envoi du message..."
#: ../src/phone.c:3181
#: ../src/phone.c:3174
msgid "Outgoing"
msgstr "Sortant"
#: ../src/phone.c:3367
#: ../src/phone.c:3360
msgid "Operation in progress..."
msgstr "Opération en cours..."
#: ../src/phone.c:3407 ../src/phone.c:3411
#: ../src/phone.c:3400 ../src/phone.c:3404
msgid "Question"
msgstr "Question"
#: ../src/phone.c:3431 ../src/phone.c:3435
#: ../src/phone.c:3424 ../src/phone.c:3428
msgid "Error"
msgstr "Erreur"
#: ../src/phone.c:3664
#: ../src/phone.c:3657
msgid "Name: "
msgstr "Nom: "
#: ../src/phone.c:3673
#: ../src/phone.c:3666
msgid "Number: "
msgstr "Numéro: "
#: ../src/phone.c:3689
#: ../src/phone.c:3682
msgid "New contact"
msgstr "Nouveau contact"
#: ../src/phone.c:3691
#: ../src/phone.c:3684
msgid "Edit contact: "
msgstr "Modifier contact: "
#: ../src/phone.c:3718
#: ../src/phone.c:3711
msgid "The name cannot be empty"
msgstr "Le nom ne peut être vide"
#: ../src/phone.c:3723
#: ../src/phone.c:3716
msgid "The number cannot be empty"
msgstr "Le numéro ne peut être vide"
#: ../src/phone.c:3857
#: ../src/phone.c:3850
msgid "Message sent"
msgstr "Message envoyé"
#: ../src/phone.c:3887
#: ../src/phone.c:3880
#, c-format
msgid "Wrong %s"
msgstr "Mauvais %s"
#: ../src/phone.c:3890
#: ../src/phone.c:3883
msgid "Authentication failed"
msgstr "Échec lors de l'authentification"
#: ../src/phone.c:3899
#: ../src/phone.c:3892
#, c-format
msgid "%s is valid"
msgstr "%s valide"
#: ../src/phone.c:3962
#: ../src/phone.c:3955
msgid "Raw data (not shown)"
msgstr "Données brutes (non affichées)"
#: ../src/phone.c:3998
#: ../src/phone.c:3991
msgid "Message deleted"
msgstr "Message effacé"

View File

@ -1814,7 +1814,19 @@ static void _show_dialer_window(Phone * phone)
/* phone_show_logs */
static void _show_logs_window(Phone * phone);
void phone_show_logs(Phone * phone, gboolean show)
{
if(phone->lo_window == NULL)
_show_logs_window(phone);
if(show)
gtk_window_present(GTK_WINDOW(phone->lo_window));
else
gtk_widget_hide(phone->lo_window);
}
static void _show_logs_window(Phone * phone)
{
GtkWidget * vbox;
GtkWidget * widget;
@ -1822,84 +1834,65 @@ void phone_show_logs(Phone * phone, gboolean show)
GtkCellRenderer * renderer;
GtkTreeViewColumn * column;
if(phone->lo_window == NULL)
{
phone->lo_window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
gtk_window_set_default_size(GTK_WINDOW(phone->lo_window), 200,
300);
phone->lo_window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
gtk_window_set_default_size(GTK_WINDOW(phone->lo_window), 200, 300);
#if GTK_CHECK_VERSION(2, 6, 0)
gtk_window_set_icon_name(GTK_WINDOW(phone->lo_window),
"logviewer");
gtk_window_set_icon_name(GTK_WINDOW(phone->lo_window), "logviewer");
#endif
gtk_window_set_title(GTK_WINDOW(phone->lo_window),
_("Phone logs"));
g_signal_connect(phone->lo_window, "delete-event", G_CALLBACK(
on_phone_closex), NULL);
vbox = gtk_vbox_new(FALSE, 0);
/* toolbar */
widget = gtk_toolbar_new();
toolitem = gtk_tool_button_new(NULL, _("Call"));
gtk_tool_button_set_icon_name(GTK_TOOL_BUTTON(toolitem),
"call-start");
g_signal_connect_swapped(G_OBJECT(toolitem), "clicked",
G_CALLBACK(on_phone_logs_call), phone);
gtk_toolbar_insert(GTK_TOOLBAR(widget), toolitem, -1);
toolitem = gtk_tool_button_new(NULL, _("Message"));
gtk_tool_button_set_icon_name(GTK_TOOL_BUTTON(toolitem),
"stock_mail-compose");
g_signal_connect_swapped(G_OBJECT(toolitem), "clicked",
G_CALLBACK(on_phone_logs_write), phone);
gtk_toolbar_insert(GTK_TOOLBAR(widget), toolitem, -1);
toolitem = gtk_separator_tool_item_new();
gtk_toolbar_insert(GTK_TOOLBAR(widget), toolitem, -1);
toolitem = gtk_tool_button_new_from_stock(GTK_STOCK_CLEAR);
g_signal_connect_swapped(G_OBJECT(toolitem), "clicked",
G_CALLBACK(on_phone_logs_clear), phone);
gtk_toolbar_insert(GTK_TOOLBAR(widget), toolitem, -1);
gtk_box_pack_start(GTK_BOX(vbox), widget, FALSE, TRUE, 0);
/* FIXME make it a notebook with different log categories */
/* view */
widget = gtk_scrolled_window_new(NULL, NULL);
gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(widget),
GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW(widget),
GTK_SHADOW_ETCHED_IN);
phone->lo_view = gtk_tree_view_new_with_model(GTK_TREE_MODEL(
phone->lo_store));
gtk_tree_view_set_rules_hint(GTK_TREE_VIEW(phone->lo_view),
TRUE);
g_signal_connect_swapped(G_OBJECT(phone->lo_view),
"row-activated", G_CALLBACK(
on_phone_logs_activated), phone);
gtk_tree_view_set_headers_visible(GTK_TREE_VIEW(phone->lo_view),
TRUE);
renderer = gtk_cell_renderer_text_new();
column = gtk_tree_view_column_new_with_attributes(
_("Direction"), renderer, "text",
PHONE_LOGS_COLUMN_CALL_TYPE_DISPLAY, NULL);
gtk_tree_view_append_column(GTK_TREE_VIEW(phone->lo_view),
column);
renderer = gtk_cell_renderer_text_new();
column = gtk_tree_view_column_new_with_attributes(_("To/From"),
renderer, "text",
PHONE_LOGS_COLUMN_NUMBER, NULL);
gtk_tree_view_append_column(GTK_TREE_VIEW(phone->lo_view),
column);
renderer = gtk_cell_renderer_text_new();
column = gtk_tree_view_column_new_with_attributes(_("Date"),
renderer, "text",
PHONE_LOGS_COLUMN_DATE_DISPLAY, NULL);
gtk_tree_view_append_column(GTK_TREE_VIEW(phone->lo_view),
column);
gtk_container_add(GTK_CONTAINER(widget), phone->lo_view);
gtk_box_pack_start(GTK_BOX(vbox), widget, TRUE, TRUE, 0);
gtk_container_add(GTK_CONTAINER(phone->lo_window), vbox);
gtk_widget_show_all(vbox);
}
if(show)
gtk_window_present(GTK_WINDOW(phone->lo_window));
else
gtk_widget_hide(phone->lo_window);
gtk_window_set_title(GTK_WINDOW(phone->lo_window), _("Phone logs"));
g_signal_connect(phone->lo_window, "delete-event", G_CALLBACK(
on_phone_closex), NULL);
vbox = gtk_vbox_new(FALSE, 0);
/* toolbar */
widget = gtk_toolbar_new();
toolitem = gtk_tool_button_new(NULL, _("Call"));
gtk_tool_button_set_icon_name(GTK_TOOL_BUTTON(toolitem), "call-start");
g_signal_connect_swapped(G_OBJECT(toolitem), "clicked", G_CALLBACK(
on_phone_logs_call), phone);
gtk_toolbar_insert(GTK_TOOLBAR(widget), toolitem, -1);
toolitem = gtk_tool_button_new(NULL, _("Message"));
gtk_tool_button_set_icon_name(GTK_TOOL_BUTTON(toolitem),
"stock_mail-compose");
g_signal_connect_swapped(G_OBJECT(toolitem), "clicked", G_CALLBACK(
on_phone_logs_write), phone);
gtk_toolbar_insert(GTK_TOOLBAR(widget), toolitem, -1);
toolitem = gtk_separator_tool_item_new();
gtk_toolbar_insert(GTK_TOOLBAR(widget), toolitem, -1);
toolitem = gtk_tool_button_new_from_stock(GTK_STOCK_CLEAR);
g_signal_connect_swapped(G_OBJECT(toolitem), "clicked", G_CALLBACK(
on_phone_logs_clear), phone);
gtk_toolbar_insert(GTK_TOOLBAR(widget), toolitem, -1);
gtk_box_pack_start(GTK_BOX(vbox), widget, FALSE, TRUE, 0);
/* FIXME make it a notebook with different log categories */
/* view */
widget = gtk_scrolled_window_new(NULL, NULL);
gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(widget),
GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW(widget),
GTK_SHADOW_ETCHED_IN);
phone->lo_view = gtk_tree_view_new_with_model(GTK_TREE_MODEL(
phone->lo_store));
gtk_tree_view_set_rules_hint(GTK_TREE_VIEW(phone->lo_view), TRUE);
g_signal_connect_swapped(G_OBJECT(phone->lo_view), "row-activated",
G_CALLBACK(on_phone_logs_activated), phone);
gtk_tree_view_set_headers_visible(GTK_TREE_VIEW(phone->lo_view), TRUE);
renderer = gtk_cell_renderer_text_new();
column = gtk_tree_view_column_new_with_attributes(_("Direction"),
renderer, "text", PHONE_LOGS_COLUMN_CALL_TYPE_DISPLAY,
NULL);
gtk_tree_view_append_column(GTK_TREE_VIEW(phone->lo_view), column);
renderer = gtk_cell_renderer_text_new();
column = gtk_tree_view_column_new_with_attributes(_("To/From"),
renderer, "text", PHONE_LOGS_COLUMN_NUMBER, NULL);
gtk_tree_view_append_column(GTK_TREE_VIEW(phone->lo_view), column);
renderer = gtk_cell_renderer_text_new();
column = gtk_tree_view_column_new_with_attributes(_("Date"), renderer,
"text", PHONE_LOGS_COLUMN_DATE_DISPLAY, NULL);
gtk_tree_view_append_column(GTK_TREE_VIEW(phone->lo_view), column);
gtk_container_add(GTK_CONTAINER(widget), phone->lo_view);
gtk_box_pack_start(GTK_BOX(vbox), widget, TRUE, TRUE, 0);
gtk_container_add(GTK_CONTAINER(phone->lo_window), vbox);
gtk_widget_show_all(vbox);
}